PyDo — DigitalOcean’s Python library

pydo is a Python client library for DigitalOceans’s HTTP API.

Installation

Install from PyPI:

pip install pydo

Initialization

pydo must be initialized with pydo.client(). A DigitalOcean API Token is required. The token can be passed explicitly to pydo.client() or defined as environment variables DIGITALOCEAN_TOKEN.

Here’s an example of initializing the PyDo Client:

from pydo import Client

client = Client(token="<DIGITALOCEAN_TOKEN>")
pydo.Client(token: str, *, timeout: int = 120, **kwargs)

The official DigitalOcean Python client

Parameters:

Example

Find below a working example for GET a ssh_key (per this http request) and printing the ID associated with the ssh key. If you’d like to try out this quick example, you can follow these instructions to add ssh keys to your DO account:

from pydo import Client

client = Client(token="<YOUR-API-TOKEN>")

ssh_keys_resp = client.ssh_keys.list()
for k in ssh_keys_resp["ssh_keys"]:
   print(f"ID: {k['id']}, NAME: {k['name']}, FINGERPRINT: {k['fingerprint']}")

The above code snippet should output the following:

ID: 123456, NAME: my_test_ssh_key, FINGERPRINT: 5c:74:7e:60:28:69:34:ca:dd:74:67:c3:f3:00:7f:fe
ID: 123457, NAME: my_prod_ssh_key, FINGERPRINT: eb:76:c7:2a:d3:3e:80:5d:ef:2e:ca:86:d7:79:94:0d

You can find a more thorough example of using the PyDo client here. The example walks through the process of creating a droplet with a specified ssh key, creating a volume, and then attaching the volume to the droplet.

Pagination

Below is an example on handling pagination. One must parse the URL to find the next page:

resp = self.client.ssh_keys.list(per_page=50, page=page)
pages = resp.links.pages
   if 'next' in pages.keys():
         parsed_url = urlparse(pages['next'])
         page = parse_qs(parsed_url.query)['page'][0]
   else:
         paginated = False

pydo.Client Usage

class pydo.operations.AccountOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s account attribute.

get(**kwargs: Any) MutableMapping[str, Any]

Get User Information.

To show information about the current user account, send a GET request to /v2/account.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "account": {
        "droplet_limit": 0,  # The total number of Droplets current user or
          team may have active at one time. Required.
        "email": "str",  # The email address used by the current user to
          register for DigitalOcean. Required.
        "email_verified": False,  # Default value is False. If true, the user
          has verified their account via email. False otherwise. Required.
        "floating_ip_limit": 0,  # The total number of Floating IPs the
          current user or team may have. Required.
        "name": "str",  # Optional. The display name for the current user.
        "status": "active",  # Default value is "active". This value is one
          of "active", "warning" or "locked". Known values are: "active", "warning",
          and "locked".
        "status_message": "str",  # A human-readable message giving more
          details about the status of the account. Required.
        "team": {
            "name": "str",  # Optional. The name for the current team.
            "uuid": "str"  # Optional. The unique universal identifier
              for the current team.
        },
        "uuid": "str"  # The unique universal identifier for the current
          user. Required.
    }
}
class pydo.operations.ActionsOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s actions attribute.

get(action_id: int, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Action.

To retrieve a specific action object, send a GET request to /v2/actions/$ACTION_ID.

Parameters:

action_id (int) – A unique numeric ID that can be used to identify and reference an action. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "action": {
        "completed_at": "2020-02-20 00:00:00",  # Optional. A time value
          given in ISO8601 combined date and time format that represents when the
          action was completed.
        "id": 0,  # Optional. A unique numeric ID that can be used to
          identify and reference an action.
        "region": {
            "available": bool,  # This is a boolean value that represents
              whether new Droplets can be created in this region. Required.
            "features": {},  # This attribute is set to an array which
              contains features available in this region. Required.
            "name": "str",  # The display name of the region.  This will
              be a full name that is used in the control panel and other interfaces.
              Required.
            "sizes": {},  # This attribute is set to an array which
              contains the identifying slugs for the sizes available in this region.
              Required.
            "slug": "str"  # A human-readable string that is used as a
              unique identifier for each region. Required.
        },
        "region_slug": {},  # Optional. Any object.
        "resource_id": 0,  # Optional. A unique identifier for the resource
          that the action is associated with.
        "resource_type": "str",  # Optional. The type of resource that the
          action is associated with.
        "started_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the action was
          initiated.
        "status": "in-progress",  # Optional. Default value is "in-progress".
          The current status of the action. This can be "in-progress", "completed", or
          "errored". Known values are: "in-progress", "completed", and "errored".
        "type": "str"  # Optional. This is the type of action that the object
          represents. For example, this could be "transfer" to represent the state of
          an image transfer action.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list(*, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All Actions.

This will be the entire list of actions taken on your account, so it will be quite large. As with any large collection returned by the API, the results will be paginated with only 20 on each page by default.

Parameters:
  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "actions": [
        {
            "completed_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the action was completed.
            "id": 0,  # Optional. A unique numeric ID that can be used to
              identify and reference an action.
            "region": {
                "available": bool,  # This is a boolean value that
                  represents whether new Droplets can be created in this region.
                  Required.
                "features": {},  # This attribute is set to an array
                  which contains features available in this region. Required.
                "name": "str",  # The display name of the region.
                  This will be a full name that is used in the control panel and other
                  interfaces. Required.
                "sizes": {},  # This attribute is set to an array
                  which contains the identifying slugs for the sizes available in this
                  region. Required.
                "slug": "str"  # A human-readable string that is used
                  as a unique identifier for each region. Required.
            },
            "region_slug": {},  # Optional. Any object.
            "resource_id": 0,  # Optional. A unique identifier for the
              resource that the action is associated with.
            "resource_type": "str",  # Optional. The type of resource
              that the action is associated with.
            "started_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the action was initiated.
            "status": "in-progress",  # Optional. Default value is
              "in-progress". The current status of the action. This can be
              "in-progress", "completed", or "errored". Known values are:
              "in-progress", "completed", and "errored".
            "type": "str"  # Optional. This is the type of action that
              the object represents. For example, this could be "transfer" to represent
              the state of an image transfer action.
        }
    ],
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
class pydo.operations.AppsOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s apps attribute.

assign_alert_destinations(app_id: str, alert_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
assign_alert_destinations(app_id: str, alert_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Update destinations for alerts.

Updates the emails and slack webhook destinations for app alerts. Emails must be associated to a user with access to the app.

Parameters:
  • app_id (str) – The app ID. Required.

  • alert_id (str) – The alert ID. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "alert": {
        "component_name": "str",  # Optional. Name of component the alert
          belongs to.
        "emails": [
            ""  # Optional. Default value is "". Emails for alerts to go
              to.
        ],
        "id": "str",  # Optional. The ID of the alert.
        "phase": "UNKNOWN",  # Optional. Default value is "UNKNOWN". Known
          values are: "UNKNOWN", "PENDING", "CONFIGURING", "ACTIVE", and "ERROR".
        "progress": {
            "steps": [
                {
                    "ended_at": "2020-02-20 00:00:00",  #
                      Optional. The start time of this step.
                    "name": "str",  # Optional. The name of this
                      step.
                    "reason": {
                        "code": "str",  # Optional. The error
                          code.
                        "message": "str"  # Optional. The
                          error message.
                    },
                    "started_at": "2020-02-20 00:00:00",  #
                      Optional. The start time of this step.
                    "status": "UNKNOWN"  # Optional. Default
                      value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING",
                      "RUNNING", "ERROR", and "SUCCESS".
                }
            ]
        },
        "slack_webhooks": [
            {
                "channel": "str",  # Optional. Name of the Slack
                  Webhook Channel.
                "url": "str"  # Optional. URL of the Slack webhook.
            }
        ],
        "spec": {
            "disabled": bool,  # Optional. Is the alert disabled?.
            "operator": "UNSPECIFIED_OPERATOR",  # Optional. Default
              value is "UNSPECIFIED_OPERATOR". Known values are:
              "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN".
            "rule": "UNSPECIFIED_RULE",  # Optional. Default value is
              "UNSPECIFIED_RULE". Known values are: "UNSPECIFIED_RULE",
              "CPU_UTILIZATION", "MEM_UTILIZATION", "RESTART_COUNT",
              "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE",
              "FUNCTIONS_ACTIVATION_COUNT", "FUNCTIONS_AVERAGE_DURATION_MS",
              "FUNCTIONS_ERROR_RATE_PER_MINUTE", "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
              "FUNCTIONS_ERROR_COUNT", and "FUNCTIONS_GB_RATE_PER_SECOND".
            "value": 0.0,  # Optional. Threshold value for alert.
            "window": "UNSPECIFIED_WINDOW"  # Optional. Default value is
              "UNSPECIFIED_WINDOW". Known values are: "UNSPECIFIED_WINDOW",
              "FIVE_MINUTES", "TEN_MINUTES", "THIRTY_MINUTES", and "ONE_HOUR".
        }
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
cancel_deployment(app_id: str, deployment_id: str, **kwargs: Any) MutableMapping[str, Any]

Cancel a Deployment.

Immediately cancel an in-progress deployment.

Parameters:
  • app_id (str) – The app ID. Required.

  • deployment_id (str) – The deployment ID. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "deployment": {
        "cause": "str",  # Optional. What caused this deployment to be
          created.
        "cloned_from": "str",  # Optional. The ID of a previous deployment
          that this deployment was cloned from.
        "created_at": "2020-02-20 00:00:00",  # Optional. The creation time
          of the deployment.
        "functions": [
            {
                "name": "str",  # Optional. The name of this
                  functions component.
                "namespace": "str",  # Optional. The namespace where
                  the functions are deployed.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this functions
                  component.
            }
        ],
        "id": "str",  # Optional. The ID of the deployment.
        "jobs": [
            {
                "name": "str",  # Optional. The name of this job.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this job.
            }
        ],
        "phase": "UNKNOWN",  # Optional. Default value is "UNKNOWN". Known
          values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", "PENDING_DEPLOY",
          "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and "CANCELED".
        "phase_last_updated_at": "2020-02-20 00:00:00",  # Optional. When the
          deployment phase was last updated.
        "progress": {
            "error_steps": 0,  # Optional. Number of unsuccessful steps.
            "pending_steps": 0,  # Optional. Number of pending steps.
            "running_steps": 0,  # Optional. Number of currently running
              steps.
            "steps": [
                {
                    "component_name": "str",  # Optional. The
                      component name that this step is associated with.
                    "ended_at": "2020-02-20 00:00:00",  #
                      Optional. The end time of this step.
                    "message_base": "str",  # Optional. The base
                      of a human-readable description of the step intended to be
                      combined with the component name for presentation. For
                      example:"n"n``message_base`` = "Building
                      service""n``component_name`` = "api".
                    "name": "str",  # Optional. The name of this
                      step.
                    "reason": {
                        "code": "str",  # Optional. The error
                          code.
                        "message": "str"  # Optional. The
                          error message.
                    },
                    "started_at": "2020-02-20 00:00:00",  #
                      Optional. The start time of this step.
                    "status": "UNKNOWN",  # Optional. Default
                      value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING",
                      "RUNNING", "ERROR", and "SUCCESS".
                    "steps": [
                        {}  # Optional. Child steps of this
                          step.
                    ]
                }
            ],
            "success_steps": 0,  # Optional. Number of successful steps.
            "summary_steps": [
                {
                    "component_name": "str",  # Optional. The
                      component name that this step is associated with.
                    "ended_at": "2020-02-20 00:00:00",  #
                      Optional. The end time of this step.
                    "message_base": "str",  # Optional. The base
                      of a human-readable description of the step intended to be
                      combined with the component name for presentation. For
                      example:"n"n``message_base`` = "Building
                      service""n``component_name`` = "api".
                    "name": "str",  # Optional. The name of this
                      step.
                    "reason": {
                        "code": "str",  # Optional. The error
                          code.
                        "message": "str"  # Optional. The
                          error message.
                    },
                    "started_at": "2020-02-20 00:00:00",  #
                      Optional. The start time of this step.
                    "status": "UNKNOWN",  # Optional. Default
                      value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING",
                      "RUNNING", "ERROR", and "SUCCESS".
                    "steps": [
                        {}  # Optional. Child steps of this
                          step.
                    ]
                }
            ],
            "total_steps": 0  # Optional. Total number of steps.
        },
        "services": [
            {
                "name": "str",  # Optional. The name of this service.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this service.
            }
        ],
        "spec": {
            "databases": [
                {
                    "cluster_name": "str",  # Optional. The name
                      of the underlying DigitalOcean DBaaS cluster. This is required
                      for production databases. For dev databases, if cluster_name is
                      not set, a new cluster will be provisioned.
                    "db_name": "str",  # Optional. The name of
                      the MySQL or PostgreSQL database to configure.
                    "db_user": "str",  # Optional. The name of
                      the MySQL or PostgreSQL user to configure.
                    "engine": "UNSET",  # Optional. Default value
                      is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis.
                      Known values are: "UNSET", "MYSQL", "PG", and "REDIS".
                    "name": "str",  # The name. Must be unique
                      across all components within the same app. Required.
                    "production": bool,  # Optional. Whether this
                      is a production or dev database.
                    "version": "str"  # Optional. The version of
                      the database engine.
                }
            ],
            "domains": [
                {
                    "domain": "str",  # The hostname for the
                      domain. Required.
                    "minimum_tls_version": "str",  # Optional.
                      The minimum version of TLS a client application can use to access
                      resources for the domain.  Must be one of the following values
                      wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values
                      are: "1.2" and "1.3".
                    "type": "UNSPECIFIED",  # Optional. Default
                      value is "UNSPECIFIED". * DEFAULT: The default
                      ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY:
                      The primary domain for this app that is displayed as the default
                      in the control panel, used in bindable environment variables, and
                      any other places that reference an app's live URL. Only one
                      domain may be set as primary."n* ALIAS: A non-primary domain.
                      Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and
                      "ALIAS".
                    "wildcard": bool,  # Optional. Indicates
                      whether the domain includes all sub-domains, in addition to the
                      given domain.
                    "zone": "str"  # Optional. Optional. If the
                      domain uses DigitalOcean DNS and you would like App"nPlatform to
                      automatically manage it for you, set this to the name of
                      the"ndomain on your account."n"nFor example, If the domain you
                      are adding is ``app.domain.com``"" , the zone"ncould be
                      ``domain.com``.
                }
            ],
            "functions": [
                {
                    "alerts": [
                        {
                            "disabled": bool,  #
                              Optional. Is the alert disabled?.
                            "operator":
                              "UNSPECIFIED_OPERATOR",  # Optional. Default value is
                              "UNSPECIFIED_OPERATOR". Known values are:
                              "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN".
                            "rule": "UNSPECIFIED_RULE",
                              # Optional. Default value is "UNSPECIFIED_RULE". Known
                              values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                              "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED",
                              "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE",
                              "FUNCTIONS_ACTIVATION_COUNT",
                              "FUNCTIONS_AVERAGE_DURATION_MS",
                              "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                              "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                              "FUNCTIONS_ERROR_COUNT", and
                              "FUNCTIONS_GB_RATE_PER_SECOND".
                            "value": 0.0,  # Optional.
                              Threshold value for alert.
                            "window":
                              "UNSPECIFIED_WINDOW"  # Optional. Default value is
                              "UNSPECIFIED_WINDOW". Known values are:
                              "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES",
                              "THIRTY_MINUTES", and "ONE_HOUR".
                        }
                    ],
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # The name. Must be unique
                      across all components within the same app. Required.
                    "routes": [
                        {
                            "path": "str",  # Optional.
                              An HTTP path prefix. Paths must start with / and must be
                              unique across all components within an app.
                            "preserve_path_prefix": bool
                              # Optional. An optional flag to preserve the path that is
                              forwarded to the backend service. By default, the HTTP
                              request path will be trimmed from the left when forwarded
                              to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``.
                        }
                    ],
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "ingress": {
                "rules": [
                    {
                        "component": {
                            "name": "str",  # The name of
                              the component to route to. Required.
                            "preserve_path_prefix":
                              "str",  # Optional. An optional flag to preserve the path
                              that is forwarded to the backend service. By default, the
                              HTTP request path will be trimmed from the left when
                              forwarded to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``. Note: this is not applicable for
                              Functions Components and is mutually exclusive with
                              ``rewrite``.
                            "rewrite": "str"  # Optional.
                              An optional field that will rewrite the path of the
                              component to be what is specified here. By default, the
                              HTTP request path will be trimmed from the left when
                              forwarded to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If you specified the rewrite to be
                              ``/v1/``"" , requests to ``/api/list`` would be rewritten
                              to ``/v1/list``. Note: this is mutually exclusive with
                              ``preserve_path_prefix``.
                        },
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "match": {
                            "path": {
                                "prefix": "str"  #
                                  Prefix-based match. For example, ``/api`` will match
                                  ``/api``"" , ``/api/``"" , and any nested paths such
                                  as ``/api/v1/endpoint``. Required.
                            }
                        },
                        "redirect": {
                            "authority": "str",  #
                              Optional. The authority/host to redirect to. This can be
                              a hostname or IP address. Note: use ``port`` to set the
                              port.
                            "port": 0,  # Optional. The
                              port to redirect to.
                            "redirect_code": 0,  #
                              Optional. The redirect code to use. Defaults to ``302``.
                              Supported values are 300, 301, 302, 303, 304, 307, 308.
                            "scheme": "str",  # Optional.
                              The scheme to redirect to. Supported values are ``http``
                              or ``https``. Default: ``https``.
                            "uri": "str"  # Optional. An
                              optional URI path to redirect to. Note: if this is
                              specified the whole URI of the original request will be
                              overwritten to this value, irrespective of the original
                              request URI being matched.
                        }
                    }
                ]
            },
            "jobs": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "instance_count": 1,  # Optional. Default
                      value is 1. The amount of instances that this component should be
                      scaled to. Default: 1.
                    "instance_size_slug": "basic-xxs",  #
                      Optional. Default value is "basic-xxs". The instance size to use
                      for this component. Default: ``basic-xxs``. Known values are:
                      "basic-xxs", "basic-xs", "basic-s", "basic-m", "professional-xs",
                      "professional-s", "professional-m", "professional-1l",
                      "professional-l", and "professional-xl".
                    "kind": "UNSPECIFIED",  # Optional. Default
                      value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will
                      auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job
                      that runs before an app deployment."n* POST_DEPLOY: Indicates a
                      job that runs after an app deployment."n* FAILED_DEPLOY:
                      Indicates a job that runs after a component fails to deploy.
                      Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and
                      "FAILED_DEPLOY".
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "name": "str",  # The name of the app. Must be unique across
              all apps in the same account. Required.
            "region": "str",  # Optional. The slug form of the
              geographical origin of the app. Default: ``nearest available``. Known
              values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and
              "syd".
            "services": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "health_check": {
                        "failure_threshold": 0,  # Optional.
                          The number of failed health checks before considered
                          unhealthy.
                        "http_path": "str",  # Optional. The
                          route path used for the HTTP health check ping. If not set,
                          the HTTP health check will be disabled and a TCP health check
                          used instead.
                        "initial_delay_seconds": 0,  #
                          Optional. The number of seconds to wait before beginning
                          health checks.
                        "period_seconds": 0,  # Optional. The
                          number of seconds to wait between health checks.
                        "port": 0,  # Optional. The port on
                          which the health check will be performed. If not set, the
                          health check will be performed on the component's http_port.
                        "success_threshold": 0,  # Optional.
                          The number of successful health checks before considered
                          healthy.
                        "timeout_seconds": 0  # Optional. The
                          number of seconds after which the check times out.
                    },
                    "http_port": 0,  # Optional. The internal
                      port on which this service's run command will listen. Default:
                      8080"nIf there is not an environment variable with the name
                      ``PORT``"" , one will be automatically added with its value set
                      to the value of this field.
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "instance_count": 1,  # Optional. Default
                      value is 1. The amount of instances that this component should be
                      scaled to. Default: 1.
                    "instance_size_slug": "basic-xxs",  #
                      Optional. Default value is "basic-xxs". The instance size to use
                      for this component. Default: ``basic-xxs``. Known values are:
                      "basic-xxs", "basic-xs", "basic-s", "basic-m", "professional-xs",
                      "professional-s", "professional-m", "professional-1l",
                      "professional-l", and "professional-xl".
                    "internal_ports": [
                        0  # Optional. The ports on which
                          this service will listen for internal traffic.
                    ],
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "routes": [
                        {
                            "path": "str",  # Optional.
                              An HTTP path prefix. Paths must start with / and must be
                              unique across all components within an app.
                            "preserve_path_prefix": bool
                              # Optional. An optional flag to preserve the path that is
                              forwarded to the backend service. By default, the HTTP
                              request path will be trimmed from the left when forwarded
                              to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``.
                        }
                    ],
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "static_sites": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "catchall_document": "str",  # Optional. The
                      name of the document to use as the fallback for any requests to
                      documents that are not found when serving this static site. Only
                      1 of ``catchall_document`` or ``error_document`` can be set.
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "error_document": "404.html",  # Optional.
                      Default value is "404.html". The name of the error document to
                      use when serving this static site. Default: 404.html. If no such
                      file exists within the built assets, App Platform will supply
                      one.
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "index_document": "index.html",  # Optional.
                      Default value is "index.html". The name of the index document to
                      use when serving this static site. Default: index.html.
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "output_dir": "str",  # Optional. An optional
                      path to where the built assets will be located, relative to the
                      build context. If not set, App Platform will automatically scan
                      for these directory names: ``_static``"" , ``dist``"" ,
                      ``public``"" , ``build``.
                    "routes": [
                        {
                            "path": "str",  # Optional.
                              An HTTP path prefix. Paths must start with / and must be
                              unique across all components within an app.
                            "preserve_path_prefix": bool
                              # Optional. An optional flag to preserve the path that is
                              forwarded to the backend service. By default, the HTTP
                              request path will be trimmed from the left when forwarded
                              to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``.
                        }
                    ],
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "workers": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "instance_count": 1,  # Optional. Default
                      value is 1. The amount of instances that this component should be
                      scaled to. Default: 1.
                    "instance_size_slug": "basic-xxs",  #
                      Optional. Default value is "basic-xxs". The instance size to use
                      for this component. Default: ``basic-xxs``. Known values are:
                      "basic-xxs", "basic-xs", "basic-s", "basic-m", "professional-xs",
                      "professional-s", "professional-m", "professional-1l",
                      "professional-l", and "professional-xl".
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ]
        },
        "static_sites": [
            {
                "name": "str",  # Optional. The name of this static
                  site.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this static site.
            }
        ],
        "tier_slug": "str",  # Optional. The current pricing tier slug of the
          deployment.
        "updated_at": "2020-02-20 00:00:00",  # Optional. When the deployment
          was last updated.
        "workers": [
            {
                "name": "str",  # Optional. The name of this worker.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this worker.
            }
        ]
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
commit_rollback(app_id: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Commit App Rollback.

Commit an app rollback. This action permanently applies the rollback and unpins the app to resume new deployments.

Parameters:

app_id (str) – The app ID. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
create(body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
create(body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create a New App.

Create a new app by submitting an app specification. For documentation on app specifications ( AppSpec objects), please refer to the product documentation.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "app": {
        "active_deployment": {
            "cause": "str",  # Optional. What caused this deployment to
              be created.
            "cloned_from": "str",  # Optional. The ID of a previous
              deployment that this deployment was cloned from.
            "created_at": "2020-02-20 00:00:00",  # Optional. The
              creation time of the deployment.
            "functions": [
                {
                    "name": "str",  # Optional. The name of this
                      functions component.
                    "namespace": "str",  # Optional. The
                      namespace where the functions are deployed.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      functions component.
                }
            ],
            "id": "str",  # Optional. The ID of the deployment.
            "jobs": [
                {
                    "name": "str",  # Optional. The name of this
                      job.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this job.
                }
            ],
            "phase": "UNKNOWN",  # Optional. Default value is "UNKNOWN".
              Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING",
              "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and
              "CANCELED".
            "phase_last_updated_at": "2020-02-20 00:00:00",  # Optional.
              When the deployment phase was last updated.
            "progress": {
                "error_steps": 0,  # Optional. Number of unsuccessful
                  steps.
                "pending_steps": 0,  # Optional. Number of pending
                  steps.
                "running_steps": 0,  # Optional. Number of currently
                  running steps.
                "steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "success_steps": 0,  # Optional. Number of successful
                  steps.
                "summary_steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "total_steps": 0  # Optional. Total number of steps.
            },
            "services": [
                {
                    "name": "str",  # Optional. The name of this
                      service.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      service.
                }
            ],
            "spec": {
                "databases": [
                    {
                        "cluster_name": "str",  # Optional.
                          The name of the underlying DigitalOcean DBaaS cluster. This
                          is required for production databases. For dev databases, if
                          cluster_name is not set, a new cluster will be provisioned.
                        "db_name": "str",  # Optional. The
                          name of the MySQL or PostgreSQL database to configure.
                        "db_user": "str",  # Optional. The
                          name of the MySQL or PostgreSQL user to configure.
                        "engine": "UNSET",  # Optional.
                          Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n*
                          REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and
                          "REDIS".
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "production": bool,  # Optional.
                          Whether this is a production or dev database.
                        "version": "str"  # Optional. The
                          version of the database engine.
                    }
                ],
                "domains": [
                    {
                        "domain": "str",  # The hostname for
                          the domain. Required.
                        "minimum_tls_version": "str",  #
                          Optional. The minimum version of TLS a client application can
                          use to access resources for the domain.  Must be one of the
                          following values wrapped within quotations: ``"1.2"`` or
                          ``"1.3"``. Known values are: "1.2" and "1.3".
                        "type": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * DEFAULT: The default
                          ``.ondigitalocean.app`` domain assigned to this app"n*
                          PRIMARY: The primary domain for this app that is displayed as
                          the default in the control panel, used in bindable
                          environment variables, and any other places that reference an
                          app's live URL. Only one domain may be set as primary."n*
                          ALIAS: A non-primary domain. Known values are: "UNSPECIFIED",
                          "DEFAULT", "PRIMARY", and "ALIAS".
                        "wildcard": bool,  # Optional.
                          Indicates whether the domain includes all sub-domains, in
                          addition to the given domain.
                        "zone": "str"  # Optional. Optional.
                          If the domain uses DigitalOcean DNS and you would like
                          App"nPlatform to automatically manage it for you, set this to
                          the name of the"ndomain on your account."n"nFor example, If
                          the domain you are adding is ``app.domain.com``"" , the
                          zone"ncould be ``domain.com``.
                    }
                ],
                "functions": [
                    {
                        "alerts": [
                            {
                                "disabled": bool,  #
                                  Optional. Is the alert disabled?.
                                "operator":
                                  "UNSPECIFIED_OPERATOR",  # Optional. Default value is
                                  "UNSPECIFIED_OPERATOR". Known values are:
                                  "UNSPECIFIED_OPERATOR", "GREATER_THAN", and
                                  "LESS_THAN".
                                "rule":
                                  "UNSPECIFIED_RULE",  # Optional. Default value is
                                  "UNSPECIFIED_RULE". Known values are:
                                  "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                                  "MEM_UTILIZATION", "RESTART_COUNT",
                                  "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE",
                                  "DOMAIN_FAILED", "DOMAIN_LIVE",
                                  "FUNCTIONS_ACTIVATION_COUNT",
                                  "FUNCTIONS_AVERAGE_DURATION_MS",
                                  "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                                  "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                                  "FUNCTIONS_ERROR_COUNT", and
                                  "FUNCTIONS_GB_RATE_PER_SECOND".
                                "value": 0.0,  #
                                  Optional. Threshold value for alert.
                                "window":
                                  "UNSPECIFIED_WINDOW"  # Optional. Default value is
                                  "UNSPECIFIED_WINDOW". Known values are:
                                  "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES",
                                  "THIRTY_MINUTES", and "ONE_HOUR".
                            }
                        ],
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "ingress": {
                    "rules": [
                        {
                            "component": {
                                "name": "str",  # The
                                  name of the component to route to. Required.
"preserve_path_prefix": "str",  # Optional. An
                                  optional flag to preserve the path that is forwarded
                                  to the backend service. By default, the HTTP request
                                  path will be trimmed from the left when forwarded to
                                  the component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``. Note: this is not
                                  applicable for Functions Components and is mutually
                                  exclusive with ``rewrite``.
                                "rewrite": "str"  #
                                  Optional. An optional field that will rewrite the
                                  path of the component to be what is specified here.
                                  By default, the HTTP request path will be trimmed
                                  from the left when forwarded to the component. For
                                  example, a component with ``path=/api`` will have
                                  requests to ``/api/list`` trimmed to ``/list``. If
                                  you specified the rewrite to be ``/v1/``"" , requests
                                  to ``/api/list`` would be rewritten to ``/v1/list``.
                                  Note: this is mutually exclusive with
                                  ``preserve_path_prefix``.
                            },
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "match": {
                                "path": {
                                    "prefix":
                                      "str"  # Prefix-based match. For example,
                                      ``/api`` will match ``/api``"" , ``/api/``"" ,
                                      and any nested paths such as
                                      ``/api/v1/endpoint``. Required.
                                }
                            },
                            "redirect": {
                                "authority": "str",
                                  # Optional. The authority/host to redirect to. This
                                  can be a hostname or IP address. Note: use ``port``
                                  to set the port.
                                "port": 0,  #
                                  Optional. The port to redirect to.
                                "redirect_code": 0,
                                  # Optional. The redirect code to use. Defaults to
                                  ``302``. Supported values are 300, 301, 302, 303,
                                  304, 307, 308.
                                "scheme": "str",  #
                                  Optional. The scheme to redirect to. Supported values
                                  are ``http`` or ``https``. Default: ``https``.
                                "uri": "str"  #
                                  Optional. An optional URI path to redirect to. Note:
                                  if this is specified the whole URI of the original
                                  request will be overwritten to this value,
                                  irrespective of the original request URI being
                                  matched.
                            }
                        }
                    ]
                },
                "jobs": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "kind": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * UNSPECIFIED: Default job
                          type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY:
                          Indicates a job that runs before an app deployment."n*
                          POST_DEPLOY: Indicates a job that runs after an app
                          deployment."n* FAILED_DEPLOY: Indicates a job that runs after
                          a component fails to deploy. Known values are: "UNSPECIFIED",
                          "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "name": "str",  # The name of the app. Must be unique
                  across all apps in the same account. Required.
                "region": "str",  # Optional. The slug form of the
                  geographical origin of the app. Default: ``nearest available``. Known
                  values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon",
                  and "syd".
                "services": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "health_check": {
                            "failure_threshold": 0,  #
                              Optional. The number of failed health checks before
                              considered unhealthy.
                            "http_path": "str",  #
                              Optional. The route path used for the HTTP health check
                              ping. If not set, the HTTP health check will be disabled
                              and a TCP health check used instead.
                            "initial_delay_seconds": 0,
                              # Optional. The number of seconds to wait before
                              beginning health checks.
                            "period_seconds": 0,  #
                              Optional. The number of seconds to wait between health
                              checks.
                            "port": 0,  # Optional. The
                              port on which the health check will be performed. If not
                              set, the health check will be performed on the
                              component's http_port.
                            "success_threshold": 0,  #
                              Optional. The number of successful health checks before
                              considered healthy.
                            "timeout_seconds": 0  #
                              Optional. The number of seconds after which the check
                              times out.
                        },
                        "http_port": 0,  # Optional. The
                          internal port on which this service's run command will
                          listen. Default: 8080"nIf there is not an environment
                          variable with the name ``PORT``"" , one will be automatically
                          added with its value set to the value of this field.
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "internal_ports": [
                            0  # Optional. The ports on
                              which this service will listen for internal traffic.
                        ],
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "static_sites": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "catchall_document": "str",  #
                          Optional. The name of the document to use as the fallback for
                          any requests to documents that are not found when serving
                          this static site. Only 1 of ``catchall_document`` or
                          ``error_document`` can be set.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "error_document": "404.html",  #
                          Optional. Default value is "404.html". The name of the error
                          document to use when serving this static site. Default:
                          404.html. If no such file exists within the built assets, App
                          Platform will supply one.
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "index_document": "index.html",  #
                          Optional. Default value is "index.html". The name of the
                          index document to use when serving this static site. Default:
                          index.html.
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "output_dir": "str",  # Optional. An
                          optional path to where the built assets will be located,
                          relative to the build context. If not set, App Platform will
                          automatically scan for these directory names: ``_static``"" ,
                          ``dist``"" , ``public``"" , ``build``.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "workers": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ]
            },
            "static_sites": [
                {
                    "name": "str",  # Optional. The name of this
                      static site.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this static
                      site.
                }
            ],
            "tier_slug": "str",  # Optional. The current pricing tier
              slug of the deployment.
            "updated_at": "2020-02-20 00:00:00",  # Optional. When the
              deployment was last updated.
            "workers": [
                {
                    "name": "str",  # Optional. The name of this
                      worker.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this worker.
                }
            ]
        },
        "created_at": "2020-02-20 00:00:00",  # Optional. The creation time
          of the app.
        "default_ingress": "str",  # Optional. The default hostname on which
          the app is accessible.
        "domains": [
            {
                "certificate_expires_at": "2020-02-20 00:00:00",  #
                  Optional. Current SSL certificate expiration time.
                "id": "str",  # Optional. The ID of the domain.
                "phase": "UNKNOWN",  # Optional. Default value is
                  "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING",
                  "ACTIVE", and "ERROR".
                "progress": {
                    "steps": [
                        {}  # Optional. The steps of the
                          domain's progress.
                    ]
                },
                "rotate_validation_records": bool,  # Optional.
                  Validation values have changed and require manual intervention.
                "spec": {
                    "domain": "str",  # The hostname for the
                      domain. Required.
                    "minimum_tls_version": "str",  # Optional.
                      The minimum version of TLS a client application can use to access
                      resources for the domain.  Must be one of the following values
                      wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values
                      are: "1.2" and "1.3".
                    "type": "UNSPECIFIED",  # Optional. Default
                      value is "UNSPECIFIED". * DEFAULT: The default
                      ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY:
                      The primary domain for this app that is displayed as the default
                      in the control panel, used in bindable environment variables, and
                      any other places that reference an app's live URL. Only one
                      domain may be set as primary."n* ALIAS: A non-primary domain.
                      Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and
                      "ALIAS".
                    "wildcard": bool,  # Optional. Indicates
                      whether the domain includes all sub-domains, in addition to the
                      given domain.
                    "zone": "str"  # Optional. Optional. If the
                      domain uses DigitalOcean DNS and you would like App"nPlatform to
                      automatically manage it for you, set this to the name of
                      the"ndomain on your account."n"nFor example, If the domain you
                      are adding is ``app.domain.com``"" , the zone"ncould be
                      ``domain.com``.
                },
                "validations": [
                    {
                        "txt_name": "str",  # Optional. TXT
                          record name.
                        "txt_value": "str"  # Optional. TXT
                          record value.
                    }
                ]
            }
        ],
        "id": "str",  # Optional. The ID of the application.
        "in_progress_deployment": {
            "cause": "str",  # Optional. What caused this deployment to
              be created.
            "cloned_from": "str",  # Optional. The ID of a previous
              deployment that this deployment was cloned from.
            "created_at": "2020-02-20 00:00:00",  # Optional. The
              creation time of the deployment.
            "functions": [
                {
                    "name": "str",  # Optional. The name of this
                      functions component.
                    "namespace": "str",  # Optional. The
                      namespace where the functions are deployed.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      functions component.
                }
            ],
            "id": "str",  # Optional. The ID of the deployment.
            "jobs": [
                {
                    "name": "str",  # Optional. The name of this
                      job.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this job.
                }
            ],
            "phase": "UNKNOWN",  # Optional. Default value is "UNKNOWN".
              Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING",
              "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and
              "CANCELED".
            "phase_last_updated_at": "2020-02-20 00:00:00",  # Optional.
              When the deployment phase was last updated.
            "progress": {
                "error_steps": 0,  # Optional. Number of unsuccessful
                  steps.
                "pending_steps": 0,  # Optional. Number of pending
                  steps.
                "running_steps": 0,  # Optional. Number of currently
                  running steps.
                "steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "success_steps": 0,  # Optional. Number of successful
                  steps.
                "summary_steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "total_steps": 0  # Optional. Total number of steps.
            },
            "services": [
                {
                    "name": "str",  # Optional. The name of this
                      service.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      service.
                }
            ],
            "spec": {
                "databases": [
                    {
                        "cluster_name": "str",  # Optional.
                          The name of the underlying DigitalOcean DBaaS cluster. This
                          is required for production databases. For dev databases, if
                          cluster_name is not set, a new cluster will be provisioned.
                        "db_name": "str",  # Optional. The
                          name of the MySQL or PostgreSQL database to configure.
                        "db_user": "str",  # Optional. The
                          name of the MySQL or PostgreSQL user to configure.
                        "engine": "UNSET",  # Optional.
                          Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n*
                          REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and
                          "REDIS".
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "production": bool,  # Optional.
                          Whether this is a production or dev database.
                        "version": "str"  # Optional. The
                          version of the database engine.
                    }
                ],
                "domains": [
                    {
                        "domain": "str",  # The hostname for
                          the domain. Required.
                        "minimum_tls_version": "str",  #
                          Optional. The minimum version of TLS a client application can
                          use to access resources for the domain.  Must be one of the
                          following values wrapped within quotations: ``"1.2"`` or
                          ``"1.3"``. Known values are: "1.2" and "1.3".
                        "type": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * DEFAULT: The default
                          ``.ondigitalocean.app`` domain assigned to this app"n*
                          PRIMARY: The primary domain for this app that is displayed as
                          the default in the control panel, used in bindable
                          environment variables, and any other places that reference an
                          app's live URL. Only one domain may be set as primary."n*
                          ALIAS: A non-primary domain. Known values are: "UNSPECIFIED",
                          "DEFAULT", "PRIMARY", and "ALIAS".
                        "wildcard": bool,  # Optional.
                          Indicates whether the domain includes all sub-domains, in
                          addition to the given domain.
                        "zone": "str"  # Optional. Optional.
                          If the domain uses DigitalOcean DNS and you would like
                          App"nPlatform to automatically manage it for you, set this to
                          the name of the"ndomain on your account."n"nFor example, If
                          the domain you are adding is ``app.domain.com``"" , the
                          zone"ncould be ``domain.com``.
                    }
                ],
                "functions": [
                    {
                        "alerts": [
                            {
                                "disabled": bool,  #
                                  Optional. Is the alert disabled?.
                                "operator":
                                  "UNSPECIFIED_OPERATOR",  # Optional. Default value is
                                  "UNSPECIFIED_OPERATOR". Known values are:
                                  "UNSPECIFIED_OPERATOR", "GREATER_THAN", and
                                  "LESS_THAN".
                                "rule":
                                  "UNSPECIFIED_RULE",  # Optional. Default value is
                                  "UNSPECIFIED_RULE". Known values are:
                                  "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                                  "MEM_UTILIZATION", "RESTART_COUNT",
                                  "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE",
                                  "DOMAIN_FAILED", "DOMAIN_LIVE",
                                  "FUNCTIONS_ACTIVATION_COUNT",
                                  "FUNCTIONS_AVERAGE_DURATION_MS",
                                  "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                                  "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                                  "FUNCTIONS_ERROR_COUNT", and
                                  "FUNCTIONS_GB_RATE_PER_SECOND".
                                "value": 0.0,  #
                                  Optional. Threshold value for alert.
                                "window":
                                  "UNSPECIFIED_WINDOW"  # Optional. Default value is
                                  "UNSPECIFIED_WINDOW". Known values are:
                                  "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES",
                                  "THIRTY_MINUTES", and "ONE_HOUR".
                            }
                        ],
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "ingress": {
                    "rules": [
                        {
                            "component": {
                                "name": "str",  # The
                                  name of the component to route to. Required.
"preserve_path_prefix": "str",  # Optional. An
                                  optional flag to preserve the path that is forwarded
                                  to the backend service. By default, the HTTP request
                                  path will be trimmed from the left when forwarded to
                                  the component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``. Note: this is not
                                  applicable for Functions Components and is mutually
                                  exclusive with ``rewrite``.
                                "rewrite": "str"  #
                                  Optional. An optional field that will rewrite the
                                  path of the component to be what is specified here.
                                  By default, the HTTP request path will be trimmed
                                  from the left when forwarded to the component. For
                                  example, a component with ``path=/api`` will have
                                  requests to ``/api/list`` trimmed to ``/list``. If
                                  you specified the rewrite to be ``/v1/``"" , requests
                                  to ``/api/list`` would be rewritten to ``/v1/list``.
                                  Note: this is mutually exclusive with
                                  ``preserve_path_prefix``.
                            },
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "match": {
                                "path": {
                                    "prefix":
                                      "str"  # Prefix-based match. For example,
                                      ``/api`` will match ``/api``"" , ``/api/``"" ,
                                      and any nested paths such as
                                      ``/api/v1/endpoint``. Required.
                                }
                            },
                            "redirect": {
                                "authority": "str",
                                  # Optional. The authority/host to redirect to. This
                                  can be a hostname or IP address. Note: use ``port``
                                  to set the port.
                                "port": 0,  #
                                  Optional. The port to redirect to.
                                "redirect_code": 0,
                                  # Optional. The redirect code to use. Defaults to
                                  ``302``. Supported values are 300, 301, 302, 303,
                                  304, 307, 308.
                                "scheme": "str",  #
                                  Optional. The scheme to redirect to. Supported values
                                  are ``http`` or ``https``. Default: ``https``.
                                "uri": "str"  #
                                  Optional. An optional URI path to redirect to. Note:
                                  if this is specified the whole URI of the original
                                  request will be overwritten to this value,
                                  irrespective of the original request URI being
                                  matched.
                            }
                        }
                    ]
                },
                "jobs": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "kind": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * UNSPECIFIED: Default job
                          type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY:
                          Indicates a job that runs before an app deployment."n*
                          POST_DEPLOY: Indicates a job that runs after an app
                          deployment."n* FAILED_DEPLOY: Indicates a job that runs after
                          a component fails to deploy. Known values are: "UNSPECIFIED",
                          "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "name": "str",  # The name of the app. Must be unique
                  across all apps in the same account. Required.
                "region": "str",  # Optional. The slug form of the
                  geographical origin of the app. Default: ``nearest available``. Known
                  values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon",
                  and "syd".
                "services": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "health_check": {
                            "failure_threshold": 0,  #
                              Optional. The number of failed health checks before
                              considered unhealthy.
                            "http_path": "str",  #
                              Optional. The route path used for the HTTP health check
                              ping. If not set, the HTTP health check will be disabled
                              and a TCP health check used instead.
                            "initial_delay_seconds": 0,
                              # Optional. The number of seconds to wait before
                              beginning health checks.
                            "period_seconds": 0,  #
                              Optional. The number of seconds to wait between health
                              checks.
                            "port": 0,  # Optional. The
                              port on which the health check will be performed. If not
                              set, the health check will be performed on the
                              component's http_port.
                            "success_threshold": 0,  #
                              Optional. The number of successful health checks before
                              considered healthy.
                            "timeout_seconds": 0  #
                              Optional. The number of seconds after which the check
                              times out.
                        },
                        "http_port": 0,  # Optional. The
                          internal port on which this service's run command will
                          listen. Default: 8080"nIf there is not an environment
                          variable with the name ``PORT``"" , one will be automatically
                          added with its value set to the value of this field.
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "internal_ports": [
                            0  # Optional. The ports on
                              which this service will listen for internal traffic.
                        ],
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "static_sites": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "catchall_document": "str",  #
                          Optional. The name of the document to use as the fallback for
                          any requests to documents that are not found when serving
                          this static site. Only 1 of ``catchall_document`` or
                          ``error_document`` can be set.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "error_document": "404.html",  #
                          Optional. Default value is "404.html". The name of the error
                          document to use when serving this static site. Default:
                          404.html. If no such file exists within the built assets, App
                          Platform will supply one.
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "index_document": "index.html",  #
                          Optional. Default value is "index.html". The name of the
                          index document to use when serving this static site. Default:
                          index.html.
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "output_dir": "str",  # Optional. An
                          optional path to where the built assets will be located,
                          relative to the build context. If not set, App Platform will
                          automatically scan for these directory names: ``_static``"" ,
                          ``dist``"" , ``public``"" , ``build``.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "workers": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ]
            },
            "static_sites": [
                {
                    "name": "str",  # Optional. The name of this
                      static site.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this static
                      site.
                }
            ],
            "tier_slug": "str",  # Optional. The current pricing tier
              slug of the deployment.
            "updated_at": "2020-02-20 00:00:00",  # Optional. When the
              deployment was last updated.
            "workers": [
                {
                    "name": "str",  # Optional. The name of this
                      worker.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this worker.
                }
            ]
        },
        "last_deployment_created_at": "2020-02-20 00:00:00",  # Optional. The
          creation time of the last deployment.
        "live_domain": "str",  # Optional. The live domain of the app.
        "live_url": "str",  # Optional. The live URL of the app.
        "live_url_base": "str",  # Optional. The live URL base of the app,
          the URL excluding the path.
        "owner_uuid": "str",  # Optional. The ID of the account to which the
          application belongs.
        "pending_deployment": {
            "cause": "str",  # Optional. What caused this deployment to
              be created.
            "cloned_from": "str",  # Optional. The ID of a previous
              deployment that this deployment was cloned from.
            "created_at": "2020-02-20 00:00:00",  # Optional. The
              creation time of the deployment.
            "functions": [
                {
                    "name": "str",  # Optional. The name of this
                      functions component.
                    "namespace": "str",  # Optional. The
                      namespace where the functions are deployed.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      functions component.
                }
            ],
            "id": "str",  # Optional. The ID of the deployment.
            "jobs": [
                {
                    "name": "str",  # Optional. The name of this
                      job.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this job.
                }
            ],
            "phase": "UNKNOWN",  # Optional. Default value is "UNKNOWN".
              Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING",
              "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and
              "CANCELED".
            "phase_last_updated_at": "2020-02-20 00:00:00",  # Optional.
              When the deployment phase was last updated.
            "progress": {
                "error_steps": 0,  # Optional. Number of unsuccessful
                  steps.
                "pending_steps": 0,  # Optional. Number of pending
                  steps.
                "running_steps": 0,  # Optional. Number of currently
                  running steps.
                "steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "success_steps": 0,  # Optional. Number of successful
                  steps.
                "summary_steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "total_steps": 0  # Optional. Total number of steps.
            },
            "services": [
                {
                    "name": "str",  # Optional. The name of this
                      service.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      service.
                }
            ],
            "spec": {
                "databases": [
                    {
                        "cluster_name": "str",  # Optional.
                          The name of the underlying DigitalOcean DBaaS cluster. This
                          is required for production databases. For dev databases, if
                          cluster_name is not set, a new cluster will be provisioned.
                        "db_name": "str",  # Optional. The
                          name of the MySQL or PostgreSQL database to configure.
                        "db_user": "str",  # Optional. The
                          name of the MySQL or PostgreSQL user to configure.
                        "engine": "UNSET",  # Optional.
                          Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n*
                          REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and
                          "REDIS".
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "production": bool,  # Optional.
                          Whether this is a production or dev database.
                        "version": "str"  # Optional. The
                          version of the database engine.
                    }
                ],
                "domains": [
                    {
                        "domain": "str",  # The hostname for
                          the domain. Required.
                        "minimum_tls_version": "str",  #
                          Optional. The minimum version of TLS a client application can
                          use to access resources for the domain.  Must be one of the
                          following values wrapped within quotations: ``"1.2"`` or
                          ``"1.3"``. Known values are: "1.2" and "1.3".
                        "type": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * DEFAULT: The default
                          ``.ondigitalocean.app`` domain assigned to this app"n*
                          PRIMARY: The primary domain for this app that is displayed as
                          the default in the control panel, used in bindable
                          environment variables, and any other places that reference an
                          app's live URL. Only one domain may be set as primary."n*
                          ALIAS: A non-primary domain. Known values are: "UNSPECIFIED",
                          "DEFAULT", "PRIMARY", and "ALIAS".
                        "wildcard": bool,  # Optional.
                          Indicates whether the domain includes all sub-domains, in
                          addition to the given domain.
                        "zone": "str"  # Optional. Optional.
                          If the domain uses DigitalOcean DNS and you would like
                          App"nPlatform to automatically manage it for you, set this to
                          the name of the"ndomain on your account."n"nFor example, If
                          the domain you are adding is ``app.domain.com``"" , the
                          zone"ncould be ``domain.com``.
                    }
                ],
                "functions": [
                    {
                        "alerts": [
                            {
                                "disabled": bool,  #
                                  Optional. Is the alert disabled?.
                                "operator":
                                  "UNSPECIFIED_OPERATOR",  # Optional. Default value is
                                  "UNSPECIFIED_OPERATOR". Known values are:
                                  "UNSPECIFIED_OPERATOR", "GREATER_THAN", and
                                  "LESS_THAN".
                                "rule":
                                  "UNSPECIFIED_RULE",  # Optional. Default value is
                                  "UNSPECIFIED_RULE". Known values are:
                                  "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                                  "MEM_UTILIZATION", "RESTART_COUNT",
                                  "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE",
                                  "DOMAIN_FAILED", "DOMAIN_LIVE",
                                  "FUNCTIONS_ACTIVATION_COUNT",
                                  "FUNCTIONS_AVERAGE_DURATION_MS",
                                  "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                                  "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                                  "FUNCTIONS_ERROR_COUNT", and
                                  "FUNCTIONS_GB_RATE_PER_SECOND".
                                "value": 0.0,  #
                                  Optional. Threshold value for alert.
                                "window":
                                  "UNSPECIFIED_WINDOW"  # Optional. Default value is
                                  "UNSPECIFIED_WINDOW". Known values are:
                                  "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES",
                                  "THIRTY_MINUTES", and "ONE_HOUR".
                            }
                        ],
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "ingress": {
                    "rules": [
                        {
                            "component": {
                                "name": "str",  # The
                                  name of the component to route to. Required.
"preserve_path_prefix": "str",  # Optional. An
                                  optional flag to preserve the path that is forwarded
                                  to the backend service. By default, the HTTP request
                                  path will be trimmed from the left when forwarded to
                                  the component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``. Note: this is not
                                  applicable for Functions Components and is mutually
                                  exclusive with ``rewrite``.
                                "rewrite": "str"  #
                                  Optional. An optional field that will rewrite the
                                  path of the component to be what is specified here.
                                  By default, the HTTP request path will be trimmed
                                  from the left when forwarded to the component. For
                                  example, a component with ``path=/api`` will have
                                  requests to ``/api/list`` trimmed to ``/list``. If
                                  you specified the rewrite to be ``/v1/``"" , requests
                                  to ``/api/list`` would be rewritten to ``/v1/list``.
                                  Note: this is mutually exclusive with
                                  ``preserve_path_prefix``.
                            },
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "match": {
                                "path": {
                                    "prefix":
                                      "str"  # Prefix-based match. For example,
                                      ``/api`` will match ``/api``"" , ``/api/``"" ,
                                      and any nested paths such as
                                      ``/api/v1/endpoint``. Required.
                                }
                            },
                            "redirect": {
                                "authority": "str",
                                  # Optional. The authority/host to redirect to. This
                                  can be a hostname or IP address. Note: use ``port``
                                  to set the port.
                                "port": 0,  #
                                  Optional. The port to redirect to.
                                "redirect_code": 0,
                                  # Optional. The redirect code to use. Defaults to
                                  ``302``. Supported values are 300, 301, 302, 303,
                                  304, 307, 308.
                                "scheme": "str",  #
                                  Optional. The scheme to redirect to. Supported values
                                  are ``http`` or ``https``. Default: ``https``.
                                "uri": "str"  #
                                  Optional. An optional URI path to redirect to. Note:
                                  if this is specified the whole URI of the original
                                  request will be overwritten to this value,
                                  irrespective of the original request URI being
                                  matched.
                            }
                        }
                    ]
                },
                "jobs": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "kind": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * UNSPECIFIED: Default job
                          type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY:
                          Indicates a job that runs before an app deployment."n*
                          POST_DEPLOY: Indicates a job that runs after an app
                          deployment."n* FAILED_DEPLOY: Indicates a job that runs after
                          a component fails to deploy. Known values are: "UNSPECIFIED",
                          "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "name": "str",  # The name of the app. Must be unique
                  across all apps in the same account. Required.
                "region": "str",  # Optional. The slug form of the
                  geographical origin of the app. Default: ``nearest available``. Known
                  values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon",
                  and "syd".
                "services": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "health_check": {
                            "failure_threshold": 0,  #
                              Optional. The number of failed health checks before
                              considered unhealthy.
                            "http_path": "str",  #
                              Optional. The route path used for the HTTP health check
                              ping. If not set, the HTTP health check will be disabled
                              and a TCP health check used instead.
                            "initial_delay_seconds": 0,
                              # Optional. The number of seconds to wait before
                              beginning health checks.
                            "period_seconds": 0,  #
                              Optional. The number of seconds to wait between health
                              checks.
                            "port": 0,  # Optional. The
                              port on which the health check will be performed. If not
                              set, the health check will be performed on the
                              component's http_port.
                            "success_threshold": 0,  #
                              Optional. The number of successful health checks before
                              considered healthy.
                            "timeout_seconds": 0  #
                              Optional. The number of seconds after which the check
                              times out.
                        },
                        "http_port": 0,  # Optional. The
                          internal port on which this service's run command will
                          listen. Default: 8080"nIf there is not an environment
                          variable with the name ``PORT``"" , one will be automatically
                          added with its value set to the value of this field.
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "internal_ports": [
                            0  # Optional. The ports on
                              which this service will listen for internal traffic.
                        ],
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "static_sites": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "catchall_document": "str",  #
                          Optional. The name of the document to use as the fallback for
                          any requests to documents that are not found when serving
                          this static site. Only 1 of ``catchall_document`` or
                          ``error_document`` can be set.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "error_document": "404.html",  #
                          Optional. Default value is "404.html". The name of the error
                          document to use when serving this static site. Default:
                          404.html. If no such file exists within the built assets, App
                          Platform will supply one.
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "index_document": "index.html",  #
                          Optional. Default value is "index.html". The name of the
                          index document to use when serving this static site. Default:
                          index.html.
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "output_dir": "str",  # Optional. An
                          optional path to where the built assets will be located,
                          relative to the build context. If not set, App Platform will
                          automatically scan for these directory names: ``_static``"" ,
                          ``dist``"" , ``public``"" , ``build``.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "workers": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ]
            },
            "static_sites": [
                {
                    "name": "str",  # Optional. The name of this
                      static site.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this static
                      site.
                }
            ],
            "tier_slug": "str",  # Optional. The current pricing tier
              slug of the deployment.
            "updated_at": "2020-02-20 00:00:00",  # Optional. When the
              deployment was last updated.
            "workers": [
                {
                    "name": "str",  # Optional. The name of this
                      worker.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this worker.
                }
            ]
        },
        "pinned_deployment": {
            "cause": "str",  # Optional. What caused this deployment to
              be created.
            "cloned_from": "str",  # Optional. The ID of a previous
              deployment that this deployment was cloned from.
            "created_at": "2020-02-20 00:00:00",  # Optional. The
              creation time of the deployment.
            "functions": [
                {
                    "name": "str",  # Optional. The name of this
                      functions component.
                    "namespace": "str",  # Optional. The
                      namespace where the functions are deployed.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      functions component.
                }
            ],
            "id": "str",  # Optional. The ID of the deployment.
            "jobs": [
                {
                    "name": "str",  # Optional. The name of this
                      job.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this job.
                }
            ],
            "phase": "UNKNOWN",  # Optional. Default value is "UNKNOWN".
              Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING",
              "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and
              "CANCELED".
            "phase_last_updated_at": "2020-02-20 00:00:00",  # Optional.
              When the deployment phase was last updated.
            "progress": {
                "error_steps": 0,  # Optional. Number of unsuccessful
                  steps.
                "pending_steps": 0,  # Optional. Number of pending
                  steps.
                "running_steps": 0,  # Optional. Number of currently
                  running steps.
                "steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "success_steps": 0,  # Optional. Number of successful
                  steps.
                "summary_steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "total_steps": 0  # Optional. Total number of steps.
            },
            "services": [
                {
                    "name": "str",  # Optional. The name of this
                      service.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      service.
                }
            ],
            "spec": {
                "databases": [
                    {
                        "cluster_name": "str",  # Optional.
                          The name of the underlying DigitalOcean DBaaS cluster. This
                          is required for production databases. For dev databases, if
                          cluster_name is not set, a new cluster will be provisioned.
                        "db_name": "str",  # Optional. The
                          name of the MySQL or PostgreSQL database to configure.
                        "db_user": "str",  # Optional. The
                          name of the MySQL or PostgreSQL user to configure.
                        "engine": "UNSET",  # Optional.
                          Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n*
                          REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and
                          "REDIS".
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "production": bool,  # Optional.
                          Whether this is a production or dev database.
                        "version": "str"  # Optional. The
                          version of the database engine.
                    }
                ],
                "domains": [
                    {
                        "domain": "str",  # The hostname for
                          the domain. Required.
                        "minimum_tls_version": "str",  #
                          Optional. The minimum version of TLS a client application can
                          use to access resources for the domain.  Must be one of the
                          following values wrapped within quotations: ``"1.2"`` or
                          ``"1.3"``. Known values are: "1.2" and "1.3".
                        "type": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * DEFAULT: The default
                          ``.ondigitalocean.app`` domain assigned to this app"n*
                          PRIMARY: The primary domain for this app that is displayed as
                          the default in the control panel, used in bindable
                          environment variables, and any other places that reference an
                          app's live URL. Only one domain may be set as primary."n*
                          ALIAS: A non-primary domain. Known values are: "UNSPECIFIED",
                          "DEFAULT", "PRIMARY", and "ALIAS".
                        "wildcard": bool,  # Optional.
                          Indicates whether the domain includes all sub-domains, in
                          addition to the given domain.
                        "zone": "str"  # Optional. Optional.
                          If the domain uses DigitalOcean DNS and you would like
                          App"nPlatform to automatically manage it for you, set this to
                          the name of the"ndomain on your account."n"nFor example, If
                          the domain you are adding is ``app.domain.com``"" , the
                          zone"ncould be ``domain.com``.
                    }
                ],
                "functions": [
                    {
                        "alerts": [
                            {
                                "disabled": bool,  #
                                  Optional. Is the alert disabled?.
                                "operator":
                                  "UNSPECIFIED_OPERATOR",  # Optional. Default value is
                                  "UNSPECIFIED_OPERATOR". Known values are:
                                  "UNSPECIFIED_OPERATOR", "GREATER_THAN", and
                                  "LESS_THAN".
                                "rule":
                                  "UNSPECIFIED_RULE",  # Optional. Default value is
                                  "UNSPECIFIED_RULE". Known values are:
                                  "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                                  "MEM_UTILIZATION", "RESTART_COUNT",
                                  "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE",
                                  "DOMAIN_FAILED", "DOMAIN_LIVE",
                                  "FUNCTIONS_ACTIVATION_COUNT",
                                  "FUNCTIONS_AVERAGE_DURATION_MS",
                                  "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                                  "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                                  "FUNCTIONS_ERROR_COUNT", and
                                  "FUNCTIONS_GB_RATE_PER_SECOND".
                                "value": 0.0,  #
                                  Optional. Threshold value for alert.
                                "window":
                                  "UNSPECIFIED_WINDOW"  # Optional. Default value is
                                  "UNSPECIFIED_WINDOW". Known values are:
                                  "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES",
                                  "THIRTY_MINUTES", and "ONE_HOUR".
                            }
                        ],
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "ingress": {
                    "rules": [
                        {
                            "component": {
                                "name": "str",  # The
                                  name of the component to route to. Required.
"preserve_path_prefix": "str",  # Optional. An
                                  optional flag to preserve the path that is forwarded
                                  to the backend service. By default, the HTTP request
                                  path will be trimmed from the left when forwarded to
                                  the component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``. Note: this is not
                                  applicable for Functions Components and is mutually
                                  exclusive with ``rewrite``.
                                "rewrite": "str"  #
                                  Optional. An optional field that will rewrite the
                                  path of the component to be what is specified here.
                                  By default, the HTTP request path will be trimmed
                                  from the left when forwarded to the component. For
                                  example, a component with ``path=/api`` will have
                                  requests to ``/api/list`` trimmed to ``/list``. If
                                  you specified the rewrite to be ``/v1/``"" , requests
                                  to ``/api/list`` would be rewritten to ``/v1/list``.
                                  Note: this is mutually exclusive with
                                  ``preserve_path_prefix``.
                            },
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "match": {
                                "path": {
                                    "prefix":
                                      "str"  # Prefix-based match. For example,
                                      ``/api`` will match ``/api``"" , ``/api/``"" ,
                                      and any nested paths such as
                                      ``/api/v1/endpoint``. Required.
                                }
                            },
                            "redirect": {
                                "authority": "str",
                                  # Optional. The authority/host to redirect to. This
                                  can be a hostname or IP address. Note: use ``port``
                                  to set the port.
                                "port": 0,  #
                                  Optional. The port to redirect to.
                                "redirect_code": 0,
                                  # Optional. The redirect code to use. Defaults to
                                  ``302``. Supported values are 300, 301, 302, 303,
                                  304, 307, 308.
                                "scheme": "str",  #
                                  Optional. The scheme to redirect to. Supported values
                                  are ``http`` or ``https``. Default: ``https``.
                                "uri": "str"  #
                                  Optional. An optional URI path to redirect to. Note:
                                  if this is specified the whole URI of the original
                                  request will be overwritten to this value,
                                  irrespective of the original request URI being
                                  matched.
                            }
                        }
                    ]
                },
                "jobs": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "kind": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * UNSPECIFIED: Default job
                          type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY:
                          Indicates a job that runs before an app deployment."n*
                          POST_DEPLOY: Indicates a job that runs after an app
                          deployment."n* FAILED_DEPLOY: Indicates a job that runs after
                          a component fails to deploy. Known values are: "UNSPECIFIED",
                          "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "name": "str",  # The name of the app. Must be unique
                  across all apps in the same account. Required.
                "region": "str",  # Optional. The slug form of the
                  geographical origin of the app. Default: ``nearest available``. Known
                  values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon",
                  and "syd".
                "services": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "health_check": {
                            "failure_threshold": 0,  #
                              Optional. The number of failed health checks before
                              considered unhealthy.
                            "http_path": "str",  #
                              Optional. The route path used for the HTTP health check
                              ping. If not set, the HTTP health check will be disabled
                              and a TCP health check used instead.
                            "initial_delay_seconds": 0,
                              # Optional. The number of seconds to wait before
                              beginning health checks.
                            "period_seconds": 0,  #
                              Optional. The number of seconds to wait between health
                              checks.
                            "port": 0,  # Optional. The
                              port on which the health check will be performed. If not
                              set, the health check will be performed on the
                              component's http_port.
                            "success_threshold": 0,  #
                              Optional. The number of successful health checks before
                              considered healthy.
                            "timeout_seconds": 0  #
                              Optional. The number of seconds after which the check
                              times out.
                        },
                        "http_port": 0,  # Optional. The
                          internal port on which this service's run command will
                          listen. Default: 8080"nIf there is not an environment
                          variable with the name ``PORT``"" , one will be automatically
                          added with its value set to the value of this field.
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "internal_ports": [
                            0  # Optional. The ports on
                              which this service will listen for internal traffic.
                        ],
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "static_sites": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "catchall_document": "str",  #
                          Optional. The name of the document to use as the fallback for
                          any requests to documents that are not found when serving
                          this static site. Only 1 of ``catchall_document`` or
                          ``error_document`` can be set.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "error_document": "404.html",  #
                          Optional. Default value is "404.html". The name of the error
                          document to use when serving this static site. Default:
                          404.html. If no such file exists within the built assets, App
                          Platform will supply one.
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "index_document": "index.html",  #
                          Optional. Default value is "index.html". The name of the
                          index document to use when serving this static site. Default:
                          index.html.
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "output_dir": "str",  # Optional. An
                          optional path to where the built assets will be located,
                          relative to the build context. If not set, App Platform will
                          automatically scan for these directory names: ``_static``"" ,
                          ``dist``"" , ``public``"" , ``build``.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "workers": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ]
            },
            "static_sites": [
                {
                    "name": "str",  # Optional. The name of this
                      static site.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this static
                      site.
                }
            ],
            "tier_slug": "str",  # Optional. The current pricing tier
              slug of the deployment.
            "updated_at": "2020-02-20 00:00:00",  # Optional. When the
              deployment was last updated.
            "workers": [
                {
                    "name": "str",  # Optional. The name of this
                      worker.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this worker.
                }
            ]
        },
        "project_id": "str",  # Optional. The ID of the project the app is
          assigned to. This will be empty if there is a lookup failure.
        "region": {
            "continent": "str",  # Optional. The continent that this
              region is in.
            "data_centers": [
                "str"  # Optional. Data centers that are in this
                  region.
            ],
            "default": bool,  # Optional. Whether or not the region is
              presented as the default.
            "disabled": bool,  # Optional. Whether or not the region is
              open for new apps.
            "flag": "str",  # Optional. The flag of this region.
            "label": "str",  # Optional. A human-readable name of the
              region.
            "reason": "str",  # Optional. Reason that this region is not
              available.
            "slug": "str"  # Optional. The slug form of the region name.
        },
        "spec": {
            "databases": [
                {
                    "cluster_name": "str",  # Optional. The name
                      of the underlying DigitalOcean DBaaS cluster. This is required
                      for production databases. For dev databases, if cluster_name is
                      not set, a new cluster will be provisioned.
                    "db_name": "str",  # Optional. The name of
                      the MySQL or PostgreSQL database to configure.
                    "db_user": "str",  # Optional. The name of
                      the MySQL or PostgreSQL user to configure.
                    "engine": "UNSET",  # Optional. Default value
                      is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis.
                      Known values are: "UNSET", "MYSQL", "PG", and "REDIS".
                    "name": "str",  # The name. Must be unique
                      across all components within the same app. Required.
                    "production": bool,  # Optional. Whether this
                      is a production or dev database.
                    "version": "str"  # Optional. The version of
                      the database engine.
                }
            ],
            "domains": [
                {
                    "domain": "str",  # The hostname for the
                      domain. Required.
                    "minimum_tls_version": "str",  # Optional.
                      The minimum version of TLS a client application can use to access
                      resources for the domain.  Must be one of the following values
                      wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values
                      are: "1.2" and "1.3".
                    "type": "UNSPECIFIED",  # Optional. Default
                      value is "UNSPECIFIED". * DEFAULT: The default
                      ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY:
                      The primary domain for this app that is displayed as the default
                      in the control panel, used in bindable environment variables, and
                      any other places that reference an app's live URL. Only one
                      domain may be set as primary."n* ALIAS: A non-primary domain.
                      Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and
                      "ALIAS".
                    "wildcard": bool,  # Optional. Indicates
                      whether the domain includes all sub-domains, in addition to the
                      given domain.
                    "zone": "str"  # Optional. Optional. If the
                      domain uses DigitalOcean DNS and you would like App"nPlatform to
                      automatically manage it for you, set this to the name of
                      the"ndomain on your account."n"nFor example, If the domain you
                      are adding is ``app.domain.com``"" , the zone"ncould be
                      ``domain.com``.
                }
            ],
            "functions": [
                {
                    "alerts": [
                        {
                            "disabled": bool,  #
                              Optional. Is the alert disabled?.
                            "operator":
                              "UNSPECIFIED_OPERATOR",  # Optional. Default value is
                              "UNSPECIFIED_OPERATOR". Known values are:
                              "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN".
                            "rule": "UNSPECIFIED_RULE",
                              # Optional. Default value is "UNSPECIFIED_RULE". Known
                              values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                              "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED",
                              "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE",
                              "FUNCTIONS_ACTIVATION_COUNT",
                              "FUNCTIONS_AVERAGE_DURATION_MS",
                              "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                              "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                              "FUNCTIONS_ERROR_COUNT", and
                              "FUNCTIONS_GB_RATE_PER_SECOND".
                            "value": 0.0,  # Optional.
                              Threshold value for alert.
                            "window":
                              "UNSPECIFIED_WINDOW"  # Optional. Default value is
                              "UNSPECIFIED_WINDOW". Known values are:
                              "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES",
                              "THIRTY_MINUTES", and "ONE_HOUR".
                        }
                    ],
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # The name. Must be unique
                      across all components within the same app. Required.
                    "routes": [
                        {
                            "path": "str",  # Optional.
                              An HTTP path prefix. Paths must start with / and must be
                              unique across all components within an app.
                            "preserve_path_prefix": bool
                              # Optional. An optional flag to preserve the path that is
                              forwarded to the backend service. By default, the HTTP
                              request path will be trimmed from the left when forwarded
                              to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``.
                        }
                    ],
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "ingress": {
                "rules": [
                    {
                        "component": {
                            "name": "str",  # The name of
                              the component to route to. Required.
                            "preserve_path_prefix":
                              "str",  # Optional. An optional flag to preserve the path
                              that is forwarded to the backend service. By default, the
                              HTTP request path will be trimmed from the left when
                              forwarded to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``. Note: this is not applicable for
                              Functions Components and is mutually exclusive with
                              ``rewrite``.
                            "rewrite": "str"  # Optional.
                              An optional field that will rewrite the path of the
                              component to be what is specified here. By default, the
                              HTTP request path will be trimmed from the left when
                              forwarded to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If you specified the rewrite to be
                              ``/v1/``"" , requests to ``/api/list`` would be rewritten
                              to ``/v1/list``. Note: this is mutually exclusive with
                              ``preserve_path_prefix``.
                        },
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "match": {
                            "path": {
                                "prefix": "str"  #
                                  Prefix-based match. For example, ``/api`` will match
                                  ``/api``"" , ``/api/``"" , and any nested paths such
                                  as ``/api/v1/endpoint``. Required.
                            }
                        },
                        "redirect": {
                            "authority": "str",  #
                              Optional. The authority/host to redirect to. This can be
                              a hostname or IP address. Note: use ``port`` to set the
                              port.
                            "port": 0,  # Optional. The
                              port to redirect to.
                            "redirect_code": 0,  #
                              Optional. The redirect code to use. Defaults to ``302``.
                              Supported values are 300, 301, 302, 303, 304, 307, 308.
                            "scheme": "str",  # Optional.
                              The scheme to redirect to. Supported values are ``http``
                              or ``https``. Default: ``https``.
                            "uri": "str"  # Optional. An
                              optional URI path to redirect to. Note: if this is
                              specified the whole URI of the original request will be
                              overwritten to this value, irrespective of the original
                              request URI being matched.
                        }
                    }
                ]
            },
            "jobs": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "instance_count": 1,  # Optional. Default
                      value is 1. The amount of instances that this component should be
                      scaled to. Default: 1.
                    "instance_size_slug": "basic-xxs",  #
                      Optional. Default value is "basic-xxs". The instance size to use
                      for this component. Default: ``basic-xxs``. Known values are:
                      "basic-xxs", "basic-xs", "basic-s", "basic-m", "professional-xs",
                      "professional-s", "professional-m", "professional-1l",
                      "professional-l", and "professional-xl".
                    "kind": "UNSPECIFIED",  # Optional. Default
                      value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will
                      auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job
                      that runs before an app deployment."n* POST_DEPLOY: Indicates a
                      job that runs after an app deployment."n* FAILED_DEPLOY:
                      Indicates a job that runs after a component fails to deploy.
                      Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and
                      "FAILED_DEPLOY".
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "name": "str",  # The name of the app. Must be unique across
              all apps in the same account. Required.
            "region": "str",  # Optional. The slug form of the
              geographical origin of the app. Default: ``nearest available``. Known
              values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and
              "syd".
            "services": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "health_check": {
                        "failure_threshold": 0,  # Optional.
                          The number of failed health checks before considered
                          unhealthy.
                        "http_path": "str",  # Optional. The
                          route path used for the HTTP health check ping. If not set,
                          the HTTP health check will be disabled and a TCP health check
                          used instead.
                        "initial_delay_seconds": 0,  #
                          Optional. The number of seconds to wait before beginning
                          health checks.
                        "period_seconds": 0,  # Optional. The
                          number of seconds to wait between health checks.
                        "port": 0,  # Optional. The port on
                          which the health check will be performed. If not set, the
                          health check will be performed on the component's http_port.
                        "success_threshold": 0,  # Optional.
                          The number of successful health checks before considered
                          healthy.
                        "timeout_seconds": 0  # Optional. The
                          number of seconds after which the check times out.
                    },
                    "http_port": 0,  # Optional. The internal
                      port on which this service's run command will listen. Default:
                      8080"nIf there is not an environment variable with the name
                      ``PORT``"" , one will be automatically added with its value set
                      to the value of this field.
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "instance_count": 1,  # Optional. Default
                      value is 1. The amount of instances that this component should be
                      scaled to. Default: 1.
                    "instance_size_slug": "basic-xxs",  #
                      Optional. Default value is "basic-xxs". The instance size to use
                      for this component. Default: ``basic-xxs``. Known values are:
                      "basic-xxs", "basic-xs", "basic-s", "basic-m", "professional-xs",
                      "professional-s", "professional-m", "professional-1l",
                      "professional-l", and "professional-xl".
                    "internal_ports": [
                        0  # Optional. The ports on which
                          this service will listen for internal traffic.
                    ],
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "routes": [
                        {
                            "path": "str",  # Optional.
                              An HTTP path prefix. Paths must start with / and must be
                              unique across all components within an app.
                            "preserve_path_prefix": bool
                              # Optional. An optional flag to preserve the path that is
                              forwarded to the backend service. By default, the HTTP
                              request path will be trimmed from the left when forwarded
                              to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``.
                        }
                    ],
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "static_sites": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "catchall_document": "str",  # Optional. The
                      name of the document to use as the fallback for any requests to
                      documents that are not found when serving this static site. Only
                      1 of ``catchall_document`` or ``error_document`` can be set.
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "error_document": "404.html",  # Optional.
                      Default value is "404.html". The name of the error document to
                      use when serving this static site. Default: 404.html. If no such
                      file exists within the built assets, App Platform will supply
                      one.
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "index_document": "index.html",  # Optional.
                      Default value is "index.html". The name of the index document to
                      use when serving this static site. Default: index.html.
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "output_dir": "str",  # Optional. An optional
                      path to where the built assets will be located, relative to the
                      build context. If not set, App Platform will automatically scan
                      for these directory names: ``_static``"" , ``dist``"" ,
                      ``public``"" , ``build``.
                    "routes": [
                        {
                            "path": "str",  # Optional.
                              An HTTP path prefix. Paths must start with / and must be
                              unique across all components within an app.
                            "preserve_path_prefix": bool
                              # Optional. An optional flag to preserve the path that is
                              forwarded to the backend service. By default, the HTTP
                              request path will be trimmed from the left when forwarded
                              to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``.
                        }
                    ],
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "workers": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "instance_count": 1,  # Optional. Default
                      value is 1. The amount of instances that this component should be
                      scaled to. Default: 1.
                    "instance_size_slug": "basic-xxs",  #
                      Optional. Default value is "basic-xxs". The instance size to use
                      for this component. Default: ``basic-xxs``. Known values are:
                      "basic-xxs", "basic-xs", "basic-s", "basic-m", "professional-xs",
                      "professional-s", "professional-m", "professional-1l",
                      "professional-l", and "professional-xl".
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ]
        },
        "tier_slug": "str",  # Optional. The current pricing tier slug of the
          app.
        "updated_at": "2020-02-20 00:00:00"  # Optional. Time of the app's
          last configuration update.
    }
}
create_deployment(app_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
create_deployment(app_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create an App Deployment.

Creating an app deployment will pull the latest changes from your repository and schedule a new deployment for your app.

Parameters:
  • app_id (str) – The app ID. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "deployment": {
        "cause": "str",  # Optional. What caused this deployment to be
          created.
        "cloned_from": "str",  # Optional. The ID of a previous deployment
          that this deployment was cloned from.
        "created_at": "2020-02-20 00:00:00",  # Optional. The creation time
          of the deployment.
        "functions": [
            {
                "name": "str",  # Optional. The name of this
                  functions component.
                "namespace": "str",  # Optional. The namespace where
                  the functions are deployed.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this functions
                  component.
            }
        ],
        "id": "str",  # Optional. The ID of the deployment.
        "jobs": [
            {
                "name": "str",  # Optional. The name of this job.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this job.
            }
        ],
        "phase": "UNKNOWN",  # Optional. Default value is "UNKNOWN". Known
          values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", "PENDING_DEPLOY",
          "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and "CANCELED".
        "phase_last_updated_at": "2020-02-20 00:00:00",  # Optional. When the
          deployment phase was last updated.
        "progress": {
            "error_steps": 0,  # Optional. Number of unsuccessful steps.
            "pending_steps": 0,  # Optional. Number of pending steps.
            "running_steps": 0,  # Optional. Number of currently running
              steps.
            "steps": [
                {
                    "component_name": "str",  # Optional. The
                      component name that this step is associated with.
                    "ended_at": "2020-02-20 00:00:00",  #
                      Optional. The end time of this step.
                    "message_base": "str",  # Optional. The base
                      of a human-readable description of the step intended to be
                      combined with the component name for presentation. For
                      example:"n"n``message_base`` = "Building
                      service""n``component_name`` = "api".
                    "name": "str",  # Optional. The name of this
                      step.
                    "reason": {
                        "code": "str",  # Optional. The error
                          code.
                        "message": "str"  # Optional. The
                          error message.
                    },
                    "started_at": "2020-02-20 00:00:00",  #
                      Optional. The start time of this step.
                    "status": "UNKNOWN",  # Optional. Default
                      value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING",
                      "RUNNING", "ERROR", and "SUCCESS".
                    "steps": [
                        {}  # Optional. Child steps of this
                          step.
                    ]
                }
            ],
            "success_steps": 0,  # Optional. Number of successful steps.
            "summary_steps": [
                {
                    "component_name": "str",  # Optional. The
                      component name that this step is associated with.
                    "ended_at": "2020-02-20 00:00:00",  #
                      Optional. The end time of this step.
                    "message_base": "str",  # Optional. The base
                      of a human-readable description of the step intended to be
                      combined with the component name for presentation. For
                      example:"n"n``message_base`` = "Building
                      service""n``component_name`` = "api".
                    "name": "str",  # Optional. The name of this
                      step.
                    "reason": {
                        "code": "str",  # Optional. The error
                          code.
                        "message": "str"  # Optional. The
                          error message.
                    },
                    "started_at": "2020-02-20 00:00:00",  #
                      Optional. The start time of this step.
                    "status": "UNKNOWN",  # Optional. Default
                      value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING",
                      "RUNNING", "ERROR", and "SUCCESS".
                    "steps": [
                        {}  # Optional. Child steps of this
                          step.
                    ]
                }
            ],
            "total_steps": 0  # Optional. Total number of steps.
        },
        "services": [
            {
                "name": "str",  # Optional. The name of this service.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this service.
            }
        ],
        "spec": {
            "databases": [
                {
                    "cluster_name": "str",  # Optional. The name
                      of the underlying DigitalOcean DBaaS cluster. This is required
                      for production databases. For dev databases, if cluster_name is
                      not set, a new cluster will be provisioned.
                    "db_name": "str",  # Optional. The name of
                      the MySQL or PostgreSQL database to configure.
                    "db_user": "str",  # Optional. The name of
                      the MySQL or PostgreSQL user to configure.
                    "engine": "UNSET",  # Optional. Default value
                      is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis.
                      Known values are: "UNSET", "MYSQL", "PG", and "REDIS".
                    "name": "str",  # The name. Must be unique
                      across all components within the same app. Required.
                    "production": bool,  # Optional. Whether this
                      is a production or dev database.
                    "version": "str"  # Optional. The version of
                      the database engine.
                }
            ],
            "domains": [
                {
                    "domain": "str",  # The hostname for the
                      domain. Required.
                    "minimum_tls_version": "str",  # Optional.
                      The minimum version of TLS a client application can use to access
                      resources for the domain.  Must be one of the following values
                      wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values
                      are: "1.2" and "1.3".
                    "type": "UNSPECIFIED",  # Optional. Default
                      value is "UNSPECIFIED". * DEFAULT: The default
                      ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY:
                      The primary domain for this app that is displayed as the default
                      in the control panel, used in bindable environment variables, and
                      any other places that reference an app's live URL. Only one
                      domain may be set as primary."n* ALIAS: A non-primary domain.
                      Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and
                      "ALIAS".
                    "wildcard": bool,  # Optional. Indicates
                      whether the domain includes all sub-domains, in addition to the
                      given domain.
                    "zone": "str"  # Optional. Optional. If the
                      domain uses DigitalOcean DNS and you would like App"nPlatform to
                      automatically manage it for you, set this to the name of
                      the"ndomain on your account."n"nFor example, If the domain you
                      are adding is ``app.domain.com``"" , the zone"ncould be
                      ``domain.com``.
                }
            ],
            "functions": [
                {
                    "alerts": [
                        {
                            "disabled": bool,  #
                              Optional. Is the alert disabled?.
                            "operator":
                              "UNSPECIFIED_OPERATOR",  # Optional. Default value is
                              "UNSPECIFIED_OPERATOR". Known values are:
                              "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN".
                            "rule": "UNSPECIFIED_RULE",
                              # Optional. Default value is "UNSPECIFIED_RULE". Known
                              values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                              "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED",
                              "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE",
                              "FUNCTIONS_ACTIVATION_COUNT",
                              "FUNCTIONS_AVERAGE_DURATION_MS",
                              "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                              "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                              "FUNCTIONS_ERROR_COUNT", and
                              "FUNCTIONS_GB_RATE_PER_SECOND".
                            "value": 0.0,  # Optional.
                              Threshold value for alert.
                            "window":
                              "UNSPECIFIED_WINDOW"  # Optional. Default value is
                              "UNSPECIFIED_WINDOW". Known values are:
                              "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES",
                              "THIRTY_MINUTES", and "ONE_HOUR".
                        }
                    ],
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # The name. Must be unique
                      across all components within the same app. Required.
                    "routes": [
                        {
                            "path": "str",  # Optional.
                              An HTTP path prefix. Paths must start with / and must be
                              unique across all components within an app.
                            "preserve_path_prefix": bool
                              # Optional. An optional flag to preserve the path that is
                              forwarded to the backend service. By default, the HTTP
                              request path will be trimmed from the left when forwarded
                              to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``.
                        }
                    ],
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "ingress": {
                "rules": [
                    {
                        "component": {
                            "name": "str",  # The name of
                              the component to route to. Required.
                            "preserve_path_prefix":
                              "str",  # Optional. An optional flag to preserve the path
                              that is forwarded to the backend service. By default, the
                              HTTP request path will be trimmed from the left when
                              forwarded to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``. Note: this is not applicable for
                              Functions Components and is mutually exclusive with
                              ``rewrite``.
                            "rewrite": "str"  # Optional.
                              An optional field that will rewrite the path of the
                              component to be what is specified here. By default, the
                              HTTP request path will be trimmed from the left when
                              forwarded to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If you specified the rewrite to be
                              ``/v1/``"" , requests to ``/api/list`` would be rewritten
                              to ``/v1/list``. Note: this is mutually exclusive with
                              ``preserve_path_prefix``.
                        },
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "match": {
                            "path": {
                                "prefix": "str"  #
                                  Prefix-based match. For example, ``/api`` will match
                                  ``/api``"" , ``/api/``"" , and any nested paths such
                                  as ``/api/v1/endpoint``. Required.
                            }
                        },
                        "redirect": {
                            "authority": "str",  #
                              Optional. The authority/host to redirect to. This can be
                              a hostname or IP address. Note: use ``port`` to set the
                              port.
                            "port": 0,  # Optional. The
                              port to redirect to.
                            "redirect_code": 0,  #
                              Optional. The redirect code to use. Defaults to ``302``.
                              Supported values are 300, 301, 302, 303, 304, 307, 308.
                            "scheme": "str",  # Optional.
                              The scheme to redirect to. Supported values are ``http``
                              or ``https``. Default: ``https``.
                            "uri": "str"  # Optional. An
                              optional URI path to redirect to. Note: if this is
                              specified the whole URI of the original request will be
                              overwritten to this value, irrespective of the original
                              request URI being matched.
                        }
                    }
                ]
            },
            "jobs": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "instance_count": 1,  # Optional. Default
                      value is 1. The amount of instances that this component should be
                      scaled to. Default: 1.
                    "instance_size_slug": "basic-xxs",  #
                      Optional. Default value is "basic-xxs". The instance size to use
                      for this component. Default: ``basic-xxs``. Known values are:
                      "basic-xxs", "basic-xs", "basic-s", "basic-m", "professional-xs",
                      "professional-s", "professional-m", "professional-1l",
                      "professional-l", and "professional-xl".
                    "kind": "UNSPECIFIED",  # Optional. Default
                      value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will
                      auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job
                      that runs before an app deployment."n* POST_DEPLOY: Indicates a
                      job that runs after an app deployment."n* FAILED_DEPLOY:
                      Indicates a job that runs after a component fails to deploy.
                      Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and
                      "FAILED_DEPLOY".
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "name": "str",  # The name of the app. Must be unique across
              all apps in the same account. Required.
            "region": "str",  # Optional. The slug form of the
              geographical origin of the app. Default: ``nearest available``. Known
              values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and
              "syd".
            "services": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "health_check": {
                        "failure_threshold": 0,  # Optional.
                          The number of failed health checks before considered
                          unhealthy.
                        "http_path": "str",  # Optional. The
                          route path used for the HTTP health check ping. If not set,
                          the HTTP health check will be disabled and a TCP health check
                          used instead.
                        "initial_delay_seconds": 0,  #
                          Optional. The number of seconds to wait before beginning
                          health checks.
                        "period_seconds": 0,  # Optional. The
                          number of seconds to wait between health checks.
                        "port": 0,  # Optional. The port on
                          which the health check will be performed. If not set, the
                          health check will be performed on the component's http_port.
                        "success_threshold": 0,  # Optional.
                          The number of successful health checks before considered
                          healthy.
                        "timeout_seconds": 0  # Optional. The
                          number of seconds after which the check times out.
                    },
                    "http_port": 0,  # Optional. The internal
                      port on which this service's run command will listen. Default:
                      8080"nIf there is not an environment variable with the name
                      ``PORT``"" , one will be automatically added with its value set
                      to the value of this field.
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "instance_count": 1,  # Optional. Default
                      value is 1. The amount of instances that this component should be
                      scaled to. Default: 1.
                    "instance_size_slug": "basic-xxs",  #
                      Optional. Default value is "basic-xxs". The instance size to use
                      for this component. Default: ``basic-xxs``. Known values are:
                      "basic-xxs", "basic-xs", "basic-s", "basic-m", "professional-xs",
                      "professional-s", "professional-m", "professional-1l",
                      "professional-l", and "professional-xl".
                    "internal_ports": [
                        0  # Optional. The ports on which
                          this service will listen for internal traffic.
                    ],
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "routes": [
                        {
                            "path": "str",  # Optional.
                              An HTTP path prefix. Paths must start with / and must be
                              unique across all components within an app.
                            "preserve_path_prefix": bool
                              # Optional. An optional flag to preserve the path that is
                              forwarded to the backend service. By default, the HTTP
                              request path will be trimmed from the left when forwarded
                              to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``.
                        }
                    ],
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "static_sites": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "catchall_document": "str",  # Optional. The
                      name of the document to use as the fallback for any requests to
                      documents that are not found when serving this static site. Only
                      1 of ``catchall_document`` or ``error_document`` can be set.
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "error_document": "404.html",  # Optional.
                      Default value is "404.html". The name of the error document to
                      use when serving this static site. Default: 404.html. If no such
                      file exists within the built assets, App Platform will supply
                      one.
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "index_document": "index.html",  # Optional.
                      Default value is "index.html". The name of the index document to
                      use when serving this static site. Default: index.html.
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "output_dir": "str",  # Optional. An optional
                      path to where the built assets will be located, relative to the
                      build context. If not set, App Platform will automatically scan
                      for these directory names: ``_static``"" , ``dist``"" ,
                      ``public``"" , ``build``.
                    "routes": [
                        {
                            "path": "str",  # Optional.
                              An HTTP path prefix. Paths must start with / and must be
                              unique across all components within an app.
                            "preserve_path_prefix": bool
                              # Optional. An optional flag to preserve the path that is
                              forwarded to the backend service. By default, the HTTP
                              request path will be trimmed from the left when forwarded
                              to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``.
                        }
                    ],
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "workers": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "instance_count": 1,  # Optional. Default
                      value is 1. The amount of instances that this component should be
                      scaled to. Default: 1.
                    "instance_size_slug": "basic-xxs",  #
                      Optional. Default value is "basic-xxs". The instance size to use
                      for this component. Default: ``basic-xxs``. Known values are:
                      "basic-xxs", "basic-xs", "basic-s", "basic-m", "professional-xs",
                      "professional-s", "professional-m", "professional-1l",
                      "professional-l", and "professional-xl".
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ]
        },
        "static_sites": [
            {
                "name": "str",  # Optional. The name of this static
                  site.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this static site.
            }
        ],
        "tier_slug": "str",  # Optional. The current pricing tier slug of the
          deployment.
        "updated_at": "2020-02-20 00:00:00",  # Optional. When the deployment
          was last updated.
        "workers": [
            {
                "name": "str",  # Optional. The name of this worker.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this worker.
            }
        ]
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
create_rollback(app_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
create_rollback(app_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Rollback App.

Rollback an app to a previous deployment. A new deployment will be created to perform the rollback. The app will be pinned to the rollback deployment preventing any new deployments from being created, either manually or through Auto Deploy on Push webhooks. To resume deployments, the rollback must be either committed or reverted.

It is recommended to use the Validate App Rollback endpoint to double check if the rollback is valid and if there are any warnings.

Parameters:
  • app_id (str) – The app ID. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "deployment": {
        "cause": "str",  # Optional. What caused this deployment to be
          created.
        "cloned_from": "str",  # Optional. The ID of a previous deployment
          that this deployment was cloned from.
        "created_at": "2020-02-20 00:00:00",  # Optional. The creation time
          of the deployment.
        "functions": [
            {
                "name": "str",  # Optional. The name of this
                  functions component.
                "namespace": "str",  # Optional. The namespace where
                  the functions are deployed.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this functions
                  component.
            }
        ],
        "id": "str",  # Optional. The ID of the deployment.
        "jobs": [
            {
                "name": "str",  # Optional. The name of this job.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this job.
            }
        ],
        "phase": "UNKNOWN",  # Optional. Default value is "UNKNOWN". Known
          values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", "PENDING_DEPLOY",
          "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and "CANCELED".
        "phase_last_updated_at": "2020-02-20 00:00:00",  # Optional. When the
          deployment phase was last updated.
        "progress": {
            "error_steps": 0,  # Optional. Number of unsuccessful steps.
            "pending_steps": 0,  # Optional. Number of pending steps.
            "running_steps": 0,  # Optional. Number of currently running
              steps.
            "steps": [
                {
                    "component_name": "str",  # Optional. The
                      component name that this step is associated with.
                    "ended_at": "2020-02-20 00:00:00",  #
                      Optional. The end time of this step.
                    "message_base": "str",  # Optional. The base
                      of a human-readable description of the step intended to be
                      combined with the component name for presentation. For
                      example:"n"n``message_base`` = "Building
                      service""n``component_name`` = "api".
                    "name": "str",  # Optional. The name of this
                      step.
                    "reason": {
                        "code": "str",  # Optional. The error
                          code.
                        "message": "str"  # Optional. The
                          error message.
                    },
                    "started_at": "2020-02-20 00:00:00",  #
                      Optional. The start time of this step.
                    "status": "UNKNOWN",  # Optional. Default
                      value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING",
                      "RUNNING", "ERROR", and "SUCCESS".
                    "steps": [
                        {}  # Optional. Child steps of this
                          step.
                    ]
                }
            ],
            "success_steps": 0,  # Optional. Number of successful steps.
            "summary_steps": [
                {
                    "component_name": "str",  # Optional. The
                      component name that this step is associated with.
                    "ended_at": "2020-02-20 00:00:00",  #
                      Optional. The end time of this step.
                    "message_base": "str",  # Optional. The base
                      of a human-readable description of the step intended to be
                      combined with the component name for presentation. For
                      example:"n"n``message_base`` = "Building
                      service""n``component_name`` = "api".
                    "name": "str",  # Optional. The name of this
                      step.
                    "reason": {
                        "code": "str",  # Optional. The error
                          code.
                        "message": "str"  # Optional. The
                          error message.
                    },
                    "started_at": "2020-02-20 00:00:00",  #
                      Optional. The start time of this step.
                    "status": "UNKNOWN",  # Optional. Default
                      value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING",
                      "RUNNING", "ERROR", and "SUCCESS".
                    "steps": [
                        {}  # Optional. Child steps of this
                          step.
                    ]
                }
            ],
            "total_steps": 0  # Optional. Total number of steps.
        },
        "services": [
            {
                "name": "str",  # Optional. The name of this service.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this service.
            }
        ],
        "spec": {
            "databases": [
                {
                    "cluster_name": "str",  # Optional. The name
                      of the underlying DigitalOcean DBaaS cluster. This is required
                      for production databases. For dev databases, if cluster_name is
                      not set, a new cluster will be provisioned.
                    "db_name": "str",  # Optional. The name of
                      the MySQL or PostgreSQL database to configure.
                    "db_user": "str",  # Optional. The name of
                      the MySQL or PostgreSQL user to configure.
                    "engine": "UNSET",  # Optional. Default value
                      is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis.
                      Known values are: "UNSET", "MYSQL", "PG", and "REDIS".
                    "name": "str",  # The name. Must be unique
                      across all components within the same app. Required.
                    "production": bool,  # Optional. Whether this
                      is a production or dev database.
                    "version": "str"  # Optional. The version of
                      the database engine.
                }
            ],
            "domains": [
                {
                    "domain": "str",  # The hostname for the
                      domain. Required.
                    "minimum_tls_version": "str",  # Optional.
                      The minimum version of TLS a client application can use to access
                      resources for the domain.  Must be one of the following values
                      wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values
                      are: "1.2" and "1.3".
                    "type": "UNSPECIFIED",  # Optional. Default
                      value is "UNSPECIFIED". * DEFAULT: The default
                      ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY:
                      The primary domain for this app that is displayed as the default
                      in the control panel, used in bindable environment variables, and
                      any other places that reference an app's live URL. Only one
                      domain may be set as primary."n* ALIAS: A non-primary domain.
                      Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and
                      "ALIAS".
                    "wildcard": bool,  # Optional. Indicates
                      whether the domain includes all sub-domains, in addition to the
                      given domain.
                    "zone": "str"  # Optional. Optional. If the
                      domain uses DigitalOcean DNS and you would like App"nPlatform to
                      automatically manage it for you, set this to the name of
                      the"ndomain on your account."n"nFor example, If the domain you
                      are adding is ``app.domain.com``"" , the zone"ncould be
                      ``domain.com``.
                }
            ],
            "functions": [
                {
                    "alerts": [
                        {
                            "disabled": bool,  #
                              Optional. Is the alert disabled?.
                            "operator":
                              "UNSPECIFIED_OPERATOR",  # Optional. Default value is
                              "UNSPECIFIED_OPERATOR". Known values are:
                              "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN".
                            "rule": "UNSPECIFIED_RULE",
                              # Optional. Default value is "UNSPECIFIED_RULE". Known
                              values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                              "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED",
                              "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE",
                              "FUNCTIONS_ACTIVATION_COUNT",
                              "FUNCTIONS_AVERAGE_DURATION_MS",
                              "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                              "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                              "FUNCTIONS_ERROR_COUNT", and
                              "FUNCTIONS_GB_RATE_PER_SECOND".
                            "value": 0.0,  # Optional.
                              Threshold value for alert.
                            "window":
                              "UNSPECIFIED_WINDOW"  # Optional. Default value is
                              "UNSPECIFIED_WINDOW". Known values are:
                              "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES",
                              "THIRTY_MINUTES", and "ONE_HOUR".
                        }
                    ],
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # The name. Must be unique
                      across all components within the same app. Required.
                    "routes": [
                        {
                            "path": "str",  # Optional.
                              An HTTP path prefix. Paths must start with / and must be
                              unique across all components within an app.
                            "preserve_path_prefix": bool
                              # Optional. An optional flag to preserve the path that is
                              forwarded to the backend service. By default, the HTTP
                              request path will be trimmed from the left when forwarded
                              to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``.
                        }
                    ],
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "ingress": {
                "rules": [
                    {
                        "component": {
                            "name": "str",  # The name of
                              the component to route to. Required.
                            "preserve_path_prefix":
                              "str",  # Optional. An optional flag to preserve the path
                              that is forwarded to the backend service. By default, the
                              HTTP request path will be trimmed from the left when
                              forwarded to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``. Note: this is not applicable for
                              Functions Components and is mutually exclusive with
                              ``rewrite``.
                            "rewrite": "str"  # Optional.
                              An optional field that will rewrite the path of the
                              component to be what is specified here. By default, the
                              HTTP request path will be trimmed from the left when
                              forwarded to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If you specified the rewrite to be
                              ``/v1/``"" , requests to ``/api/list`` would be rewritten
                              to ``/v1/list``. Note: this is mutually exclusive with
                              ``preserve_path_prefix``.
                        },
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "match": {
                            "path": {
                                "prefix": "str"  #
                                  Prefix-based match. For example, ``/api`` will match
                                  ``/api``"" , ``/api/``"" , and any nested paths such
                                  as ``/api/v1/endpoint``. Required.
                            }
                        },
                        "redirect": {
                            "authority": "str",  #
                              Optional. The authority/host to redirect to. This can be
                              a hostname or IP address. Note: use ``port`` to set the
                              port.
                            "port": 0,  # Optional. The
                              port to redirect to.
                            "redirect_code": 0,  #
                              Optional. The redirect code to use. Defaults to ``302``.
                              Supported values are 300, 301, 302, 303, 304, 307, 308.
                            "scheme": "str",  # Optional.
                              The scheme to redirect to. Supported values are ``http``
                              or ``https``. Default: ``https``.
                            "uri": "str"  # Optional. An
                              optional URI path to redirect to. Note: if this is
                              specified the whole URI of the original request will be
                              overwritten to this value, irrespective of the original
                              request URI being matched.
                        }
                    }
                ]
            },
            "jobs": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "instance_count": 1,  # Optional. Default
                      value is 1. The amount of instances that this component should be
                      scaled to. Default: 1.
                    "instance_size_slug": "basic-xxs",  #
                      Optional. Default value is "basic-xxs". The instance size to use
                      for this component. Default: ``basic-xxs``. Known values are:
                      "basic-xxs", "basic-xs", "basic-s", "basic-m", "professional-xs",
                      "professional-s", "professional-m", "professional-1l",
                      "professional-l", and "professional-xl".
                    "kind": "UNSPECIFIED",  # Optional. Default
                      value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will
                      auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job
                      that runs before an app deployment."n* POST_DEPLOY: Indicates a
                      job that runs after an app deployment."n* FAILED_DEPLOY:
                      Indicates a job that runs after a component fails to deploy.
                      Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and
                      "FAILED_DEPLOY".
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "name": "str",  # The name of the app. Must be unique across
              all apps in the same account. Required.
            "region": "str",  # Optional. The slug form of the
              geographical origin of the app. Default: ``nearest available``. Known
              values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and
              "syd".
            "services": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "health_check": {
                        "failure_threshold": 0,  # Optional.
                          The number of failed health checks before considered
                          unhealthy.
                        "http_path": "str",  # Optional. The
                          route path used for the HTTP health check ping. If not set,
                          the HTTP health check will be disabled and a TCP health check
                          used instead.
                        "initial_delay_seconds": 0,  #
                          Optional. The number of seconds to wait before beginning
                          health checks.
                        "period_seconds": 0,  # Optional. The
                          number of seconds to wait between health checks.
                        "port": 0,  # Optional. The port on
                          which the health check will be performed. If not set, the
                          health check will be performed on the component's http_port.
                        "success_threshold": 0,  # Optional.
                          The number of successful health checks before considered
                          healthy.
                        "timeout_seconds": 0  # Optional. The
                          number of seconds after which the check times out.
                    },
                    "http_port": 0,  # Optional. The internal
                      port on which this service's run command will listen. Default:
                      8080"nIf there is not an environment variable with the name
                      ``PORT``"" , one will be automatically added with its value set
                      to the value of this field.
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "instance_count": 1,  # Optional. Default
                      value is 1. The amount of instances that this component should be
                      scaled to. Default: 1.
                    "instance_size_slug": "basic-xxs",  #
                      Optional. Default value is "basic-xxs". The instance size to use
                      for this component. Default: ``basic-xxs``. Known values are:
                      "basic-xxs", "basic-xs", "basic-s", "basic-m", "professional-xs",
                      "professional-s", "professional-m", "professional-1l",
                      "professional-l", and "professional-xl".
                    "internal_ports": [
                        0  # Optional. The ports on which
                          this service will listen for internal traffic.
                    ],
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "routes": [
                        {
                            "path": "str",  # Optional.
                              An HTTP path prefix. Paths must start with / and must be
                              unique across all components within an app.
                            "preserve_path_prefix": bool
                              # Optional. An optional flag to preserve the path that is
                              forwarded to the backend service. By default, the HTTP
                              request path will be trimmed from the left when forwarded
                              to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``.
                        }
                    ],
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "static_sites": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "catchall_document": "str",  # Optional. The
                      name of the document to use as the fallback for any requests to
                      documents that are not found when serving this static site. Only
                      1 of ``catchall_document`` or ``error_document`` can be set.
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "error_document": "404.html",  # Optional.
                      Default value is "404.html". The name of the error document to
                      use when serving this static site. Default: 404.html. If no such
                      file exists within the built assets, App Platform will supply
                      one.
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "index_document": "index.html",  # Optional.
                      Default value is "index.html". The name of the index document to
                      use when serving this static site. Default: index.html.
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "output_dir": "str",  # Optional. An optional
                      path to where the built assets will be located, relative to the
                      build context. If not set, App Platform will automatically scan
                      for these directory names: ``_static``"" , ``dist``"" ,
                      ``public``"" , ``build``.
                    "routes": [
                        {
                            "path": "str",  # Optional.
                              An HTTP path prefix. Paths must start with / and must be
                              unique across all components within an app.
                            "preserve_path_prefix": bool
                              # Optional. An optional flag to preserve the path that is
                              forwarded to the backend service. By default, the HTTP
                              request path will be trimmed from the left when forwarded
                              to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``.
                        }
                    ],
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "workers": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "instance_count": 1,  # Optional. Default
                      value is 1. The amount of instances that this component should be
                      scaled to. Default: 1.
                    "instance_size_slug": "basic-xxs",  #
                      Optional. Default value is "basic-xxs". The instance size to use
                      for this component. Default: ``basic-xxs``. Known values are:
                      "basic-xxs", "basic-xs", "basic-s", "basic-m", "professional-xs",
                      "professional-s", "professional-m", "professional-1l",
                      "professional-l", and "professional-xl".
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ]
        },
        "static_sites": [
            {
                "name": "str",  # Optional. The name of this static
                  site.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this static site.
            }
        ],
        "tier_slug": "str",  # Optional. The current pricing tier slug of the
          deployment.
        "updated_at": "2020-02-20 00:00:00",  # Optional. When the deployment
          was last updated.
        "workers": [
            {
                "name": "str",  # Optional. The name of this worker.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this worker.
            }
        ]
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
delete(id: str, **kwargs: Any) MutableMapping[str, Any]

Delete an App.

Delete an existing app. Once deleted, all active deployments will be permanently shut down and the app deleted. If needed, be sure to back up your app specification so that you may re-create it at a later time.

Parameters:

id (str) – The ID of the app. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "id": "str"  # Optional. The ID of the app that was deleted.
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get(id: str, *, name: Optional[str] = None, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing App.

Retrieve details about an existing app by either its ID or name. To retrieve an app by its name, do not include an ID in the request path. Information about the current active deployment as well as any in progress ones will also be included in the response.

Parameters:
  • id (str) – The ID of the app. Required.

  • name (str) – The name of the app to retrieve. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "app": {
        "active_deployment": {
            "cause": "str",  # Optional. What caused this deployment to
              be created.
            "cloned_from": "str",  # Optional. The ID of a previous
              deployment that this deployment was cloned from.
            "created_at": "2020-02-20 00:00:00",  # Optional. The
              creation time of the deployment.
            "functions": [
                {
                    "name": "str",  # Optional. The name of this
                      functions component.
                    "namespace": "str",  # Optional. The
                      namespace where the functions are deployed.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      functions component.
                }
            ],
            "id": "str",  # Optional. The ID of the deployment.
            "jobs": [
                {
                    "name": "str",  # Optional. The name of this
                      job.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this job.
                }
            ],
            "phase": "UNKNOWN",  # Optional. Default value is "UNKNOWN".
              Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING",
              "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and
              "CANCELED".
            "phase_last_updated_at": "2020-02-20 00:00:00",  # Optional.
              When the deployment phase was last updated.
            "progress": {
                "error_steps": 0,  # Optional. Number of unsuccessful
                  steps.
                "pending_steps": 0,  # Optional. Number of pending
                  steps.
                "running_steps": 0,  # Optional. Number of currently
                  running steps.
                "steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "success_steps": 0,  # Optional. Number of successful
                  steps.
                "summary_steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "total_steps": 0  # Optional. Total number of steps.
            },
            "services": [
                {
                    "name": "str",  # Optional. The name of this
                      service.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      service.
                }
            ],
            "spec": {
                "databases": [
                    {
                        "cluster_name": "str",  # Optional.
                          The name of the underlying DigitalOcean DBaaS cluster. This
                          is required for production databases. For dev databases, if
                          cluster_name is not set, a new cluster will be provisioned.
                        "db_name": "str",  # Optional. The
                          name of the MySQL or PostgreSQL database to configure.
                        "db_user": "str",  # Optional. The
                          name of the MySQL or PostgreSQL user to configure.
                        "engine": "UNSET",  # Optional.
                          Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n*
                          REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and
                          "REDIS".
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "production": bool,  # Optional.
                          Whether this is a production or dev database.
                        "version": "str"  # Optional. The
                          version of the database engine.
                    }
                ],
                "domains": [
                    {
                        "domain": "str",  # The hostname for
                          the domain. Required.
                        "minimum_tls_version": "str",  #
                          Optional. The minimum version of TLS a client application can
                          use to access resources for the domain.  Must be one of the
                          following values wrapped within quotations: ``"1.2"`` or
                          ``"1.3"``. Known values are: "1.2" and "1.3".
                        "type": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * DEFAULT: The default
                          ``.ondigitalocean.app`` domain assigned to this app"n*
                          PRIMARY: The primary domain for this app that is displayed as
                          the default in the control panel, used in bindable
                          environment variables, and any other places that reference an
                          app's live URL. Only one domain may be set as primary."n*
                          ALIAS: A non-primary domain. Known values are: "UNSPECIFIED",
                          "DEFAULT", "PRIMARY", and "ALIAS".
                        "wildcard": bool,  # Optional.
                          Indicates whether the domain includes all sub-domains, in
                          addition to the given domain.
                        "zone": "str"  # Optional. Optional.
                          If the domain uses DigitalOcean DNS and you would like
                          App"nPlatform to automatically manage it for you, set this to
                          the name of the"ndomain on your account."n"nFor example, If
                          the domain you are adding is ``app.domain.com``"" , the
                          zone"ncould be ``domain.com``.
                    }
                ],
                "functions": [
                    {
                        "alerts": [
                            {
                                "disabled": bool,  #
                                  Optional. Is the alert disabled?.
                                "operator":
                                  "UNSPECIFIED_OPERATOR",  # Optional. Default value is
                                  "UNSPECIFIED_OPERATOR". Known values are:
                                  "UNSPECIFIED_OPERATOR", "GREATER_THAN", and
                                  "LESS_THAN".
                                "rule":
                                  "UNSPECIFIED_RULE",  # Optional. Default value is
                                  "UNSPECIFIED_RULE". Known values are:
                                  "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                                  "MEM_UTILIZATION", "RESTART_COUNT",
                                  "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE",
                                  "DOMAIN_FAILED", "DOMAIN_LIVE",
                                  "FUNCTIONS_ACTIVATION_COUNT",
                                  "FUNCTIONS_AVERAGE_DURATION_MS",
                                  "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                                  "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                                  "FUNCTIONS_ERROR_COUNT", and
                                  "FUNCTIONS_GB_RATE_PER_SECOND".
                                "value": 0.0,  #
                                  Optional. Threshold value for alert.
                                "window":
                                  "UNSPECIFIED_WINDOW"  # Optional. Default value is
                                  "UNSPECIFIED_WINDOW". Known values are:
                                  "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES",
                                  "THIRTY_MINUTES", and "ONE_HOUR".
                            }
                        ],
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "ingress": {
                    "rules": [
                        {
                            "component": {
                                "name": "str",  # The
                                  name of the component to route to. Required.
"preserve_path_prefix": "str",  # Optional. An
                                  optional flag to preserve the path that is forwarded
                                  to the backend service. By default, the HTTP request
                                  path will be trimmed from the left when forwarded to
                                  the component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``. Note: this is not
                                  applicable for Functions Components and is mutually
                                  exclusive with ``rewrite``.
                                "rewrite": "str"  #
                                  Optional. An optional field that will rewrite the
                                  path of the component to be what is specified here.
                                  By default, the HTTP request path will be trimmed
                                  from the left when forwarded to the component. For
                                  example, a component with ``path=/api`` will have
                                  requests to ``/api/list`` trimmed to ``/list``. If
                                  you specified the rewrite to be ``/v1/``"" , requests
                                  to ``/api/list`` would be rewritten to ``/v1/list``.
                                  Note: this is mutually exclusive with
                                  ``preserve_path_prefix``.
                            },
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "match": {
                                "path": {
                                    "prefix":
                                      "str"  # Prefix-based match. For example,
                                      ``/api`` will match ``/api``"" , ``/api/``"" ,
                                      and any nested paths such as
                                      ``/api/v1/endpoint``. Required.
                                }
                            },
                            "redirect": {
                                "authority": "str",
                                  # Optional. The authority/host to redirect to. This
                                  can be a hostname or IP address. Note: use ``port``
                                  to set the port.
                                "port": 0,  #
                                  Optional. The port to redirect to.
                                "redirect_code": 0,
                                  # Optional. The redirect code to use. Defaults to
                                  ``302``. Supported values are 300, 301, 302, 303,
                                  304, 307, 308.
                                "scheme": "str",  #
                                  Optional. The scheme to redirect to. Supported values
                                  are ``http`` or ``https``. Default: ``https``.
                                "uri": "str"  #
                                  Optional. An optional URI path to redirect to. Note:
                                  if this is specified the whole URI of the original
                                  request will be overwritten to this value,
                                  irrespective of the original request URI being
                                  matched.
                            }
                        }
                    ]
                },
                "jobs": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "kind": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * UNSPECIFIED: Default job
                          type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY:
                          Indicates a job that runs before an app deployment."n*
                          POST_DEPLOY: Indicates a job that runs after an app
                          deployment."n* FAILED_DEPLOY: Indicates a job that runs after
                          a component fails to deploy. Known values are: "UNSPECIFIED",
                          "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "name": "str",  # The name of the app. Must be unique
                  across all apps in the same account. Required.
                "region": "str",  # Optional. The slug form of the
                  geographical origin of the app. Default: ``nearest available``. Known
                  values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon",
                  and "syd".
                "services": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "health_check": {
                            "failure_threshold": 0,  #
                              Optional. The number of failed health checks before
                              considered unhealthy.
                            "http_path": "str",  #
                              Optional. The route path used for the HTTP health check
                              ping. If not set, the HTTP health check will be disabled
                              and a TCP health check used instead.
                            "initial_delay_seconds": 0,
                              # Optional. The number of seconds to wait before
                              beginning health checks.
                            "period_seconds": 0,  #
                              Optional. The number of seconds to wait between health
                              checks.
                            "port": 0,  # Optional. The
                              port on which the health check will be performed. If not
                              set, the health check will be performed on the
                              component's http_port.
                            "success_threshold": 0,  #
                              Optional. The number of successful health checks before
                              considered healthy.
                            "timeout_seconds": 0  #
                              Optional. The number of seconds after which the check
                              times out.
                        },
                        "http_port": 0,  # Optional. The
                          internal port on which this service's run command will
                          listen. Default: 8080"nIf there is not an environment
                          variable with the name ``PORT``"" , one will be automatically
                          added with its value set to the value of this field.
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "internal_ports": [
                            0  # Optional. The ports on
                              which this service will listen for internal traffic.
                        ],
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "static_sites": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "catchall_document": "str",  #
                          Optional. The name of the document to use as the fallback for
                          any requests to documents that are not found when serving
                          this static site. Only 1 of ``catchall_document`` or
                          ``error_document`` can be set.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "error_document": "404.html",  #
                          Optional. Default value is "404.html". The name of the error
                          document to use when serving this static site. Default:
                          404.html. If no such file exists within the built assets, App
                          Platform will supply one.
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "index_document": "index.html",  #
                          Optional. Default value is "index.html". The name of the
                          index document to use when serving this static site. Default:
                          index.html.
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "output_dir": "str",  # Optional. An
                          optional path to where the built assets will be located,
                          relative to the build context. If not set, App Platform will
                          automatically scan for these directory names: ``_static``"" ,
                          ``dist``"" , ``public``"" , ``build``.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "workers": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ]
            },
            "static_sites": [
                {
                    "name": "str",  # Optional. The name of this
                      static site.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this static
                      site.
                }
            ],
            "tier_slug": "str",  # Optional. The current pricing tier
              slug of the deployment.
            "updated_at": "2020-02-20 00:00:00",  # Optional. When the
              deployment was last updated.
            "workers": [
                {
                    "name": "str",  # Optional. The name of this
                      worker.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this worker.
                }
            ]
        },
        "created_at": "2020-02-20 00:00:00",  # Optional. The creation time
          of the app.
        "default_ingress": "str",  # Optional. The default hostname on which
          the app is accessible.
        "domains": [
            {
                "certificate_expires_at": "2020-02-20 00:00:00",  #
                  Optional. Current SSL certificate expiration time.
                "id": "str",  # Optional. The ID of the domain.
                "phase": "UNKNOWN",  # Optional. Default value is
                  "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING",
                  "ACTIVE", and "ERROR".
                "progress": {
                    "steps": [
                        {}  # Optional. The steps of the
                          domain's progress.
                    ]
                },
                "rotate_validation_records": bool,  # Optional.
                  Validation values have changed and require manual intervention.
                "spec": {
                    "domain": "str",  # The hostname for the
                      domain. Required.
                    "minimum_tls_version": "str",  # Optional.
                      The minimum version of TLS a client application can use to access
                      resources for the domain.  Must be one of the following values
                      wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values
                      are: "1.2" and "1.3".
                    "type": "UNSPECIFIED",  # Optional. Default
                      value is "UNSPECIFIED". * DEFAULT: The default
                      ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY:
                      The primary domain for this app that is displayed as the default
                      in the control panel, used in bindable environment variables, and
                      any other places that reference an app's live URL. Only one
                      domain may be set as primary."n* ALIAS: A non-primary domain.
                      Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and
                      "ALIAS".
                    "wildcard": bool,  # Optional. Indicates
                      whether the domain includes all sub-domains, in addition to the
                      given domain.
                    "zone": "str"  # Optional. Optional. If the
                      domain uses DigitalOcean DNS and you would like App"nPlatform to
                      automatically manage it for you, set this to the name of
                      the"ndomain on your account."n"nFor example, If the domain you
                      are adding is ``app.domain.com``"" , the zone"ncould be
                      ``domain.com``.
                },
                "validations": [
                    {
                        "txt_name": "str",  # Optional. TXT
                          record name.
                        "txt_value": "str"  # Optional. TXT
                          record value.
                    }
                ]
            }
        ],
        "id": "str",  # Optional. The ID of the application.
        "in_progress_deployment": {
            "cause": "str",  # Optional. What caused this deployment to
              be created.
            "cloned_from": "str",  # Optional. The ID of a previous
              deployment that this deployment was cloned from.
            "created_at": "2020-02-20 00:00:00",  # Optional. The
              creation time of the deployment.
            "functions": [
                {
                    "name": "str",  # Optional. The name of this
                      functions component.
                    "namespace": "str",  # Optional. The
                      namespace where the functions are deployed.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      functions component.
                }
            ],
            "id": "str",  # Optional. The ID of the deployment.
            "jobs": [
                {
                    "name": "str",  # Optional. The name of this
                      job.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this job.
                }
            ],
            "phase": "UNKNOWN",  # Optional. Default value is "UNKNOWN".
              Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING",
              "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and
              "CANCELED".
            "phase_last_updated_at": "2020-02-20 00:00:00",  # Optional.
              When the deployment phase was last updated.
            "progress": {
                "error_steps": 0,  # Optional. Number of unsuccessful
                  steps.
                "pending_steps": 0,  # Optional. Number of pending
                  steps.
                "running_steps": 0,  # Optional. Number of currently
                  running steps.
                "steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "success_steps": 0,  # Optional. Number of successful
                  steps.
                "summary_steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "total_steps": 0  # Optional. Total number of steps.
            },
            "services": [
                {
                    "name": "str",  # Optional. The name of this
                      service.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      service.
                }
            ],
            "spec": {
                "databases": [
                    {
                        "cluster_name": "str",  # Optional.
                          The name of the underlying DigitalOcean DBaaS cluster. This
                          is required for production databases. For dev databases, if
                          cluster_name is not set, a new cluster will be provisioned.
                        "db_name": "str",  # Optional. The
                          name of the MySQL or PostgreSQL database to configure.
                        "db_user": "str",  # Optional. The
                          name of the MySQL or PostgreSQL user to configure.
                        "engine": "UNSET",  # Optional.
                          Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n*
                          REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and
                          "REDIS".
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "production": bool,  # Optional.
                          Whether this is a production or dev database.
                        "version": "str"  # Optional. The
                          version of the database engine.
                    }
                ],
                "domains": [
                    {
                        "domain": "str",  # The hostname for
                          the domain. Required.
                        "minimum_tls_version": "str",  #
                          Optional. The minimum version of TLS a client application can
                          use to access resources for the domain.  Must be one of the
                          following values wrapped within quotations: ``"1.2"`` or
                          ``"1.3"``. Known values are: "1.2" and "1.3".
                        "type": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * DEFAULT: The default
                          ``.ondigitalocean.app`` domain assigned to this app"n*
                          PRIMARY: The primary domain for this app that is displayed as
                          the default in the control panel, used in bindable
                          environment variables, and any other places that reference an
                          app's live URL. Only one domain may be set as primary."n*
                          ALIAS: A non-primary domain. Known values are: "UNSPECIFIED",
                          "DEFAULT", "PRIMARY", and "ALIAS".
                        "wildcard": bool,  # Optional.
                          Indicates whether the domain includes all sub-domains, in
                          addition to the given domain.
                        "zone": "str"  # Optional. Optional.
                          If the domain uses DigitalOcean DNS and you would like
                          App"nPlatform to automatically manage it for you, set this to
                          the name of the"ndomain on your account."n"nFor example, If
                          the domain you are adding is ``app.domain.com``"" , the
                          zone"ncould be ``domain.com``.
                    }
                ],
                "functions": [
                    {
                        "alerts": [
                            {
                                "disabled": bool,  #
                                  Optional. Is the alert disabled?.
                                "operator":
                                  "UNSPECIFIED_OPERATOR",  # Optional. Default value is
                                  "UNSPECIFIED_OPERATOR". Known values are:
                                  "UNSPECIFIED_OPERATOR", "GREATER_THAN", and
                                  "LESS_THAN".
                                "rule":
                                  "UNSPECIFIED_RULE",  # Optional. Default value is
                                  "UNSPECIFIED_RULE". Known values are:
                                  "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                                  "MEM_UTILIZATION", "RESTART_COUNT",
                                  "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE",
                                  "DOMAIN_FAILED", "DOMAIN_LIVE",
                                  "FUNCTIONS_ACTIVATION_COUNT",
                                  "FUNCTIONS_AVERAGE_DURATION_MS",
                                  "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                                  "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                                  "FUNCTIONS_ERROR_COUNT", and
                                  "FUNCTIONS_GB_RATE_PER_SECOND".
                                "value": 0.0,  #
                                  Optional. Threshold value for alert.
                                "window":
                                  "UNSPECIFIED_WINDOW"  # Optional. Default value is
                                  "UNSPECIFIED_WINDOW". Known values are:
                                  "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES",
                                  "THIRTY_MINUTES", and "ONE_HOUR".
                            }
                        ],
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "ingress": {
                    "rules": [
                        {
                            "component": {
                                "name": "str",  # The
                                  name of the component to route to. Required.
"preserve_path_prefix": "str",  # Optional. An
                                  optional flag to preserve the path that is forwarded
                                  to the backend service. By default, the HTTP request
                                  path will be trimmed from the left when forwarded to
                                  the component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``. Note: this is not
                                  applicable for Functions Components and is mutually
                                  exclusive with ``rewrite``.
                                "rewrite": "str"  #
                                  Optional. An optional field that will rewrite the
                                  path of the component to be what is specified here.
                                  By default, the HTTP request path will be trimmed
                                  from the left when forwarded to the component. For
                                  example, a component with ``path=/api`` will have
                                  requests to ``/api/list`` trimmed to ``/list``. If
                                  you specified the rewrite to be ``/v1/``"" , requests
                                  to ``/api/list`` would be rewritten to ``/v1/list``.
                                  Note: this is mutually exclusive with
                                  ``preserve_path_prefix``.
                            },
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "match": {
                                "path": {
                                    "prefix":
                                      "str"  # Prefix-based match. For example,
                                      ``/api`` will match ``/api``"" , ``/api/``"" ,
                                      and any nested paths such as
                                      ``/api/v1/endpoint``. Required.
                                }
                            },
                            "redirect": {
                                "authority": "str",
                                  # Optional. The authority/host to redirect to. This
                                  can be a hostname or IP address. Note: use ``port``
                                  to set the port.
                                "port": 0,  #
                                  Optional. The port to redirect to.
                                "redirect_code": 0,
                                  # Optional. The redirect code to use. Defaults to
                                  ``302``. Supported values are 300, 301, 302, 303,
                                  304, 307, 308.
                                "scheme": "str",  #
                                  Optional. The scheme to redirect to. Supported values
                                  are ``http`` or ``https``. Default: ``https``.
                                "uri": "str"  #
                                  Optional. An optional URI path to redirect to. Note:
                                  if this is specified the whole URI of the original
                                  request will be overwritten to this value,
                                  irrespective of the original request URI being
                                  matched.
                            }
                        }
                    ]
                },
                "jobs": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "kind": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * UNSPECIFIED: Default job
                          type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY:
                          Indicates a job that runs before an app deployment."n*
                          POST_DEPLOY: Indicates a job that runs after an app
                          deployment."n* FAILED_DEPLOY: Indicates a job that runs after
                          a component fails to deploy. Known values are: "UNSPECIFIED",
                          "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "name": "str",  # The name of the app. Must be unique
                  across all apps in the same account. Required.
                "region": "str",  # Optional. The slug form of the
                  geographical origin of the app. Default: ``nearest available``. Known
                  values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon",
                  and "syd".
                "services": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "health_check": {
                            "failure_threshold": 0,  #
                              Optional. The number of failed health checks before
                              considered unhealthy.
                            "http_path": "str",  #
                              Optional. The route path used for the HTTP health check
                              ping. If not set, the HTTP health check will be disabled
                              and a TCP health check used instead.
                            "initial_delay_seconds": 0,
                              # Optional. The number of seconds to wait before
                              beginning health checks.
                            "period_seconds": 0,  #
                              Optional. The number of seconds to wait between health
                              checks.
                            "port": 0,  # Optional. The
                              port on which the health check will be performed. If not
                              set, the health check will be performed on the
                              component's http_port.
                            "success_threshold": 0,  #
                              Optional. The number of successful health checks before
                              considered healthy.
                            "timeout_seconds": 0  #
                              Optional. The number of seconds after which the check
                              times out.
                        },
                        "http_port": 0,  # Optional. The
                          internal port on which this service's run command will
                          listen. Default: 8080"nIf there is not an environment
                          variable with the name ``PORT``"" , one will be automatically
                          added with its value set to the value of this field.
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "internal_ports": [
                            0  # Optional. The ports on
                              which this service will listen for internal traffic.
                        ],
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "static_sites": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "catchall_document": "str",  #
                          Optional. The name of the document to use as the fallback for
                          any requests to documents that are not found when serving
                          this static site. Only 1 of ``catchall_document`` or
                          ``error_document`` can be set.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "error_document": "404.html",  #
                          Optional. Default value is "404.html". The name of the error
                          document to use when serving this static site. Default:
                          404.html. If no such file exists within the built assets, App
                          Platform will supply one.
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "index_document": "index.html",  #
                          Optional. Default value is "index.html". The name of the
                          index document to use when serving this static site. Default:
                          index.html.
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "output_dir": "str",  # Optional. An
                          optional path to where the built assets will be located,
                          relative to the build context. If not set, App Platform will
                          automatically scan for these directory names: ``_static``"" ,
                          ``dist``"" , ``public``"" , ``build``.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "workers": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ]
            },
            "static_sites": [
                {
                    "name": "str",  # Optional. The name of this
                      static site.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this static
                      site.
                }
            ],
            "tier_slug": "str",  # Optional. The current pricing tier
              slug of the deployment.
            "updated_at": "2020-02-20 00:00:00",  # Optional. When the
              deployment was last updated.
            "workers": [
                {
                    "name": "str",  # Optional. The name of this
                      worker.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this worker.
                }
            ]
        },
        "last_deployment_created_at": "2020-02-20 00:00:00",  # Optional. The
          creation time of the last deployment.
        "live_domain": "str",  # Optional. The live domain of the app.
        "live_url": "str",  # Optional. The live URL of the app.
        "live_url_base": "str",  # Optional. The live URL base of the app,
          the URL excluding the path.
        "owner_uuid": "str",  # Optional. The ID of the account to which the
          application belongs.
        "pending_deployment": {
            "cause": "str",  # Optional. What caused this deployment to
              be created.
            "cloned_from": "str",  # Optional. The ID of a previous
              deployment that this deployment was cloned from.
            "created_at": "2020-02-20 00:00:00",  # Optional. The
              creation time of the deployment.
            "functions": [
                {
                    "name": "str",  # Optional. The name of this
                      functions component.
                    "namespace": "str",  # Optional. The
                      namespace where the functions are deployed.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      functions component.
                }
            ],
            "id": "str",  # Optional. The ID of the deployment.
            "jobs": [
                {
                    "name": "str",  # Optional. The name of this
                      job.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this job.
                }
            ],
            "phase": "UNKNOWN",  # Optional. Default value is "UNKNOWN".
              Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING",
              "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and
              "CANCELED".
            "phase_last_updated_at": "2020-02-20 00:00:00",  # Optional.
              When the deployment phase was last updated.
            "progress": {
                "error_steps": 0,  # Optional. Number of unsuccessful
                  steps.
                "pending_steps": 0,  # Optional. Number of pending
                  steps.
                "running_steps": 0,  # Optional. Number of currently
                  running steps.
                "steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "success_steps": 0,  # Optional. Number of successful
                  steps.
                "summary_steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "total_steps": 0  # Optional. Total number of steps.
            },
            "services": [
                {
                    "name": "str",  # Optional. The name of this
                      service.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      service.
                }
            ],
            "spec": {
                "databases": [
                    {
                        "cluster_name": "str",  # Optional.
                          The name of the underlying DigitalOcean DBaaS cluster. This
                          is required for production databases. For dev databases, if
                          cluster_name is not set, a new cluster will be provisioned.
                        "db_name": "str",  # Optional. The
                          name of the MySQL or PostgreSQL database to configure.
                        "db_user": "str",  # Optional. The
                          name of the MySQL or PostgreSQL user to configure.
                        "engine": "UNSET",  # Optional.
                          Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n*
                          REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and
                          "REDIS".
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "production": bool,  # Optional.
                          Whether this is a production or dev database.
                        "version": "str"  # Optional. The
                          version of the database engine.
                    }
                ],
                "domains": [
                    {
                        "domain": "str",  # The hostname for
                          the domain. Required.
                        "minimum_tls_version": "str",  #
                          Optional. The minimum version of TLS a client application can
                          use to access resources for the domain.  Must be one of the
                          following values wrapped within quotations: ``"1.2"`` or
                          ``"1.3"``. Known values are: "1.2" and "1.3".
                        "type": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * DEFAULT: The default
                          ``.ondigitalocean.app`` domain assigned to this app"n*
                          PRIMARY: The primary domain for this app that is displayed as
                          the default in the control panel, used in bindable
                          environment variables, and any other places that reference an
                          app's live URL. Only one domain may be set as primary."n*
                          ALIAS: A non-primary domain. Known values are: "UNSPECIFIED",
                          "DEFAULT", "PRIMARY", and "ALIAS".
                        "wildcard": bool,  # Optional.
                          Indicates whether the domain includes all sub-domains, in
                          addition to the given domain.
                        "zone": "str"  # Optional. Optional.
                          If the domain uses DigitalOcean DNS and you would like
                          App"nPlatform to automatically manage it for you, set this to
                          the name of the"ndomain on your account."n"nFor example, If
                          the domain you are adding is ``app.domain.com``"" , the
                          zone"ncould be ``domain.com``.
                    }
                ],
                "functions": [
                    {
                        "alerts": [
                            {
                                "disabled": bool,  #
                                  Optional. Is the alert disabled?.
                                "operator":
                                  "UNSPECIFIED_OPERATOR",  # Optional. Default value is
                                  "UNSPECIFIED_OPERATOR". Known values are:
                                  "UNSPECIFIED_OPERATOR", "GREATER_THAN", and
                                  "LESS_THAN".
                                "rule":
                                  "UNSPECIFIED_RULE",  # Optional. Default value is
                                  "UNSPECIFIED_RULE". Known values are:
                                  "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                                  "MEM_UTILIZATION", "RESTART_COUNT",
                                  "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE",
                                  "DOMAIN_FAILED", "DOMAIN_LIVE",
                                  "FUNCTIONS_ACTIVATION_COUNT",
                                  "FUNCTIONS_AVERAGE_DURATION_MS",
                                  "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                                  "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                                  "FUNCTIONS_ERROR_COUNT", and
                                  "FUNCTIONS_GB_RATE_PER_SECOND".
                                "value": 0.0,  #
                                  Optional. Threshold value for alert.
                                "window":
                                  "UNSPECIFIED_WINDOW"  # Optional. Default value is
                                  "UNSPECIFIED_WINDOW". Known values are:
                                  "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES",
                                  "THIRTY_MINUTES", and "ONE_HOUR".
                            }
                        ],
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "ingress": {
                    "rules": [
                        {
                            "component": {
                                "name": "str",  # The
                                  name of the component to route to. Required.
"preserve_path_prefix": "str",  # Optional. An
                                  optional flag to preserve the path that is forwarded
                                  to the backend service. By default, the HTTP request
                                  path will be trimmed from the left when forwarded to
                                  the component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``. Note: this is not
                                  applicable for Functions Components and is mutually
                                  exclusive with ``rewrite``.
                                "rewrite": "str"  #
                                  Optional. An optional field that will rewrite the
                                  path of the component to be what is specified here.
                                  By default, the HTTP request path will be trimmed
                                  from the left when forwarded to the component. For
                                  example, a component with ``path=/api`` will have
                                  requests to ``/api/list`` trimmed to ``/list``. If
                                  you specified the rewrite to be ``/v1/``"" , requests
                                  to ``/api/list`` would be rewritten to ``/v1/list``.
                                  Note: this is mutually exclusive with
                                  ``preserve_path_prefix``.
                            },
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "match": {
                                "path": {
                                    "prefix":
                                      "str"  # Prefix-based match. For example,
                                      ``/api`` will match ``/api``"" , ``/api/``"" ,
                                      and any nested paths such as
                                      ``/api/v1/endpoint``. Required.
                                }
                            },
                            "redirect": {
                                "authority": "str",
                                  # Optional. The authority/host to redirect to. This
                                  can be a hostname or IP address. Note: use ``port``
                                  to set the port.
                                "port": 0,  #
                                  Optional. The port to redirect to.
                                "redirect_code": 0,
                                  # Optional. The redirect code to use. Defaults to
                                  ``302``. Supported values are 300, 301, 302, 303,
                                  304, 307, 308.
                                "scheme": "str",  #
                                  Optional. The scheme to redirect to. Supported values
                                  are ``http`` or ``https``. Default: ``https``.
                                "uri": "str"  #
                                  Optional. An optional URI path to redirect to. Note:
                                  if this is specified the whole URI of the original
                                  request will be overwritten to this value,
                                  irrespective of the original request URI being
                                  matched.
                            }
                        }
                    ]
                },
                "jobs": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "kind": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * UNSPECIFIED: Default job
                          type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY:
                          Indicates a job that runs before an app deployment."n*
                          POST_DEPLOY: Indicates a job that runs after an app
                          deployment."n* FAILED_DEPLOY: Indicates a job that runs after
                          a component fails to deploy. Known values are: "UNSPECIFIED",
                          "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "name": "str",  # The name of the app. Must be unique
                  across all apps in the same account. Required.
                "region": "str",  # Optional. The slug form of the
                  geographical origin of the app. Default: ``nearest available``. Known
                  values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon",
                  and "syd".
                "services": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "health_check": {
                            "failure_threshold": 0,  #
                              Optional. The number of failed health checks before
                              considered unhealthy.
                            "http_path": "str",  #
                              Optional. The route path used for the HTTP health check
                              ping. If not set, the HTTP health check will be disabled
                              and a TCP health check used instead.
                            "initial_delay_seconds": 0,
                              # Optional. The number of seconds to wait before
                              beginning health checks.
                            "period_seconds": 0,  #
                              Optional. The number of seconds to wait between health
                              checks.
                            "port": 0,  # Optional. The
                              port on which the health check will be performed. If not
                              set, the health check will be performed on the
                              component's http_port.
                            "success_threshold": 0,  #
                              Optional. The number of successful health checks before
                              considered healthy.
                            "timeout_seconds": 0  #
                              Optional. The number of seconds after which the check
                              times out.
                        },
                        "http_port": 0,  # Optional. The
                          internal port on which this service's run command will
                          listen. Default: 8080"nIf there is not an environment
                          variable with the name ``PORT``"" , one will be automatically
                          added with its value set to the value of this field.
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "internal_ports": [
                            0  # Optional. The ports on
                              which this service will listen for internal traffic.
                        ],
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "static_sites": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "catchall_document": "str",  #
                          Optional. The name of the document to use as the fallback for
                          any requests to documents that are not found when serving
                          this static site. Only 1 of ``catchall_document`` or
                          ``error_document`` can be set.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "error_document": "404.html",  #
                          Optional. Default value is "404.html". The name of the error
                          document to use when serving this static site. Default:
                          404.html. If no such file exists within the built assets, App
                          Platform will supply one.
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "index_document": "index.html",  #
                          Optional. Default value is "index.html". The name of the
                          index document to use when serving this static site. Default:
                          index.html.
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "output_dir": "str",  # Optional. An
                          optional path to where the built assets will be located,
                          relative to the build context. If not set, App Platform will
                          automatically scan for these directory names: ``_static``"" ,
                          ``dist``"" , ``public``"" , ``build``.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "workers": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ]
            },
            "static_sites": [
                {
                    "name": "str",  # Optional. The name of this
                      static site.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this static
                      site.
                }
            ],
            "tier_slug": "str",  # Optional. The current pricing tier
              slug of the deployment.
            "updated_at": "2020-02-20 00:00:00",  # Optional. When the
              deployment was last updated.
            "workers": [
                {
                    "name": "str",  # Optional. The name of this
                      worker.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this worker.
                }
            ]
        },
        "pinned_deployment": {
            "cause": "str",  # Optional. What caused this deployment to
              be created.
            "cloned_from": "str",  # Optional. The ID of a previous
              deployment that this deployment was cloned from.
            "created_at": "2020-02-20 00:00:00",  # Optional. The
              creation time of the deployment.
            "functions": [
                {
                    "name": "str",  # Optional. The name of this
                      functions component.
                    "namespace": "str",  # Optional. The
                      namespace where the functions are deployed.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      functions component.
                }
            ],
            "id": "str",  # Optional. The ID of the deployment.
            "jobs": [
                {
                    "name": "str",  # Optional. The name of this
                      job.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this job.
                }
            ],
            "phase": "UNKNOWN",  # Optional. Default value is "UNKNOWN".
              Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING",
              "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and
              "CANCELED".
            "phase_last_updated_at": "2020-02-20 00:00:00",  # Optional.
              When the deployment phase was last updated.
            "progress": {
                "error_steps": 0,  # Optional. Number of unsuccessful
                  steps.
                "pending_steps": 0,  # Optional. Number of pending
                  steps.
                "running_steps": 0,  # Optional. Number of currently
                  running steps.
                "steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "success_steps": 0,  # Optional. Number of successful
                  steps.
                "summary_steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "total_steps": 0  # Optional. Total number of steps.
            },
            "services": [
                {
                    "name": "str",  # Optional. The name of this
                      service.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      service.
                }
            ],
            "spec": {
                "databases": [
                    {
                        "cluster_name": "str",  # Optional.
                          The name of the underlying DigitalOcean DBaaS cluster. This
                          is required for production databases. For dev databases, if
                          cluster_name is not set, a new cluster will be provisioned.
                        "db_name": "str",  # Optional. The
                          name of the MySQL or PostgreSQL database to configure.
                        "db_user": "str",  # Optional. The
                          name of the MySQL or PostgreSQL user to configure.
                        "engine": "UNSET",  # Optional.
                          Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n*
                          REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and
                          "REDIS".
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "production": bool,  # Optional.
                          Whether this is a production or dev database.
                        "version": "str"  # Optional. The
                          version of the database engine.
                    }
                ],
                "domains": [
                    {
                        "domain": "str",  # The hostname for
                          the domain. Required.
                        "minimum_tls_version": "str",  #
                          Optional. The minimum version of TLS a client application can
                          use to access resources for the domain.  Must be one of the
                          following values wrapped within quotations: ``"1.2"`` or
                          ``"1.3"``. Known values are: "1.2" and "1.3".
                        "type": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * DEFAULT: The default
                          ``.ondigitalocean.app`` domain assigned to this app"n*
                          PRIMARY: The primary domain for this app that is displayed as
                          the default in the control panel, used in bindable
                          environment variables, and any other places that reference an
                          app's live URL. Only one domain may be set as primary."n*
                          ALIAS: A non-primary domain. Known values are: "UNSPECIFIED",
                          "DEFAULT", "PRIMARY", and "ALIAS".
                        "wildcard": bool,  # Optional.
                          Indicates whether the domain includes all sub-domains, in
                          addition to the given domain.
                        "zone": "str"  # Optional. Optional.
                          If the domain uses DigitalOcean DNS and you would like
                          App"nPlatform to automatically manage it for you, set this to
                          the name of the"ndomain on your account."n"nFor example, If
                          the domain you are adding is ``app.domain.com``"" , the
                          zone"ncould be ``domain.com``.
                    }
                ],
                "functions": [
                    {
                        "alerts": [
                            {
                                "disabled": bool,  #
                                  Optional. Is the alert disabled?.
                                "operator":
                                  "UNSPECIFIED_OPERATOR",  # Optional. Default value is
                                  "UNSPECIFIED_OPERATOR". Known values are:
                                  "UNSPECIFIED_OPERATOR", "GREATER_THAN", and
                                  "LESS_THAN".
                                "rule":
                                  "UNSPECIFIED_RULE",  # Optional. Default value is
                                  "UNSPECIFIED_RULE". Known values are:
                                  "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                                  "MEM_UTILIZATION", "RESTART_COUNT",
                                  "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE",
                                  "DOMAIN_FAILED", "DOMAIN_LIVE",
                                  "FUNCTIONS_ACTIVATION_COUNT",
                                  "FUNCTIONS_AVERAGE_DURATION_MS",
                                  "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                                  "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                                  "FUNCTIONS_ERROR_COUNT", and
                                  "FUNCTIONS_GB_RATE_PER_SECOND".
                                "value": 0.0,  #
                                  Optional. Threshold value for alert.
                                "window":
                                  "UNSPECIFIED_WINDOW"  # Optional. Default value is
                                  "UNSPECIFIED_WINDOW". Known values are:
                                  "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES",
                                  "THIRTY_MINUTES", and "ONE_HOUR".
                            }
                        ],
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "ingress": {
                    "rules": [
                        {
                            "component": {
                                "name": "str",  # The
                                  name of the component to route to. Required.
"preserve_path_prefix": "str",  # Optional. An
                                  optional flag to preserve the path that is forwarded
                                  to the backend service. By default, the HTTP request
                                  path will be trimmed from the left when forwarded to
                                  the component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``. Note: this is not
                                  applicable for Functions Components and is mutually
                                  exclusive with ``rewrite``.
                                "rewrite": "str"  #
                                  Optional. An optional field that will rewrite the
                                  path of the component to be what is specified here.
                                  By default, the HTTP request path will be trimmed
                                  from the left when forwarded to the component. For
                                  example, a component with ``path=/api`` will have
                                  requests to ``/api/list`` trimmed to ``/list``. If
                                  you specified the rewrite to be ``/v1/``"" , requests
                                  to ``/api/list`` would be rewritten to ``/v1/list``.
                                  Note: this is mutually exclusive with
                                  ``preserve_path_prefix``.
                            },
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "match": {
                                "path": {
                                    "prefix":
                                      "str"  # Prefix-based match. For example,
                                      ``/api`` will match ``/api``"" , ``/api/``"" ,
                                      and any nested paths such as
                                      ``/api/v1/endpoint``. Required.
                                }
                            },
                            "redirect": {
                                "authority": "str",
                                  # Optional. The authority/host to redirect to. This
                                  can be a hostname or IP address. Note: use ``port``
                                  to set the port.
                                "port": 0,  #
                                  Optional. The port to redirect to.
                                "redirect_code": 0,
                                  # Optional. The redirect code to use. Defaults to
                                  ``302``. Supported values are 300, 301, 302, 303,
                                  304, 307, 308.
                                "scheme": "str",  #
                                  Optional. The scheme to redirect to. Supported values
                                  are ``http`` or ``https``. Default: ``https``.
                                "uri": "str"  #
                                  Optional. An optional URI path to redirect to. Note:
                                  if this is specified the whole URI of the original
                                  request will be overwritten to this value,
                                  irrespective of the original request URI being
                                  matched.
                            }
                        }
                    ]
                },
                "jobs": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "kind": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * UNSPECIFIED: Default job
                          type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY:
                          Indicates a job that runs before an app deployment."n*
                          POST_DEPLOY: Indicates a job that runs after an app
                          deployment."n* FAILED_DEPLOY: Indicates a job that runs after
                          a component fails to deploy. Known values are: "UNSPECIFIED",
                          "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "name": "str",  # The name of the app. Must be unique
                  across all apps in the same account. Required.
                "region": "str",  # Optional. The slug form of the
                  geographical origin of the app. Default: ``nearest available``. Known
                  values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon",
                  and "syd".
                "services": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "health_check": {
                            "failure_threshold": 0,  #
                              Optional. The number of failed health checks before
                              considered unhealthy.
                            "http_path": "str",  #
                              Optional. The route path used for the HTTP health check
                              ping. If not set, the HTTP health check will be disabled
                              and a TCP health check used instead.
                            "initial_delay_seconds": 0,
                              # Optional. The number of seconds to wait before
                              beginning health checks.
                            "period_seconds": 0,  #
                              Optional. The number of seconds to wait between health
                              checks.
                            "port": 0,  # Optional. The
                              port on which the health check will be performed. If not
                              set, the health check will be performed on the
                              component's http_port.
                            "success_threshold": 0,  #
                              Optional. The number of successful health checks before
                              considered healthy.
                            "timeout_seconds": 0  #
                              Optional. The number of seconds after which the check
                              times out.
                        },
                        "http_port": 0,  # Optional. The
                          internal port on which this service's run command will
                          listen. Default: 8080"nIf there is not an environment
                          variable with the name ``PORT``"" , one will be automatically
                          added with its value set to the value of this field.
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "internal_ports": [
                            0  # Optional. The ports on
                              which this service will listen for internal traffic.
                        ],
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "static_sites": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "catchall_document": "str",  #
                          Optional. The name of the document to use as the fallback for
                          any requests to documents that are not found when serving
                          this static site. Only 1 of ``catchall_document`` or
                          ``error_document`` can be set.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "error_document": "404.html",  #
                          Optional. Default value is "404.html". The name of the error
                          document to use when serving this static site. Default:
                          404.html. If no such file exists within the built assets, App
                          Platform will supply one.
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "index_document": "index.html",  #
                          Optional. Default value is "index.html". The name of the
                          index document to use when serving this static site. Default:
                          index.html.
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "output_dir": "str",  # Optional. An
                          optional path to where the built assets will be located,
                          relative to the build context. If not set, App Platform will
                          automatically scan for these directory names: ``_static``"" ,
                          ``dist``"" , ``public``"" , ``build``.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "workers": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ]
            },
            "static_sites": [
                {
                    "name": "str",  # Optional. The name of this
                      static site.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this static
                      site.
                }
            ],
            "tier_slug": "str",  # Optional. The current pricing tier
              slug of the deployment.
            "updated_at": "2020-02-20 00:00:00",  # Optional. When the
              deployment was last updated.
            "workers": [
                {
                    "name": "str",  # Optional. The name of this
                      worker.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this worker.
                }
            ]
        },
        "project_id": "str",  # Optional. The ID of the project the app is
          assigned to. This will be empty if there is a lookup failure.
        "region": {
            "continent": "str",  # Optional. The continent that this
              region is in.
            "data_centers": [
                "str"  # Optional. Data centers that are in this
                  region.
            ],
            "default": bool,  # Optional. Whether or not the region is
              presented as the default.
            "disabled": bool,  # Optional. Whether or not the region is
              open for new apps.
            "flag": "str",  # Optional. The flag of this region.
            "label": "str",  # Optional. A human-readable name of the
              region.
            "reason": "str",  # Optional. Reason that this region is not
              available.
            "slug": "str"  # Optional. The slug form of the region name.
        },
        "spec": {
            "databases": [
                {
                    "cluster_name": "str",  # Optional. The name
                      of the underlying DigitalOcean DBaaS cluster. This is required
                      for production databases. For dev databases, if cluster_name is
                      not set, a new cluster will be provisioned.
                    "db_name": "str",  # Optional. The name of
                      the MySQL or PostgreSQL database to configure.
                    "db_user": "str",  # Optional. The name of
                      the MySQL or PostgreSQL user to configure.
                    "engine": "UNSET",  # Optional. Default value
                      is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis.
                      Known values are: "UNSET", "MYSQL", "PG", and "REDIS".
                    "name": "str",  # The name. Must be unique
                      across all components within the same app. Required.
                    "production": bool,  # Optional. Whether this
                      is a production or dev database.
                    "version": "str"  # Optional. The version of
                      the database engine.
                }
            ],
            "domains": [
                {
                    "domain": "str",  # The hostname for the
                      domain. Required.
                    "minimum_tls_version": "str",  # Optional.
                      The minimum version of TLS a client application can use to access
                      resources for the domain.  Must be one of the following values
                      wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values
                      are: "1.2" and "1.3".
                    "type": "UNSPECIFIED",  # Optional. Default
                      value is "UNSPECIFIED". * DEFAULT: The default
                      ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY:
                      The primary domain for this app that is displayed as the default
                      in the control panel, used in bindable environment variables, and
                      any other places that reference an app's live URL. Only one
                      domain may be set as primary."n* ALIAS: A non-primary domain.
                      Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and
                      "ALIAS".
                    "wildcard": bool,  # Optional. Indicates
                      whether the domain includes all sub-domains, in addition to the
                      given domain.
                    "zone": "str"  # Optional. Optional. If the
                      domain uses DigitalOcean DNS and you would like App"nPlatform to
                      automatically manage it for you, set this to the name of
                      the"ndomain on your account."n"nFor example, If the domain you
                      are adding is ``app.domain.com``"" , the zone"ncould be
                      ``domain.com``.
                }
            ],
            "functions": [
                {
                    "alerts": [
                        {
                            "disabled": bool,  #
                              Optional. Is the alert disabled?.
                            "operator":
                              "UNSPECIFIED_OPERATOR",  # Optional. Default value is
                              "UNSPECIFIED_OPERATOR". Known values are:
                              "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN".
                            "rule": "UNSPECIFIED_RULE",
                              # Optional. Default value is "UNSPECIFIED_RULE". Known
                              values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                              "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED",
                              "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE",
                              "FUNCTIONS_ACTIVATION_COUNT",
                              "FUNCTIONS_AVERAGE_DURATION_MS",
                              "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                              "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                              "FUNCTIONS_ERROR_COUNT", and
                              "FUNCTIONS_GB_RATE_PER_SECOND".
                            "value": 0.0,  # Optional.
                              Threshold value for alert.
                            "window":
                              "UNSPECIFIED_WINDOW"  # Optional. Default value is
                              "UNSPECIFIED_WINDOW". Known values are:
                              "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES",
                              "THIRTY_MINUTES", and "ONE_HOUR".
                        }
                    ],
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # The name. Must be unique
                      across all components within the same app. Required.
                    "routes": [
                        {
                            "path": "str",  # Optional.
                              An HTTP path prefix. Paths must start with / and must be
                              unique across all components within an app.
                            "preserve_path_prefix": bool
                              # Optional. An optional flag to preserve the path that is
                              forwarded to the backend service. By default, the HTTP
                              request path will be trimmed from the left when forwarded
                              to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``.
                        }
                    ],
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "ingress": {
                "rules": [
                    {
                        "component": {
                            "name": "str",  # The name of
                              the component to route to. Required.
                            "preserve_path_prefix":
                              "str",  # Optional. An optional flag to preserve the path
                              that is forwarded to the backend service. By default, the
                              HTTP request path will be trimmed from the left when
                              forwarded to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``. Note: this is not applicable for
                              Functions Components and is mutually exclusive with
                              ``rewrite``.
                            "rewrite": "str"  # Optional.
                              An optional field that will rewrite the path of the
                              component to be what is specified here. By default, the
                              HTTP request path will be trimmed from the left when
                              forwarded to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If you specified the rewrite to be
                              ``/v1/``"" , requests to ``/api/list`` would be rewritten
                              to ``/v1/list``. Note: this is mutually exclusive with
                              ``preserve_path_prefix``.
                        },
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "match": {
                            "path": {
                                "prefix": "str"  #
                                  Prefix-based match. For example, ``/api`` will match
                                  ``/api``"" , ``/api/``"" , and any nested paths such
                                  as ``/api/v1/endpoint``. Required.
                            }
                        },
                        "redirect": {
                            "authority": "str",  #
                              Optional. The authority/host to redirect to. This can be
                              a hostname or IP address. Note: use ``port`` to set the
                              port.
                            "port": 0,  # Optional. The
                              port to redirect to.
                            "redirect_code": 0,  #
                              Optional. The redirect code to use. Defaults to ``302``.
                              Supported values are 300, 301, 302, 303, 304, 307, 308.
                            "scheme": "str",  # Optional.
                              The scheme to redirect to. Supported values are ``http``
                              or ``https``. Default: ``https``.
                            "uri": "str"  # Optional. An
                              optional URI path to redirect to. Note: if this is
                              specified the whole URI of the original request will be
                              overwritten to this value, irrespective of the original
                              request URI being matched.
                        }
                    }
                ]
            },
            "jobs": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "instance_count": 1,  # Optional. Default
                      value is 1. The amount of instances that this component should be
                      scaled to. Default: 1.
                    "instance_size_slug": "basic-xxs",  #
                      Optional. Default value is "basic-xxs". The instance size to use
                      for this component. Default: ``basic-xxs``. Known values are:
                      "basic-xxs", "basic-xs", "basic-s", "basic-m", "professional-xs",
                      "professional-s", "professional-m", "professional-1l",
                      "professional-l", and "professional-xl".
                    "kind": "UNSPECIFIED",  # Optional. Default
                      value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will
                      auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job
                      that runs before an app deployment."n* POST_DEPLOY: Indicates a
                      job that runs after an app deployment."n* FAILED_DEPLOY:
                      Indicates a job that runs after a component fails to deploy.
                      Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and
                      "FAILED_DEPLOY".
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "name": "str",  # The name of the app. Must be unique across
              all apps in the same account. Required.
            "region": "str",  # Optional. The slug form of the
              geographical origin of the app. Default: ``nearest available``. Known
              values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and
              "syd".
            "services": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "health_check": {
                        "failure_threshold": 0,  # Optional.
                          The number of failed health checks before considered
                          unhealthy.
                        "http_path": "str",  # Optional. The
                          route path used for the HTTP health check ping. If not set,
                          the HTTP health check will be disabled and a TCP health check
                          used instead.
                        "initial_delay_seconds": 0,  #
                          Optional. The number of seconds to wait before beginning
                          health checks.
                        "period_seconds": 0,  # Optional. The
                          number of seconds to wait between health checks.
                        "port": 0,  # Optional. The port on
                          which the health check will be performed. If not set, the
                          health check will be performed on the component's http_port.
                        "success_threshold": 0,  # Optional.
                          The number of successful health checks before considered
                          healthy.
                        "timeout_seconds": 0  # Optional. The
                          number of seconds after which the check times out.
                    },
                    "http_port": 0,  # Optional. The internal
                      port on which this service's run command will listen. Default:
                      8080"nIf there is not an environment variable with the name
                      ``PORT``"" , one will be automatically added with its value set
                      to the value of this field.
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "instance_count": 1,  # Optional. Default
                      value is 1. The amount of instances that this component should be
                      scaled to. Default: 1.
                    "instance_size_slug": "basic-xxs",  #
                      Optional. Default value is "basic-xxs". The instance size to use
                      for this component. Default: ``basic-xxs``. Known values are:
                      "basic-xxs", "basic-xs", "basic-s", "basic-m", "professional-xs",
                      "professional-s", "professional-m", "professional-1l",
                      "professional-l", and "professional-xl".
                    "internal_ports": [
                        0  # Optional. The ports on which
                          this service will listen for internal traffic.
                    ],
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "routes": [
                        {
                            "path": "str",  # Optional.
                              An HTTP path prefix. Paths must start with / and must be
                              unique across all components within an app.
                            "preserve_path_prefix": bool
                              # Optional. An optional flag to preserve the path that is
                              forwarded to the backend service. By default, the HTTP
                              request path will be trimmed from the left when forwarded
                              to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``.
                        }
                    ],
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "static_sites": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "catchall_document": "str",  # Optional. The
                      name of the document to use as the fallback for any requests to
                      documents that are not found when serving this static site. Only
                      1 of ``catchall_document`` or ``error_document`` can be set.
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "error_document": "404.html",  # Optional.
                      Default value is "404.html". The name of the error document to
                      use when serving this static site. Default: 404.html. If no such
                      file exists within the built assets, App Platform will supply
                      one.
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "index_document": "index.html",  # Optional.
                      Default value is "index.html". The name of the index document to
                      use when serving this static site. Default: index.html.
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "output_dir": "str",  # Optional. An optional
                      path to where the built assets will be located, relative to the
                      build context. If not set, App Platform will automatically scan
                      for these directory names: ``_static``"" , ``dist``"" ,
                      ``public``"" , ``build``.
                    "routes": [
                        {
                            "path": "str",  # Optional.
                              An HTTP path prefix. Paths must start with / and must be
                              unique across all components within an app.
                            "preserve_path_prefix": bool
                              # Optional. An optional flag to preserve the path that is
                              forwarded to the backend service. By default, the HTTP
                              request path will be trimmed from the left when forwarded
                              to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``.
                        }
                    ],
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "workers": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "instance_count": 1,  # Optional. Default
                      value is 1. The amount of instances that this component should be
                      scaled to. Default: 1.
                    "instance_size_slug": "basic-xxs",  #
                      Optional. Default value is "basic-xxs". The instance size to use
                      for this component. Default: ``basic-xxs``. Known values are:
                      "basic-xxs", "basic-xs", "basic-s", "basic-m", "professional-xs",
                      "professional-s", "professional-m", "professional-1l",
                      "professional-l", and "professional-xl".
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ]
        },
        "tier_slug": "str",  # Optional. The current pricing tier slug of the
          app.
        "updated_at": "2020-02-20 00:00:00"  # Optional. Time of the app's
          last configuration update.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_deployment(app_id: str, deployment_id: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve an App Deployment.

Retrieve information about an app deployment.

Parameters:
  • app_id (str) – The app ID. Required.

  • deployment_id (str) – The deployment ID. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "deployment": {
        "cause": "str",  # Optional. What caused this deployment to be
          created.
        "cloned_from": "str",  # Optional. The ID of a previous deployment
          that this deployment was cloned from.
        "created_at": "2020-02-20 00:00:00",  # Optional. The creation time
          of the deployment.
        "functions": [
            {
                "name": "str",  # Optional. The name of this
                  functions component.
                "namespace": "str",  # Optional. The namespace where
                  the functions are deployed.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this functions
                  component.
            }
        ],
        "id": "str",  # Optional. The ID of the deployment.
        "jobs": [
            {
                "name": "str",  # Optional. The name of this job.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this job.
            }
        ],
        "phase": "UNKNOWN",  # Optional. Default value is "UNKNOWN". Known
          values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", "PENDING_DEPLOY",
          "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and "CANCELED".
        "phase_last_updated_at": "2020-02-20 00:00:00",  # Optional. When the
          deployment phase was last updated.
        "progress": {
            "error_steps": 0,  # Optional. Number of unsuccessful steps.
            "pending_steps": 0,  # Optional. Number of pending steps.
            "running_steps": 0,  # Optional. Number of currently running
              steps.
            "steps": [
                {
                    "component_name": "str",  # Optional. The
                      component name that this step is associated with.
                    "ended_at": "2020-02-20 00:00:00",  #
                      Optional. The end time of this step.
                    "message_base": "str",  # Optional. The base
                      of a human-readable description of the step intended to be
                      combined with the component name for presentation. For
                      example:"n"n``message_base`` = "Building
                      service""n``component_name`` = "api".
                    "name": "str",  # Optional. The name of this
                      step.
                    "reason": {
                        "code": "str",  # Optional. The error
                          code.
                        "message": "str"  # Optional. The
                          error message.
                    },
                    "started_at": "2020-02-20 00:00:00",  #
                      Optional. The start time of this step.
                    "status": "UNKNOWN",  # Optional. Default
                      value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING",
                      "RUNNING", "ERROR", and "SUCCESS".
                    "steps": [
                        {}  # Optional. Child steps of this
                          step.
                    ]
                }
            ],
            "success_steps": 0,  # Optional. Number of successful steps.
            "summary_steps": [
                {
                    "component_name": "str",  # Optional. The
                      component name that this step is associated with.
                    "ended_at": "2020-02-20 00:00:00",  #
                      Optional. The end time of this step.
                    "message_base": "str",  # Optional. The base
                      of a human-readable description of the step intended to be
                      combined with the component name for presentation. For
                      example:"n"n``message_base`` = "Building
                      service""n``component_name`` = "api".
                    "name": "str",  # Optional. The name of this
                      step.
                    "reason": {
                        "code": "str",  # Optional. The error
                          code.
                        "message": "str"  # Optional. The
                          error message.
                    },
                    "started_at": "2020-02-20 00:00:00",  #
                      Optional. The start time of this step.
                    "status": "UNKNOWN",  # Optional. Default
                      value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING",
                      "RUNNING", "ERROR", and "SUCCESS".
                    "steps": [
                        {}  # Optional. Child steps of this
                          step.
                    ]
                }
            ],
            "total_steps": 0  # Optional. Total number of steps.
        },
        "services": [
            {
                "name": "str",  # Optional. The name of this service.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this service.
            }
        ],
        "spec": {
            "databases": [
                {
                    "cluster_name": "str",  # Optional. The name
                      of the underlying DigitalOcean DBaaS cluster. This is required
                      for production databases. For dev databases, if cluster_name is
                      not set, a new cluster will be provisioned.
                    "db_name": "str",  # Optional. The name of
                      the MySQL or PostgreSQL database to configure.
                    "db_user": "str",  # Optional. The name of
                      the MySQL or PostgreSQL user to configure.
                    "engine": "UNSET",  # Optional. Default value
                      is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis.
                      Known values are: "UNSET", "MYSQL", "PG", and "REDIS".
                    "name": "str",  # The name. Must be unique
                      across all components within the same app. Required.
                    "production": bool,  # Optional. Whether this
                      is a production or dev database.
                    "version": "str"  # Optional. The version of
                      the database engine.
                }
            ],
            "domains": [
                {
                    "domain": "str",  # The hostname for the
                      domain. Required.
                    "minimum_tls_version": "str",  # Optional.
                      The minimum version of TLS a client application can use to access
                      resources for the domain.  Must be one of the following values
                      wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values
                      are: "1.2" and "1.3".
                    "type": "UNSPECIFIED",  # Optional. Default
                      value is "UNSPECIFIED". * DEFAULT: The default
                      ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY:
                      The primary domain for this app that is displayed as the default
                      in the control panel, used in bindable environment variables, and
                      any other places that reference an app's live URL. Only one
                      domain may be set as primary."n* ALIAS: A non-primary domain.
                      Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and
                      "ALIAS".
                    "wildcard": bool,  # Optional. Indicates
                      whether the domain includes all sub-domains, in addition to the
                      given domain.
                    "zone": "str"  # Optional. Optional. If the
                      domain uses DigitalOcean DNS and you would like App"nPlatform to
                      automatically manage it for you, set this to the name of
                      the"ndomain on your account."n"nFor example, If the domain you
                      are adding is ``app.domain.com``"" , the zone"ncould be
                      ``domain.com``.
                }
            ],
            "functions": [
                {
                    "alerts": [
                        {
                            "disabled": bool,  #
                              Optional. Is the alert disabled?.
                            "operator":
                              "UNSPECIFIED_OPERATOR",  # Optional. Default value is
                              "UNSPECIFIED_OPERATOR". Known values are:
                              "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN".
                            "rule": "UNSPECIFIED_RULE",
                              # Optional. Default value is "UNSPECIFIED_RULE". Known
                              values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                              "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED",
                              "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE",
                              "FUNCTIONS_ACTIVATION_COUNT",
                              "FUNCTIONS_AVERAGE_DURATION_MS",
                              "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                              "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                              "FUNCTIONS_ERROR_COUNT", and
                              "FUNCTIONS_GB_RATE_PER_SECOND".
                            "value": 0.0,  # Optional.
                              Threshold value for alert.
                            "window":
                              "UNSPECIFIED_WINDOW"  # Optional. Default value is
                              "UNSPECIFIED_WINDOW". Known values are:
                              "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES",
                              "THIRTY_MINUTES", and "ONE_HOUR".
                        }
                    ],
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # The name. Must be unique
                      across all components within the same app. Required.
                    "routes": [
                        {
                            "path": "str",  # Optional.
                              An HTTP path prefix. Paths must start with / and must be
                              unique across all components within an app.
                            "preserve_path_prefix": bool
                              # Optional. An optional flag to preserve the path that is
                              forwarded to the backend service. By default, the HTTP
                              request path will be trimmed from the left when forwarded
                              to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``.
                        }
                    ],
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "ingress": {
                "rules": [
                    {
                        "component": {
                            "name": "str",  # The name of
                              the component to route to. Required.
                            "preserve_path_prefix":
                              "str",  # Optional. An optional flag to preserve the path
                              that is forwarded to the backend service. By default, the
                              HTTP request path will be trimmed from the left when
                              forwarded to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``. Note: this is not applicable for
                              Functions Components and is mutually exclusive with
                              ``rewrite``.
                            "rewrite": "str"  # Optional.
                              An optional field that will rewrite the path of the
                              component to be what is specified here. By default, the
                              HTTP request path will be trimmed from the left when
                              forwarded to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If you specified the rewrite to be
                              ``/v1/``"" , requests to ``/api/list`` would be rewritten
                              to ``/v1/list``. Note: this is mutually exclusive with
                              ``preserve_path_prefix``.
                        },
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "match": {
                            "path": {
                                "prefix": "str"  #
                                  Prefix-based match. For example, ``/api`` will match
                                  ``/api``"" , ``/api/``"" , and any nested paths such
                                  as ``/api/v1/endpoint``. Required.
                            }
                        },
                        "redirect": {
                            "authority": "str",  #
                              Optional. The authority/host to redirect to. This can be
                              a hostname or IP address. Note: use ``port`` to set the
                              port.
                            "port": 0,  # Optional. The
                              port to redirect to.
                            "redirect_code": 0,  #
                              Optional. The redirect code to use. Defaults to ``302``.
                              Supported values are 300, 301, 302, 303, 304, 307, 308.
                            "scheme": "str",  # Optional.
                              The scheme to redirect to. Supported values are ``http``
                              or ``https``. Default: ``https``.
                            "uri": "str"  # Optional. An
                              optional URI path to redirect to. Note: if this is
                              specified the whole URI of the original request will be
                              overwritten to this value, irrespective of the original
                              request URI being matched.
                        }
                    }
                ]
            },
            "jobs": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "instance_count": 1,  # Optional. Default
                      value is 1. The amount of instances that this component should be
                      scaled to. Default: 1.
                    "instance_size_slug": "basic-xxs",  #
                      Optional. Default value is "basic-xxs". The instance size to use
                      for this component. Default: ``basic-xxs``. Known values are:
                      "basic-xxs", "basic-xs", "basic-s", "basic-m", "professional-xs",
                      "professional-s", "professional-m", "professional-1l",
                      "professional-l", and "professional-xl".
                    "kind": "UNSPECIFIED",  # Optional. Default
                      value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will
                      auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job
                      that runs before an app deployment."n* POST_DEPLOY: Indicates a
                      job that runs after an app deployment."n* FAILED_DEPLOY:
                      Indicates a job that runs after a component fails to deploy.
                      Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and
                      "FAILED_DEPLOY".
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "name": "str",  # The name of the app. Must be unique across
              all apps in the same account. Required.
            "region": "str",  # Optional. The slug form of the
              geographical origin of the app. Default: ``nearest available``. Known
              values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and
              "syd".
            "services": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "health_check": {
                        "failure_threshold": 0,  # Optional.
                          The number of failed health checks before considered
                          unhealthy.
                        "http_path": "str",  # Optional. The
                          route path used for the HTTP health check ping. If not set,
                          the HTTP health check will be disabled and a TCP health check
                          used instead.
                        "initial_delay_seconds": 0,  #
                          Optional. The number of seconds to wait before beginning
                          health checks.
                        "period_seconds": 0,  # Optional. The
                          number of seconds to wait between health checks.
                        "port": 0,  # Optional. The port on
                          which the health check will be performed. If not set, the
                          health check will be performed on the component's http_port.
                        "success_threshold": 0,  # Optional.
                          The number of successful health checks before considered
                          healthy.
                        "timeout_seconds": 0  # Optional. The
                          number of seconds after which the check times out.
                    },
                    "http_port": 0,  # Optional. The internal
                      port on which this service's run command will listen. Default:
                      8080"nIf there is not an environment variable with the name
                      ``PORT``"" , one will be automatically added with its value set
                      to the value of this field.
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "instance_count": 1,  # Optional. Default
                      value is 1. The amount of instances that this component should be
                      scaled to. Default: 1.
                    "instance_size_slug": "basic-xxs",  #
                      Optional. Default value is "basic-xxs". The instance size to use
                      for this component. Default: ``basic-xxs``. Known values are:
                      "basic-xxs", "basic-xs", "basic-s", "basic-m", "professional-xs",
                      "professional-s", "professional-m", "professional-1l",
                      "professional-l", and "professional-xl".
                    "internal_ports": [
                        0  # Optional. The ports on which
                          this service will listen for internal traffic.
                    ],
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "routes": [
                        {
                            "path": "str",  # Optional.
                              An HTTP path prefix. Paths must start with / and must be
                              unique across all components within an app.
                            "preserve_path_prefix": bool
                              # Optional. An optional flag to preserve the path that is
                              forwarded to the backend service. By default, the HTTP
                              request path will be trimmed from the left when forwarded
                              to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``.
                        }
                    ],
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "static_sites": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "catchall_document": "str",  # Optional. The
                      name of the document to use as the fallback for any requests to
                      documents that are not found when serving this static site. Only
                      1 of ``catchall_document`` or ``error_document`` can be set.
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "error_document": "404.html",  # Optional.
                      Default value is "404.html". The name of the error document to
                      use when serving this static site. Default: 404.html. If no such
                      file exists within the built assets, App Platform will supply
                      one.
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "index_document": "index.html",  # Optional.
                      Default value is "index.html". The name of the index document to
                      use when serving this static site. Default: index.html.
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "output_dir": "str",  # Optional. An optional
                      path to where the built assets will be located, relative to the
                      build context. If not set, App Platform will automatically scan
                      for these directory names: ``_static``"" , ``dist``"" ,
                      ``public``"" , ``build``.
                    "routes": [
                        {
                            "path": "str",  # Optional.
                              An HTTP path prefix. Paths must start with / and must be
                              unique across all components within an app.
                            "preserve_path_prefix": bool
                              # Optional. An optional flag to preserve the path that is
                              forwarded to the backend service. By default, the HTTP
                              request path will be trimmed from the left when forwarded
                              to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``.
                        }
                    ],
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "workers": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "instance_count": 1,  # Optional. Default
                      value is 1. The amount of instances that this component should be
                      scaled to. Default: 1.
                    "instance_size_slug": "basic-xxs",  #
                      Optional. Default value is "basic-xxs". The instance size to use
                      for this component. Default: ``basic-xxs``. Known values are:
                      "basic-xxs", "basic-xs", "basic-s", "basic-m", "professional-xs",
                      "professional-s", "professional-m", "professional-1l",
                      "professional-l", and "professional-xl".
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ]
        },
        "static_sites": [
            {
                "name": "str",  # Optional. The name of this static
                  site.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this static site.
            }
        ],
        "tier_slug": "str",  # Optional. The current pricing tier slug of the
          deployment.
        "updated_at": "2020-02-20 00:00:00",  # Optional. When the deployment
          was last updated.
        "workers": [
            {
                "name": "str",  # Optional. The name of this worker.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this worker.
            }
        ]
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_instance_size(slug: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Instance Size.

Retrieve information about a specific instance size for service, worker, and job components.

Parameters:

slug (str) – The slug of the instance size. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "instance_size": {
        "cpu_type": "UNSPECIFIED",  # Optional. Default value is
          "UNSPECIFIED". * SHARED: Shared vCPU cores"n"n  * DEDICATED: Dedicated vCPU
          cores. Known values are: "UNSPECIFIED", "SHARED", and "DEDICATED".
        "cpus": "str",  # Optional. The number of allotted vCPU cores.
        "memory_bytes": "str",  # Optional. The allotted memory in bytes.
        "name": "str",  # Optional. A human-readable name of the instance
          size.
        "slug": "str",  # Optional. The slug of the instance size.
        "tier_downgrade_to": "str",  # Optional. The slug of the
          corresponding downgradable instance size on the lower tier.
        "tier_slug": "str",  # Optional. The slug of the tier to which this
          instance size belongs.
        "tier_upgrade_to": "str",  # Optional. The slug of the corresponding
          upgradable instance size on the higher tier.
        "usd_per_month": "str",  # Optional. The cost of this instance size
          in USD per month.
        "usd_per_second": "str"  # Optional. The cost of this instance size
          in USD per second.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_logs(app_id: str, deployment_id: str, component_name: str, *, follow: Optional[bool] = None, type: str = 'UNSPECIFIED', pod_connection_timeout: Optional[str] = None, **kwargs: Any) MutableMapping[str, Any]

Retrieve Deployment Logs.

Retrieve the logs of a past, in-progress, or active deployment. The response will include links to either real-time logs of an in-progress or active deployment or archived logs of a past deployment.

Parameters:
  • app_id (str) – The app ID. Required.

  • deployment_id (str) – The deployment ID. Required.

  • component_name (str) – An optional component name. If set, logs will be limited to this component only. Required.

  • follow (bool) – Whether the logs should follow live updates. Default value is None.

  • type (str) –

    The type of logs to retrieve

    • BUILD: Build-time logs

    • DEPLOY: Deploy-time logs

    • RUN: Live run-time logs. Known values are: “UNSPECIFIED”, “BUILD”, “DEPLOY”, and “RUN”.

    Default value is “UNSPECIFIED”.

  • pod_connection_timeout (str) – An optional time duration to wait if the underlying component instance is not immediately available. Default: 3m. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "historic_urls": [
        "str"  # Optional. A list of URLs to archived log files.
    ],
    "live_url": "str"  # Optional. A URL of the real-time live logs. This URL may
      use either the ``https://`` or ``wss://`` protocols and will keep pushing live
      logs as they become available.
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_logs_active_deployment(app_id: str, component_name: str, *, follow: Optional[bool] = None, type: str = 'UNSPECIFIED', pod_connection_timeout: Optional[str] = None, **kwargs: Any) MutableMapping[str, Any]

Retrieve Active Deployment Logs.

Retrieve the logs of the active deployment if one exists. The response will include links to either real-time logs of an in-progress or active deployment or archived logs of a past deployment. Note log_type=BUILD logs will return logs associated with the current active deployment (being served). To view build logs associated with in-progress build, the query must explicitly reference the deployment id.

Parameters:
  • app_id (str) – The app ID. Required.

  • component_name (str) – An optional component name. If set, logs will be limited to this component only. Required.

  • follow (bool) – Whether the logs should follow live updates. Default value is None.

  • type (str) –

    The type of logs to retrieve

    • BUILD: Build-time logs

    • DEPLOY: Deploy-time logs

    • RUN: Live run-time logs. Known values are: “UNSPECIFIED”, “BUILD”, “DEPLOY”, and “RUN”.

    Default value is “UNSPECIFIED”.

  • pod_connection_timeout (str) – An optional time duration to wait if the underlying component instance is not immediately available. Default: 3m. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "historic_urls": [
        "str"  # Optional. A list of URLs to archived log files.
    ],
    "live_url": "str"  # Optional. A URL of the real-time live logs. This URL may
      use either the ``https://`` or ``wss://`` protocols and will keep pushing live
      logs as they become available.
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_logs_active_deployment_aggregate(app_id: str, *, follow: Optional[bool] = None, type: str = 'UNSPECIFIED', pod_connection_timeout: Optional[str] = None, **kwargs: Any) MutableMapping[str, Any]

Retrieve Active Deployment Aggregate Logs.

Retrieve the logs of the active deployment if one exists. The response will include links to either real-time logs of an in-progress or active deployment or archived logs of a past deployment. Note log_type=BUILD logs will return logs associated with the current active deployment (being served). To view build logs associated with in-progress build, the query must explicitly reference the deployment id.

Parameters:
  • app_id (str) – The app ID. Required.

  • follow (bool) – Whether the logs should follow live updates. Default value is None.

  • type (str) –

    The type of logs to retrieve

    • BUILD: Build-time logs

    • DEPLOY: Deploy-time logs

    • RUN: Live run-time logs. Known values are: “UNSPECIFIED”, “BUILD”, “DEPLOY”, and “RUN”.

    Default value is “UNSPECIFIED”.

  • pod_connection_timeout (str) – An optional time duration to wait if the underlying component instance is not immediately available. Default: 3m. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "historic_urls": [
        "str"  # Optional. A list of URLs to archived log files.
    ],
    "live_url": "str"  # Optional. A URL of the real-time live logs. This URL may
      use either the ``https://`` or ``wss://`` protocols and will keep pushing live
      logs as they become available.
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_logs_aggregate(app_id: str, deployment_id: str, *, follow: Optional[bool] = None, type: str = 'UNSPECIFIED', pod_connection_timeout: Optional[str] = None, **kwargs: Any) MutableMapping[str, Any]

Retrieve Aggregate Deployment Logs.

Retrieve the logs of a past, in-progress, or active deployment. If a component name is specified, the logs will be limited to only that component. The response will include links to either real-time logs of an in-progress or active deployment or archived logs of a past deployment.

Parameters:
  • app_id (str) – The app ID. Required.

  • deployment_id (str) – The deployment ID. Required.

  • follow (bool) – Whether the logs should follow live updates. Default value is None.

  • type (str) –

    The type of logs to retrieve

    • BUILD: Build-time logs

    • DEPLOY: Deploy-time logs

    • RUN: Live run-time logs. Known values are: “UNSPECIFIED”, “BUILD”, “DEPLOY”, and “RUN”.

    Default value is “UNSPECIFIED”.

  • pod_connection_timeout (str) – An optional time duration to wait if the underlying component instance is not immediately available. Default: 3m. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "historic_urls": [
        "str"  # Optional. A list of URLs to archived log files.
    ],
    "live_url": "str"  # Optional. A URL of the real-time live logs. This URL may
      use either the ``https://`` or ``wss://`` protocols and will keep pushing live
      logs as they become available.
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_metrics_bandwidth_daily(app_id: str, *, date: Optional[datetime] = None, **kwargs: Any) MutableMapping[str, Any]

Retrieve App Daily Bandwidth Metrics.

Retrieve daily bandwidth usage metrics for a single app.

Parameters:
  • app_id (str) – The app ID. Required.

  • date (datetime) – Optional day to query. Only the date component of the timestamp will be considered. Default: yesterday. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "app_bandwidth_usage": [
        {
            "app_id": "str",  # Optional. The ID of the app.
            "bandwidth_bytes": "str"  # Optional. The used bandwidth
              amount in bytes.
        }
    ],
    "date": "2020-02-20 00:00:00"  # Optional. The date for the metrics data.
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_tier(slug: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve an App Tier.

Retrieve information about a specific app tier.

Parameters:

slug (str) – The slug of the tier. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "tier": {
        "build_seconds": "str",  # Optional. The amount of included build
          time in seconds.
        "egress_bandwidth_bytes": "str",  # Optional. The amount of included
          outbound bandwidth in bytes.
        "name": "str",  # Optional. A human-readable name of the tier.
        "slug": "str",  # Optional. The slug of the tier.
        "storage_bytes": "str"  # Optional. The allotted disk space in bytes.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list(*, page: int = 1, per_page: int = 20, with_projects: Optional[bool] = None, **kwargs: Any) MutableMapping[str, Any]

List All Apps.

List all apps on your account. Information about the current active deployment as well as any in progress ones will also be included for each app.

Parameters:
  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

  • per_page (int) – Number of items returned per page. Default value is 20.

  • with_projects (bool) – Whether the project_id of listed apps should be fetched and included. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "apps": [
        {
            "active_deployment": {
                "cause": "str",  # Optional. What caused this
                  deployment to be created.
                "cloned_from": "str",  # Optional. The ID of a
                  previous deployment that this deployment was cloned from.
                "created_at": "2020-02-20 00:00:00",  # Optional. The
                  creation time of the deployment.
                "functions": [
                    {
                        "name": "str",  # Optional. The name
                          of this functions component.
                        "namespace": "str",  # Optional. The
                          namespace where the functions are deployed.
                        "source_commit_hash": "str"  #
                          Optional. The commit hash of the repository that was used to
                          build this functions component.
                    }
                ],
                "id": "str",  # Optional. The ID of the deployment.
                "jobs": [
                    {
                        "name": "str",  # Optional. The name
                          of this job.
                        "source_commit_hash": "str"  #
                          Optional. The commit hash of the repository that was used to
                          build this job.
                    }
                ],
                "phase": "UNKNOWN",  # Optional. Default value is
                  "UNKNOWN". Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING",
                  "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and
                  "CANCELED".
                "phase_last_updated_at": "2020-02-20 00:00:00",  #
                  Optional. When the deployment phase was last updated.
                "progress": {
                    "error_steps": 0,  # Optional. Number of
                      unsuccessful steps.
                    "pending_steps": 0,  # Optional. Number of
                      pending steps.
                    "running_steps": 0,  # Optional. Number of
                      currently running steps.
                    "steps": [
                        {
                            "component_name": "str",  #
                              Optional. The component name that this step is associated
                              with.
                            "ended_at": "2020-02-20
                              00:00:00",  # Optional. The end time of this step.
                            "message_base": "str",  #
                              Optional. The base of a human-readable description of the
                              step intended to be combined with the component name for
                              presentation. For example:"n"n``message_base`` =
                              "Building service""n``component_name`` = "api".
                            "name": "str",  # Optional.
                              The name of this step.
                            "reason": {
                                "code": "str",  #
                                  Optional. The error code.
                                "message": "str"  #
                                  Optional. The error message.
                            },
                            "started_at": "2020-02-20
                              00:00:00",  # Optional. The start time of this step.
                            "status": "UNKNOWN",  #
                              Optional. Default value is "UNKNOWN". Known values are:
                              "UNKNOWN", "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                            "steps": [
                                {}  # Optional. Child
                                  steps of this step.
                            ]
                        }
                    ],
                    "success_steps": 0,  # Optional. Number of
                      successful steps.
                    "summary_steps": [
                        {
                            "component_name": "str",  #
                              Optional. The component name that this step is associated
                              with.
                            "ended_at": "2020-02-20
                              00:00:00",  # Optional. The end time of this step.
                            "message_base": "str",  #
                              Optional. The base of a human-readable description of the
                              step intended to be combined with the component name for
                              presentation. For example:"n"n``message_base`` =
                              "Building service""n``component_name`` = "api".
                            "name": "str",  # Optional.
                              The name of this step.
                            "reason": {
                                "code": "str",  #
                                  Optional. The error code.
                                "message": "str"  #
                                  Optional. The error message.
                            },
                            "started_at": "2020-02-20
                              00:00:00",  # Optional. The start time of this step.
                            "status": "UNKNOWN",  #
                              Optional. Default value is "UNKNOWN". Known values are:
                              "UNKNOWN", "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                            "steps": [
                                {}  # Optional. Child
                                  steps of this step.
                            ]
                        }
                    ],
                    "total_steps": 0  # Optional. Total number of
                      steps.
                },
                "services": [
                    {
                        "name": "str",  # Optional. The name
                          of this service.
                        "source_commit_hash": "str"  #
                          Optional. The commit hash of the repository that was used to
                          build this service.
                    }
                ],
                "spec": {
                    "databases": [
                        {
                            "cluster_name": "str",  #
                              Optional. The name of the underlying DigitalOcean DBaaS
                              cluster. This is required for production databases. For
                              dev databases, if cluster_name is not set, a new cluster
                              will be provisioned.
                            "db_name": "str",  #
                              Optional. The name of the MySQL or PostgreSQL database to
                              configure.
                            "db_user": "str",  #
                              Optional. The name of the MySQL or PostgreSQL user to
                              configure.
                            "engine": "UNSET",  #
                              Optional. Default value is "UNSET". * MYSQL: MySQL"n* PG:
                              PostgreSQL"n* REDIS: Redis. Known values are: "UNSET",
                              "MYSQL", "PG", and "REDIS".
                            "name": "str",  # The name.
                              Must be unique across all components within the same app.
                              Required.
                            "production": bool,  #
                              Optional. Whether this is a production or dev database.
                            "version": "str"  # Optional.
                              The version of the database engine.
                        }
                    ],
                    "domains": [
                        {
                            "domain": "str",  # The
                              hostname for the domain. Required.
                            "minimum_tls_version": "str",
                              # Optional. The minimum version of TLS a client
                              application can use to access resources for the domain.
                              Must be one of the following values wrapped within
                              quotations: ``"1.2"`` or ``"1.3"``. Known values are:
                              "1.2" and "1.3".
                            "type": "UNSPECIFIED",  #
                              Optional. Default value is "UNSPECIFIED". * DEFAULT: The
                              default ``.ondigitalocean.app`` domain assigned to this
                              app"n* PRIMARY: The primary domain for this app that is
                              displayed as the default in the control panel, used in
                              bindable environment variables, and any other places that
                              reference an app's live URL. Only one domain may be set
                              as primary."n* ALIAS: A non-primary domain. Known values
                              are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS".
                            "wildcard": bool,  #
                              Optional. Indicates whether the domain includes all
                              sub-domains, in addition to the given domain.
                            "zone": "str"  # Optional.
                              Optional. If the domain uses DigitalOcean DNS and you
                              would like App"nPlatform to automatically manage it for
                              you, set this to the name of the"ndomain on your
                              account."n"nFor example, If the domain you are adding is
                              ``app.domain.com``"" , the zone"ncould be ``domain.com``.
                        }
                    ],
                    "functions": [
                        {
                            "alerts": [
                                {
                                    "disabled":
                                      bool,  # Optional. Is the alert disabled?.
                                    "operator":
                                      "UNSPECIFIED_OPERATOR",  # Optional. Default
                                      value is "UNSPECIFIED_OPERATOR". Known values
                                      are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and
                                      "LESS_THAN".
                                    "rule":
                                      "UNSPECIFIED_RULE",  # Optional. Default value is
                                      "UNSPECIFIED_RULE". Known values are:
                                      "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                                      "MEM_UTILIZATION", "RESTART_COUNT",
                                      "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE",
                                      "DOMAIN_FAILED", "DOMAIN_LIVE",
                                      "FUNCTIONS_ACTIVATION_COUNT",
                                      "FUNCTIONS_AVERAGE_DURATION_MS",
                                      "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                                      "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                                      "FUNCTIONS_ERROR_COUNT", and
                                      "FUNCTIONS_GB_RATE_PER_SECOND".
                                    "value": 0.0,
                                      # Optional. Threshold value for alert.
                                    "window":
                                      "UNSPECIFIED_WINDOW"  # Optional. Default value
                                      is "UNSPECIFIED_WINDOW". Known values are:
                                      "UNSPECIFIED_WINDOW", "FIVE_MINUTES",
                                      "TEN_MINUTES", "THIRTY_MINUTES", and "ONE_HOUR".
                                }
                            ],
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "envs": [
                                {
                                    "key": "str",
                                      # The variable name. Required.
                                    "scope":
                                      "RUN_AND_BUILD_TIME",  # Optional. Default value
                                      is "RUN_AND_BUILD_TIME". * RUN_TIME: Made
                                      available only at run-time"n* BUILD_TIME: Made
                                      available only at build-time"n*
                                      RUN_AND_BUILD_TIME: Made available at both build
                                      and run-time. Known values are: "UNSET",
                                      "RUN_TIME", "BUILD_TIME", and
                                      "RUN_AND_BUILD_TIME".
                                    "type":
                                      "GENERAL",  # Optional. Default value is
                                      "GENERAL". * GENERAL: A plain-text environment
                                      variable"n* SECRET: A secret encrypted
                                      environment variable. Known values are: "GENERAL"
                                      and "SECRET".
                                    "value":
                                      "str"  # Optional. The value. If the type is
                                      ``SECRET``"" , the value will be encrypted on
                                      first submission. On following submissions, the
                                      encrypted value should be used.
                                }
                            ],
                            "git": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "repo_clone_url":
                                  "str"  # Optional. The clone URL of the repo.
                                  Example:
                                  ``https://github.com/digitalocean/sample-golang.git``.
                            },
                            "github": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "gitlab": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "log_destinations": {
                                "datadog": {
                                    "api_key":
                                      "str",  # Datadog API key. Required.
                                    "endpoint":
                                      "str"  # Optional. Datadog HTTP log intake
                                      endpoint.
                                },
                                "logtail": {
                                    "token":
                                      "str"  # Optional. Logtail token.
                                },
                                "name": "str",  #
                                  Required.
                                "papertrail": {
                                    "endpoint":
                                      "str"  # Papertrail syslog endpoint. Required.
                                }
                            },
                            "name": "str",  # The name.
                              Must be unique across all components within the same app.
                              Required.
                            "routes": [
                                {
                                    "path":
                                      "str",  # Optional. An HTTP path prefix. Paths
                                      must start with / and must be unique across all
                                      components within an app.
"preserve_path_prefix": bool  # Optional. An
                                      optional flag to preserve the path that is
                                      forwarded to the backend service. By default, the
                                      HTTP request path will be trimmed from the left
                                      when forwarded to the component. For example, a
                                      component with ``path=/api`` will have requests
                                      to ``/api/list`` trimmed to ``/list``. If this
                                      value is ``true``"" , the path will remain
                                      ``/api/list``.
                                }
                            ],
                            "source_dir": "str"  #
                              Optional. An optional path to the working directory to
                              use for the build. For Dockerfile builds, this will be
                              used as the build context. Must be relative to the root
                              of the repo.
                        }
                    ],
                    "ingress": {
                        "rules": [
                            {
                                "component": {
                                    "name":
                                      "str",  # The name of the component to route to.
                                      Required.
"preserve_path_prefix": "str",  # Optional. An
                                      optional flag to preserve the path that is
                                      forwarded to the backend service. By default, the
                                      HTTP request path will be trimmed from the left
                                      when forwarded to the component. For example, a
                                      component with ``path=/api`` will have requests
                                      to ``/api/list`` trimmed to ``/list``. If this
                                      value is ``true``"" , the path will remain
                                      ``/api/list``. Note: this is not applicable for
                                      Functions Components and is mutually exclusive
                                      with ``rewrite``.
                                    "rewrite":
                                      "str"  # Optional. An optional field that will
                                      rewrite the path of the component to be what is
                                      specified here. By default, the HTTP request path
                                      will be trimmed from the left when forwarded to
                                      the component. For example, a component with
                                      ``path=/api`` will have requests to ``/api/list``
                                      trimmed to ``/list``. If you specified the
                                      rewrite to be ``/v1/``"" , requests to
                                      ``/api/list`` would be rewritten to ``/v1/list``.
                                      Note: this is mutually exclusive with
                                      ``preserve_path_prefix``.
                                },
                                "cors": {
"allow_credentials": bool,  # Optional. Whether
                                      browsers should expose the response to the
                                      client-side JavaScript code when the
                                      request"u2019s credentials mode is include. This
                                      configures the
                                      ``Access-Control-Allow-Credentials`` header.
"allow_headers": [
                                        "str"
                                          # Optional. The set of allowed HTTP request
                                          headers. This configures the
                                          ``Access-Control-Allow-Headers`` header.
                                    ],
"allow_methods": [
                                        "str"
                                          # Optional. The set of allowed HTTP methods.
                                          This configures the
                                          ``Access-Control-Allow-Methods`` header.
                                    ],
"allow_origins": [
                                        {
"exact": "str",  # Optional. Exact string
                                              match. Only 1 of ``exact``"" ,
                                              ``prefix``"" , or ``regex`` must be set.
"prefix": "str",  # Optional.
                                              Prefix-based match. Only 1 of ``exact``""
                                              , ``prefix``"" , or ``regex`` must be
                                              set.
"regex": "str"  # Optional. RE2 style
                                              regex-based match. Only 1 of ``exact``""
                                              , ``prefix``"" , or ``regex`` must be
                                              set. For more information about RE2
                                              syntax, see:
                                              https://github.com/google/re2/wiki/Syntax.
                                        }
                                    ],
"expose_headers": [
                                        "str"
                                          # Optional. The set of HTTP response headers
                                          that browsers are allowed to access. This
                                          configures the
                                          ``Access-Control-Expose-Headers`` header.
                                    ],
                                    "max_age":
                                      "str"  # Optional. An optional duration
                                      specifying how long browsers can cache the
                                      results of a preflight request. This configures
                                      the ``Access-Control-Max-Age`` header.
                                },
                                "match": {
                                    "path": {
"prefix": "str"  # Prefix-based match. For
                                          example, ``/api`` will match ``/api``"" ,
                                          ``/api/``"" , and any nested paths such as
                                          ``/api/v1/endpoint``. Required.
                                    }
                                },
                                "redirect": {
                                    "authority":
                                      "str",  # Optional. The authority/host to
                                      redirect to. This can be a hostname or IP
                                      address. Note: use ``port`` to set the port.
                                    "port": 0,  #
                                      Optional. The port to redirect to.
"redirect_code": 0,  # Optional. The redirect
                                      code to use. Defaults to ``302``. Supported
                                      values are 300, 301, 302, 303, 304, 307, 308.
                                    "scheme":
                                      "str",  # Optional. The scheme to redirect to.
                                      Supported values are ``http`` or ``https``.
                                      Default: ``https``.
                                    "uri": "str"
                                      # Optional. An optional URI path to redirect to.
                                      Note: if this is specified the whole URI of the
                                      original request will be overwritten to this
                                      value, irrespective of the original request URI
                                      being matched.
                                }
                            }
                        ]
                    },
                    "jobs": [
                        {
                            "build_command": "str",  #
                              Optional. An optional build command to run while building
                              this component from source.
                            "dockerfile_path": "str",  #
                              Optional. The path to the Dockerfile relative to the root
                              of the repo. If set, it will be used to build this
                              component. Otherwise, App Platform will attempt to build
                              it using buildpacks.
                            "environment_slug": "str",  #
                              Optional. An environment slug describing the type of this
                              app. For a full list, please refer to `the product
                              documentation
                              <https://www.digitalocean.com/docs/app-platform/>`_.
                            "envs": [
                                {
                                    "key": "str",
                                      # The variable name. Required.
                                    "scope":
                                      "RUN_AND_BUILD_TIME",  # Optional. Default value
                                      is "RUN_AND_BUILD_TIME". * RUN_TIME: Made
                                      available only at run-time"n* BUILD_TIME: Made
                                      available only at build-time"n*
                                      RUN_AND_BUILD_TIME: Made available at both build
                                      and run-time. Known values are: "UNSET",
                                      "RUN_TIME", "BUILD_TIME", and
                                      "RUN_AND_BUILD_TIME".
                                    "type":
                                      "GENERAL",  # Optional. Default value is
                                      "GENERAL". * GENERAL: A plain-text environment
                                      variable"n* SECRET: A secret encrypted
                                      environment variable. Known values are: "GENERAL"
                                      and "SECRET".
                                    "value":
                                      "str"  # Optional. The value. If the type is
                                      ``SECRET``"" , the value will be encrypted on
                                      first submission. On following submissions, the
                                      encrypted value should be used.
                                }
                            ],
                            "git": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "repo_clone_url":
                                  "str"  # Optional. The clone URL of the repo.
                                  Example:
                                  ``https://github.com/digitalocean/sample-golang.git``.
                            },
                            "github": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "gitlab": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "image": {
                                "registry": "str",  #
                                  Optional. The registry name. Must be left empty for
                                  the ``DOCR`` registry type.
                                "registry_type":
                                  "str",  # Optional. * DOCKER_HUB: The DockerHub
                                  container registry type."n* DOCR: The DigitalOcean
                                  container registry type. Known values are:
                                  "DOCKER_HUB" and "DOCR".
                                "repository": "str",
                                  # Optional. The repository name.
                                "tag": "latest"  #
                                  Optional. Default value is "latest". The repository
                                  tag. Defaults to ``latest`` if not provided.
                            },
                            "instance_count": 1,  #
                              Optional. Default value is 1. The amount of instances
                              that this component should be scaled to. Default: 1.
                            "instance_size_slug":
                              "basic-xxs",  # Optional. Default value is "basic-xxs".
                              The instance size to use for this component. Default:
                              ``basic-xxs``. Known values are: "basic-xxs", "basic-xs",
                              "basic-s", "basic-m", "professional-xs",
                              "professional-s", "professional-m", "professional-1l",
                              "professional-l", and "professional-xl".
                            "kind": "UNSPECIFIED",  #
                              Optional. Default value is "UNSPECIFIED". * UNSPECIFIED:
                              Default job type, will auto-complete to POST_DEPLOY
                              kind."n* PRE_DEPLOY: Indicates a job that runs before an
                              app deployment."n* POST_DEPLOY: Indicates a job that runs
                              after an app deployment."n* FAILED_DEPLOY: Indicates a
                              job that runs after a component fails to deploy. Known
                              values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY",
                              and "FAILED_DEPLOY".
                            "log_destinations": {
                                "datadog": {
                                    "api_key":
                                      "str",  # Datadog API key. Required.
                                    "endpoint":
                                      "str"  # Optional. Datadog HTTP log intake
                                      endpoint.
                                },
                                "logtail": {
                                    "token":
                                      "str"  # Optional. Logtail token.
                                },
                                "name": "str",  #
                                  Required.
                                "papertrail": {
                                    "endpoint":
                                      "str"  # Papertrail syslog endpoint. Required.
                                }
                            },
                            "name": "str",  # Optional.
                              The name. Must be unique across all components within the
                              same app.
                            "run_command": "str",  #
                              Optional. An optional run command to override the
                              component's default.
                            "source_dir": "str"  #
                              Optional. An optional path to the working directory to
                              use for the build. For Dockerfile builds, this will be
                              used as the build context. Must be relative to the root
                              of the repo.
                        }
                    ],
                    "name": "str",  # The name of the app. Must
                      be unique across all apps in the same account. Required.
                    "region": "str",  # Optional. The slug form
                      of the geographical origin of the app. Default: ``nearest
                      available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp",
                      "blr", "tor", "lon", and "syd".
                    "services": [
                        {
                            "build_command": "str",  #
                              Optional. An optional build command to run while building
                              this component from source.
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "dockerfile_path": "str",  #
                              Optional. The path to the Dockerfile relative to the root
                              of the repo. If set, it will be used to build this
                              component. Otherwise, App Platform will attempt to build
                              it using buildpacks.
                            "environment_slug": "str",  #
                              Optional. An environment slug describing the type of this
                              app. For a full list, please refer to `the product
                              documentation
                              <https://www.digitalocean.com/docs/app-platform/>`_.
                            "envs": [
                                {
                                    "key": "str",
                                      # The variable name. Required.
                                    "scope":
                                      "RUN_AND_BUILD_TIME",  # Optional. Default value
                                      is "RUN_AND_BUILD_TIME". * RUN_TIME: Made
                                      available only at run-time"n* BUILD_TIME: Made
                                      available only at build-time"n*
                                      RUN_AND_BUILD_TIME: Made available at both build
                                      and run-time. Known values are: "UNSET",
                                      "RUN_TIME", "BUILD_TIME", and
                                      "RUN_AND_BUILD_TIME".
                                    "type":
                                      "GENERAL",  # Optional. Default value is
                                      "GENERAL". * GENERAL: A plain-text environment
                                      variable"n* SECRET: A secret encrypted
                                      environment variable. Known values are: "GENERAL"
                                      and "SECRET".
                                    "value":
                                      "str"  # Optional. The value. If the type is
                                      ``SECRET``"" , the value will be encrypted on
                                      first submission. On following submissions, the
                                      encrypted value should be used.
                                }
                            ],
                            "git": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "repo_clone_url":
                                  "str"  # Optional. The clone URL of the repo.
                                  Example:
                                  ``https://github.com/digitalocean/sample-golang.git``.
                            },
                            "github": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "gitlab": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "health_check": {
                                "failure_threshold":
                                  0,  # Optional. The number of failed health checks
                                  before considered unhealthy.
                                "http_path": "str",
                                  # Optional. The route path used for the HTTP health
                                  check ping. If not set, the HTTP health check will be
                                  disabled and a TCP health check used instead.
"initial_delay_seconds": 0,  # Optional. The number
                                  of seconds to wait before beginning health checks.
                                "period_seconds": 0,
                                  # Optional. The number of seconds to wait between
                                  health checks.
                                "port": 0,  #
                                  Optional. The port on which the health check will be
                                  performed. If not set, the health check will be
                                  performed on the component's http_port.
                                "success_threshold":
                                  0,  # Optional. The number of successful health
                                  checks before considered healthy.
                                "timeout_seconds": 0
                                  # Optional. The number of seconds after which the
                                  check times out.
                            },
                            "http_port": 0,  # Optional.
                              The internal port on which this service's run command
                              will listen. Default: 8080"nIf there is not an
                              environment variable with the name ``PORT``"" , one will
                              be automatically added with its value set to the value of
                              this field.
                            "image": {
                                "registry": "str",  #
                                  Optional. The registry name. Must be left empty for
                                  the ``DOCR`` registry type.
                                "registry_type":
                                  "str",  # Optional. * DOCKER_HUB: The DockerHub
                                  container registry type."n* DOCR: The DigitalOcean
                                  container registry type. Known values are:
                                  "DOCKER_HUB" and "DOCR".
                                "repository": "str",
                                  # Optional. The repository name.
                                "tag": "latest"  #
                                  Optional. Default value is "latest". The repository
                                  tag. Defaults to ``latest`` if not provided.
                            },
                            "instance_count": 1,  #
                              Optional. Default value is 1. The amount of instances
                              that this component should be scaled to. Default: 1.
                            "instance_size_slug":
                              "basic-xxs",  # Optional. Default value is "basic-xxs".
                              The instance size to use for this component. Default:
                              ``basic-xxs``. Known values are: "basic-xxs", "basic-xs",
                              "basic-s", "basic-m", "professional-xs",
                              "professional-s", "professional-m", "professional-1l",
                              "professional-l", and "professional-xl".
                            "internal_ports": [
                                0  # Optional. The
                                  ports on which this service will listen for internal
                                  traffic.
                            ],
                            "log_destinations": {
                                "datadog": {
                                    "api_key":
                                      "str",  # Datadog API key. Required.
                                    "endpoint":
                                      "str"  # Optional. Datadog HTTP log intake
                                      endpoint.
                                },
                                "logtail": {
                                    "token":
                                      "str"  # Optional. Logtail token.
                                },
                                "name": "str",  #
                                  Required.
                                "papertrail": {
                                    "endpoint":
                                      "str"  # Papertrail syslog endpoint. Required.
                                }
                            },
                            "name": "str",  # Optional.
                              The name. Must be unique across all components within the
                              same app.
                            "routes": [
                                {
                                    "path":
                                      "str",  # Optional. An HTTP path prefix. Paths
                                      must start with / and must be unique across all
                                      components within an app.
"preserve_path_prefix": bool  # Optional. An
                                      optional flag to preserve the path that is
                                      forwarded to the backend service. By default, the
                                      HTTP request path will be trimmed from the left
                                      when forwarded to the component. For example, a
                                      component with ``path=/api`` will have requests
                                      to ``/api/list`` trimmed to ``/list``. If this
                                      value is ``true``"" , the path will remain
                                      ``/api/list``.
                                }
                            ],
                            "run_command": "str",  #
                              Optional. An optional run command to override the
                              component's default.
                            "source_dir": "str"  #
                              Optional. An optional path to the working directory to
                              use for the build. For Dockerfile builds, this will be
                              used as the build context. Must be relative to the root
                              of the repo.
                        }
                    ],
                    "static_sites": [
                        {
                            "build_command": "str",  #
                              Optional. An optional build command to run while building
                              this component from source.
                            "catchall_document": "str",
                              # Optional. The name of the document to use as the
                              fallback for any requests to documents that are not found
                              when serving this static site. Only 1 of
                              ``catchall_document`` or ``error_document`` can be set.
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "dockerfile_path": "str",  #
                              Optional. The path to the Dockerfile relative to the root
                              of the repo. If set, it will be used to build this
                              component. Otherwise, App Platform will attempt to build
                              it using buildpacks.
                            "environment_slug": "str",  #
                              Optional. An environment slug describing the type of this
                              app. For a full list, please refer to `the product
                              documentation
                              <https://www.digitalocean.com/docs/app-platform/>`_.
                            "envs": [
                                {
                                    "key": "str",
                                      # The variable name. Required.
                                    "scope":
                                      "RUN_AND_BUILD_TIME",  # Optional. Default value
                                      is "RUN_AND_BUILD_TIME". * RUN_TIME: Made
                                      available only at run-time"n* BUILD_TIME: Made
                                      available only at build-time"n*
                                      RUN_AND_BUILD_TIME: Made available at both build
                                      and run-time. Known values are: "UNSET",
                                      "RUN_TIME", "BUILD_TIME", and
                                      "RUN_AND_BUILD_TIME".
                                    "type":
                                      "GENERAL",  # Optional. Default value is
                                      "GENERAL". * GENERAL: A plain-text environment
                                      variable"n* SECRET: A secret encrypted
                                      environment variable. Known values are: "GENERAL"
                                      and "SECRET".
                                    "value":
                                      "str"  # Optional. The value. If the type is
                                      ``SECRET``"" , the value will be encrypted on
                                      first submission. On following submissions, the
                                      encrypted value should be used.
                                }
                            ],
                            "error_document": "404.html",
                              # Optional. Default value is "404.html". The name of the
                              error document to use when serving this static site.
                              Default: 404.html. If no such file exists within the
                              built assets, App Platform will supply one.
                            "git": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "repo_clone_url":
                                  "str"  # Optional. The clone URL of the repo.
                                  Example:
                                  ``https://github.com/digitalocean/sample-golang.git``.
                            },
                            "github": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "gitlab": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "image": {
                                "registry": "str",  #
                                  Optional. The registry name. Must be left empty for
                                  the ``DOCR`` registry type.
                                "registry_type":
                                  "str",  # Optional. * DOCKER_HUB: The DockerHub
                                  container registry type."n* DOCR: The DigitalOcean
                                  container registry type. Known values are:
                                  "DOCKER_HUB" and "DOCR".
                                "repository": "str",
                                  # Optional. The repository name.
                                "tag": "latest"  #
                                  Optional. Default value is "latest". The repository
                                  tag. Defaults to ``latest`` if not provided.
                            },
                            "index_document":
                              "index.html",  # Optional. Default value is "index.html".
                              The name of the index document to use when serving this
                              static site. Default: index.html.
                            "log_destinations": {
                                "datadog": {
                                    "api_key":
                                      "str",  # Datadog API key. Required.
                                    "endpoint":
                                      "str"  # Optional. Datadog HTTP log intake
                                      endpoint.
                                },
                                "logtail": {
                                    "token":
                                      "str"  # Optional. Logtail token.
                                },
                                "name": "str",  #
                                  Required.
                                "papertrail": {
                                    "endpoint":
                                      "str"  # Papertrail syslog endpoint. Required.
                                }
                            },
                            "name": "str",  # Optional.
                              The name. Must be unique across all components within the
                              same app.
                            "output_dir": "str",  #
                              Optional. An optional path to where the built assets will
                              be located, relative to the build context. If not set,
                              App Platform will automatically scan for these directory
                              names: ``_static``"" , ``dist``"" , ``public``"" ,
                              ``build``.
                            "routes": [
                                {
                                    "path":
                                      "str",  # Optional. An HTTP path prefix. Paths
                                      must start with / and must be unique across all
                                      components within an app.
"preserve_path_prefix": bool  # Optional. An
                                      optional flag to preserve the path that is
                                      forwarded to the backend service. By default, the
                                      HTTP request path will be trimmed from the left
                                      when forwarded to the component. For example, a
                                      component with ``path=/api`` will have requests
                                      to ``/api/list`` trimmed to ``/list``. If this
                                      value is ``true``"" , the path will remain
                                      ``/api/list``.
                                }
                            ],
                            "run_command": "str",  #
                              Optional. An optional run command to override the
                              component's default.
                            "source_dir": "str"  #
                              Optional. An optional path to the working directory to
                              use for the build. For Dockerfile builds, this will be
                              used as the build context. Must be relative to the root
                              of the repo.
                        }
                    ],
                    "workers": [
                        {
                            "build_command": "str",  #
                              Optional. An optional build command to run while building
                              this component from source.
                            "dockerfile_path": "str",  #
                              Optional. The path to the Dockerfile relative to the root
                              of the repo. If set, it will be used to build this
                              component. Otherwise, App Platform will attempt to build
                              it using buildpacks.
                            "environment_slug": "str",  #
                              Optional. An environment slug describing the type of this
                              app. For a full list, please refer to `the product
                              documentation
                              <https://www.digitalocean.com/docs/app-platform/>`_.
                            "envs": [
                                {
                                    "key": "str",
                                      # The variable name. Required.
                                    "scope":
                                      "RUN_AND_BUILD_TIME",  # Optional. Default value
                                      is "RUN_AND_BUILD_TIME". * RUN_TIME: Made
                                      available only at run-time"n* BUILD_TIME: Made
                                      available only at build-time"n*
                                      RUN_AND_BUILD_TIME: Made available at both build
                                      and run-time. Known values are: "UNSET",
                                      "RUN_TIME", "BUILD_TIME", and
                                      "RUN_AND_BUILD_TIME".
                                    "type":
                                      "GENERAL",  # Optional. Default value is
                                      "GENERAL". * GENERAL: A plain-text environment
                                      variable"n* SECRET: A secret encrypted
                                      environment variable. Known values are: "GENERAL"
                                      and "SECRET".
                                    "value":
                                      "str"  # Optional. The value. If the type is
                                      ``SECRET``"" , the value will be encrypted on
                                      first submission. On following submissions, the
                                      encrypted value should be used.
                                }
                            ],
                            "git": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "repo_clone_url":
                                  "str"  # Optional. The clone URL of the repo.
                                  Example:
                                  ``https://github.com/digitalocean/sample-golang.git``.
                            },
                            "github": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "gitlab": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "image": {
                                "registry": "str",  #
                                  Optional. The registry name. Must be left empty for
                                  the ``DOCR`` registry type.
                                "registry_type":
                                  "str",  # Optional. * DOCKER_HUB: The DockerHub
                                  container registry type."n* DOCR: The DigitalOcean
                                  container registry type. Known values are:
                                  "DOCKER_HUB" and "DOCR".
                                "repository": "str",
                                  # Optional. The repository name.
                                "tag": "latest"  #
                                  Optional. Default value is "latest". The repository
                                  tag. Defaults to ``latest`` if not provided.
                            },
                            "instance_count": 1,  #
                              Optional. Default value is 1. The amount of instances
                              that this component should be scaled to. Default: 1.
                            "instance_size_slug":
                              "basic-xxs",  # Optional. Default value is "basic-xxs".
                              The instance size to use for this component. Default:
                              ``basic-xxs``. Known values are: "basic-xxs", "basic-xs",
                              "basic-s", "basic-m", "professional-xs",
                              "professional-s", "professional-m", "professional-1l",
                              "professional-l", and "professional-xl".
                            "log_destinations": {
                                "datadog": {
                                    "api_key":
                                      "str",  # Datadog API key. Required.
                                    "endpoint":
                                      "str"  # Optional. Datadog HTTP log intake
                                      endpoint.
                                },
                                "logtail": {
                                    "token":
                                      "str"  # Optional. Logtail token.
                                },
                                "name": "str",  #
                                  Required.
                                "papertrail": {
                                    "endpoint":
                                      "str"  # Papertrail syslog endpoint. Required.
                                }
                            },
                            "name": "str",  # Optional.
                              The name. Must be unique across all components within the
                              same app.
                            "run_command": "str",  #
                              Optional. An optional run command to override the
                              component's default.
                            "source_dir": "str"  #
                              Optional. An optional path to the working directory to
                              use for the build. For Dockerfile builds, this will be
                              used as the build context. Must be relative to the root
                              of the repo.
                        }
                    ]
                },
                "static_sites": [
                    {
                        "name": "str",  # Optional. The name
                          of this static site.
                        "source_commit_hash": "str"  #
                          Optional. The commit hash of the repository that was used to
                          build this static site.
                    }
                ],
                "tier_slug": "str",  # Optional. The current pricing
                  tier slug of the deployment.
                "updated_at": "2020-02-20 00:00:00",  # Optional.
                  When the deployment was last updated.
                "workers": [
                    {
                        "name": "str",  # Optional. The name
                          of this worker.
                        "source_commit_hash": "str"  #
                          Optional. The commit hash of the repository that was used to
                          build this worker.
                    }
                ]
            },
            "created_at": "2020-02-20 00:00:00",  # Optional. The
              creation time of the app.
            "default_ingress": "str",  # Optional. The default hostname
              on which the app is accessible.
            "domains": [
                {
                    "certificate_expires_at": "2020-02-20
                      00:00:00",  # Optional. Current SSL certificate expiration time.
                    "id": "str",  # Optional. The ID of the
                      domain.
                    "phase": "UNKNOWN",  # Optional. Default
                      value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING",
                      "CONFIGURING", "ACTIVE", and "ERROR".
                    "progress": {
                        "steps": [
                            {}  # Optional. The steps of
                              the domain's progress.
                        ]
                    },
                    "rotate_validation_records": bool,  #
                      Optional. Validation values have changed and require manual
                      intervention.
                    "spec": {
                        "domain": "str",  # The hostname for
                          the domain. Required.
                        "minimum_tls_version": "str",  #
                          Optional. The minimum version of TLS a client application can
                          use to access resources for the domain.  Must be one of the
                          following values wrapped within quotations: ``"1.2"`` or
                          ``"1.3"``. Known values are: "1.2" and "1.3".
                        "type": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * DEFAULT: The default
                          ``.ondigitalocean.app`` domain assigned to this app"n*
                          PRIMARY: The primary domain for this app that is displayed as
                          the default in the control panel, used in bindable
                          environment variables, and any other places that reference an
                          app's live URL. Only one domain may be set as primary."n*
                          ALIAS: A non-primary domain. Known values are: "UNSPECIFIED",
                          "DEFAULT", "PRIMARY", and "ALIAS".
                        "wildcard": bool,  # Optional.
                          Indicates whether the domain includes all sub-domains, in
                          addition to the given domain.
                        "zone": "str"  # Optional. Optional.
                          If the domain uses DigitalOcean DNS and you would like
                          App"nPlatform to automatically manage it for you, set this to
                          the name of the"ndomain on your account."n"nFor example, If
                          the domain you are adding is ``app.domain.com``"" , the
                          zone"ncould be ``domain.com``.
                    },
                    "validations": [
                        {
                            "txt_name": "str",  #
                              Optional. TXT record name.
                            "txt_value": "str"  #
                              Optional. TXT record value.
                        }
                    ]
                }
            ],
            "id": "str",  # Optional. The ID of the application.
            "in_progress_deployment": {
                "cause": "str",  # Optional. What caused this
                  deployment to be created.
                "cloned_from": "str",  # Optional. The ID of a
                  previous deployment that this deployment was cloned from.
                "created_at": "2020-02-20 00:00:00",  # Optional. The
                  creation time of the deployment.
                "functions": [
                    {
                        "name": "str",  # Optional. The name
                          of this functions component.
                        "namespace": "str",  # Optional. The
                          namespace where the functions are deployed.
                        "source_commit_hash": "str"  #
                          Optional. The commit hash of the repository that was used to
                          build this functions component.
                    }
                ],
                "id": "str",  # Optional. The ID of the deployment.
                "jobs": [
                    {
                        "name": "str",  # Optional. The name
                          of this job.
                        "source_commit_hash": "str"  #
                          Optional. The commit hash of the repository that was used to
                          build this job.
                    }
                ],
                "phase": "UNKNOWN",  # Optional. Default value is
                  "UNKNOWN". Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING",
                  "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and
                  "CANCELED".
                "phase_last_updated_at": "2020-02-20 00:00:00",  #
                  Optional. When the deployment phase was last updated.
                "progress": {
                    "error_steps": 0,  # Optional. Number of
                      unsuccessful steps.
                    "pending_steps": 0,  # Optional. Number of
                      pending steps.
                    "running_steps": 0,  # Optional. Number of
                      currently running steps.
                    "steps": [
                        {
                            "component_name": "str",  #
                              Optional. The component name that this step is associated
                              with.
                            "ended_at": "2020-02-20
                              00:00:00",  # Optional. The end time of this step.
                            "message_base": "str",  #
                              Optional. The base of a human-readable description of the
                              step intended to be combined with the component name for
                              presentation. For example:"n"n``message_base`` =
                              "Building service""n``component_name`` = "api".
                            "name": "str",  # Optional.
                              The name of this step.
                            "reason": {
                                "code": "str",  #
                                  Optional. The error code.
                                "message": "str"  #
                                  Optional. The error message.
                            },
                            "started_at": "2020-02-20
                              00:00:00",  # Optional. The start time of this step.
                            "status": "UNKNOWN",  #
                              Optional. Default value is "UNKNOWN". Known values are:
                              "UNKNOWN", "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                            "steps": [
                                {}  # Optional. Child
                                  steps of this step.
                            ]
                        }
                    ],
                    "success_steps": 0,  # Optional. Number of
                      successful steps.
                    "summary_steps": [
                        {
                            "component_name": "str",  #
                              Optional. The component name that this step is associated
                              with.
                            "ended_at": "2020-02-20
                              00:00:00",  # Optional. The end time of this step.
                            "message_base": "str",  #
                              Optional. The base of a human-readable description of the
                              step intended to be combined with the component name for
                              presentation. For example:"n"n``message_base`` =
                              "Building service""n``component_name`` = "api".
                            "name": "str",  # Optional.
                              The name of this step.
                            "reason": {
                                "code": "str",  #
                                  Optional. The error code.
                                "message": "str"  #
                                  Optional. The error message.
                            },
                            "started_at": "2020-02-20
                              00:00:00",  # Optional. The start time of this step.
                            "status": "UNKNOWN",  #
                              Optional. Default value is "UNKNOWN". Known values are:
                              "UNKNOWN", "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                            "steps": [
                                {}  # Optional. Child
                                  steps of this step.
                            ]
                        }
                    ],
                    "total_steps": 0  # Optional. Total number of
                      steps.
                },
                "services": [
                    {
                        "name": "str",  # Optional. The name
                          of this service.
                        "source_commit_hash": "str"  #
                          Optional. The commit hash of the repository that was used to
                          build this service.
                    }
                ],
                "spec": {
                    "databases": [
                        {
                            "cluster_name": "str",  #
                              Optional. The name of the underlying DigitalOcean DBaaS
                              cluster. This is required for production databases. For
                              dev databases, if cluster_name is not set, a new cluster
                              will be provisioned.
                            "db_name": "str",  #
                              Optional. The name of the MySQL or PostgreSQL database to
                              configure.
                            "db_user": "str",  #
                              Optional. The name of the MySQL or PostgreSQL user to
                              configure.
                            "engine": "UNSET",  #
                              Optional. Default value is "UNSET". * MYSQL: MySQL"n* PG:
                              PostgreSQL"n* REDIS: Redis. Known values are: "UNSET",
                              "MYSQL", "PG", and "REDIS".
                            "name": "str",  # The name.
                              Must be unique across all components within the same app.
                              Required.
                            "production": bool,  #
                              Optional. Whether this is a production or dev database.
                            "version": "str"  # Optional.
                              The version of the database engine.
                        }
                    ],
                    "domains": [
                        {
                            "domain": "str",  # The
                              hostname for the domain. Required.
                            "minimum_tls_version": "str",
                              # Optional. The minimum version of TLS a client
                              application can use to access resources for the domain.
                              Must be one of the following values wrapped within
                              quotations: ``"1.2"`` or ``"1.3"``. Known values are:
                              "1.2" and "1.3".
                            "type": "UNSPECIFIED",  #
                              Optional. Default value is "UNSPECIFIED". * DEFAULT: The
                              default ``.ondigitalocean.app`` domain assigned to this
                              app"n* PRIMARY: The primary domain for this app that is
                              displayed as the default in the control panel, used in
                              bindable environment variables, and any other places that
                              reference an app's live URL. Only one domain may be set
                              as primary."n* ALIAS: A non-primary domain. Known values
                              are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS".
                            "wildcard": bool,  #
                              Optional. Indicates whether the domain includes all
                              sub-domains, in addition to the given domain.
                            "zone": "str"  # Optional.
                              Optional. If the domain uses DigitalOcean DNS and you
                              would like App"nPlatform to automatically manage it for
                              you, set this to the name of the"ndomain on your
                              account."n"nFor example, If the domain you are adding is
                              ``app.domain.com``"" , the zone"ncould be ``domain.com``.
                        }
                    ],
                    "functions": [
                        {
                            "alerts": [
                                {
                                    "disabled":
                                      bool,  # Optional. Is the alert disabled?.
                                    "operator":
                                      "UNSPECIFIED_OPERATOR",  # Optional. Default
                                      value is "UNSPECIFIED_OPERATOR". Known values
                                      are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and
                                      "LESS_THAN".
                                    "rule":
                                      "UNSPECIFIED_RULE",  # Optional. Default value is
                                      "UNSPECIFIED_RULE". Known values are:
                                      "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                                      "MEM_UTILIZATION", "RESTART_COUNT",
                                      "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE",
                                      "DOMAIN_FAILED", "DOMAIN_LIVE",
                                      "FUNCTIONS_ACTIVATION_COUNT",
                                      "FUNCTIONS_AVERAGE_DURATION_MS",
                                      "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                                      "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                                      "FUNCTIONS_ERROR_COUNT", and
                                      "FUNCTIONS_GB_RATE_PER_SECOND".
                                    "value": 0.0,
                                      # Optional. Threshold value for alert.
                                    "window":
                                      "UNSPECIFIED_WINDOW"  # Optional. Default value
                                      is "UNSPECIFIED_WINDOW". Known values are:
                                      "UNSPECIFIED_WINDOW", "FIVE_MINUTES",
                                      "TEN_MINUTES", "THIRTY_MINUTES", and "ONE_HOUR".
                                }
                            ],
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "envs": [
                                {
                                    "key": "str",
                                      # The variable name. Required.
                                    "scope":
                                      "RUN_AND_BUILD_TIME",  # Optional. Default value
                                      is "RUN_AND_BUILD_TIME". * RUN_TIME: Made
                                      available only at run-time"n* BUILD_TIME: Made
                                      available only at build-time"n*
                                      RUN_AND_BUILD_TIME: Made available at both build
                                      and run-time. Known values are: "UNSET",
                                      "RUN_TIME", "BUILD_TIME", and
                                      "RUN_AND_BUILD_TIME".
                                    "type":
                                      "GENERAL",  # Optional. Default value is
                                      "GENERAL". * GENERAL: A plain-text environment
                                      variable"n* SECRET: A secret encrypted
                                      environment variable. Known values are: "GENERAL"
                                      and "SECRET".
                                    "value":
                                      "str"  # Optional. The value. If the type is
                                      ``SECRET``"" , the value will be encrypted on
                                      first submission. On following submissions, the
                                      encrypted value should be used.
                                }
                            ],
                            "git": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "repo_clone_url":
                                  "str"  # Optional. The clone URL of the repo.
                                  Example:
                                  ``https://github.com/digitalocean/sample-golang.git``.
                            },
                            "github": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "gitlab": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "log_destinations": {
                                "datadog": {
                                    "api_key":
                                      "str",  # Datadog API key. Required.
                                    "endpoint":
                                      "str"  # Optional. Datadog HTTP log intake
                                      endpoint.
                                },
                                "logtail": {
                                    "token":
                                      "str"  # Optional. Logtail token.
                                },
                                "name": "str",  #
                                  Required.
                                "papertrail": {
                                    "endpoint":
                                      "str"  # Papertrail syslog endpoint. Required.
                                }
                            },
                            "name": "str",  # The name.
                              Must be unique across all components within the same app.
                              Required.
                            "routes": [
                                {
                                    "path":
                                      "str",  # Optional. An HTTP path prefix. Paths
                                      must start with / and must be unique across all
                                      components within an app.
"preserve_path_prefix": bool  # Optional. An
                                      optional flag to preserve the path that is
                                      forwarded to the backend service. By default, the
                                      HTTP request path will be trimmed from the left
                                      when forwarded to the component. For example, a
                                      component with ``path=/api`` will have requests
                                      to ``/api/list`` trimmed to ``/list``. If this
                                      value is ``true``"" , the path will remain
                                      ``/api/list``.
                                }
                            ],
                            "source_dir": "str"  #
                              Optional. An optional path to the working directory to
                              use for the build. For Dockerfile builds, this will be
                              used as the build context. Must be relative to the root
                              of the repo.
                        }
                    ],
                    "ingress": {
                        "rules": [
                            {
                                "component": {
                                    "name":
                                      "str",  # The name of the component to route to.
                                      Required.
"preserve_path_prefix": "str",  # Optional. An
                                      optional flag to preserve the path that is
                                      forwarded to the backend service. By default, the
                                      HTTP request path will be trimmed from the left
                                      when forwarded to the component. For example, a
                                      component with ``path=/api`` will have requests
                                      to ``/api/list`` trimmed to ``/list``. If this
                                      value is ``true``"" , the path will remain
                                      ``/api/list``. Note: this is not applicable for
                                      Functions Components and is mutually exclusive
                                      with ``rewrite``.
                                    "rewrite":
                                      "str"  # Optional. An optional field that will
                                      rewrite the path of the component to be what is
                                      specified here. By default, the HTTP request path
                                      will be trimmed from the left when forwarded to
                                      the component. For example, a component with
                                      ``path=/api`` will have requests to ``/api/list``
                                      trimmed to ``/list``. If you specified the
                                      rewrite to be ``/v1/``"" , requests to
                                      ``/api/list`` would be rewritten to ``/v1/list``.
                                      Note: this is mutually exclusive with
                                      ``preserve_path_prefix``.
                                },
                                "cors": {
"allow_credentials": bool,  # Optional. Whether
                                      browsers should expose the response to the
                                      client-side JavaScript code when the
                                      request"u2019s credentials mode is include. This
                                      configures the
                                      ``Access-Control-Allow-Credentials`` header.
"allow_headers": [
                                        "str"
                                          # Optional. The set of allowed HTTP request
                                          headers. This configures the
                                          ``Access-Control-Allow-Headers`` header.
                                    ],
"allow_methods": [
                                        "str"
                                          # Optional. The set of allowed HTTP methods.
                                          This configures the
                                          ``Access-Control-Allow-Methods`` header.
                                    ],
"allow_origins": [
                                        {
"exact": "str",  # Optional. Exact string
                                              match. Only 1 of ``exact``"" ,
                                              ``prefix``"" , or ``regex`` must be set.
"prefix": "str",  # Optional.
                                              Prefix-based match. Only 1 of ``exact``""
                                              , ``prefix``"" , or ``regex`` must be
                                              set.
"regex": "str"  # Optional. RE2 style
                                              regex-based match. Only 1 of ``exact``""
                                              , ``prefix``"" , or ``regex`` must be
                                              set. For more information about RE2
                                              syntax, see:
                                              https://github.com/google/re2/wiki/Syntax.
                                        }
                                    ],
"expose_headers": [
                                        "str"
                                          # Optional. The set of HTTP response headers
                                          that browsers are allowed to access. This
                                          configures the
                                          ``Access-Control-Expose-Headers`` header.
                                    ],
                                    "max_age":
                                      "str"  # Optional. An optional duration
                                      specifying how long browsers can cache the
                                      results of a preflight request. This configures
                                      the ``Access-Control-Max-Age`` header.
                                },
                                "match": {
                                    "path": {
"prefix": "str"  # Prefix-based match. For
                                          example, ``/api`` will match ``/api``"" ,
                                          ``/api/``"" , and any nested paths such as
                                          ``/api/v1/endpoint``. Required.
                                    }
                                },
                                "redirect": {
                                    "authority":
                                      "str",  # Optional. The authority/host to
                                      redirect to. This can be a hostname or IP
                                      address. Note: use ``port`` to set the port.
                                    "port": 0,  #
                                      Optional. The port to redirect to.
"redirect_code": 0,  # Optional. The redirect
                                      code to use. Defaults to ``302``. Supported
                                      values are 300, 301, 302, 303, 304, 307, 308.
                                    "scheme":
                                      "str",  # Optional. The scheme to redirect to.
                                      Supported values are ``http`` or ``https``.
                                      Default: ``https``.
                                    "uri": "str"
                                      # Optional. An optional URI path to redirect to.
                                      Note: if this is specified the whole URI of the
                                      original request will be overwritten to this
                                      value, irrespective of the original request URI
                                      being matched.
                                }
                            }
                        ]
                    },
                    "jobs": [
                        {
                            "build_command": "str",  #
                              Optional. An optional build command to run while building
                              this component from source.
                            "dockerfile_path": "str",  #
                              Optional. The path to the Dockerfile relative to the root
                              of the repo. If set, it will be used to build this
                              component. Otherwise, App Platform will attempt to build
                              it using buildpacks.
                            "environment_slug": "str",  #
                              Optional. An environment slug describing the type of this
                              app. For a full list, please refer to `the product
                              documentation
                              <https://www.digitalocean.com/docs/app-platform/>`_.
                            "envs": [
                                {
                                    "key": "str",
                                      # The variable name. Required.
                                    "scope":
                                      "RUN_AND_BUILD_TIME",  # Optional. Default value
                                      is "RUN_AND_BUILD_TIME". * RUN_TIME: Made
                                      available only at run-time"n* BUILD_TIME: Made
                                      available only at build-time"n*
                                      RUN_AND_BUILD_TIME: Made available at both build
                                      and run-time. Known values are: "UNSET",
                                      "RUN_TIME", "BUILD_TIME", and
                                      "RUN_AND_BUILD_TIME".
                                    "type":
                                      "GENERAL",  # Optional. Default value is
                                      "GENERAL". * GENERAL: A plain-text environment
                                      variable"n* SECRET: A secret encrypted
                                      environment variable. Known values are: "GENERAL"
                                      and "SECRET".
                                    "value":
                                      "str"  # Optional. The value. If the type is
                                      ``SECRET``"" , the value will be encrypted on
                                      first submission. On following submissions, the
                                      encrypted value should be used.
                                }
                            ],
                            "git": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "repo_clone_url":
                                  "str"  # Optional. The clone URL of the repo.
                                  Example:
                                  ``https://github.com/digitalocean/sample-golang.git``.
                            },
                            "github": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "gitlab": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "image": {
                                "registry": "str",  #
                                  Optional. The registry name. Must be left empty for
                                  the ``DOCR`` registry type.
                                "registry_type":
                                  "str",  # Optional. * DOCKER_HUB: The DockerHub
                                  container registry type."n* DOCR: The DigitalOcean
                                  container registry type. Known values are:
                                  "DOCKER_HUB" and "DOCR".
                                "repository": "str",
                                  # Optional. The repository name.
                                "tag": "latest"  #
                                  Optional. Default value is "latest". The repository
                                  tag. Defaults to ``latest`` if not provided.
                            },
                            "instance_count": 1,  #
                              Optional. Default value is 1. The amount of instances
                              that this component should be scaled to. Default: 1.
                            "instance_size_slug":
                              "basic-xxs",  # Optional. Default value is "basic-xxs".
                              The instance size to use for this component. Default:
                              ``basic-xxs``. Known values are: "basic-xxs", "basic-xs",
                              "basic-s", "basic-m", "professional-xs",
                              "professional-s", "professional-m", "professional-1l",
                              "professional-l", and "professional-xl".
                            "kind": "UNSPECIFIED",  #
                              Optional. Default value is "UNSPECIFIED". * UNSPECIFIED:
                              Default job type, will auto-complete to POST_DEPLOY
                              kind."n* PRE_DEPLOY: Indicates a job that runs before an
                              app deployment."n* POST_DEPLOY: Indicates a job that runs
                              after an app deployment."n* FAILED_DEPLOY: Indicates a
                              job that runs after a component fails to deploy. Known
                              values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY",
                              and "FAILED_DEPLOY".
                            "log_destinations": {
                                "datadog": {
                                    "api_key":
                                      "str",  # Datadog API key. Required.
                                    "endpoint":
                                      "str"  # Optional. Datadog HTTP log intake
                                      endpoint.
                                },
                                "logtail": {
                                    "token":
                                      "str"  # Optional. Logtail token.
                                },
                                "name": "str",  #
                                  Required.
                                "papertrail": {
                                    "endpoint":
                                      "str"  # Papertrail syslog endpoint. Required.
                                }
                            },
                            "name": "str",  # Optional.
                              The name. Must be unique across all components within the
                              same app.
                            "run_command": "str",  #
                              Optional. An optional run command to override the
                              component's default.
                            "source_dir": "str"  #
                              Optional. An optional path to the working directory to
                              use for the build. For Dockerfile builds, this will be
                              used as the build context. Must be relative to the root
                              of the repo.
                        }
                    ],
                    "name": "str",  # The name of the app. Must
                      be unique across all apps in the same account. Required.
                    "region": "str",  # Optional. The slug form
                      of the geographical origin of the app. Default: ``nearest
                      available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp",
                      "blr", "tor", "lon", and "syd".
                    "services": [
                        {
                            "build_command": "str",  #
                              Optional. An optional build command to run while building
                              this component from source.
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "dockerfile_path": "str",  #
                              Optional. The path to the Dockerfile relative to the root
                              of the repo. If set, it will be used to build this
                              component. Otherwise, App Platform will attempt to build
                              it using buildpacks.
                            "environment_slug": "str",  #
                              Optional. An environment slug describing the type of this
                              app. For a full list, please refer to `the product
                              documentation
                              <https://www.digitalocean.com/docs/app-platform/>`_.
                            "envs": [
                                {
                                    "key": "str",
                                      # The variable name. Required.
                                    "scope":
                                      "RUN_AND_BUILD_TIME",  # Optional. Default value
                                      is "RUN_AND_BUILD_TIME". * RUN_TIME: Made
                                      available only at run-time"n* BUILD_TIME: Made
                                      available only at build-time"n*
                                      RUN_AND_BUILD_TIME: Made available at both build
                                      and run-time. Known values are: "UNSET",
                                      "RUN_TIME", "BUILD_TIME", and
                                      "RUN_AND_BUILD_TIME".
                                    "type":
                                      "GENERAL",  # Optional. Default value is
                                      "GENERAL". * GENERAL: A plain-text environment
                                      variable"n* SECRET: A secret encrypted
                                      environment variable. Known values are: "GENERAL"
                                      and "SECRET".
                                    "value":
                                      "str"  # Optional. The value. If the type is
                                      ``SECRET``"" , the value will be encrypted on
                                      first submission. On following submissions, the
                                      encrypted value should be used.
                                }
                            ],
                            "git": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "repo_clone_url":
                                  "str"  # Optional. The clone URL of the repo.
                                  Example:
                                  ``https://github.com/digitalocean/sample-golang.git``.
                            },
                            "github": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "gitlab": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "health_check": {
                                "failure_threshold":
                                  0,  # Optional. The number of failed health checks
                                  before considered unhealthy.
                                "http_path": "str",
                                  # Optional. The route path used for the HTTP health
                                  check ping. If not set, the HTTP health check will be
                                  disabled and a TCP health check used instead.
"initial_delay_seconds": 0,  # Optional. The number
                                  of seconds to wait before beginning health checks.
                                "period_seconds": 0,
                                  # Optional. The number of seconds to wait between
                                  health checks.
                                "port": 0,  #
                                  Optional. The port on which the health check will be
                                  performed. If not set, the health check will be
                                  performed on the component's http_port.
                                "success_threshold":
                                  0,  # Optional. The number of successful health
                                  checks before considered healthy.
                                "timeout_seconds": 0
                                  # Optional. The number of seconds after which the
                                  check times out.
                            },
                            "http_port": 0,  # Optional.
                              The internal port on which this service's run command
                              will listen. Default: 8080"nIf there is not an
                              environment variable with the name ``PORT``"" , one will
                              be automatically added with its value set to the value of
                              this field.
                            "image": {
                                "registry": "str",  #
                                  Optional. The registry name. Must be left empty for
                                  the ``DOCR`` registry type.
                                "registry_type":
                                  "str",  # Optional. * DOCKER_HUB: The DockerHub
                                  container registry type."n* DOCR: The DigitalOcean
                                  container registry type. Known values are:
                                  "DOCKER_HUB" and "DOCR".
                                "repository": "str",
                                  # Optional. The repository name.
                                "tag": "latest"  #
                                  Optional. Default value is "latest". The repository
                                  tag. Defaults to ``latest`` if not provided.
                            },
                            "instance_count": 1,  #
                              Optional. Default value is 1. The amount of instances
                              that this component should be scaled to. Default: 1.
                            "instance_size_slug":
                              "basic-xxs",  # Optional. Default value is "basic-xxs".
                              The instance size to use for this component. Default:
                              ``basic-xxs``. Known values are: "basic-xxs", "basic-xs",
                              "basic-s", "basic-m", "professional-xs",
                              "professional-s", "professional-m", "professional-1l",
                              "professional-l", and "professional-xl".
                            "internal_ports": [
                                0  # Optional. The
                                  ports on which this service will listen for internal
                                  traffic.
                            ],
                            "log_destinations": {
                                "datadog": {
                                    "api_key":
                                      "str",  # Datadog API key. Required.
                                    "endpoint":
                                      "str"  # Optional. Datadog HTTP log intake
                                      endpoint.
                                },
                                "logtail": {
                                    "token":
                                      "str"  # Optional. Logtail token.
                                },
                                "name": "str",  #
                                  Required.
                                "papertrail": {
                                    "endpoint":
                                      "str"  # Papertrail syslog endpoint. Required.
                                }
                            },
                            "name": "str",  # Optional.
                              The name. Must be unique across all components within the
                              same app.
                            "routes": [
                                {
                                    "path":
                                      "str",  # Optional. An HTTP path prefix. Paths
                                      must start with / and must be unique across all
                                      components within an app.
"preserve_path_prefix": bool  # Optional. An
                                      optional flag to preserve the path that is
                                      forwarded to the backend service. By default, the
                                      HTTP request path will be trimmed from the left
                                      when forwarded to the component. For example, a
                                      component with ``path=/api`` will have requests
                                      to ``/api/list`` trimmed to ``/list``. If this
                                      value is ``true``"" , the path will remain
                                      ``/api/list``.
                                }
                            ],
                            "run_command": "str",  #
                              Optional. An optional run command to override the
                              component's default.
                            "source_dir": "str"  #
                              Optional. An optional path to the working directory to
                              use for the build. For Dockerfile builds, this will be
                              used as the build context. Must be relative to the root
                              of the repo.
                        }
                    ],
                    "static_sites": [
                        {
                            "build_command": "str",  #
                              Optional. An optional build command to run while building
                              this component from source.
                            "catchall_document": "str",
                              # Optional. The name of the document to use as the
                              fallback for any requests to documents that are not found
                              when serving this static site. Only 1 of
                              ``catchall_document`` or ``error_document`` can be set.
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "dockerfile_path": "str",  #
                              Optional. The path to the Dockerfile relative to the root
                              of the repo. If set, it will be used to build this
                              component. Otherwise, App Platform will attempt to build
                              it using buildpacks.
                            "environment_slug": "str",  #
                              Optional. An environment slug describing the type of this
                              app. For a full list, please refer to `the product
                              documentation
                              <https://www.digitalocean.com/docs/app-platform/>`_.
                            "envs": [
                                {
                                    "key": "str",
                                      # The variable name. Required.
                                    "scope":
                                      "RUN_AND_BUILD_TIME",  # Optional. Default value
                                      is "RUN_AND_BUILD_TIME". * RUN_TIME: Made
                                      available only at run-time"n* BUILD_TIME: Made
                                      available only at build-time"n*
                                      RUN_AND_BUILD_TIME: Made available at both build
                                      and run-time. Known values are: "UNSET",
                                      "RUN_TIME", "BUILD_TIME", and
                                      "RUN_AND_BUILD_TIME".
                                    "type":
                                      "GENERAL",  # Optional. Default value is
                                      "GENERAL". * GENERAL: A plain-text environment
                                      variable"n* SECRET: A secret encrypted
                                      environment variable. Known values are: "GENERAL"
                                      and "SECRET".
                                    "value":
                                      "str"  # Optional. The value. If the type is
                                      ``SECRET``"" , the value will be encrypted on
                                      first submission. On following submissions, the
                                      encrypted value should be used.
                                }
                            ],
                            "error_document": "404.html",
                              # Optional. Default value is "404.html". The name of the
                              error document to use when serving this static site.
                              Default: 404.html. If no such file exists within the
                              built assets, App Platform will supply one.
                            "git": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "repo_clone_url":
                                  "str"  # Optional. The clone URL of the repo.
                                  Example:
                                  ``https://github.com/digitalocean/sample-golang.git``.
                            },
                            "github": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "gitlab": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "image": {
                                "registry": "str",  #
                                  Optional. The registry name. Must be left empty for
                                  the ``DOCR`` registry type.
                                "registry_type":
                                  "str",  # Optional. * DOCKER_HUB: The DockerHub
                                  container registry type."n* DOCR: The DigitalOcean
                                  container registry type. Known values are:
                                  "DOCKER_HUB" and "DOCR".
                                "repository": "str",
                                  # Optional. The repository name.
                                "tag": "latest"  #
                                  Optional. Default value is "latest". The repository
                                  tag. Defaults to ``latest`` if not provided.
                            },
                            "index_document":
                              "index.html",  # Optional. Default value is "index.html".
                              The name of the index document to use when serving this
                              static site. Default: index.html.
                            "log_destinations": {
                                "datadog": {
                                    "api_key":
                                      "str",  # Datadog API key. Required.
                                    "endpoint":
                                      "str"  # Optional. Datadog HTTP log intake
                                      endpoint.
                                },
                                "logtail": {
                                    "token":
                                      "str"  # Optional. Logtail token.
                                },
                                "name": "str",  #
                                  Required.
                                "papertrail": {
                                    "endpoint":
                                      "str"  # Papertrail syslog endpoint. Required.
                                }
                            },
                            "name": "str",  # Optional.
                              The name. Must be unique across all components within the
                              same app.
                            "output_dir": "str",  #
                              Optional. An optional path to where the built assets will
                              be located, relative to the build context. If not set,
                              App Platform will automatically scan for these directory
                              names: ``_static``"" , ``dist``"" , ``public``"" ,
                              ``build``.
                            "routes": [
                                {
                                    "path":
                                      "str",  # Optional. An HTTP path prefix. Paths
                                      must start with / and must be unique across all
                                      components within an app.
"preserve_path_prefix": bool  # Optional. An
                                      optional flag to preserve the path that is
                                      forwarded to the backend service. By default, the
                                      HTTP request path will be trimmed from the left
                                      when forwarded to the component. For example, a
                                      component with ``path=/api`` will have requests
                                      to ``/api/list`` trimmed to ``/list``. If this
                                      value is ``true``"" , the path will remain
                                      ``/api/list``.
                                }
                            ],
                            "run_command": "str",  #
                              Optional. An optional run command to override the
                              component's default.
                            "source_dir": "str"  #
                              Optional. An optional path to the working directory to
                              use for the build. For Dockerfile builds, this will be
                              used as the build context. Must be relative to the root
                              of the repo.
                        }
                    ],
                    "workers": [
                        {
                            "build_command": "str",  #
                              Optional. An optional build command to run while building
                              this component from source.
                            "dockerfile_path": "str",  #
                              Optional. The path to the Dockerfile relative to the root
                              of the repo. If set, it will be used to build this
                              component. Otherwise, App Platform will attempt to build
                              it using buildpacks.
                            "environment_slug": "str",  #
                              Optional. An environment slug describing the type of this
                              app. For a full list, please refer to `the product
                              documentation
                              <https://www.digitalocean.com/docs/app-platform/>`_.
                            "envs": [
                                {
                                    "key": "str",
                                      # The variable name. Required.
                                    "scope":
                                      "RUN_AND_BUILD_TIME",  # Optional. Default value
                                      is "RUN_AND_BUILD_TIME". * RUN_TIME: Made
                                      available only at run-time"n* BUILD_TIME: Made
                                      available only at build-time"n*
                                      RUN_AND_BUILD_TIME: Made available at both build
                                      and run-time. Known values are: "UNSET",
                                      "RUN_TIME", "BUILD_TIME", and
                                      "RUN_AND_BUILD_TIME".
                                    "type":
                                      "GENERAL",  # Optional. Default value is
                                      "GENERAL". * GENERAL: A plain-text environment
                                      variable"n* SECRET: A secret encrypted
                                      environment variable. Known values are: "GENERAL"
                                      and "SECRET".
                                    "value":
                                      "str"  # Optional. The value. If the type is
                                      ``SECRET``"" , the value will be encrypted on
                                      first submission. On following submissions, the
                                      encrypted value should be used.
                                }
                            ],
                            "git": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "repo_clone_url":
                                  "str"  # Optional. The clone URL of the repo.
                                  Example:
                                  ``https://github.com/digitalocean/sample-golang.git``.
                            },
                            "github": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "gitlab": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "image": {
                                "registry": "str",  #
                                  Optional. The registry name. Must be left empty for
                                  the ``DOCR`` registry type.
                                "registry_type":
                                  "str",  # Optional. * DOCKER_HUB: The DockerHub
                                  container registry type."n* DOCR: The DigitalOcean
                                  container registry type. Known values are:
                                  "DOCKER_HUB" and "DOCR".
                                "repository": "str",
                                  # Optional. The repository name.
                                "tag": "latest"  #
                                  Optional. Default value is "latest". The repository
                                  tag. Defaults to ``latest`` if not provided.
                            },
                            "instance_count": 1,  #
                              Optional. Default value is 1. The amount of instances
                              that this component should be scaled to. Default: 1.
                            "instance_size_slug":
                              "basic-xxs",  # Optional. Default value is "basic-xxs".
                              The instance size to use for this component. Default:
                              ``basic-xxs``. Known values are: "basic-xxs", "basic-xs",
                              "basic-s", "basic-m", "professional-xs",
                              "professional-s", "professional-m", "professional-1l",
                              "professional-l", and "professional-xl".
                            "log_destinations": {
                                "datadog": {
                                    "api_key":
                                      "str",  # Datadog API key. Required.
                                    "endpoint":
                                      "str"  # Optional. Datadog HTTP log intake
                                      endpoint.
                                },
                                "logtail": {
                                    "token":
                                      "str"  # Optional. Logtail token.
                                },
                                "name": "str",  #
                                  Required.
                                "papertrail": {
                                    "endpoint":
                                      "str"  # Papertrail syslog endpoint. Required.
                                }
                            },
                            "name": "str",  # Optional.
                              The name. Must be unique across all components within the
                              same app.
                            "run_command": "str",  #
                              Optional. An optional run command to override the
                              component's default.
                            "source_dir": "str"  #
                              Optional. An optional path to the working directory to
                              use for the build. For Dockerfile builds, this will be
                              used as the build context. Must be relative to the root
                              of the repo.
                        }
                    ]
                },
                "static_sites": [
                    {
                        "name": "str",  # Optional. The name
                          of this static site.
                        "source_commit_hash": "str"  #
                          Optional. The commit hash of the repository that was used to
                          build this static site.
                    }
                ],
                "tier_slug": "str",  # Optional. The current pricing
                  tier slug of the deployment.
                "updated_at": "2020-02-20 00:00:00",  # Optional.
                  When the deployment was last updated.
                "workers": [
                    {
                        "name": "str",  # Optional. The name
                          of this worker.
                        "source_commit_hash": "str"  #
                          Optional. The commit hash of the repository that was used to
                          build this worker.
                    }
                ]
            },
            "last_deployment_created_at": "2020-02-20 00:00:00",  #
              Optional. The creation time of the last deployment.
            "live_domain": "str",  # Optional. The live domain of the
              app.
            "live_url": "str",  # Optional. The live URL of the app.
            "live_url_base": "str",  # Optional. The live URL base of the
              app, the URL excluding the path.
            "owner_uuid": "str",  # Optional. The ID of the account to
              which the application belongs.
            "pending_deployment": {
                "cause": "str",  # Optional. What caused this
                  deployment to be created.
                "cloned_from": "str",  # Optional. The ID of a
                  previous deployment that this deployment was cloned from.
                "created_at": "2020-02-20 00:00:00",  # Optional. The
                  creation time of the deployment.
                "functions": [
                    {
                        "name": "str",  # Optional. The name
                          of this functions component.
                        "namespace": "str",  # Optional. The
                          namespace where the functions are deployed.
                        "source_commit_hash": "str"  #
                          Optional. The commit hash of the repository that was used to
                          build this functions component.
                    }
                ],
                "id": "str",  # Optional. The ID of the deployment.
                "jobs": [
                    {
                        "name": "str",  # Optional. The name
                          of this job.
                        "source_commit_hash": "str"  #
                          Optional. The commit hash of the repository that was used to
                          build this job.
                    }
                ],
                "phase": "UNKNOWN",  # Optional. Default value is
                  "UNKNOWN". Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING",
                  "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and
                  "CANCELED".
                "phase_last_updated_at": "2020-02-20 00:00:00",  #
                  Optional. When the deployment phase was last updated.
                "progress": {
                    "error_steps": 0,  # Optional. Number of
                      unsuccessful steps.
                    "pending_steps": 0,  # Optional. Number of
                      pending steps.
                    "running_steps": 0,  # Optional. Number of
                      currently running steps.
                    "steps": [
                        {
                            "component_name": "str",  #
                              Optional. The component name that this step is associated
                              with.
                            "ended_at": "2020-02-20
                              00:00:00",  # Optional. The end time of this step.
                            "message_base": "str",  #
                              Optional. The base of a human-readable description of the
                              step intended to be combined with the component name for
                              presentation. For example:"n"n``message_base`` =
                              "Building service""n``component_name`` = "api".
                            "name": "str",  # Optional.
                              The name of this step.
                            "reason": {
                                "code": "str",  #
                                  Optional. The error code.
                                "message": "str"  #
                                  Optional. The error message.
                            },
                            "started_at": "2020-02-20
                              00:00:00",  # Optional. The start time of this step.
                            "status": "UNKNOWN",  #
                              Optional. Default value is "UNKNOWN". Known values are:
                              "UNKNOWN", "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                            "steps": [
                                {}  # Optional. Child
                                  steps of this step.
                            ]
                        }
                    ],
                    "success_steps": 0,  # Optional. Number of
                      successful steps.
                    "summary_steps": [
                        {
                            "component_name": "str",  #
                              Optional. The component name that this step is associated
                              with.
                            "ended_at": "2020-02-20
                              00:00:00",  # Optional. The end time of this step.
                            "message_base": "str",  #
                              Optional. The base of a human-readable description of the
                              step intended to be combined with the component name for
                              presentation. For example:"n"n``message_base`` =
                              "Building service""n``component_name`` = "api".
                            "name": "str",  # Optional.
                              The name of this step.
                            "reason": {
                                "code": "str",  #
                                  Optional. The error code.
                                "message": "str"  #
                                  Optional. The error message.
                            },
                            "started_at": "2020-02-20
                              00:00:00",  # Optional. The start time of this step.
                            "status": "UNKNOWN",  #
                              Optional. Default value is "UNKNOWN". Known values are:
                              "UNKNOWN", "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                            "steps": [
                                {}  # Optional. Child
                                  steps of this step.
                            ]
                        }
                    ],
                    "total_steps": 0  # Optional. Total number of
                      steps.
                },
                "services": [
                    {
                        "name": "str",  # Optional. The name
                          of this service.
                        "source_commit_hash": "str"  #
                          Optional. The commit hash of the repository that was used to
                          build this service.
                    }
                ],
                "spec": {
                    "databases": [
                        {
                            "cluster_name": "str",  #
                              Optional. The name of the underlying DigitalOcean DBaaS
                              cluster. This is required for production databases. For
                              dev databases, if cluster_name is not set, a new cluster
                              will be provisioned.
                            "db_name": "str",  #
                              Optional. The name of the MySQL or PostgreSQL database to
                              configure.
                            "db_user": "str",  #
                              Optional. The name of the MySQL or PostgreSQL user to
                              configure.
                            "engine": "UNSET",  #
                              Optional. Default value is "UNSET". * MYSQL: MySQL"n* PG:
                              PostgreSQL"n* REDIS: Redis. Known values are: "UNSET",
                              "MYSQL", "PG", and "REDIS".
                            "name": "str",  # The name.
                              Must be unique across all components within the same app.
                              Required.
                            "production": bool,  #
                              Optional. Whether this is a production or dev database.
                            "version": "str"  # Optional.
                              The version of the database engine.
                        }
                    ],
                    "domains": [
                        {
                            "domain": "str",  # The
                              hostname for the domain. Required.
                            "minimum_tls_version": "str",
                              # Optional. The minimum version of TLS a client
                              application can use to access resources for the domain.
                              Must be one of the following values wrapped within
                              quotations: ``"1.2"`` or ``"1.3"``. Known values are:
                              "1.2" and "1.3".
                            "type": "UNSPECIFIED",  #
                              Optional. Default value is "UNSPECIFIED". * DEFAULT: The
                              default ``.ondigitalocean.app`` domain assigned to this
                              app"n* PRIMARY: The primary domain for this app that is
                              displayed as the default in the control panel, used in
                              bindable environment variables, and any other places that
                              reference an app's live URL. Only one domain may be set
                              as primary."n* ALIAS: A non-primary domain. Known values
                              are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS".
                            "wildcard": bool,  #
                              Optional. Indicates whether the domain includes all
                              sub-domains, in addition to the given domain.
                            "zone": "str"  # Optional.
                              Optional. If the domain uses DigitalOcean DNS and you
                              would like App"nPlatform to automatically manage it for
                              you, set this to the name of the"ndomain on your
                              account."n"nFor example, If the domain you are adding is
                              ``app.domain.com``"" , the zone"ncould be ``domain.com``.
                        }
                    ],
                    "functions": [
                        {
                            "alerts": [
                                {
                                    "disabled":
                                      bool,  # Optional. Is the alert disabled?.
                                    "operator":
                                      "UNSPECIFIED_OPERATOR",  # Optional. Default
                                      value is "UNSPECIFIED_OPERATOR". Known values
                                      are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and
                                      "LESS_THAN".
                                    "rule":
                                      "UNSPECIFIED_RULE",  # Optional. Default value is
                                      "UNSPECIFIED_RULE". Known values are:
                                      "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                                      "MEM_UTILIZATION", "RESTART_COUNT",
                                      "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE",
                                      "DOMAIN_FAILED", "DOMAIN_LIVE",
                                      "FUNCTIONS_ACTIVATION_COUNT",
                                      "FUNCTIONS_AVERAGE_DURATION_MS",
                                      "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                                      "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                                      "FUNCTIONS_ERROR_COUNT", and
                                      "FUNCTIONS_GB_RATE_PER_SECOND".
                                    "value": 0.0,
                                      # Optional. Threshold value for alert.
                                    "window":
                                      "UNSPECIFIED_WINDOW"  # Optional. Default value
                                      is "UNSPECIFIED_WINDOW". Known values are:
                                      "UNSPECIFIED_WINDOW", "FIVE_MINUTES",
                                      "TEN_MINUTES", "THIRTY_MINUTES", and "ONE_HOUR".
                                }
                            ],
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "envs": [
                                {
                                    "key": "str",
                                      # The variable name. Required.
                                    "scope":
                                      "RUN_AND_BUILD_TIME",  # Optional. Default value
                                      is "RUN_AND_BUILD_TIME". * RUN_TIME: Made
                                      available only at run-time"n* BUILD_TIME: Made
                                      available only at build-time"n*
                                      RUN_AND_BUILD_TIME: Made available at both build
                                      and run-time. Known values are: "UNSET",
                                      "RUN_TIME", "BUILD_TIME", and
                                      "RUN_AND_BUILD_TIME".
                                    "type":
                                      "GENERAL",  # Optional. Default value is
                                      "GENERAL". * GENERAL: A plain-text environment
                                      variable"n* SECRET: A secret encrypted
                                      environment variable. Known values are: "GENERAL"
                                      and "SECRET".
                                    "value":
                                      "str"  # Optional. The value. If the type is
                                      ``SECRET``"" , the value will be encrypted on
                                      first submission. On following submissions, the
                                      encrypted value should be used.
                                }
                            ],
                            "git": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "repo_clone_url":
                                  "str"  # Optional. The clone URL of the repo.
                                  Example:
                                  ``https://github.com/digitalocean/sample-golang.git``.
                            },
                            "github": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "gitlab": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "log_destinations": {
                                "datadog": {
                                    "api_key":
                                      "str",  # Datadog API key. Required.
                                    "endpoint":
                                      "str"  # Optional. Datadog HTTP log intake
                                      endpoint.
                                },
                                "logtail": {
                                    "token":
                                      "str"  # Optional. Logtail token.
                                },
                                "name": "str",  #
                                  Required.
                                "papertrail": {
                                    "endpoint":
                                      "str"  # Papertrail syslog endpoint. Required.
                                }
                            },
                            "name": "str",  # The name.
                              Must be unique across all components within the same app.
                              Required.
                            "routes": [
                                {
                                    "path":
                                      "str",  # Optional. An HTTP path prefix. Paths
                                      must start with / and must be unique across all
                                      components within an app.
"preserve_path_prefix": bool  # Optional. An
                                      optional flag to preserve the path that is
                                      forwarded to the backend service. By default, the
                                      HTTP request path will be trimmed from the left
                                      when forwarded to the component. For example, a
                                      component with ``path=/api`` will have requests
                                      to ``/api/list`` trimmed to ``/list``. If this
                                      value is ``true``"" , the path will remain
                                      ``/api/list``.
                                }
                            ],
                            "source_dir": "str"  #
                              Optional. An optional path to the working directory to
                              use for the build. For Dockerfile builds, this will be
                              used as the build context. Must be relative to the root
                              of the repo.
                        }
                    ],
                    "ingress": {
                        "rules": [
                            {
                                "component": {
                                    "name":
                                      "str",  # The name of the component to route to.
                                      Required.
"preserve_path_prefix": "str",  # Optional. An
                                      optional flag to preserve the path that is
                                      forwarded to the backend service. By default, the
                                      HTTP request path will be trimmed from the left
                                      when forwarded to the component. For example, a
                                      component with ``path=/api`` will have requests
                                      to ``/api/list`` trimmed to ``/list``. If this
                                      value is ``true``"" , the path will remain
                                      ``/api/list``. Note: this is not applicable for
                                      Functions Components and is mutually exclusive
                                      with ``rewrite``.
                                    "rewrite":
                                      "str"  # Optional. An optional field that will
                                      rewrite the path of the component to be what is
                                      specified here. By default, the HTTP request path
                                      will be trimmed from the left when forwarded to
                                      the component. For example, a component with
                                      ``path=/api`` will have requests to ``/api/list``
                                      trimmed to ``/list``. If you specified the
                                      rewrite to be ``/v1/``"" , requests to
                                      ``/api/list`` would be rewritten to ``/v1/list``.
                                      Note: this is mutually exclusive with
                                      ``preserve_path_prefix``.
                                },
                                "cors": {
"allow_credentials": bool,  # Optional. Whether
                                      browsers should expose the response to the
                                      client-side JavaScript code when the
                                      request"u2019s credentials mode is include. This
                                      configures the
                                      ``Access-Control-Allow-Credentials`` header.
"allow_headers": [
                                        "str"
                                          # Optional. The set of allowed HTTP request
                                          headers. This configures the
                                          ``Access-Control-Allow-Headers`` header.
                                    ],
"allow_methods": [
                                        "str"
                                          # Optional. The set of allowed HTTP methods.
                                          This configures the
                                          ``Access-Control-Allow-Methods`` header.
                                    ],
"allow_origins": [
                                        {
"exact": "str",  # Optional. Exact string
                                              match. Only 1 of ``exact``"" ,
                                              ``prefix``"" , or ``regex`` must be set.
"prefix": "str",  # Optional.
                                              Prefix-based match. Only 1 of ``exact``""
                                              , ``prefix``"" , or ``regex`` must be
                                              set.
"regex": "str"  # Optional. RE2 style
                                              regex-based match. Only 1 of ``exact``""
                                              , ``prefix``"" , or ``regex`` must be
                                              set. For more information about RE2
                                              syntax, see:
                                              https://github.com/google/re2/wiki/Syntax.
                                        }
                                    ],
"expose_headers": [
                                        "str"
                                          # Optional. The set of HTTP response headers
                                          that browsers are allowed to access. This
                                          configures the
                                          ``Access-Control-Expose-Headers`` header.
                                    ],
                                    "max_age":
                                      "str"  # Optional. An optional duration
                                      specifying how long browsers can cache the
                                      results of a preflight request. This configures
                                      the ``Access-Control-Max-Age`` header.
                                },
                                "match": {
                                    "path": {
"prefix": "str"  # Prefix-based match. For
                                          example, ``/api`` will match ``/api``"" ,
                                          ``/api/``"" , and any nested paths such as
                                          ``/api/v1/endpoint``. Required.
                                    }
                                },
                                "redirect": {
                                    "authority":
                                      "str",  # Optional. The authority/host to
                                      redirect to. This can be a hostname or IP
                                      address. Note: use ``port`` to set the port.
                                    "port": 0,  #
                                      Optional. The port to redirect to.
"redirect_code": 0,  # Optional. The redirect
                                      code to use. Defaults to ``302``. Supported
                                      values are 300, 301, 302, 303, 304, 307, 308.
                                    "scheme":
                                      "str",  # Optional. The scheme to redirect to.
                                      Supported values are ``http`` or ``https``.
                                      Default: ``https``.
                                    "uri": "str"
                                      # Optional. An optional URI path to redirect to.
                                      Note: if this is specified the whole URI of the
                                      original request will be overwritten to this
                                      value, irrespective of the original request URI
                                      being matched.
                                }
                            }
                        ]
                    },
                    "jobs": [
                        {
                            "build_command": "str",  #
                              Optional. An optional build command to run while building
                              this component from source.
                            "dockerfile_path": "str",  #
                              Optional. The path to the Dockerfile relative to the root
                              of the repo. If set, it will be used to build this
                              component. Otherwise, App Platform will attempt to build
                              it using buildpacks.
                            "environment_slug": "str",  #
                              Optional. An environment slug describing the type of this
                              app. For a full list, please refer to `the product
                              documentation
                              <https://www.digitalocean.com/docs/app-platform/>`_.
                            "envs": [
                                {
                                    "key": "str",
                                      # The variable name. Required.
                                    "scope":
                                      "RUN_AND_BUILD_TIME",  # Optional. Default value
                                      is "RUN_AND_BUILD_TIME". * RUN_TIME: Made
                                      available only at run-time"n* BUILD_TIME: Made
                                      available only at build-time"n*
                                      RUN_AND_BUILD_TIME: Made available at both build
                                      and run-time. Known values are: "UNSET",
                                      "RUN_TIME", "BUILD_TIME", and
                                      "RUN_AND_BUILD_TIME".
                                    "type":
                                      "GENERAL",  # Optional. Default value is
                                      "GENERAL". * GENERAL: A plain-text environment
                                      variable"n* SECRET: A secret encrypted
                                      environment variable. Known values are: "GENERAL"
                                      and "SECRET".
                                    "value":
                                      "str"  # Optional. The value. If the type is
                                      ``SECRET``"" , the value will be encrypted on
                                      first submission. On following submissions, the
                                      encrypted value should be used.
                                }
                            ],
                            "git": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "repo_clone_url":
                                  "str"  # Optional. The clone URL of the repo.
                                  Example:
                                  ``https://github.com/digitalocean/sample-golang.git``.
                            },
                            "github": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "gitlab": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "image": {
                                "registry": "str",  #
                                  Optional. The registry name. Must be left empty for
                                  the ``DOCR`` registry type.
                                "registry_type":
                                  "str",  # Optional. * DOCKER_HUB: The DockerHub
                                  container registry type."n* DOCR: The DigitalOcean
                                  container registry type. Known values are:
                                  "DOCKER_HUB" and "DOCR".
                                "repository": "str",
                                  # Optional. The repository name.
                                "tag": "latest"  #
                                  Optional. Default value is "latest". The repository
                                  tag. Defaults to ``latest`` if not provided.
                            },
                            "instance_count": 1,  #
                              Optional. Default value is 1. The amount of instances
                              that this component should be scaled to. Default: 1.
                            "instance_size_slug":
                              "basic-xxs",  # Optional. Default value is "basic-xxs".
                              The instance size to use for this component. Default:
                              ``basic-xxs``. Known values are: "basic-xxs", "basic-xs",
                              "basic-s", "basic-m", "professional-xs",
                              "professional-s", "professional-m", "professional-1l",
                              "professional-l", and "professional-xl".
                            "kind": "UNSPECIFIED",  #
                              Optional. Default value is "UNSPECIFIED". * UNSPECIFIED:
                              Default job type, will auto-complete to POST_DEPLOY
                              kind."n* PRE_DEPLOY: Indicates a job that runs before an
                              app deployment."n* POST_DEPLOY: Indicates a job that runs
                              after an app deployment."n* FAILED_DEPLOY: Indicates a
                              job that runs after a component fails to deploy. Known
                              values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY",
                              and "FAILED_DEPLOY".
                            "log_destinations": {
                                "datadog": {
                                    "api_key":
                                      "str",  # Datadog API key. Required.
                                    "endpoint":
                                      "str"  # Optional. Datadog HTTP log intake
                                      endpoint.
                                },
                                "logtail": {
                                    "token":
                                      "str"  # Optional. Logtail token.
                                },
                                "name": "str",  #
                                  Required.
                                "papertrail": {
                                    "endpoint":
                                      "str"  # Papertrail syslog endpoint. Required.
                                }
                            },
                            "name": "str",  # Optional.
                              The name. Must be unique across all components within the
                              same app.
                            "run_command": "str",  #
                              Optional. An optional run command to override the
                              component's default.
                            "source_dir": "str"  #
                              Optional. An optional path to the working directory to
                              use for the build. For Dockerfile builds, this will be
                              used as the build context. Must be relative to the root
                              of the repo.
                        }
                    ],
                    "name": "str",  # The name of the app. Must
                      be unique across all apps in the same account. Required.
                    "region": "str",  # Optional. The slug form
                      of the geographical origin of the app. Default: ``nearest
                      available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp",
                      "blr", "tor", "lon", and "syd".
                    "services": [
                        {
                            "build_command": "str",  #
                              Optional. An optional build command to run while building
                              this component from source.
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "dockerfile_path": "str",  #
                              Optional. The path to the Dockerfile relative to the root
                              of the repo. If set, it will be used to build this
                              component. Otherwise, App Platform will attempt to build
                              it using buildpacks.
                            "environment_slug": "str",  #
                              Optional. An environment slug describing the type of this
                              app. For a full list, please refer to `the product
                              documentation
                              <https://www.digitalocean.com/docs/app-platform/>`_.
                            "envs": [
                                {
                                    "key": "str",
                                      # The variable name. Required.
                                    "scope":
                                      "RUN_AND_BUILD_TIME",  # Optional. Default value
                                      is "RUN_AND_BUILD_TIME". * RUN_TIME: Made
                                      available only at run-time"n* BUILD_TIME: Made
                                      available only at build-time"n*
                                      RUN_AND_BUILD_TIME: Made available at both build
                                      and run-time. Known values are: "UNSET",
                                      "RUN_TIME", "BUILD_TIME", and
                                      "RUN_AND_BUILD_TIME".
                                    "type":
                                      "GENERAL",  # Optional. Default value is
                                      "GENERAL". * GENERAL: A plain-text environment
                                      variable"n* SECRET: A secret encrypted
                                      environment variable. Known values are: "GENERAL"
                                      and "SECRET".
                                    "value":
                                      "str"  # Optional. The value. If the type is
                                      ``SECRET``"" , the value will be encrypted on
                                      first submission. On following submissions, the
                                      encrypted value should be used.
                                }
                            ],
                            "git": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "repo_clone_url":
                                  "str"  # Optional. The clone URL of the repo.
                                  Example:
                                  ``https://github.com/digitalocean/sample-golang.git``.
                            },
                            "github": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "gitlab": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "health_check": {
                                "failure_threshold":
                                  0,  # Optional. The number of failed health checks
                                  before considered unhealthy.
                                "http_path": "str",
                                  # Optional. The route path used for the HTTP health
                                  check ping. If not set, the HTTP health check will be
                                  disabled and a TCP health check used instead.
"initial_delay_seconds": 0,  # Optional. The number
                                  of seconds to wait before beginning health checks.
                                "period_seconds": 0,
                                  # Optional. The number of seconds to wait between
                                  health checks.
                                "port": 0,  #
                                  Optional. The port on which the health check will be
                                  performed. If not set, the health check will be
                                  performed on the component's http_port.
                                "success_threshold":
                                  0,  # Optional. The number of successful health
                                  checks before considered healthy.
                                "timeout_seconds": 0
                                  # Optional. The number of seconds after which the
                                  check times out.
                            },
                            "http_port": 0,  # Optional.
                              The internal port on which this service's run command
                              will listen. Default: 8080"nIf there is not an
                              environment variable with the name ``PORT``"" , one will
                              be automatically added with its value set to the value of
                              this field.
                            "image": {
                                "registry": "str",  #
                                  Optional. The registry name. Must be left empty for
                                  the ``DOCR`` registry type.
                                "registry_type":
                                  "str",  # Optional. * DOCKER_HUB: The DockerHub
                                  container registry type."n* DOCR: The DigitalOcean
                                  container registry type. Known values are:
                                  "DOCKER_HUB" and "DOCR".
                                "repository": "str",
                                  # Optional. The repository name.
                                "tag": "latest"  #
                                  Optional. Default value is "latest". The repository
                                  tag. Defaults to ``latest`` if not provided.
                            },
                            "instance_count": 1,  #
                              Optional. Default value is 1. The amount of instances
                              that this component should be scaled to. Default: 1.
                            "instance_size_slug":
                              "basic-xxs",  # Optional. Default value is "basic-xxs".
                              The instance size to use for this component. Default:
                              ``basic-xxs``. Known values are: "basic-xxs", "basic-xs",
                              "basic-s", "basic-m", "professional-xs",
                              "professional-s", "professional-m", "professional-1l",
                              "professional-l", and "professional-xl".
                            "internal_ports": [
                                0  # Optional. The
                                  ports on which this service will listen for internal
                                  traffic.
                            ],
                            "log_destinations": {
                                "datadog": {
                                    "api_key":
                                      "str",  # Datadog API key. Required.
                                    "endpoint":
                                      "str"  # Optional. Datadog HTTP log intake
                                      endpoint.
                                },
                                "logtail": {
                                    "token":
                                      "str"  # Optional. Logtail token.
                                },
                                "name": "str",  #
                                  Required.
                                "papertrail": {
                                    "endpoint":
                                      "str"  # Papertrail syslog endpoint. Required.
                                }
                            },
                            "name": "str",  # Optional.
                              The name. Must be unique across all components within the
                              same app.
                            "routes": [
                                {
                                    "path":
                                      "str",  # Optional. An HTTP path prefix. Paths
                                      must start with / and must be unique across all
                                      components within an app.
"preserve_path_prefix": bool  # Optional. An
                                      optional flag to preserve the path that is
                                      forwarded to the backend service. By default, the
                                      HTTP request path will be trimmed from the left
                                      when forwarded to the component. For example, a
                                      component with ``path=/api`` will have requests
                                      to ``/api/list`` trimmed to ``/list``. If this
                                      value is ``true``"" , the path will remain
                                      ``/api/list``.
                                }
                            ],
                            "run_command": "str",  #
                              Optional. An optional run command to override the
                              component's default.
                            "source_dir": "str"  #
                              Optional. An optional path to the working directory to
                              use for the build. For Dockerfile builds, this will be
                              used as the build context. Must be relative to the root
                              of the repo.
                        }
                    ],
                    "static_sites": [
                        {
                            "build_command": "str",  #
                              Optional. An optional build command to run while building
                              this component from source.
                            "catchall_document": "str",
                              # Optional. The name of the document to use as the
                              fallback for any requests to documents that are not found
                              when serving this static site. Only 1 of
                              ``catchall_document`` or ``error_document`` can be set.
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "dockerfile_path": "str",  #
                              Optional. The path to the Dockerfile relative to the root
                              of the repo. If set, it will be used to build this
                              component. Otherwise, App Platform will attempt to build
                              it using buildpacks.
                            "environment_slug": "str",  #
                              Optional. An environment slug describing the type of this
                              app. For a full list, please refer to `the product
                              documentation
                              <https://www.digitalocean.com/docs/app-platform/>`_.
                            "envs": [
                                {
                                    "key": "str",
                                      # The variable name. Required.
                                    "scope":
                                      "RUN_AND_BUILD_TIME",  # Optional. Default value
                                      is "RUN_AND_BUILD_TIME". * RUN_TIME: Made
                                      available only at run-time"n* BUILD_TIME: Made
                                      available only at build-time"n*
                                      RUN_AND_BUILD_TIME: Made available at both build
                                      and run-time. Known values are: "UNSET",
                                      "RUN_TIME", "BUILD_TIME", and
                                      "RUN_AND_BUILD_TIME".
                                    "type":
                                      "GENERAL",  # Optional. Default value is
                                      "GENERAL". * GENERAL: A plain-text environment
                                      variable"n* SECRET: A secret encrypted
                                      environment variable. Known values are: "GENERAL"
                                      and "SECRET".
                                    "value":
                                      "str"  # Optional. The value. If the type is
                                      ``SECRET``"" , the value will be encrypted on
                                      first submission. On following submissions, the
                                      encrypted value should be used.
                                }
                            ],
                            "error_document": "404.html",
                              # Optional. Default value is "404.html". The name of the
                              error document to use when serving this static site.
                              Default: 404.html. If no such file exists within the
                              built assets, App Platform will supply one.
                            "git": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "repo_clone_url":
                                  "str"  # Optional. The clone URL of the repo.
                                  Example:
                                  ``https://github.com/digitalocean/sample-golang.git``.
                            },
                            "github": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "gitlab": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "image": {
                                "registry": "str",  #
                                  Optional. The registry name. Must be left empty for
                                  the ``DOCR`` registry type.
                                "registry_type":
                                  "str",  # Optional. * DOCKER_HUB: The DockerHub
                                  container registry type."n* DOCR: The DigitalOcean
                                  container registry type. Known values are:
                                  "DOCKER_HUB" and "DOCR".
                                "repository": "str",
                                  # Optional. The repository name.
                                "tag": "latest"  #
                                  Optional. Default value is "latest". The repository
                                  tag. Defaults to ``latest`` if not provided.
                            },
                            "index_document":
                              "index.html",  # Optional. Default value is "index.html".
                              The name of the index document to use when serving this
                              static site. Default: index.html.
                            "log_destinations": {
                                "datadog": {
                                    "api_key":
                                      "str",  # Datadog API key. Required.
                                    "endpoint":
                                      "str"  # Optional. Datadog HTTP log intake
                                      endpoint.
                                },
                                "logtail": {
                                    "token":
                                      "str"  # Optional. Logtail token.
                                },
                                "name": "str",  #
                                  Required.
                                "papertrail": {
                                    "endpoint":
                                      "str"  # Papertrail syslog endpoint. Required.
                                }
                            },
                            "name": "str",  # Optional.
                              The name. Must be unique across all components within the
                              same app.
                            "output_dir": "str",  #
                              Optional. An optional path to where the built assets will
                              be located, relative to the build context. If not set,
                              App Platform will automatically scan for these directory
                              names: ``_static``"" , ``dist``"" , ``public``"" ,
                              ``build``.
                            "routes": [
                                {
                                    "path":
                                      "str",  # Optional. An HTTP path prefix. Paths
                                      must start with / and must be unique across all
                                      components within an app.
"preserve_path_prefix": bool  # Optional. An
                                      optional flag to preserve the path that is
                                      forwarded to the backend service. By default, the
                                      HTTP request path will be trimmed from the left
                                      when forwarded to the component. For example, a
                                      component with ``path=/api`` will have requests
                                      to ``/api/list`` trimmed to ``/list``. If this
                                      value is ``true``"" , the path will remain
                                      ``/api/list``.
                                }
                            ],
                            "run_command": "str",  #
                              Optional. An optional run command to override the
                              component's default.
                            "source_dir": "str"  #
                              Optional. An optional path to the working directory to
                              use for the build. For Dockerfile builds, this will be
                              used as the build context. Must be relative to the root
                              of the repo.
                        }
                    ],
                    "workers": [
                        {
                            "build_command": "str",  #
                              Optional. An optional build command to run while building
                              this component from source.
                            "dockerfile_path": "str",  #
                              Optional. The path to the Dockerfile relative to the root
                              of the repo. If set, it will be used to build this
                              component. Otherwise, App Platform will attempt to build
                              it using buildpacks.
                            "environment_slug": "str",  #
                              Optional. An environment slug describing the type of this
                              app. For a full list, please refer to `the product
                              documentation
                              <https://www.digitalocean.com/docs/app-platform/>`_.
                            "envs": [
                                {
                                    "key": "str",
                                      # The variable name. Required.
                                    "scope":
                                      "RUN_AND_BUILD_TIME",  # Optional. Default value
                                      is "RUN_AND_BUILD_TIME". * RUN_TIME: Made
                                      available only at run-time"n* BUILD_TIME: Made
                                      available only at build-time"n*
                                      RUN_AND_BUILD_TIME: Made available at both build
                                      and run-time. Known values are: "UNSET",
                                      "RUN_TIME", "BUILD_TIME", and
                                      "RUN_AND_BUILD_TIME".
                                    "type":
                                      "GENERAL",  # Optional. Default value is
                                      "GENERAL". * GENERAL: A plain-text environment
                                      variable"n* SECRET: A secret encrypted
                                      environment variable. Known values are: "GENERAL"
                                      and "SECRET".
                                    "value":
                                      "str"  # Optional. The value. If the type is
                                      ``SECRET``"" , the value will be encrypted on
                                      first submission. On following submissions, the
                                      encrypted value should be used.
                                }
                            ],
                            "git": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "repo_clone_url":
                                  "str"  # Optional. The clone URL of the repo.
                                  Example:
                                  ``https://github.com/digitalocean/sample-golang.git``.
                            },
                            "github": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "gitlab": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "image": {
                                "registry": "str",  #
                                  Optional. The registry name. Must be left empty for
                                  the ``DOCR`` registry type.
                                "registry_type":
                                  "str",  # Optional. * DOCKER_HUB: The DockerHub
                                  container registry type."n* DOCR: The DigitalOcean
                                  container registry type. Known values are:
                                  "DOCKER_HUB" and "DOCR".
                                "repository": "str",
                                  # Optional. The repository name.
                                "tag": "latest"  #
                                  Optional. Default value is "latest". The repository
                                  tag. Defaults to ``latest`` if not provided.
                            },
                            "instance_count": 1,  #
                              Optional. Default value is 1. The amount of instances
                              that this component should be scaled to. Default: 1.
                            "instance_size_slug":
                              "basic-xxs",  # Optional. Default value is "basic-xxs".
                              The instance size to use for this component. Default:
                              ``basic-xxs``. Known values are: "basic-xxs", "basic-xs",
                              "basic-s", "basic-m", "professional-xs",
                              "professional-s", "professional-m", "professional-1l",
                              "professional-l", and "professional-xl".
                            "log_destinations": {
                                "datadog": {
                                    "api_key":
                                      "str",  # Datadog API key. Required.
                                    "endpoint":
                                      "str"  # Optional. Datadog HTTP log intake
                                      endpoint.
                                },
                                "logtail": {
                                    "token":
                                      "str"  # Optional. Logtail token.
                                },
                                "name": "str",  #
                                  Required.
                                "papertrail": {
                                    "endpoint":
                                      "str"  # Papertrail syslog endpoint. Required.
                                }
                            },
                            "name": "str",  # Optional.
                              The name. Must be unique across all components within the
                              same app.
                            "run_command": "str",  #
                              Optional. An optional run command to override the
                              component's default.
                            "source_dir": "str"  #
                              Optional. An optional path to the working directory to
                              use for the build. For Dockerfile builds, this will be
                              used as the build context. Must be relative to the root
                              of the repo.
                        }
                    ]
                },
                "static_sites": [
                    {
                        "name": "str",  # Optional. The name
                          of this static site.
                        "source_commit_hash": "str"  #
                          Optional. The commit hash of the repository that was used to
                          build this static site.
                    }
                ],
                "tier_slug": "str",  # Optional. The current pricing
                  tier slug of the deployment.
                "updated_at": "2020-02-20 00:00:00",  # Optional.
                  When the deployment was last updated.
                "workers": [
                    {
                        "name": "str",  # Optional. The name
                          of this worker.
                        "source_commit_hash": "str"  #
                          Optional. The commit hash of the repository that was used to
                          build this worker.
                    }
                ]
            },
            "pinned_deployment": {
                "cause": "str",  # Optional. What caused this
                  deployment to be created.
                "cloned_from": "str",  # Optional. The ID of a
                  previous deployment that this deployment was cloned from.
                "created_at": "2020-02-20 00:00:00",  # Optional. The
                  creation time of the deployment.
                "functions": [
                    {
                        "name": "str",  # Optional. The name
                          of this functions component.
                        "namespace": "str",  # Optional. The
                          namespace where the functions are deployed.
                        "source_commit_hash": "str"  #
                          Optional. The commit hash of the repository that was used to
                          build this functions component.
                    }
                ],
                "id": "str",  # Optional. The ID of the deployment.
                "jobs": [
                    {
                        "name": "str",  # Optional. The name
                          of this job.
                        "source_commit_hash": "str"  #
                          Optional. The commit hash of the repository that was used to
                          build this job.
                    }
                ],
                "phase": "UNKNOWN",  # Optional. Default value is
                  "UNKNOWN". Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING",
                  "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and
                  "CANCELED".
                "phase_last_updated_at": "2020-02-20 00:00:00",  #
                  Optional. When the deployment phase was last updated.
                "progress": {
                    "error_steps": 0,  # Optional. Number of
                      unsuccessful steps.
                    "pending_steps": 0,  # Optional. Number of
                      pending steps.
                    "running_steps": 0,  # Optional. Number of
                      currently running steps.
                    "steps": [
                        {
                            "component_name": "str",  #
                              Optional. The component name that this step is associated
                              with.
                            "ended_at": "2020-02-20
                              00:00:00",  # Optional. The end time of this step.
                            "message_base": "str",  #
                              Optional. The base of a human-readable description of the
                              step intended to be combined with the component name for
                              presentation. For example:"n"n``message_base`` =
                              "Building service""n``component_name`` = "api".
                            "name": "str",  # Optional.
                              The name of this step.
                            "reason": {
                                "code": "str",  #
                                  Optional. The error code.
                                "message": "str"  #
                                  Optional. The error message.
                            },
                            "started_at": "2020-02-20
                              00:00:00",  # Optional. The start time of this step.
                            "status": "UNKNOWN",  #
                              Optional. Default value is "UNKNOWN". Known values are:
                              "UNKNOWN", "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                            "steps": [
                                {}  # Optional. Child
                                  steps of this step.
                            ]
                        }
                    ],
                    "success_steps": 0,  # Optional. Number of
                      successful steps.
                    "summary_steps": [
                        {
                            "component_name": "str",  #
                              Optional. The component name that this step is associated
                              with.
                            "ended_at": "2020-02-20
                              00:00:00",  # Optional. The end time of this step.
                            "message_base": "str",  #
                              Optional. The base of a human-readable description of the
                              step intended to be combined with the component name for
                              presentation. For example:"n"n``message_base`` =
                              "Building service""n``component_name`` = "api".
                            "name": "str",  # Optional.
                              The name of this step.
                            "reason": {
                                "code": "str",  #
                                  Optional. The error code.
                                "message": "str"  #
                                  Optional. The error message.
                            },
                            "started_at": "2020-02-20
                              00:00:00",  # Optional. The start time of this step.
                            "status": "UNKNOWN",  #
                              Optional. Default value is "UNKNOWN". Known values are:
                              "UNKNOWN", "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                            "steps": [
                                {}  # Optional. Child
                                  steps of this step.
                            ]
                        }
                    ],
                    "total_steps": 0  # Optional. Total number of
                      steps.
                },
                "services": [
                    {
                        "name": "str",  # Optional. The name
                          of this service.
                        "source_commit_hash": "str"  #
                          Optional. The commit hash of the repository that was used to
                          build this service.
                    }
                ],
                "spec": {
                    "databases": [
                        {
                            "cluster_name": "str",  #
                              Optional. The name of the underlying DigitalOcean DBaaS
                              cluster. This is required for production databases. For
                              dev databases, if cluster_name is not set, a new cluster
                              will be provisioned.
                            "db_name": "str",  #
                              Optional. The name of the MySQL or PostgreSQL database to
                              configure.
                            "db_user": "str",  #
                              Optional. The name of the MySQL or PostgreSQL user to
                              configure.
                            "engine": "UNSET",  #
                              Optional. Default value is "UNSET". * MYSQL: MySQL"n* PG:
                              PostgreSQL"n* REDIS: Redis. Known values are: "UNSET",
                              "MYSQL", "PG", and "REDIS".
                            "name": "str",  # The name.
                              Must be unique across all components within the same app.
                              Required.
                            "production": bool,  #
                              Optional. Whether this is a production or dev database.
                            "version": "str"  # Optional.
                              The version of the database engine.
                        }
                    ],
                    "domains": [
                        {
                            "domain": "str",  # The
                              hostname for the domain. Required.
                            "minimum_tls_version": "str",
                              # Optional. The minimum version of TLS a client
                              application can use to access resources for the domain.
                              Must be one of the following values wrapped within
                              quotations: ``"1.2"`` or ``"1.3"``. Known values are:
                              "1.2" and "1.3".
                            "type": "UNSPECIFIED",  #
                              Optional. Default value is "UNSPECIFIED". * DEFAULT: The
                              default ``.ondigitalocean.app`` domain assigned to this
                              app"n* PRIMARY: The primary domain for this app that is
                              displayed as the default in the control panel, used in
                              bindable environment variables, and any other places that
                              reference an app's live URL. Only one domain may be set
                              as primary."n* ALIAS: A non-primary domain. Known values
                              are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and "ALIAS".
                            "wildcard": bool,  #
                              Optional. Indicates whether the domain includes all
                              sub-domains, in addition to the given domain.
                            "zone": "str"  # Optional.
                              Optional. If the domain uses DigitalOcean DNS and you
                              would like App"nPlatform to automatically manage it for
                              you, set this to the name of the"ndomain on your
                              account."n"nFor example, If the domain you are adding is
                              ``app.domain.com``"" , the zone"ncould be ``domain.com``.
                        }
                    ],
                    "functions": [
                        {
                            "alerts": [
                                {
                                    "disabled":
                                      bool,  # Optional. Is the alert disabled?.
                                    "operator":
                                      "UNSPECIFIED_OPERATOR",  # Optional. Default
                                      value is "UNSPECIFIED_OPERATOR". Known values
                                      are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and
                                      "LESS_THAN".
                                    "rule":
                                      "UNSPECIFIED_RULE",  # Optional. Default value is
                                      "UNSPECIFIED_RULE". Known values are:
                                      "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                                      "MEM_UTILIZATION", "RESTART_COUNT",
                                      "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE",
                                      "DOMAIN_FAILED", "DOMAIN_LIVE",
                                      "FUNCTIONS_ACTIVATION_COUNT",
                                      "FUNCTIONS_AVERAGE_DURATION_MS",
                                      "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                                      "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                                      "FUNCTIONS_ERROR_COUNT", and
                                      "FUNCTIONS_GB_RATE_PER_SECOND".
                                    "value": 0.0,
                                      # Optional. Threshold value for alert.
                                    "window":
                                      "UNSPECIFIED_WINDOW"  # Optional. Default value
                                      is "UNSPECIFIED_WINDOW". Known values are:
                                      "UNSPECIFIED_WINDOW", "FIVE_MINUTES",
                                      "TEN_MINUTES", "THIRTY_MINUTES", and "ONE_HOUR".
                                }
                            ],
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "envs": [
                                {
                                    "key": "str",
                                      # The variable name. Required.
                                    "scope":
                                      "RUN_AND_BUILD_TIME",  # Optional. Default value
                                      is "RUN_AND_BUILD_TIME". * RUN_TIME: Made
                                      available only at run-time"n* BUILD_TIME: Made
                                      available only at build-time"n*
                                      RUN_AND_BUILD_TIME: Made available at both build
                                      and run-time. Known values are: "UNSET",
                                      "RUN_TIME", "BUILD_TIME", and
                                      "RUN_AND_BUILD_TIME".
                                    "type":
                                      "GENERAL",  # Optional. Default value is
                                      "GENERAL". * GENERAL: A plain-text environment
                                      variable"n* SECRET: A secret encrypted
                                      environment variable. Known values are: "GENERAL"
                                      and "SECRET".
                                    "value":
                                      "str"  # Optional. The value. If the type is
                                      ``SECRET``"" , the value will be encrypted on
                                      first submission. On following submissions, the
                                      encrypted value should be used.
                                }
                            ],
                            "git": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "repo_clone_url":
                                  "str"  # Optional. The clone URL of the repo.
                                  Example:
                                  ``https://github.com/digitalocean/sample-golang.git``.
                            },
                            "github": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "gitlab": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "log_destinations": {
                                "datadog": {
                                    "api_key":
                                      "str",  # Datadog API key. Required.
                                    "endpoint":
                                      "str"  # Optional. Datadog HTTP log intake
                                      endpoint.
                                },
                                "logtail": {
                                    "token":
                                      "str"  # Optional. Logtail token.
                                },
                                "name": "str",  #
                                  Required.
                                "papertrail": {
                                    "endpoint":
                                      "str"  # Papertrail syslog endpoint. Required.
                                }
                            },
                            "name": "str",  # The name.
                              Must be unique across all components within the same app.
                              Required.
                            "routes": [
                                {
                                    "path":
                                      "str",  # Optional. An HTTP path prefix. Paths
                                      must start with / and must be unique across all
                                      components within an app.
"preserve_path_prefix": bool  # Optional. An
                                      optional flag to preserve the path that is
                                      forwarded to the backend service. By default, the
                                      HTTP request path will be trimmed from the left
                                      when forwarded to the component. For example, a
                                      component with ``path=/api`` will have requests
                                      to ``/api/list`` trimmed to ``/list``. If this
                                      value is ``true``"" , the path will remain
                                      ``/api/list``.
                                }
                            ],
                            "source_dir": "str"  #
                              Optional. An optional path to the working directory to
                              use for the build. For Dockerfile builds, this will be
                              used as the build context. Must be relative to the root
                              of the repo.
                        }
                    ],
                    "ingress": {
                        "rules": [
                            {
                                "component": {
                                    "name":
                                      "str",  # The name of the component to route to.
                                      Required.
"preserve_path_prefix": "str",  # Optional. An
                                      optional flag to preserve the path that is
                                      forwarded to the backend service. By default, the
                                      HTTP request path will be trimmed from the left
                                      when forwarded to the component. For example, a
                                      component with ``path=/api`` will have requests
                                      to ``/api/list`` trimmed to ``/list``. If this
                                      value is ``true``"" , the path will remain
                                      ``/api/list``. Note: this is not applicable for
                                      Functions Components and is mutually exclusive
                                      with ``rewrite``.
                                    "rewrite":
                                      "str"  # Optional. An optional field that will
                                      rewrite the path of the component to be what is
                                      specified here. By default, the HTTP request path
                                      will be trimmed from the left when forwarded to
                                      the component. For example, a component with
                                      ``path=/api`` will have requests to ``/api/list``
                                      trimmed to ``/list``. If you specified the
                                      rewrite to be ``/v1/``"" , requests to
                                      ``/api/list`` would be rewritten to ``/v1/list``.
                                      Note: this is mutually exclusive with
                                      ``preserve_path_prefix``.
                                },
                                "cors": {
"allow_credentials": bool,  # Optional. Whether
                                      browsers should expose the response to the
                                      client-side JavaScript code when the
                                      request"u2019s credentials mode is include. This
                                      configures the
                                      ``Access-Control-Allow-Credentials`` header.
"allow_headers": [
                                        "str"
                                          # Optional. The set of allowed HTTP request
                                          headers. This configures the
                                          ``Access-Control-Allow-Headers`` header.
                                    ],
"allow_methods": [
                                        "str"
                                          # Optional. The set of allowed HTTP methods.
                                          This configures the
                                          ``Access-Control-Allow-Methods`` header.
                                    ],
"allow_origins": [
                                        {
"exact": "str",  # Optional. Exact string
                                              match. Only 1 of ``exact``"" ,
                                              ``prefix``"" , or ``regex`` must be set.
"prefix": "str",  # Optional.
                                              Prefix-based match. Only 1 of ``exact``""
                                              , ``prefix``"" , or ``regex`` must be
                                              set.
"regex": "str"  # Optional. RE2 style
                                              regex-based match. Only 1 of ``exact``""
                                              , ``prefix``"" , or ``regex`` must be
                                              set. For more information about RE2
                                              syntax, see:
                                              https://github.com/google/re2/wiki/Syntax.
                                        }
                                    ],
"expose_headers": [
                                        "str"
                                          # Optional. The set of HTTP response headers
                                          that browsers are allowed to access. This
                                          configures the
                                          ``Access-Control-Expose-Headers`` header.
                                    ],
                                    "max_age":
                                      "str"  # Optional. An optional duration
                                      specifying how long browsers can cache the
                                      results of a preflight request. This configures
                                      the ``Access-Control-Max-Age`` header.
                                },
                                "match": {
                                    "path": {
"prefix": "str"  # Prefix-based match. For
                                          example, ``/api`` will match ``/api``"" ,
                                          ``/api/``"" , and any nested paths such as
                                          ``/api/v1/endpoint``. Required.
                                    }
                                },
                                "redirect": {
                                    "authority":
                                      "str",  # Optional. The authority/host to
                                      redirect to. This can be a hostname or IP
                                      address. Note: use ``port`` to set the port.
                                    "port": 0,  #
                                      Optional. The port to redirect to.
"redirect_code": 0,  # Optional. The redirect
                                      code to use. Defaults to ``302``. Supported
                                      values are 300, 301, 302, 303, 304, 307, 308.
                                    "scheme":
                                      "str",  # Optional. The scheme to redirect to.
                                      Supported values are ``http`` or ``https``.
                                      Default: ``https``.
                                    "uri": "str"
                                      # Optional. An optional URI path to redirect to.
                                      Note: if this is specified the whole URI of the
                                      original request will be overwritten to this
                                      value, irrespective of the original request URI
                                      being matched.
                                }
                            }
                        ]
                    },
                    "jobs": [
                        {
                            "build_command": "str",  #
                              Optional. An optional build command to run while building
                              this component from source.
                            "dockerfile_path": "str",  #
                              Optional. The path to the Dockerfile relative to the root
                              of the repo. If set, it will be used to build this
                              component. Otherwise, App Platform will attempt to build
                              it using buildpacks.
                            "environment_slug": "str",  #
                              Optional. An environment slug describing the type of this
                              app. For a full list, please refer to `the product
                              documentation
                              <https://www.digitalocean.com/docs/app-platform/>`_.
                            "envs": [
                                {
                                    "key": "str",
                                      # The variable name. Required.
                                    "scope":
                                      "RUN_AND_BUILD_TIME",  # Optional. Default value
                                      is "RUN_AND_BUILD_TIME". * RUN_TIME: Made
                                      available only at run-time"n* BUILD_TIME: Made
                                      available only at build-time"n*
                                      RUN_AND_BUILD_TIME: Made available at both build
                                      and run-time. Known values are: "UNSET",
                                      "RUN_TIME", "BUILD_TIME", and
                                      "RUN_AND_BUILD_TIME".
                                    "type":
                                      "GENERAL",  # Optional. Default value is
                                      "GENERAL". * GENERAL: A plain-text environment
                                      variable"n* SECRET: A secret encrypted
                                      environment variable. Known values are: "GENERAL"
                                      and "SECRET".
                                    "value":
                                      "str"  # Optional. The value. If the type is
                                      ``SECRET``"" , the value will be encrypted on
                                      first submission. On following submissions, the
                                      encrypted value should be used.
                                }
                            ],
                            "git": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "repo_clone_url":
                                  "str"  # Optional. The clone URL of the repo.
                                  Example:
                                  ``https://github.com/digitalocean/sample-golang.git``.
                            },
                            "github": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "gitlab": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "image": {
                                "registry": "str",  #
                                  Optional. The registry name. Must be left empty for
                                  the ``DOCR`` registry type.
                                "registry_type":
                                  "str",  # Optional. * DOCKER_HUB: The DockerHub
                                  container registry type."n* DOCR: The DigitalOcean
                                  container registry type. Known values are:
                                  "DOCKER_HUB" and "DOCR".
                                "repository": "str",
                                  # Optional. The repository name.
                                "tag": "latest"  #
                                  Optional. Default value is "latest". The repository
                                  tag. Defaults to ``latest`` if not provided.
                            },
                            "instance_count": 1,  #
                              Optional. Default value is 1. The amount of instances
                              that this component should be scaled to. Default: 1.
                            "instance_size_slug":
                              "basic-xxs",  # Optional. Default value is "basic-xxs".
                              The instance size to use for this component. Default:
                              ``basic-xxs``. Known values are: "basic-xxs", "basic-xs",
                              "basic-s", "basic-m", "professional-xs",
                              "professional-s", "professional-m", "professional-1l",
                              "professional-l", and "professional-xl".
                            "kind": "UNSPECIFIED",  #
                              Optional. Default value is "UNSPECIFIED". * UNSPECIFIED:
                              Default job type, will auto-complete to POST_DEPLOY
                              kind."n* PRE_DEPLOY: Indicates a job that runs before an
                              app deployment."n* POST_DEPLOY: Indicates a job that runs
                              after an app deployment."n* FAILED_DEPLOY: Indicates a
                              job that runs after a component fails to deploy. Known
                              values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY",
                              and "FAILED_DEPLOY".
                            "log_destinations": {
                                "datadog": {
                                    "api_key":
                                      "str",  # Datadog API key. Required.
                                    "endpoint":
                                      "str"  # Optional. Datadog HTTP log intake
                                      endpoint.
                                },
                                "logtail": {
                                    "token":
                                      "str"  # Optional. Logtail token.
                                },
                                "name": "str",  #
                                  Required.
                                "papertrail": {
                                    "endpoint":
                                      "str"  # Papertrail syslog endpoint. Required.
                                }
                            },
                            "name": "str",  # Optional.
                              The name. Must be unique across all components within the
                              same app.
                            "run_command": "str",  #
                              Optional. An optional run command to override the
                              component's default.
                            "source_dir": "str"  #
                              Optional. An optional path to the working directory to
                              use for the build. For Dockerfile builds, this will be
                              used as the build context. Must be relative to the root
                              of the repo.
                        }
                    ],
                    "name": "str",  # The name of the app. Must
                      be unique across all apps in the same account. Required.
                    "region": "str",  # Optional. The slug form
                      of the geographical origin of the app. Default: ``nearest
                      available``. Known values are: "ams", "nyc", "fra", "sfo", "sgp",
                      "blr", "tor", "lon", and "syd".
                    "services": [
                        {
                            "build_command": "str",  #
                              Optional. An optional build command to run while building
                              this component from source.
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "dockerfile_path": "str",  #
                              Optional. The path to the Dockerfile relative to the root
                              of the repo. If set, it will be used to build this
                              component. Otherwise, App Platform will attempt to build
                              it using buildpacks.
                            "environment_slug": "str",  #
                              Optional. An environment slug describing the type of this
                              app. For a full list, please refer to `the product
                              documentation
                              <https://www.digitalocean.com/docs/app-platform/>`_.
                            "envs": [
                                {
                                    "key": "str",
                                      # The variable name. Required.
                                    "scope":
                                      "RUN_AND_BUILD_TIME",  # Optional. Default value
                                      is "RUN_AND_BUILD_TIME". * RUN_TIME: Made
                                      available only at run-time"n* BUILD_TIME: Made
                                      available only at build-time"n*
                                      RUN_AND_BUILD_TIME: Made available at both build
                                      and run-time. Known values are: "UNSET",
                                      "RUN_TIME", "BUILD_TIME", and
                                      "RUN_AND_BUILD_TIME".
                                    "type":
                                      "GENERAL",  # Optional. Default value is
                                      "GENERAL". * GENERAL: A plain-text environment
                                      variable"n* SECRET: A secret encrypted
                                      environment variable. Known values are: "GENERAL"
                                      and "SECRET".
                                    "value":
                                      "str"  # Optional. The value. If the type is
                                      ``SECRET``"" , the value will be encrypted on
                                      first submission. On following submissions, the
                                      encrypted value should be used.
                                }
                            ],
                            "git": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "repo_clone_url":
                                  "str"  # Optional. The clone URL of the repo.
                                  Example:
                                  ``https://github.com/digitalocean/sample-golang.git``.
                            },
                            "github": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "gitlab": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "health_check": {
                                "failure_threshold":
                                  0,  # Optional. The number of failed health checks
                                  before considered unhealthy.
                                "http_path": "str",
                                  # Optional. The route path used for the HTTP health
                                  check ping. If not set, the HTTP health check will be
                                  disabled and a TCP health check used instead.
"initial_delay_seconds": 0,  # Optional. The number
                                  of seconds to wait before beginning health checks.
                                "period_seconds": 0,
                                  # Optional. The number of seconds to wait between
                                  health checks.
                                "port": 0,  #
                                  Optional. The port on which the health check will be
                                  performed. If not set, the health check will be
                                  performed on the component's http_port.
                                "success_threshold":
                                  0,  # Optional. The number of successful health
                                  checks before considered healthy.
                                "timeout_seconds": 0
                                  # Optional. The number of seconds after which the
                                  check times out.
                            },
                            "http_port": 0,  # Optional.
                              The internal port on which this service's run command
                              will listen. Default: 8080"nIf there is not an
                              environment variable with the name ``PORT``"" , one will
                              be automatically added with its value set to the value of
                              this field.
                            "image": {
                                "registry": "str",  #
                                  Optional. The registry name. Must be left empty for
                                  the ``DOCR`` registry type.
                                "registry_type":
                                  "str",  # Optional. * DOCKER_HUB: The DockerHub
                                  container registry type."n* DOCR: The DigitalOcean
                                  container registry type. Known values are:
                                  "DOCKER_HUB" and "DOCR".
                                "repository": "str",
                                  # Optional. The repository name.
                                "tag": "latest"  #
                                  Optional. Default value is "latest". The repository
                                  tag. Defaults to ``latest`` if not provided.
                            },
                            "instance_count": 1,  #
                              Optional. Default value is 1. The amount of instances
                              that this component should be scaled to. Default: 1.
                            "instance_size_slug":
                              "basic-xxs",  # Optional. Default value is "basic-xxs".
                              The instance size to use for this component. Default:
                              ``basic-xxs``. Known values are: "basic-xxs", "basic-xs",
                              "basic-s", "basic-m", "professional-xs",
                              "professional-s", "professional-m", "professional-1l",
                              "professional-l", and "professional-xl".
                            "internal_ports": [
                                0  # Optional. The
                                  ports on which this service will listen for internal
                                  traffic.
                            ],
                            "log_destinations": {
                                "datadog": {
                                    "api_key":
                                      "str",  # Datadog API key. Required.
                                    "endpoint":
                                      "str"  # Optional. Datadog HTTP log intake
                                      endpoint.
                                },
                                "logtail": {
                                    "token":
                                      "str"  # Optional. Logtail token.
                                },
                                "name": "str",  #
                                  Required.
                                "papertrail": {
                                    "endpoint":
                                      "str"  # Papertrail syslog endpoint. Required.
                                }
                            },
                            "name": "str",  # Optional.
                              The name. Must be unique across all components within the
                              same app.
                            "routes": [
                                {
                                    "path":
                                      "str",  # Optional. An HTTP path prefix. Paths
                                      must start with / and must be unique across all
                                      components within an app.
"preserve_path_prefix": bool  # Optional. An
                                      optional flag to preserve the path that is
                                      forwarded to the backend service. By default, the
                                      HTTP request path will be trimmed from the left
                                      when forwarded to the component. For example, a
                                      component with ``path=/api`` will have requests
                                      to ``/api/list`` trimmed to ``/list``. If this
                                      value is ``true``"" , the path will remain
                                      ``/api/list``.
                                }
                            ],
                            "run_command": "str",  #
                              Optional. An optional run command to override the
                              component's default.
                            "source_dir": "str"  #
                              Optional. An optional path to the working directory to
                              use for the build. For Dockerfile builds, this will be
                              used as the build context. Must be relative to the root
                              of the repo.
                        }
                    ],
                    "static_sites": [
                        {
                            "build_command": "str",  #
                              Optional. An optional build command to run while building
                              this component from source.
                            "catchall_document": "str",
                              # Optional. The name of the document to use as the
                              fallback for any requests to documents that are not found
                              when serving this static site. Only 1 of
                              ``catchall_document`` or ``error_document`` can be set.
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "dockerfile_path": "str",  #
                              Optional. The path to the Dockerfile relative to the root
                              of the repo. If set, it will be used to build this
                              component. Otherwise, App Platform will attempt to build
                              it using buildpacks.
                            "environment_slug": "str",  #
                              Optional. An environment slug describing the type of this
                              app. For a full list, please refer to `the product
                              documentation
                              <https://www.digitalocean.com/docs/app-platform/>`_.
                            "envs": [
                                {
                                    "key": "str",
                                      # The variable name. Required.
                                    "scope":
                                      "RUN_AND_BUILD_TIME",  # Optional. Default value
                                      is "RUN_AND_BUILD_TIME". * RUN_TIME: Made
                                      available only at run-time"n* BUILD_TIME: Made
                                      available only at build-time"n*
                                      RUN_AND_BUILD_TIME: Made available at both build
                                      and run-time. Known values are: "UNSET",
                                      "RUN_TIME", "BUILD_TIME", and
                                      "RUN_AND_BUILD_TIME".
                                    "type":
                                      "GENERAL",  # Optional. Default value is
                                      "GENERAL". * GENERAL: A plain-text environment
                                      variable"n* SECRET: A secret encrypted
                                      environment variable. Known values are: "GENERAL"
                                      and "SECRET".
                                    "value":
                                      "str"  # Optional. The value. If the type is
                                      ``SECRET``"" , the value will be encrypted on
                                      first submission. On following submissions, the
                                      encrypted value should be used.
                                }
                            ],
                            "error_document": "404.html",
                              # Optional. Default value is "404.html". The name of the
                              error document to use when serving this static site.
                              Default: 404.html. If no such file exists within the
                              built assets, App Platform will supply one.
                            "git": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "repo_clone_url":
                                  "str"  # Optional. The clone URL of the repo.
                                  Example:
                                  ``https://github.com/digitalocean/sample-golang.git``.
                            },
                            "github": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "gitlab": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "image": {
                                "registry": "str",  #
                                  Optional. The registry name. Must be left empty for
                                  the ``DOCR`` registry type.
                                "registry_type":
                                  "str",  # Optional. * DOCKER_HUB: The DockerHub
                                  container registry type."n* DOCR: The DigitalOcean
                                  container registry type. Known values are:
                                  "DOCKER_HUB" and "DOCR".
                                "repository": "str",
                                  # Optional. The repository name.
                                "tag": "latest"  #
                                  Optional. Default value is "latest". The repository
                                  tag. Defaults to ``latest`` if not provided.
                            },
                            "index_document":
                              "index.html",  # Optional. Default value is "index.html".
                              The name of the index document to use when serving this
                              static site. Default: index.html.
                            "log_destinations": {
                                "datadog": {
                                    "api_key":
                                      "str",  # Datadog API key. Required.
                                    "endpoint":
                                      "str"  # Optional. Datadog HTTP log intake
                                      endpoint.
                                },
                                "logtail": {
                                    "token":
                                      "str"  # Optional. Logtail token.
                                },
                                "name": "str",  #
                                  Required.
                                "papertrail": {
                                    "endpoint":
                                      "str"  # Papertrail syslog endpoint. Required.
                                }
                            },
                            "name": "str",  # Optional.
                              The name. Must be unique across all components within the
                              same app.
                            "output_dir": "str",  #
                              Optional. An optional path to where the built assets will
                              be located, relative to the build context. If not set,
                              App Platform will automatically scan for these directory
                              names: ``_static``"" , ``dist``"" , ``public``"" ,
                              ``build``.
                            "routes": [
                                {
                                    "path":
                                      "str",  # Optional. An HTTP path prefix. Paths
                                      must start with / and must be unique across all
                                      components within an app.
"preserve_path_prefix": bool  # Optional. An
                                      optional flag to preserve the path that is
                                      forwarded to the backend service. By default, the
                                      HTTP request path will be trimmed from the left
                                      when forwarded to the component. For example, a
                                      component with ``path=/api`` will have requests
                                      to ``/api/list`` trimmed to ``/list``. If this
                                      value is ``true``"" , the path will remain
                                      ``/api/list``.
                                }
                            ],
                            "run_command": "str",  #
                              Optional. An optional run command to override the
                              component's default.
                            "source_dir": "str"  #
                              Optional. An optional path to the working directory to
                              use for the build. For Dockerfile builds, this will be
                              used as the build context. Must be relative to the root
                              of the repo.
                        }
                    ],
                    "workers": [
                        {
                            "build_command": "str",  #
                              Optional. An optional build command to run while building
                              this component from source.
                            "dockerfile_path": "str",  #
                              Optional. The path to the Dockerfile relative to the root
                              of the repo. If set, it will be used to build this
                              component. Otherwise, App Platform will attempt to build
                              it using buildpacks.
                            "environment_slug": "str",  #
                              Optional. An environment slug describing the type of this
                              app. For a full list, please refer to `the product
                              documentation
                              <https://www.digitalocean.com/docs/app-platform/>`_.
                            "envs": [
                                {
                                    "key": "str",
                                      # The variable name. Required.
                                    "scope":
                                      "RUN_AND_BUILD_TIME",  # Optional. Default value
                                      is "RUN_AND_BUILD_TIME". * RUN_TIME: Made
                                      available only at run-time"n* BUILD_TIME: Made
                                      available only at build-time"n*
                                      RUN_AND_BUILD_TIME: Made available at both build
                                      and run-time. Known values are: "UNSET",
                                      "RUN_TIME", "BUILD_TIME", and
                                      "RUN_AND_BUILD_TIME".
                                    "type":
                                      "GENERAL",  # Optional. Default value is
                                      "GENERAL". * GENERAL: A plain-text environment
                                      variable"n* SECRET: A secret encrypted
                                      environment variable. Known values are: "GENERAL"
                                      and "SECRET".
                                    "value":
                                      "str"  # Optional. The value. If the type is
                                      ``SECRET``"" , the value will be encrypted on
                                      first submission. On following submissions, the
                                      encrypted value should be used.
                                }
                            ],
                            "git": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "repo_clone_url":
                                  "str"  # Optional. The clone URL of the repo.
                                  Example:
                                  ``https://github.com/digitalocean/sample-golang.git``.
                            },
                            "github": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "gitlab": {
                                "branch": "str",  #
                                  Optional. The name of the branch to use.
                                "deploy_on_push":
                                  bool,  # Optional. Whether to automatically deploy
                                  new commits made to the repo.
                                "repo": "str"  #
                                  Optional. The name of the repo in the format
                                  owner/repo. Example: ``digitalocean/sample-golang``.
                            },
                            "image": {
                                "registry": "str",  #
                                  Optional. The registry name. Must be left empty for
                                  the ``DOCR`` registry type.
                                "registry_type":
                                  "str",  # Optional. * DOCKER_HUB: The DockerHub
                                  container registry type."n* DOCR: The DigitalOcean
                                  container registry type. Known values are:
                                  "DOCKER_HUB" and "DOCR".
                                "repository": "str",
                                  # Optional. The repository name.
                                "tag": "latest"  #
                                  Optional. Default value is "latest". The repository
                                  tag. Defaults to ``latest`` if not provided.
                            },
                            "instance_count": 1,  #
                              Optional. Default value is 1. The amount of instances
                              that this component should be scaled to. Default: 1.
                            "instance_size_slug":
                              "basic-xxs",  # Optional. Default value is "basic-xxs".
                              The instance size to use for this component. Default:
                              ``basic-xxs``. Known values are: "basic-xxs", "basic-xs",
                              "basic-s", "basic-m", "professional-xs",
                              "professional-s", "professional-m", "professional-1l",
                              "professional-l", and "professional-xl".
                            "log_destinations": {
                                "datadog": {
                                    "api_key":
                                      "str",  # Datadog API key. Required.
                                    "endpoint":
                                      "str"  # Optional. Datadog HTTP log intake
                                      endpoint.
                                },
                                "logtail": {
                                    "token":
                                      "str"  # Optional. Logtail token.
                                },
                                "name": "str",  #
                                  Required.
                                "papertrail": {
                                    "endpoint":
                                      "str"  # Papertrail syslog endpoint. Required.
                                }
                            },
                            "name": "str",  # Optional.
                              The name. Must be unique across all components within the
                              same app.
                            "run_command": "str",  #
                              Optional. An optional run command to override the
                              component's default.
                            "source_dir": "str"  #
                              Optional. An optional path to the working directory to
                              use for the build. For Dockerfile builds, this will be
                              used as the build context. Must be relative to the root
                              of the repo.
                        }
                    ]
                },
                "static_sites": [
                    {
                        "name": "str",  # Optional. The name
                          of this static site.
                        "source_commit_hash": "str"  #
                          Optional. The commit hash of the repository that was used to
                          build this static site.
                    }
                ],
                "tier_slug": "str",  # Optional. The current pricing
                  tier slug of the deployment.
                "updated_at": "2020-02-20 00:00:00",  # Optional.
                  When the deployment was last updated.
                "workers": [
                    {
                        "name": "str",  # Optional. The name
                          of this worker.
                        "source_commit_hash": "str"  #
                          Optional. The commit hash of the repository that was used to
                          build this worker.
                    }
                ]
            },
            "project_id": "str",  # Optional. The ID of the project the
              app is assigned to. This will be empty if there is a lookup failure.
            "region": {
                "continent": "str",  # Optional. The continent that
                  this region is in.
                "data_centers": [
                    "str"  # Optional. Data centers that are in
                      this region.
                ],
                "default": bool,  # Optional. Whether or not the
                  region is presented as the default.
                "disabled": bool,  # Optional. Whether or not the
                  region is open for new apps.
                "flag": "str",  # Optional. The flag of this region.
                "label": "str",  # Optional. A human-readable name of
                  the region.
                "reason": "str",  # Optional. Reason that this region
                  is not available.
                "slug": "str"  # Optional. The slug form of the
                  region name.
            },
            "spec": {
                "databases": [
                    {
                        "cluster_name": "str",  # Optional.
                          The name of the underlying DigitalOcean DBaaS cluster. This
                          is required for production databases. For dev databases, if
                          cluster_name is not set, a new cluster will be provisioned.
                        "db_name": "str",  # Optional. The
                          name of the MySQL or PostgreSQL database to configure.
                        "db_user": "str",  # Optional. The
                          name of the MySQL or PostgreSQL user to configure.
                        "engine": "UNSET",  # Optional.
                          Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n*
                          REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and
                          "REDIS".
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "production": bool,  # Optional.
                          Whether this is a production or dev database.
                        "version": "str"  # Optional. The
                          version of the database engine.
                    }
                ],
                "domains": [
                    {
                        "domain": "str",  # The hostname for
                          the domain. Required.
                        "minimum_tls_version": "str",  #
                          Optional. The minimum version of TLS a client application can
                          use to access resources for the domain.  Must be one of the
                          following values wrapped within quotations: ``"1.2"`` or
                          ``"1.3"``. Known values are: "1.2" and "1.3".
                        "type": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * DEFAULT: The default
                          ``.ondigitalocean.app`` domain assigned to this app"n*
                          PRIMARY: The primary domain for this app that is displayed as
                          the default in the control panel, used in bindable
                          environment variables, and any other places that reference an
                          app's live URL. Only one domain may be set as primary."n*
                          ALIAS: A non-primary domain. Known values are: "UNSPECIFIED",
                          "DEFAULT", "PRIMARY", and "ALIAS".
                        "wildcard": bool,  # Optional.
                          Indicates whether the domain includes all sub-domains, in
                          addition to the given domain.
                        "zone": "str"  # Optional. Optional.
                          If the domain uses DigitalOcean DNS and you would like
                          App"nPlatform to automatically manage it for you, set this to
                          the name of the"ndomain on your account."n"nFor example, If
                          the domain you are adding is ``app.domain.com``"" , the
                          zone"ncould be ``domain.com``.
                    }
                ],
                "functions": [
                    {
                        "alerts": [
                            {
                                "disabled": bool,  #
                                  Optional. Is the alert disabled?.
                                "operator":
                                  "UNSPECIFIED_OPERATOR",  # Optional. Default value is
                                  "UNSPECIFIED_OPERATOR". Known values are:
                                  "UNSPECIFIED_OPERATOR", "GREATER_THAN", and
                                  "LESS_THAN".
                                "rule":
                                  "UNSPECIFIED_RULE",  # Optional. Default value is
                                  "UNSPECIFIED_RULE". Known values are:
                                  "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                                  "MEM_UTILIZATION", "RESTART_COUNT",
                                  "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE",
                                  "DOMAIN_FAILED", "DOMAIN_LIVE",
                                  "FUNCTIONS_ACTIVATION_COUNT",
                                  "FUNCTIONS_AVERAGE_DURATION_MS",
                                  "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                                  "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                                  "FUNCTIONS_ERROR_COUNT", and
                                  "FUNCTIONS_GB_RATE_PER_SECOND".
                                "value": 0.0,  #
                                  Optional. Threshold value for alert.
                                "window":
                                  "UNSPECIFIED_WINDOW"  # Optional. Default value is
                                  "UNSPECIFIED_WINDOW". Known values are:
                                  "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES",
                                  "THIRTY_MINUTES", and "ONE_HOUR".
                            }
                        ],
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "ingress": {
                    "rules": [
                        {
                            "component": {
                                "name": "str",  # The
                                  name of the component to route to. Required.
"preserve_path_prefix": "str",  # Optional. An
                                  optional flag to preserve the path that is forwarded
                                  to the backend service. By default, the HTTP request
                                  path will be trimmed from the left when forwarded to
                                  the component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``. Note: this is not
                                  applicable for Functions Components and is mutually
                                  exclusive with ``rewrite``.
                                "rewrite": "str"  #
                                  Optional. An optional field that will rewrite the
                                  path of the component to be what is specified here.
                                  By default, the HTTP request path will be trimmed
                                  from the left when forwarded to the component. For
                                  example, a component with ``path=/api`` will have
                                  requests to ``/api/list`` trimmed to ``/list``. If
                                  you specified the rewrite to be ``/v1/``"" , requests
                                  to ``/api/list`` would be rewritten to ``/v1/list``.
                                  Note: this is mutually exclusive with
                                  ``preserve_path_prefix``.
                            },
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "match": {
                                "path": {
                                    "prefix":
                                      "str"  # Prefix-based match. For example,
                                      ``/api`` will match ``/api``"" , ``/api/``"" ,
                                      and any nested paths such as
                                      ``/api/v1/endpoint``. Required.
                                }
                            },
                            "redirect": {
                                "authority": "str",
                                  # Optional. The authority/host to redirect to. This
                                  can be a hostname or IP address. Note: use ``port``
                                  to set the port.
                                "port": 0,  #
                                  Optional. The port to redirect to.
                                "redirect_code": 0,
                                  # Optional. The redirect code to use. Defaults to
                                  ``302``. Supported values are 300, 301, 302, 303,
                                  304, 307, 308.
                                "scheme": "str",  #
                                  Optional. The scheme to redirect to. Supported values
                                  are ``http`` or ``https``. Default: ``https``.
                                "uri": "str"  #
                                  Optional. An optional URI path to redirect to. Note:
                                  if this is specified the whole URI of the original
                                  request will be overwritten to this value,
                                  irrespective of the original request URI being
                                  matched.
                            }
                        }
                    ]
                },
                "jobs": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "kind": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * UNSPECIFIED: Default job
                          type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY:
                          Indicates a job that runs before an app deployment."n*
                          POST_DEPLOY: Indicates a job that runs after an app
                          deployment."n* FAILED_DEPLOY: Indicates a job that runs after
                          a component fails to deploy. Known values are: "UNSPECIFIED",
                          "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "name": "str",  # The name of the app. Must be unique
                  across all apps in the same account. Required.
                "region": "str",  # Optional. The slug form of the
                  geographical origin of the app. Default: ``nearest available``. Known
                  values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon",
                  and "syd".
                "services": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "health_check": {
                            "failure_threshold": 0,  #
                              Optional. The number of failed health checks before
                              considered unhealthy.
                            "http_path": "str",  #
                              Optional. The route path used for the HTTP health check
                              ping. If not set, the HTTP health check will be disabled
                              and a TCP health check used instead.
                            "initial_delay_seconds": 0,
                              # Optional. The number of seconds to wait before
                              beginning health checks.
                            "period_seconds": 0,  #
                              Optional. The number of seconds to wait between health
                              checks.
                            "port": 0,  # Optional. The
                              port on which the health check will be performed. If not
                              set, the health check will be performed on the
                              component's http_port.
                            "success_threshold": 0,  #
                              Optional. The number of successful health checks before
                              considered healthy.
                            "timeout_seconds": 0  #
                              Optional. The number of seconds after which the check
                              times out.
                        },
                        "http_port": 0,  # Optional. The
                          internal port on which this service's run command will
                          listen. Default: 8080"nIf there is not an environment
                          variable with the name ``PORT``"" , one will be automatically
                          added with its value set to the value of this field.
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "internal_ports": [
                            0  # Optional. The ports on
                              which this service will listen for internal traffic.
                        ],
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "static_sites": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "catchall_document": "str",  #
                          Optional. The name of the document to use as the fallback for
                          any requests to documents that are not found when serving
                          this static site. Only 1 of ``catchall_document`` or
                          ``error_document`` can be set.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "error_document": "404.html",  #
                          Optional. Default value is "404.html". The name of the error
                          document to use when serving this static site. Default:
                          404.html. If no such file exists within the built assets, App
                          Platform will supply one.
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "index_document": "index.html",  #
                          Optional. Default value is "index.html". The name of the
                          index document to use when serving this static site. Default:
                          index.html.
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "output_dir": "str",  # Optional. An
                          optional path to where the built assets will be located,
                          relative to the build context. If not set, App Platform will
                          automatically scan for these directory names: ``_static``"" ,
                          ``dist``"" , ``public``"" , ``build``.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "workers": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ]
            },
            "tier_slug": "str",  # Optional. The current pricing tier
              slug of the app.
            "updated_at": "2020-02-20 00:00:00"  # Optional. Time of the
              app's last configuration update.
        }
    ],
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
list_alerts(app_id: str, **kwargs: Any) MutableMapping[str, Any]

List all app alerts.

List alerts associated to the app and any components. This includes configuration information about the alerts including emails, slack webhooks, and triggering events or conditions.

Parameters:

app_id (str) – The app ID. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "alerts": [
        {
            "component_name": "str",  # Optional. Name of component the
              alert belongs to.
            "emails": [
                ""  # Optional. Default value is "". Emails for
                  alerts to go to.
            ],
            "id": "str",  # Optional. The ID of the alert.
            "phase": "UNKNOWN",  # Optional. Default value is "UNKNOWN".
              Known values are: "UNKNOWN", "PENDING", "CONFIGURING", "ACTIVE", and
              "ERROR".
            "progress": {
                "steps": [
                    {
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The start time of this step.
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN"  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                    }
                ]
            },
            "slack_webhooks": [
                {
                    "channel": "str",  # Optional. Name of the
                      Slack Webhook Channel.
                    "url": "str"  # Optional. URL of the Slack
                      webhook.
                }
            ],
            "spec": {
                "disabled": bool,  # Optional. Is the alert
                  disabled?.
                "operator": "UNSPECIFIED_OPERATOR",  # Optional.
                  Default value is "UNSPECIFIED_OPERATOR". Known values are:
                  "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN".
                "rule": "UNSPECIFIED_RULE",  # Optional. Default
                  value is "UNSPECIFIED_RULE". Known values are: "UNSPECIFIED_RULE",
                  "CPU_UTILIZATION", "MEM_UTILIZATION", "RESTART_COUNT",
                  "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE", "DOMAIN_FAILED",
                  "DOMAIN_LIVE", "FUNCTIONS_ACTIVATION_COUNT",
                  "FUNCTIONS_AVERAGE_DURATION_MS", "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                  "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT", and
                  "FUNCTIONS_GB_RATE_PER_SECOND".
                "value": 0.0,  # Optional. Threshold value for alert.
                "window": "UNSPECIFIED_WINDOW"  # Optional. Default
                  value is "UNSPECIFIED_WINDOW". Known values are:
                  "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES",
                  "THIRTY_MINUTES", and "ONE_HOUR".
            }
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_deployments(app_id: str, *, page: int = 1, per_page: int = 20, **kwargs: Any) MutableMapping[str, Any]

List App Deployments.

List all deployments of an app.

Parameters:
  • app_id (str) – The app ID. Required.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

  • per_page (int) – Number of items returned per page. Default value is 20.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "deployments": [
        {
            "cause": "str",  # Optional. What caused this deployment to
              be created.
            "cloned_from": "str",  # Optional. The ID of a previous
              deployment that this deployment was cloned from.
            "created_at": "2020-02-20 00:00:00",  # Optional. The
              creation time of the deployment.
            "functions": [
                {
                    "name": "str",  # Optional. The name of this
                      functions component.
                    "namespace": "str",  # Optional. The
                      namespace where the functions are deployed.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      functions component.
                }
            ],
            "id": "str",  # Optional. The ID of the deployment.
            "jobs": [
                {
                    "name": "str",  # Optional. The name of this
                      job.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this job.
                }
            ],
            "phase": "UNKNOWN",  # Optional. Default value is "UNKNOWN".
              Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING",
              "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and
              "CANCELED".
            "phase_last_updated_at": "2020-02-20 00:00:00",  # Optional.
              When the deployment phase was last updated.
            "progress": {
                "error_steps": 0,  # Optional. Number of unsuccessful
                  steps.
                "pending_steps": 0,  # Optional. Number of pending
                  steps.
                "running_steps": 0,  # Optional. Number of currently
                  running steps.
                "steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "success_steps": 0,  # Optional. Number of successful
                  steps.
                "summary_steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "total_steps": 0  # Optional. Total number of steps.
            },
            "services": [
                {
                    "name": "str",  # Optional. The name of this
                      service.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      service.
                }
            ],
            "spec": {
                "databases": [
                    {
                        "cluster_name": "str",  # Optional.
                          The name of the underlying DigitalOcean DBaaS cluster. This
                          is required for production databases. For dev databases, if
                          cluster_name is not set, a new cluster will be provisioned.
                        "db_name": "str",  # Optional. The
                          name of the MySQL or PostgreSQL database to configure.
                        "db_user": "str",  # Optional. The
                          name of the MySQL or PostgreSQL user to configure.
                        "engine": "UNSET",  # Optional.
                          Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n*
                          REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and
                          "REDIS".
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "production": bool,  # Optional.
                          Whether this is a production or dev database.
                        "version": "str"  # Optional. The
                          version of the database engine.
                    }
                ],
                "domains": [
                    {
                        "domain": "str",  # The hostname for
                          the domain. Required.
                        "minimum_tls_version": "str",  #
                          Optional. The minimum version of TLS a client application can
                          use to access resources for the domain.  Must be one of the
                          following values wrapped within quotations: ``"1.2"`` or
                          ``"1.3"``. Known values are: "1.2" and "1.3".
                        "type": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * DEFAULT: The default
                          ``.ondigitalocean.app`` domain assigned to this app"n*
                          PRIMARY: The primary domain for this app that is displayed as
                          the default in the control panel, used in bindable
                          environment variables, and any other places that reference an
                          app's live URL. Only one domain may be set as primary."n*
                          ALIAS: A non-primary domain. Known values are: "UNSPECIFIED",
                          "DEFAULT", "PRIMARY", and "ALIAS".
                        "wildcard": bool,  # Optional.
                          Indicates whether the domain includes all sub-domains, in
                          addition to the given domain.
                        "zone": "str"  # Optional. Optional.
                          If the domain uses DigitalOcean DNS and you would like
                          App"nPlatform to automatically manage it for you, set this to
                          the name of the"ndomain on your account."n"nFor example, If
                          the domain you are adding is ``app.domain.com``"" , the
                          zone"ncould be ``domain.com``.
                    }
                ],
                "functions": [
                    {
                        "alerts": [
                            {
                                "disabled": bool,  #
                                  Optional. Is the alert disabled?.
                                "operator":
                                  "UNSPECIFIED_OPERATOR",  # Optional. Default value is
                                  "UNSPECIFIED_OPERATOR". Known values are:
                                  "UNSPECIFIED_OPERATOR", "GREATER_THAN", and
                                  "LESS_THAN".
                                "rule":
                                  "UNSPECIFIED_RULE",  # Optional. Default value is
                                  "UNSPECIFIED_RULE". Known values are:
                                  "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                                  "MEM_UTILIZATION", "RESTART_COUNT",
                                  "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE",
                                  "DOMAIN_FAILED", "DOMAIN_LIVE",
                                  "FUNCTIONS_ACTIVATION_COUNT",
                                  "FUNCTIONS_AVERAGE_DURATION_MS",
                                  "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                                  "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                                  "FUNCTIONS_ERROR_COUNT", and
                                  "FUNCTIONS_GB_RATE_PER_SECOND".
                                "value": 0.0,  #
                                  Optional. Threshold value for alert.
                                "window":
                                  "UNSPECIFIED_WINDOW"  # Optional. Default value is
                                  "UNSPECIFIED_WINDOW". Known values are:
                                  "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES",
                                  "THIRTY_MINUTES", and "ONE_HOUR".
                            }
                        ],
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "ingress": {
                    "rules": [
                        {
                            "component": {
                                "name": "str",  # The
                                  name of the component to route to. Required.
"preserve_path_prefix": "str",  # Optional. An
                                  optional flag to preserve the path that is forwarded
                                  to the backend service. By default, the HTTP request
                                  path will be trimmed from the left when forwarded to
                                  the component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``. Note: this is not
                                  applicable for Functions Components and is mutually
                                  exclusive with ``rewrite``.
                                "rewrite": "str"  #
                                  Optional. An optional field that will rewrite the
                                  path of the component to be what is specified here.
                                  By default, the HTTP request path will be trimmed
                                  from the left when forwarded to the component. For
                                  example, a component with ``path=/api`` will have
                                  requests to ``/api/list`` trimmed to ``/list``. If
                                  you specified the rewrite to be ``/v1/``"" , requests
                                  to ``/api/list`` would be rewritten to ``/v1/list``.
                                  Note: this is mutually exclusive with
                                  ``preserve_path_prefix``.
                            },
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "match": {
                                "path": {
                                    "prefix":
                                      "str"  # Prefix-based match. For example,
                                      ``/api`` will match ``/api``"" , ``/api/``"" ,
                                      and any nested paths such as
                                      ``/api/v1/endpoint``. Required.
                                }
                            },
                            "redirect": {
                                "authority": "str",
                                  # Optional. The authority/host to redirect to. This
                                  can be a hostname or IP address. Note: use ``port``
                                  to set the port.
                                "port": 0,  #
                                  Optional. The port to redirect to.
                                "redirect_code": 0,
                                  # Optional. The redirect code to use. Defaults to
                                  ``302``. Supported values are 300, 301, 302, 303,
                                  304, 307, 308.
                                "scheme": "str",  #
                                  Optional. The scheme to redirect to. Supported values
                                  are ``http`` or ``https``. Default: ``https``.
                                "uri": "str"  #
                                  Optional. An optional URI path to redirect to. Note:
                                  if this is specified the whole URI of the original
                                  request will be overwritten to this value,
                                  irrespective of the original request URI being
                                  matched.
                            }
                        }
                    ]
                },
                "jobs": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "kind": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * UNSPECIFIED: Default job
                          type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY:
                          Indicates a job that runs before an app deployment."n*
                          POST_DEPLOY: Indicates a job that runs after an app
                          deployment."n* FAILED_DEPLOY: Indicates a job that runs after
                          a component fails to deploy. Known values are: "UNSPECIFIED",
                          "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "name": "str",  # The name of the app. Must be unique
                  across all apps in the same account. Required.
                "region": "str",  # Optional. The slug form of the
                  geographical origin of the app. Default: ``nearest available``. Known
                  values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon",
                  and "syd".
                "services": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "health_check": {
                            "failure_threshold": 0,  #
                              Optional. The number of failed health checks before
                              considered unhealthy.
                            "http_path": "str",  #
                              Optional. The route path used for the HTTP health check
                              ping. If not set, the HTTP health check will be disabled
                              and a TCP health check used instead.
                            "initial_delay_seconds": 0,
                              # Optional. The number of seconds to wait before
                              beginning health checks.
                            "period_seconds": 0,  #
                              Optional. The number of seconds to wait between health
                              checks.
                            "port": 0,  # Optional. The
                              port on which the health check will be performed. If not
                              set, the health check will be performed on the
                              component's http_port.
                            "success_threshold": 0,  #
                              Optional. The number of successful health checks before
                              considered healthy.
                            "timeout_seconds": 0  #
                              Optional. The number of seconds after which the check
                              times out.
                        },
                        "http_port": 0,  # Optional. The
                          internal port on which this service's run command will
                          listen. Default: 8080"nIf there is not an environment
                          variable with the name ``PORT``"" , one will be automatically
                          added with its value set to the value of this field.
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "internal_ports": [
                            0  # Optional. The ports on
                              which this service will listen for internal traffic.
                        ],
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "static_sites": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "catchall_document": "str",  #
                          Optional. The name of the document to use as the fallback for
                          any requests to documents that are not found when serving
                          this static site. Only 1 of ``catchall_document`` or
                          ``error_document`` can be set.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "error_document": "404.html",  #
                          Optional. Default value is "404.html". The name of the error
                          document to use when serving this static site. Default:
                          404.html. If no such file exists within the built assets, App
                          Platform will supply one.
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "index_document": "index.html",  #
                          Optional. Default value is "index.html". The name of the
                          index document to use when serving this static site. Default:
                          index.html.
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "output_dir": "str",  # Optional. An
                          optional path to where the built assets will be located,
                          relative to the build context. If not set, App Platform will
                          automatically scan for these directory names: ``_static``"" ,
                          ``dist``"" , ``public``"" , ``build``.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "workers": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ]
            },
            "static_sites": [
                {
                    "name": "str",  # Optional. The name of this
                      static site.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this static
                      site.
                }
            ],
            "tier_slug": "str",  # Optional. The current pricing tier
              slug of the deployment.
            "updated_at": "2020-02-20 00:00:00",  # Optional. When the
              deployment was last updated.
            "workers": [
                {
                    "name": "str",  # Optional. The name of this
                      worker.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this worker.
                }
            ]
        }
    ],
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_instance_sizes(**kwargs: Any) MutableMapping[str, Any]

List Instance Sizes.

List all instance sizes for service, worker, and job components.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "discount_percent": 0.0,  # Optional.
    "instance_sizes": [
        {
            "cpu_type": "UNSPECIFIED",  # Optional. Default value is
              "UNSPECIFIED". * SHARED: Shared vCPU cores"n"n  * DEDICATED: Dedicated
              vCPU cores. Known values are: "UNSPECIFIED", "SHARED", and "DEDICATED".
            "cpus": "str",  # Optional. The number of allotted vCPU
              cores.
            "memory_bytes": "str",  # Optional. The allotted memory in
              bytes.
            "name": "str",  # Optional. A human-readable name of the
              instance size.
            "slug": "str",  # Optional. The slug of the instance size.
            "tier_downgrade_to": "str",  # Optional. The slug of the
              corresponding downgradable instance size on the lower tier.
            "tier_slug": "str",  # Optional. The slug of the tier to
              which this instance size belongs.
            "tier_upgrade_to": "str",  # Optional. The slug of the
              corresponding upgradable instance size on the higher tier.
            "usd_per_month": "str",  # Optional. The cost of this
              instance size in USD per month.
            "usd_per_second": "str"  # Optional. The cost of this
              instance size in USD per second.
        }
    ]
}
list_metrics_bandwidth_daily(body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
list_metrics_bandwidth_daily(body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Retrieve Multiple Apps’ Daily Bandwidth Metrics.

Retrieve daily bandwidth usage metrics for multiple apps.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "app_bandwidth_usage": [
        {
            "app_id": "str",  # Optional. The ID of the app.
            "bandwidth_bytes": "str"  # Optional. The used bandwidth
              amount in bytes.
        }
    ],
    "date": "2020-02-20 00:00:00"  # Optional. The date for the metrics data.
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_regions(**kwargs: Any) MutableMapping[str, Any]

List App Regions.

List all regions supported by App Platform.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "regions": [
        {
            "continent": "str",  # Optional. The continent that this
              region is in.
            "data_centers": [
                "str"  # Optional. Data centers that are in this
                  region.
            ],
            "default": bool,  # Optional. Whether or not the region is
              presented as the default.
            "disabled": bool,  # Optional. Whether or not the region is
              open for new apps.
            "flag": "str",  # Optional. The flag of this region.
            "label": "str",  # Optional. A human-readable name of the
              region.
            "reason": "str",  # Optional. Reason that this region is not
              available.
            "slug": "str"  # Optional. The slug form of the region name.
        }
    ]
}
list_tiers(**kwargs: Any) MutableMapping[str, Any]

List App Tiers.

List all app tiers.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "tiers": [
        {
            "build_seconds": "str",  # Optional. The amount of included
              build time in seconds.
            "egress_bandwidth_bytes": "str",  # Optional. The amount of
              included outbound bandwidth in bytes.
            "name": "str",  # Optional. A human-readable name of the
              tier.
            "slug": "str",  # Optional. The slug of the tier.
            "storage_bytes": "str"  # Optional. The allotted disk space
              in bytes.
        }
    ]
}
revert_rollback(app_id: str, **kwargs: Any) MutableMapping[str, Any]

Revert App Rollback.

Revert an app rollback. This action reverts the active rollback by creating a new deployment from the latest app spec prior to the rollback and unpins the app to resume new deployments.

Parameters:

app_id (str) – The app ID. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "deployment": {
        "cause": "str",  # Optional. What caused this deployment to be
          created.
        "cloned_from": "str",  # Optional. The ID of a previous deployment
          that this deployment was cloned from.
        "created_at": "2020-02-20 00:00:00",  # Optional. The creation time
          of the deployment.
        "functions": [
            {
                "name": "str",  # Optional. The name of this
                  functions component.
                "namespace": "str",  # Optional. The namespace where
                  the functions are deployed.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this functions
                  component.
            }
        ],
        "id": "str",  # Optional. The ID of the deployment.
        "jobs": [
            {
                "name": "str",  # Optional. The name of this job.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this job.
            }
        ],
        "phase": "UNKNOWN",  # Optional. Default value is "UNKNOWN". Known
          values are: "UNKNOWN", "PENDING_BUILD", "BUILDING", "PENDING_DEPLOY",
          "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and "CANCELED".
        "phase_last_updated_at": "2020-02-20 00:00:00",  # Optional. When the
          deployment phase was last updated.
        "progress": {
            "error_steps": 0,  # Optional. Number of unsuccessful steps.
            "pending_steps": 0,  # Optional. Number of pending steps.
            "running_steps": 0,  # Optional. Number of currently running
              steps.
            "steps": [
                {
                    "component_name": "str",  # Optional. The
                      component name that this step is associated with.
                    "ended_at": "2020-02-20 00:00:00",  #
                      Optional. The end time of this step.
                    "message_base": "str",  # Optional. The base
                      of a human-readable description of the step intended to be
                      combined with the component name for presentation. For
                      example:"n"n``message_base`` = "Building
                      service""n``component_name`` = "api".
                    "name": "str",  # Optional. The name of this
                      step.
                    "reason": {
                        "code": "str",  # Optional. The error
                          code.
                        "message": "str"  # Optional. The
                          error message.
                    },
                    "started_at": "2020-02-20 00:00:00",  #
                      Optional. The start time of this step.
                    "status": "UNKNOWN",  # Optional. Default
                      value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING",
                      "RUNNING", "ERROR", and "SUCCESS".
                    "steps": [
                        {}  # Optional. Child steps of this
                          step.
                    ]
                }
            ],
            "success_steps": 0,  # Optional. Number of successful steps.
            "summary_steps": [
                {
                    "component_name": "str",  # Optional. The
                      component name that this step is associated with.
                    "ended_at": "2020-02-20 00:00:00",  #
                      Optional. The end time of this step.
                    "message_base": "str",  # Optional. The base
                      of a human-readable description of the step intended to be
                      combined with the component name for presentation. For
                      example:"n"n``message_base`` = "Building
                      service""n``component_name`` = "api".
                    "name": "str",  # Optional. The name of this
                      step.
                    "reason": {
                        "code": "str",  # Optional. The error
                          code.
                        "message": "str"  # Optional. The
                          error message.
                    },
                    "started_at": "2020-02-20 00:00:00",  #
                      Optional. The start time of this step.
                    "status": "UNKNOWN",  # Optional. Default
                      value is "UNKNOWN". Known values are: "UNKNOWN", "PENDING",
                      "RUNNING", "ERROR", and "SUCCESS".
                    "steps": [
                        {}  # Optional. Child steps of this
                          step.
                    ]
                }
            ],
            "total_steps": 0  # Optional. Total number of steps.
        },
        "services": [
            {
                "name": "str",  # Optional. The name of this service.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this service.
            }
        ],
        "spec": {
            "databases": [
                {
                    "cluster_name": "str",  # Optional. The name
                      of the underlying DigitalOcean DBaaS cluster. This is required
                      for production databases. For dev databases, if cluster_name is
                      not set, a new cluster will be provisioned.
                    "db_name": "str",  # Optional. The name of
                      the MySQL or PostgreSQL database to configure.
                    "db_user": "str",  # Optional. The name of
                      the MySQL or PostgreSQL user to configure.
                    "engine": "UNSET",  # Optional. Default value
                      is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis.
                      Known values are: "UNSET", "MYSQL", "PG", and "REDIS".
                    "name": "str",  # The name. Must be unique
                      across all components within the same app. Required.
                    "production": bool,  # Optional. Whether this
                      is a production or dev database.
                    "version": "str"  # Optional. The version of
                      the database engine.
                }
            ],
            "domains": [
                {
                    "domain": "str",  # The hostname for the
                      domain. Required.
                    "minimum_tls_version": "str",  # Optional.
                      The minimum version of TLS a client application can use to access
                      resources for the domain.  Must be one of the following values
                      wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values
                      are: "1.2" and "1.3".
                    "type": "UNSPECIFIED",  # Optional. Default
                      value is "UNSPECIFIED". * DEFAULT: The default
                      ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY:
                      The primary domain for this app that is displayed as the default
                      in the control panel, used in bindable environment variables, and
                      any other places that reference an app's live URL. Only one
                      domain may be set as primary."n* ALIAS: A non-primary domain.
                      Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and
                      "ALIAS".
                    "wildcard": bool,  # Optional. Indicates
                      whether the domain includes all sub-domains, in addition to the
                      given domain.
                    "zone": "str"  # Optional. Optional. If the
                      domain uses DigitalOcean DNS and you would like App"nPlatform to
                      automatically manage it for you, set this to the name of
                      the"ndomain on your account."n"nFor example, If the domain you
                      are adding is ``app.domain.com``"" , the zone"ncould be
                      ``domain.com``.
                }
            ],
            "functions": [
                {
                    "alerts": [
                        {
                            "disabled": bool,  #
                              Optional. Is the alert disabled?.
                            "operator":
                              "UNSPECIFIED_OPERATOR",  # Optional. Default value is
                              "UNSPECIFIED_OPERATOR". Known values are:
                              "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN".
                            "rule": "UNSPECIFIED_RULE",
                              # Optional. Default value is "UNSPECIFIED_RULE". Known
                              values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                              "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED",
                              "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE",
                              "FUNCTIONS_ACTIVATION_COUNT",
                              "FUNCTIONS_AVERAGE_DURATION_MS",
                              "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                              "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                              "FUNCTIONS_ERROR_COUNT", and
                              "FUNCTIONS_GB_RATE_PER_SECOND".
                            "value": 0.0,  # Optional.
                              Threshold value for alert.
                            "window":
                              "UNSPECIFIED_WINDOW"  # Optional. Default value is
                              "UNSPECIFIED_WINDOW". Known values are:
                              "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES",
                              "THIRTY_MINUTES", and "ONE_HOUR".
                        }
                    ],
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # The name. Must be unique
                      across all components within the same app. Required.
                    "routes": [
                        {
                            "path": "str",  # Optional.
                              An HTTP path prefix. Paths must start with / and must be
                              unique across all components within an app.
                            "preserve_path_prefix": bool
                              # Optional. An optional flag to preserve the path that is
                              forwarded to the backend service. By default, the HTTP
                              request path will be trimmed from the left when forwarded
                              to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``.
                        }
                    ],
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "ingress": {
                "rules": [
                    {
                        "component": {
                            "name": "str",  # The name of
                              the component to route to. Required.
                            "preserve_path_prefix":
                              "str",  # Optional. An optional flag to preserve the path
                              that is forwarded to the backend service. By default, the
                              HTTP request path will be trimmed from the left when
                              forwarded to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``. Note: this is not applicable for
                              Functions Components and is mutually exclusive with
                              ``rewrite``.
                            "rewrite": "str"  # Optional.
                              An optional field that will rewrite the path of the
                              component to be what is specified here. By default, the
                              HTTP request path will be trimmed from the left when
                              forwarded to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If you specified the rewrite to be
                              ``/v1/``"" , requests to ``/api/list`` would be rewritten
                              to ``/v1/list``. Note: this is mutually exclusive with
                              ``preserve_path_prefix``.
                        },
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "match": {
                            "path": {
                                "prefix": "str"  #
                                  Prefix-based match. For example, ``/api`` will match
                                  ``/api``"" , ``/api/``"" , and any nested paths such
                                  as ``/api/v1/endpoint``. Required.
                            }
                        },
                        "redirect": {
                            "authority": "str",  #
                              Optional. The authority/host to redirect to. This can be
                              a hostname or IP address. Note: use ``port`` to set the
                              port.
                            "port": 0,  # Optional. The
                              port to redirect to.
                            "redirect_code": 0,  #
                              Optional. The redirect code to use. Defaults to ``302``.
                              Supported values are 300, 301, 302, 303, 304, 307, 308.
                            "scheme": "str",  # Optional.
                              The scheme to redirect to. Supported values are ``http``
                              or ``https``. Default: ``https``.
                            "uri": "str"  # Optional. An
                              optional URI path to redirect to. Note: if this is
                              specified the whole URI of the original request will be
                              overwritten to this value, irrespective of the original
                              request URI being matched.
                        }
                    }
                ]
            },
            "jobs": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "instance_count": 1,  # Optional. Default
                      value is 1. The amount of instances that this component should be
                      scaled to. Default: 1.
                    "instance_size_slug": "basic-xxs",  #
                      Optional. Default value is "basic-xxs". The instance size to use
                      for this component. Default: ``basic-xxs``. Known values are:
                      "basic-xxs", "basic-xs", "basic-s", "basic-m", "professional-xs",
                      "professional-s", "professional-m", "professional-1l",
                      "professional-l", and "professional-xl".
                    "kind": "UNSPECIFIED",  # Optional. Default
                      value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will
                      auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job
                      that runs before an app deployment."n* POST_DEPLOY: Indicates a
                      job that runs after an app deployment."n* FAILED_DEPLOY:
                      Indicates a job that runs after a component fails to deploy.
                      Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and
                      "FAILED_DEPLOY".
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "name": "str",  # The name of the app. Must be unique across
              all apps in the same account. Required.
            "region": "str",  # Optional. The slug form of the
              geographical origin of the app. Default: ``nearest available``. Known
              values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and
              "syd".
            "services": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "health_check": {
                        "failure_threshold": 0,  # Optional.
                          The number of failed health checks before considered
                          unhealthy.
                        "http_path": "str",  # Optional. The
                          route path used for the HTTP health check ping. If not set,
                          the HTTP health check will be disabled and a TCP health check
                          used instead.
                        "initial_delay_seconds": 0,  #
                          Optional. The number of seconds to wait before beginning
                          health checks.
                        "period_seconds": 0,  # Optional. The
                          number of seconds to wait between health checks.
                        "port": 0,  # Optional. The port on
                          which the health check will be performed. If not set, the
                          health check will be performed on the component's http_port.
                        "success_threshold": 0,  # Optional.
                          The number of successful health checks before considered
                          healthy.
                        "timeout_seconds": 0  # Optional. The
                          number of seconds after which the check times out.
                    },
                    "http_port": 0,  # Optional. The internal
                      port on which this service's run command will listen. Default:
                      8080"nIf there is not an environment variable with the name
                      ``PORT``"" , one will be automatically added with its value set
                      to the value of this field.
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "instance_count": 1,  # Optional. Default
                      value is 1. The amount of instances that this component should be
                      scaled to. Default: 1.
                    "instance_size_slug": "basic-xxs",  #
                      Optional. Default value is "basic-xxs". The instance size to use
                      for this component. Default: ``basic-xxs``. Known values are:
                      "basic-xxs", "basic-xs", "basic-s", "basic-m", "professional-xs",
                      "professional-s", "professional-m", "professional-1l",
                      "professional-l", and "professional-xl".
                    "internal_ports": [
                        0  # Optional. The ports on which
                          this service will listen for internal traffic.
                    ],
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "routes": [
                        {
                            "path": "str",  # Optional.
                              An HTTP path prefix. Paths must start with / and must be
                              unique across all components within an app.
                            "preserve_path_prefix": bool
                              # Optional. An optional flag to preserve the path that is
                              forwarded to the backend service. By default, the HTTP
                              request path will be trimmed from the left when forwarded
                              to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``.
                        }
                    ],
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "static_sites": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "catchall_document": "str",  # Optional. The
                      name of the document to use as the fallback for any requests to
                      documents that are not found when serving this static site. Only
                      1 of ``catchall_document`` or ``error_document`` can be set.
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "error_document": "404.html",  # Optional.
                      Default value is "404.html". The name of the error document to
                      use when serving this static site. Default: 404.html. If no such
                      file exists within the built assets, App Platform will supply
                      one.
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "index_document": "index.html",  # Optional.
                      Default value is "index.html". The name of the index document to
                      use when serving this static site. Default: index.html.
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "output_dir": "str",  # Optional. An optional
                      path to where the built assets will be located, relative to the
                      build context. If not set, App Platform will automatically scan
                      for these directory names: ``_static``"" , ``dist``"" ,
                      ``public``"" , ``build``.
                    "routes": [
                        {
                            "path": "str",  # Optional.
                              An HTTP path prefix. Paths must start with / and must be
                              unique across all components within an app.
                            "preserve_path_prefix": bool
                              # Optional. An optional flag to preserve the path that is
                              forwarded to the backend service. By default, the HTTP
                              request path will be trimmed from the left when forwarded
                              to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``.
                        }
                    ],
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "workers": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "instance_count": 1,  # Optional. Default
                      value is 1. The amount of instances that this component should be
                      scaled to. Default: 1.
                    "instance_size_slug": "basic-xxs",  #
                      Optional. Default value is "basic-xxs". The instance size to use
                      for this component. Default: ``basic-xxs``. Known values are:
                      "basic-xxs", "basic-xs", "basic-s", "basic-m", "professional-xs",
                      "professional-s", "professional-m", "professional-1l",
                      "professional-l", and "professional-xl".
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ]
        },
        "static_sites": [
            {
                "name": "str",  # Optional. The name of this static
                  site.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this static site.
            }
        ],
        "tier_slug": "str",  # Optional. The current pricing tier slug of the
          deployment.
        "updated_at": "2020-02-20 00:00:00",  # Optional. When the deployment
          was last updated.
        "workers": [
            {
                "name": "str",  # Optional. The name of this worker.
                "source_commit_hash": "str"  # Optional. The commit
                  hash of the repository that was used to build this worker.
            }
        ]
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
update(id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
update(id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Update an App.

Update an existing app by submitting a new app specification. For documentation on app specifications (AppSpec objects), please refer to the product documentation.

Parameters:
  • id (str) – The ID of the app. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "app": {
        "active_deployment": {
            "cause": "str",  # Optional. What caused this deployment to
              be created.
            "cloned_from": "str",  # Optional. The ID of a previous
              deployment that this deployment was cloned from.
            "created_at": "2020-02-20 00:00:00",  # Optional. The
              creation time of the deployment.
            "functions": [
                {
                    "name": "str",  # Optional. The name of this
                      functions component.
                    "namespace": "str",  # Optional. The
                      namespace where the functions are deployed.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      functions component.
                }
            ],
            "id": "str",  # Optional. The ID of the deployment.
            "jobs": [
                {
                    "name": "str",  # Optional. The name of this
                      job.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this job.
                }
            ],
            "phase": "UNKNOWN",  # Optional. Default value is "UNKNOWN".
              Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING",
              "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and
              "CANCELED".
            "phase_last_updated_at": "2020-02-20 00:00:00",  # Optional.
              When the deployment phase was last updated.
            "progress": {
                "error_steps": 0,  # Optional. Number of unsuccessful
                  steps.
                "pending_steps": 0,  # Optional. Number of pending
                  steps.
                "running_steps": 0,  # Optional. Number of currently
                  running steps.
                "steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "success_steps": 0,  # Optional. Number of successful
                  steps.
                "summary_steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "total_steps": 0  # Optional. Total number of steps.
            },
            "services": [
                {
                    "name": "str",  # Optional. The name of this
                      service.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      service.
                }
            ],
            "spec": {
                "databases": [
                    {
                        "cluster_name": "str",  # Optional.
                          The name of the underlying DigitalOcean DBaaS cluster. This
                          is required for production databases. For dev databases, if
                          cluster_name is not set, a new cluster will be provisioned.
                        "db_name": "str",  # Optional. The
                          name of the MySQL or PostgreSQL database to configure.
                        "db_user": "str",  # Optional. The
                          name of the MySQL or PostgreSQL user to configure.
                        "engine": "UNSET",  # Optional.
                          Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n*
                          REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and
                          "REDIS".
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "production": bool,  # Optional.
                          Whether this is a production or dev database.
                        "version": "str"  # Optional. The
                          version of the database engine.
                    }
                ],
                "domains": [
                    {
                        "domain": "str",  # The hostname for
                          the domain. Required.
                        "minimum_tls_version": "str",  #
                          Optional. The minimum version of TLS a client application can
                          use to access resources for the domain.  Must be one of the
                          following values wrapped within quotations: ``"1.2"`` or
                          ``"1.3"``. Known values are: "1.2" and "1.3".
                        "type": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * DEFAULT: The default
                          ``.ondigitalocean.app`` domain assigned to this app"n*
                          PRIMARY: The primary domain for this app that is displayed as
                          the default in the control panel, used in bindable
                          environment variables, and any other places that reference an
                          app's live URL. Only one domain may be set as primary."n*
                          ALIAS: A non-primary domain. Known values are: "UNSPECIFIED",
                          "DEFAULT", "PRIMARY", and "ALIAS".
                        "wildcard": bool,  # Optional.
                          Indicates whether the domain includes all sub-domains, in
                          addition to the given domain.
                        "zone": "str"  # Optional. Optional.
                          If the domain uses DigitalOcean DNS and you would like
                          App"nPlatform to automatically manage it for you, set this to
                          the name of the"ndomain on your account."n"nFor example, If
                          the domain you are adding is ``app.domain.com``"" , the
                          zone"ncould be ``domain.com``.
                    }
                ],
                "functions": [
                    {
                        "alerts": [
                            {
                                "disabled": bool,  #
                                  Optional. Is the alert disabled?.
                                "operator":
                                  "UNSPECIFIED_OPERATOR",  # Optional. Default value is
                                  "UNSPECIFIED_OPERATOR". Known values are:
                                  "UNSPECIFIED_OPERATOR", "GREATER_THAN", and
                                  "LESS_THAN".
                                "rule":
                                  "UNSPECIFIED_RULE",  # Optional. Default value is
                                  "UNSPECIFIED_RULE". Known values are:
                                  "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                                  "MEM_UTILIZATION", "RESTART_COUNT",
                                  "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE",
                                  "DOMAIN_FAILED", "DOMAIN_LIVE",
                                  "FUNCTIONS_ACTIVATION_COUNT",
                                  "FUNCTIONS_AVERAGE_DURATION_MS",
                                  "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                                  "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                                  "FUNCTIONS_ERROR_COUNT", and
                                  "FUNCTIONS_GB_RATE_PER_SECOND".
                                "value": 0.0,  #
                                  Optional. Threshold value for alert.
                                "window":
                                  "UNSPECIFIED_WINDOW"  # Optional. Default value is
                                  "UNSPECIFIED_WINDOW". Known values are:
                                  "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES",
                                  "THIRTY_MINUTES", and "ONE_HOUR".
                            }
                        ],
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "ingress": {
                    "rules": [
                        {
                            "component": {
                                "name": "str",  # The
                                  name of the component to route to. Required.
"preserve_path_prefix": "str",  # Optional. An
                                  optional flag to preserve the path that is forwarded
                                  to the backend service. By default, the HTTP request
                                  path will be trimmed from the left when forwarded to
                                  the component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``. Note: this is not
                                  applicable for Functions Components and is mutually
                                  exclusive with ``rewrite``.
                                "rewrite": "str"  #
                                  Optional. An optional field that will rewrite the
                                  path of the component to be what is specified here.
                                  By default, the HTTP request path will be trimmed
                                  from the left when forwarded to the component. For
                                  example, a component with ``path=/api`` will have
                                  requests to ``/api/list`` trimmed to ``/list``. If
                                  you specified the rewrite to be ``/v1/``"" , requests
                                  to ``/api/list`` would be rewritten to ``/v1/list``.
                                  Note: this is mutually exclusive with
                                  ``preserve_path_prefix``.
                            },
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "match": {
                                "path": {
                                    "prefix":
                                      "str"  # Prefix-based match. For example,
                                      ``/api`` will match ``/api``"" , ``/api/``"" ,
                                      and any nested paths such as
                                      ``/api/v1/endpoint``. Required.
                                }
                            },
                            "redirect": {
                                "authority": "str",
                                  # Optional. The authority/host to redirect to. This
                                  can be a hostname or IP address. Note: use ``port``
                                  to set the port.
                                "port": 0,  #
                                  Optional. The port to redirect to.
                                "redirect_code": 0,
                                  # Optional. The redirect code to use. Defaults to
                                  ``302``. Supported values are 300, 301, 302, 303,
                                  304, 307, 308.
                                "scheme": "str",  #
                                  Optional. The scheme to redirect to. Supported values
                                  are ``http`` or ``https``. Default: ``https``.
                                "uri": "str"  #
                                  Optional. An optional URI path to redirect to. Note:
                                  if this is specified the whole URI of the original
                                  request will be overwritten to this value,
                                  irrespective of the original request URI being
                                  matched.
                            }
                        }
                    ]
                },
                "jobs": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "kind": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * UNSPECIFIED: Default job
                          type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY:
                          Indicates a job that runs before an app deployment."n*
                          POST_DEPLOY: Indicates a job that runs after an app
                          deployment."n* FAILED_DEPLOY: Indicates a job that runs after
                          a component fails to deploy. Known values are: "UNSPECIFIED",
                          "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "name": "str",  # The name of the app. Must be unique
                  across all apps in the same account. Required.
                "region": "str",  # Optional. The slug form of the
                  geographical origin of the app. Default: ``nearest available``. Known
                  values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon",
                  and "syd".
                "services": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "health_check": {
                            "failure_threshold": 0,  #
                              Optional. The number of failed health checks before
                              considered unhealthy.
                            "http_path": "str",  #
                              Optional. The route path used for the HTTP health check
                              ping. If not set, the HTTP health check will be disabled
                              and a TCP health check used instead.
                            "initial_delay_seconds": 0,
                              # Optional. The number of seconds to wait before
                              beginning health checks.
                            "period_seconds": 0,  #
                              Optional. The number of seconds to wait between health
                              checks.
                            "port": 0,  # Optional. The
                              port on which the health check will be performed. If not
                              set, the health check will be performed on the
                              component's http_port.
                            "success_threshold": 0,  #
                              Optional. The number of successful health checks before
                              considered healthy.
                            "timeout_seconds": 0  #
                              Optional. The number of seconds after which the check
                              times out.
                        },
                        "http_port": 0,  # Optional. The
                          internal port on which this service's run command will
                          listen. Default: 8080"nIf there is not an environment
                          variable with the name ``PORT``"" , one will be automatically
                          added with its value set to the value of this field.
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "internal_ports": [
                            0  # Optional. The ports on
                              which this service will listen for internal traffic.
                        ],
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "static_sites": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "catchall_document": "str",  #
                          Optional. The name of the document to use as the fallback for
                          any requests to documents that are not found when serving
                          this static site. Only 1 of ``catchall_document`` or
                          ``error_document`` can be set.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "error_document": "404.html",  #
                          Optional. Default value is "404.html". The name of the error
                          document to use when serving this static site. Default:
                          404.html. If no such file exists within the built assets, App
                          Platform will supply one.
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "index_document": "index.html",  #
                          Optional. Default value is "index.html". The name of the
                          index document to use when serving this static site. Default:
                          index.html.
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "output_dir": "str",  # Optional. An
                          optional path to where the built assets will be located,
                          relative to the build context. If not set, App Platform will
                          automatically scan for these directory names: ``_static``"" ,
                          ``dist``"" , ``public``"" , ``build``.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "workers": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ]
            },
            "static_sites": [
                {
                    "name": "str",  # Optional. The name of this
                      static site.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this static
                      site.
                }
            ],
            "tier_slug": "str",  # Optional. The current pricing tier
              slug of the deployment.
            "updated_at": "2020-02-20 00:00:00",  # Optional. When the
              deployment was last updated.
            "workers": [
                {
                    "name": "str",  # Optional. The name of this
                      worker.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this worker.
                }
            ]
        },
        "created_at": "2020-02-20 00:00:00",  # Optional. The creation time
          of the app.
        "default_ingress": "str",  # Optional. The default hostname on which
          the app is accessible.
        "domains": [
            {
                "certificate_expires_at": "2020-02-20 00:00:00",  #
                  Optional. Current SSL certificate expiration time.
                "id": "str",  # Optional. The ID of the domain.
                "phase": "UNKNOWN",  # Optional. Default value is
                  "UNKNOWN". Known values are: "UNKNOWN", "PENDING", "CONFIGURING",
                  "ACTIVE", and "ERROR".
                "progress": {
                    "steps": [
                        {}  # Optional. The steps of the
                          domain's progress.
                    ]
                },
                "rotate_validation_records": bool,  # Optional.
                  Validation values have changed and require manual intervention.
                "spec": {
                    "domain": "str",  # The hostname for the
                      domain. Required.
                    "minimum_tls_version": "str",  # Optional.
                      The minimum version of TLS a client application can use to access
                      resources for the domain.  Must be one of the following values
                      wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values
                      are: "1.2" and "1.3".
                    "type": "UNSPECIFIED",  # Optional. Default
                      value is "UNSPECIFIED". * DEFAULT: The default
                      ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY:
                      The primary domain for this app that is displayed as the default
                      in the control panel, used in bindable environment variables, and
                      any other places that reference an app's live URL. Only one
                      domain may be set as primary."n* ALIAS: A non-primary domain.
                      Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and
                      "ALIAS".
                    "wildcard": bool,  # Optional. Indicates
                      whether the domain includes all sub-domains, in addition to the
                      given domain.
                    "zone": "str"  # Optional. Optional. If the
                      domain uses DigitalOcean DNS and you would like App"nPlatform to
                      automatically manage it for you, set this to the name of
                      the"ndomain on your account."n"nFor example, If the domain you
                      are adding is ``app.domain.com``"" , the zone"ncould be
                      ``domain.com``.
                },
                "validations": [
                    {
                        "txt_name": "str",  # Optional. TXT
                          record name.
                        "txt_value": "str"  # Optional. TXT
                          record value.
                    }
                ]
            }
        ],
        "id": "str",  # Optional. The ID of the application.
        "in_progress_deployment": {
            "cause": "str",  # Optional. What caused this deployment to
              be created.
            "cloned_from": "str",  # Optional. The ID of a previous
              deployment that this deployment was cloned from.
            "created_at": "2020-02-20 00:00:00",  # Optional. The
              creation time of the deployment.
            "functions": [
                {
                    "name": "str",  # Optional. The name of this
                      functions component.
                    "namespace": "str",  # Optional. The
                      namespace where the functions are deployed.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      functions component.
                }
            ],
            "id": "str",  # Optional. The ID of the deployment.
            "jobs": [
                {
                    "name": "str",  # Optional. The name of this
                      job.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this job.
                }
            ],
            "phase": "UNKNOWN",  # Optional. Default value is "UNKNOWN".
              Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING",
              "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and
              "CANCELED".
            "phase_last_updated_at": "2020-02-20 00:00:00",  # Optional.
              When the deployment phase was last updated.
            "progress": {
                "error_steps": 0,  # Optional. Number of unsuccessful
                  steps.
                "pending_steps": 0,  # Optional. Number of pending
                  steps.
                "running_steps": 0,  # Optional. Number of currently
                  running steps.
                "steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "success_steps": 0,  # Optional. Number of successful
                  steps.
                "summary_steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "total_steps": 0  # Optional. Total number of steps.
            },
            "services": [
                {
                    "name": "str",  # Optional. The name of this
                      service.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      service.
                }
            ],
            "spec": {
                "databases": [
                    {
                        "cluster_name": "str",  # Optional.
                          The name of the underlying DigitalOcean DBaaS cluster. This
                          is required for production databases. For dev databases, if
                          cluster_name is not set, a new cluster will be provisioned.
                        "db_name": "str",  # Optional. The
                          name of the MySQL or PostgreSQL database to configure.
                        "db_user": "str",  # Optional. The
                          name of the MySQL or PostgreSQL user to configure.
                        "engine": "UNSET",  # Optional.
                          Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n*
                          REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and
                          "REDIS".
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "production": bool,  # Optional.
                          Whether this is a production or dev database.
                        "version": "str"  # Optional. The
                          version of the database engine.
                    }
                ],
                "domains": [
                    {
                        "domain": "str",  # The hostname for
                          the domain. Required.
                        "minimum_tls_version": "str",  #
                          Optional. The minimum version of TLS a client application can
                          use to access resources for the domain.  Must be one of the
                          following values wrapped within quotations: ``"1.2"`` or
                          ``"1.3"``. Known values are: "1.2" and "1.3".
                        "type": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * DEFAULT: The default
                          ``.ondigitalocean.app`` domain assigned to this app"n*
                          PRIMARY: The primary domain for this app that is displayed as
                          the default in the control panel, used in bindable
                          environment variables, and any other places that reference an
                          app's live URL. Only one domain may be set as primary."n*
                          ALIAS: A non-primary domain. Known values are: "UNSPECIFIED",
                          "DEFAULT", "PRIMARY", and "ALIAS".
                        "wildcard": bool,  # Optional.
                          Indicates whether the domain includes all sub-domains, in
                          addition to the given domain.
                        "zone": "str"  # Optional. Optional.
                          If the domain uses DigitalOcean DNS and you would like
                          App"nPlatform to automatically manage it for you, set this to
                          the name of the"ndomain on your account."n"nFor example, If
                          the domain you are adding is ``app.domain.com``"" , the
                          zone"ncould be ``domain.com``.
                    }
                ],
                "functions": [
                    {
                        "alerts": [
                            {
                                "disabled": bool,  #
                                  Optional. Is the alert disabled?.
                                "operator":
                                  "UNSPECIFIED_OPERATOR",  # Optional. Default value is
                                  "UNSPECIFIED_OPERATOR". Known values are:
                                  "UNSPECIFIED_OPERATOR", "GREATER_THAN", and
                                  "LESS_THAN".
                                "rule":
                                  "UNSPECIFIED_RULE",  # Optional. Default value is
                                  "UNSPECIFIED_RULE". Known values are:
                                  "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                                  "MEM_UTILIZATION", "RESTART_COUNT",
                                  "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE",
                                  "DOMAIN_FAILED", "DOMAIN_LIVE",
                                  "FUNCTIONS_ACTIVATION_COUNT",
                                  "FUNCTIONS_AVERAGE_DURATION_MS",
                                  "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                                  "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                                  "FUNCTIONS_ERROR_COUNT", and
                                  "FUNCTIONS_GB_RATE_PER_SECOND".
                                "value": 0.0,  #
                                  Optional. Threshold value for alert.
                                "window":
                                  "UNSPECIFIED_WINDOW"  # Optional. Default value is
                                  "UNSPECIFIED_WINDOW". Known values are:
                                  "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES",
                                  "THIRTY_MINUTES", and "ONE_HOUR".
                            }
                        ],
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "ingress": {
                    "rules": [
                        {
                            "component": {
                                "name": "str",  # The
                                  name of the component to route to. Required.
"preserve_path_prefix": "str",  # Optional. An
                                  optional flag to preserve the path that is forwarded
                                  to the backend service. By default, the HTTP request
                                  path will be trimmed from the left when forwarded to
                                  the component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``. Note: this is not
                                  applicable for Functions Components and is mutually
                                  exclusive with ``rewrite``.
                                "rewrite": "str"  #
                                  Optional. An optional field that will rewrite the
                                  path of the component to be what is specified here.
                                  By default, the HTTP request path will be trimmed
                                  from the left when forwarded to the component. For
                                  example, a component with ``path=/api`` will have
                                  requests to ``/api/list`` trimmed to ``/list``. If
                                  you specified the rewrite to be ``/v1/``"" , requests
                                  to ``/api/list`` would be rewritten to ``/v1/list``.
                                  Note: this is mutually exclusive with
                                  ``preserve_path_prefix``.
                            },
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "match": {
                                "path": {
                                    "prefix":
                                      "str"  # Prefix-based match. For example,
                                      ``/api`` will match ``/api``"" , ``/api/``"" ,
                                      and any nested paths such as
                                      ``/api/v1/endpoint``. Required.
                                }
                            },
                            "redirect": {
                                "authority": "str",
                                  # Optional. The authority/host to redirect to. This
                                  can be a hostname or IP address. Note: use ``port``
                                  to set the port.
                                "port": 0,  #
                                  Optional. The port to redirect to.
                                "redirect_code": 0,
                                  # Optional. The redirect code to use. Defaults to
                                  ``302``. Supported values are 300, 301, 302, 303,
                                  304, 307, 308.
                                "scheme": "str",  #
                                  Optional. The scheme to redirect to. Supported values
                                  are ``http`` or ``https``. Default: ``https``.
                                "uri": "str"  #
                                  Optional. An optional URI path to redirect to. Note:
                                  if this is specified the whole URI of the original
                                  request will be overwritten to this value,
                                  irrespective of the original request URI being
                                  matched.
                            }
                        }
                    ]
                },
                "jobs": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "kind": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * UNSPECIFIED: Default job
                          type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY:
                          Indicates a job that runs before an app deployment."n*
                          POST_DEPLOY: Indicates a job that runs after an app
                          deployment."n* FAILED_DEPLOY: Indicates a job that runs after
                          a component fails to deploy. Known values are: "UNSPECIFIED",
                          "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "name": "str",  # The name of the app. Must be unique
                  across all apps in the same account. Required.
                "region": "str",  # Optional. The slug form of the
                  geographical origin of the app. Default: ``nearest available``. Known
                  values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon",
                  and "syd".
                "services": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "health_check": {
                            "failure_threshold": 0,  #
                              Optional. The number of failed health checks before
                              considered unhealthy.
                            "http_path": "str",  #
                              Optional. The route path used for the HTTP health check
                              ping. If not set, the HTTP health check will be disabled
                              and a TCP health check used instead.
                            "initial_delay_seconds": 0,
                              # Optional. The number of seconds to wait before
                              beginning health checks.
                            "period_seconds": 0,  #
                              Optional. The number of seconds to wait between health
                              checks.
                            "port": 0,  # Optional. The
                              port on which the health check will be performed. If not
                              set, the health check will be performed on the
                              component's http_port.
                            "success_threshold": 0,  #
                              Optional. The number of successful health checks before
                              considered healthy.
                            "timeout_seconds": 0  #
                              Optional. The number of seconds after which the check
                              times out.
                        },
                        "http_port": 0,  # Optional. The
                          internal port on which this service's run command will
                          listen. Default: 8080"nIf there is not an environment
                          variable with the name ``PORT``"" , one will be automatically
                          added with its value set to the value of this field.
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "internal_ports": [
                            0  # Optional. The ports on
                              which this service will listen for internal traffic.
                        ],
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "static_sites": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "catchall_document": "str",  #
                          Optional. The name of the document to use as the fallback for
                          any requests to documents that are not found when serving
                          this static site. Only 1 of ``catchall_document`` or
                          ``error_document`` can be set.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "error_document": "404.html",  #
                          Optional. Default value is "404.html". The name of the error
                          document to use when serving this static site. Default:
                          404.html. If no such file exists within the built assets, App
                          Platform will supply one.
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "index_document": "index.html",  #
                          Optional. Default value is "index.html". The name of the
                          index document to use when serving this static site. Default:
                          index.html.
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "output_dir": "str",  # Optional. An
                          optional path to where the built assets will be located,
                          relative to the build context. If not set, App Platform will
                          automatically scan for these directory names: ``_static``"" ,
                          ``dist``"" , ``public``"" , ``build``.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "workers": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ]
            },
            "static_sites": [
                {
                    "name": "str",  # Optional. The name of this
                      static site.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this static
                      site.
                }
            ],
            "tier_slug": "str",  # Optional. The current pricing tier
              slug of the deployment.
            "updated_at": "2020-02-20 00:00:00",  # Optional. When the
              deployment was last updated.
            "workers": [
                {
                    "name": "str",  # Optional. The name of this
                      worker.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this worker.
                }
            ]
        },
        "last_deployment_created_at": "2020-02-20 00:00:00",  # Optional. The
          creation time of the last deployment.
        "live_domain": "str",  # Optional. The live domain of the app.
        "live_url": "str",  # Optional. The live URL of the app.
        "live_url_base": "str",  # Optional. The live URL base of the app,
          the URL excluding the path.
        "owner_uuid": "str",  # Optional. The ID of the account to which the
          application belongs.
        "pending_deployment": {
            "cause": "str",  # Optional. What caused this deployment to
              be created.
            "cloned_from": "str",  # Optional. The ID of a previous
              deployment that this deployment was cloned from.
            "created_at": "2020-02-20 00:00:00",  # Optional. The
              creation time of the deployment.
            "functions": [
                {
                    "name": "str",  # Optional. The name of this
                      functions component.
                    "namespace": "str",  # Optional. The
                      namespace where the functions are deployed.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      functions component.
                }
            ],
            "id": "str",  # Optional. The ID of the deployment.
            "jobs": [
                {
                    "name": "str",  # Optional. The name of this
                      job.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this job.
                }
            ],
            "phase": "UNKNOWN",  # Optional. Default value is "UNKNOWN".
              Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING",
              "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and
              "CANCELED".
            "phase_last_updated_at": "2020-02-20 00:00:00",  # Optional.
              When the deployment phase was last updated.
            "progress": {
                "error_steps": 0,  # Optional. Number of unsuccessful
                  steps.
                "pending_steps": 0,  # Optional. Number of pending
                  steps.
                "running_steps": 0,  # Optional. Number of currently
                  running steps.
                "steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "success_steps": 0,  # Optional. Number of successful
                  steps.
                "summary_steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "total_steps": 0  # Optional. Total number of steps.
            },
            "services": [
                {
                    "name": "str",  # Optional. The name of this
                      service.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      service.
                }
            ],
            "spec": {
                "databases": [
                    {
                        "cluster_name": "str",  # Optional.
                          The name of the underlying DigitalOcean DBaaS cluster. This
                          is required for production databases. For dev databases, if
                          cluster_name is not set, a new cluster will be provisioned.
                        "db_name": "str",  # Optional. The
                          name of the MySQL or PostgreSQL database to configure.
                        "db_user": "str",  # Optional. The
                          name of the MySQL or PostgreSQL user to configure.
                        "engine": "UNSET",  # Optional.
                          Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n*
                          REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and
                          "REDIS".
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "production": bool,  # Optional.
                          Whether this is a production or dev database.
                        "version": "str"  # Optional. The
                          version of the database engine.
                    }
                ],
                "domains": [
                    {
                        "domain": "str",  # The hostname for
                          the domain. Required.
                        "minimum_tls_version": "str",  #
                          Optional. The minimum version of TLS a client application can
                          use to access resources for the domain.  Must be one of the
                          following values wrapped within quotations: ``"1.2"`` or
                          ``"1.3"``. Known values are: "1.2" and "1.3".
                        "type": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * DEFAULT: The default
                          ``.ondigitalocean.app`` domain assigned to this app"n*
                          PRIMARY: The primary domain for this app that is displayed as
                          the default in the control panel, used in bindable
                          environment variables, and any other places that reference an
                          app's live URL. Only one domain may be set as primary."n*
                          ALIAS: A non-primary domain. Known values are: "UNSPECIFIED",
                          "DEFAULT", "PRIMARY", and "ALIAS".
                        "wildcard": bool,  # Optional.
                          Indicates whether the domain includes all sub-domains, in
                          addition to the given domain.
                        "zone": "str"  # Optional. Optional.
                          If the domain uses DigitalOcean DNS and you would like
                          App"nPlatform to automatically manage it for you, set this to
                          the name of the"ndomain on your account."n"nFor example, If
                          the domain you are adding is ``app.domain.com``"" , the
                          zone"ncould be ``domain.com``.
                    }
                ],
                "functions": [
                    {
                        "alerts": [
                            {
                                "disabled": bool,  #
                                  Optional. Is the alert disabled?.
                                "operator":
                                  "UNSPECIFIED_OPERATOR",  # Optional. Default value is
                                  "UNSPECIFIED_OPERATOR". Known values are:
                                  "UNSPECIFIED_OPERATOR", "GREATER_THAN", and
                                  "LESS_THAN".
                                "rule":
                                  "UNSPECIFIED_RULE",  # Optional. Default value is
                                  "UNSPECIFIED_RULE". Known values are:
                                  "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                                  "MEM_UTILIZATION", "RESTART_COUNT",
                                  "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE",
                                  "DOMAIN_FAILED", "DOMAIN_LIVE",
                                  "FUNCTIONS_ACTIVATION_COUNT",
                                  "FUNCTIONS_AVERAGE_DURATION_MS",
                                  "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                                  "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                                  "FUNCTIONS_ERROR_COUNT", and
                                  "FUNCTIONS_GB_RATE_PER_SECOND".
                                "value": 0.0,  #
                                  Optional. Threshold value for alert.
                                "window":
                                  "UNSPECIFIED_WINDOW"  # Optional. Default value is
                                  "UNSPECIFIED_WINDOW". Known values are:
                                  "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES",
                                  "THIRTY_MINUTES", and "ONE_HOUR".
                            }
                        ],
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "ingress": {
                    "rules": [
                        {
                            "component": {
                                "name": "str",  # The
                                  name of the component to route to. Required.
"preserve_path_prefix": "str",  # Optional. An
                                  optional flag to preserve the path that is forwarded
                                  to the backend service. By default, the HTTP request
                                  path will be trimmed from the left when forwarded to
                                  the component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``. Note: this is not
                                  applicable for Functions Components and is mutually
                                  exclusive with ``rewrite``.
                                "rewrite": "str"  #
                                  Optional. An optional field that will rewrite the
                                  path of the component to be what is specified here.
                                  By default, the HTTP request path will be trimmed
                                  from the left when forwarded to the component. For
                                  example, a component with ``path=/api`` will have
                                  requests to ``/api/list`` trimmed to ``/list``. If
                                  you specified the rewrite to be ``/v1/``"" , requests
                                  to ``/api/list`` would be rewritten to ``/v1/list``.
                                  Note: this is mutually exclusive with
                                  ``preserve_path_prefix``.
                            },
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "match": {
                                "path": {
                                    "prefix":
                                      "str"  # Prefix-based match. For example,
                                      ``/api`` will match ``/api``"" , ``/api/``"" ,
                                      and any nested paths such as
                                      ``/api/v1/endpoint``. Required.
                                }
                            },
                            "redirect": {
                                "authority": "str",
                                  # Optional. The authority/host to redirect to. This
                                  can be a hostname or IP address. Note: use ``port``
                                  to set the port.
                                "port": 0,  #
                                  Optional. The port to redirect to.
                                "redirect_code": 0,
                                  # Optional. The redirect code to use. Defaults to
                                  ``302``. Supported values are 300, 301, 302, 303,
                                  304, 307, 308.
                                "scheme": "str",  #
                                  Optional. The scheme to redirect to. Supported values
                                  are ``http`` or ``https``. Default: ``https``.
                                "uri": "str"  #
                                  Optional. An optional URI path to redirect to. Note:
                                  if this is specified the whole URI of the original
                                  request will be overwritten to this value,
                                  irrespective of the original request URI being
                                  matched.
                            }
                        }
                    ]
                },
                "jobs": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "kind": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * UNSPECIFIED: Default job
                          type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY:
                          Indicates a job that runs before an app deployment."n*
                          POST_DEPLOY: Indicates a job that runs after an app
                          deployment."n* FAILED_DEPLOY: Indicates a job that runs after
                          a component fails to deploy. Known values are: "UNSPECIFIED",
                          "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "name": "str",  # The name of the app. Must be unique
                  across all apps in the same account. Required.
                "region": "str",  # Optional. The slug form of the
                  geographical origin of the app. Default: ``nearest available``. Known
                  values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon",
                  and "syd".
                "services": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "health_check": {
                            "failure_threshold": 0,  #
                              Optional. The number of failed health checks before
                              considered unhealthy.
                            "http_path": "str",  #
                              Optional. The route path used for the HTTP health check
                              ping. If not set, the HTTP health check will be disabled
                              and a TCP health check used instead.
                            "initial_delay_seconds": 0,
                              # Optional. The number of seconds to wait before
                              beginning health checks.
                            "period_seconds": 0,  #
                              Optional. The number of seconds to wait between health
                              checks.
                            "port": 0,  # Optional. The
                              port on which the health check will be performed. If not
                              set, the health check will be performed on the
                              component's http_port.
                            "success_threshold": 0,  #
                              Optional. The number of successful health checks before
                              considered healthy.
                            "timeout_seconds": 0  #
                              Optional. The number of seconds after which the check
                              times out.
                        },
                        "http_port": 0,  # Optional. The
                          internal port on which this service's run command will
                          listen. Default: 8080"nIf there is not an environment
                          variable with the name ``PORT``"" , one will be automatically
                          added with its value set to the value of this field.
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "internal_ports": [
                            0  # Optional. The ports on
                              which this service will listen for internal traffic.
                        ],
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "static_sites": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "catchall_document": "str",  #
                          Optional. The name of the document to use as the fallback for
                          any requests to documents that are not found when serving
                          this static site. Only 1 of ``catchall_document`` or
                          ``error_document`` can be set.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "error_document": "404.html",  #
                          Optional. Default value is "404.html". The name of the error
                          document to use when serving this static site. Default:
                          404.html. If no such file exists within the built assets, App
                          Platform will supply one.
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "index_document": "index.html",  #
                          Optional. Default value is "index.html". The name of the
                          index document to use when serving this static site. Default:
                          index.html.
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "output_dir": "str",  # Optional. An
                          optional path to where the built assets will be located,
                          relative to the build context. If not set, App Platform will
                          automatically scan for these directory names: ``_static``"" ,
                          ``dist``"" , ``public``"" , ``build``.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "workers": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ]
            },
            "static_sites": [
                {
                    "name": "str",  # Optional. The name of this
                      static site.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this static
                      site.
                }
            ],
            "tier_slug": "str",  # Optional. The current pricing tier
              slug of the deployment.
            "updated_at": "2020-02-20 00:00:00",  # Optional. When the
              deployment was last updated.
            "workers": [
                {
                    "name": "str",  # Optional. The name of this
                      worker.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this worker.
                }
            ]
        },
        "pinned_deployment": {
            "cause": "str",  # Optional. What caused this deployment to
              be created.
            "cloned_from": "str",  # Optional. The ID of a previous
              deployment that this deployment was cloned from.
            "created_at": "2020-02-20 00:00:00",  # Optional. The
              creation time of the deployment.
            "functions": [
                {
                    "name": "str",  # Optional. The name of this
                      functions component.
                    "namespace": "str",  # Optional. The
                      namespace where the functions are deployed.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      functions component.
                }
            ],
            "id": "str",  # Optional. The ID of the deployment.
            "jobs": [
                {
                    "name": "str",  # Optional. The name of this
                      job.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this job.
                }
            ],
            "phase": "UNKNOWN",  # Optional. Default value is "UNKNOWN".
              Known values are: "UNKNOWN", "PENDING_BUILD", "BUILDING",
              "PENDING_DEPLOY", "DEPLOYING", "ACTIVE", "SUPERSEDED", "ERROR", and
              "CANCELED".
            "phase_last_updated_at": "2020-02-20 00:00:00",  # Optional.
              When the deployment phase was last updated.
            "progress": {
                "error_steps": 0,  # Optional. Number of unsuccessful
                  steps.
                "pending_steps": 0,  # Optional. Number of pending
                  steps.
                "running_steps": 0,  # Optional. Number of currently
                  running steps.
                "steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "success_steps": 0,  # Optional. Number of successful
                  steps.
                "summary_steps": [
                    {
                        "component_name": "str",  # Optional.
                          The component name that this step is associated with.
                        "ended_at": "2020-02-20 00:00:00",  #
                          Optional. The end time of this step.
                        "message_base": "str",  # Optional.
                          The base of a human-readable description of the step intended
                          to be combined with the component name for presentation. For
                          example:"n"n``message_base`` = "Building
                          service""n``component_name`` = "api".
                        "name": "str",  # Optional. The name
                          of this step.
                        "reason": {
                            "code": "str",  # Optional.
                              The error code.
                            "message": "str"  # Optional.
                              The error message.
                        },
                        "started_at": "2020-02-20 00:00:00",
                          # Optional. The start time of this step.
                        "status": "UNKNOWN",  # Optional.
                          Default value is "UNKNOWN". Known values are: "UNKNOWN",
                          "PENDING", "RUNNING", "ERROR", and "SUCCESS".
                        "steps": [
                            {}  # Optional. Child steps
                              of this step.
                        ]
                    }
                ],
                "total_steps": 0  # Optional. Total number of steps.
            },
            "services": [
                {
                    "name": "str",  # Optional. The name of this
                      service.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this
                      service.
                }
            ],
            "spec": {
                "databases": [
                    {
                        "cluster_name": "str",  # Optional.
                          The name of the underlying DigitalOcean DBaaS cluster. This
                          is required for production databases. For dev databases, if
                          cluster_name is not set, a new cluster will be provisioned.
                        "db_name": "str",  # Optional. The
                          name of the MySQL or PostgreSQL database to configure.
                        "db_user": "str",  # Optional. The
                          name of the MySQL or PostgreSQL user to configure.
                        "engine": "UNSET",  # Optional.
                          Default value is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n*
                          REDIS: Redis. Known values are: "UNSET", "MYSQL", "PG", and
                          "REDIS".
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "production": bool,  # Optional.
                          Whether this is a production or dev database.
                        "version": "str"  # Optional. The
                          version of the database engine.
                    }
                ],
                "domains": [
                    {
                        "domain": "str",  # The hostname for
                          the domain. Required.
                        "minimum_tls_version": "str",  #
                          Optional. The minimum version of TLS a client application can
                          use to access resources for the domain.  Must be one of the
                          following values wrapped within quotations: ``"1.2"`` or
                          ``"1.3"``. Known values are: "1.2" and "1.3".
                        "type": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * DEFAULT: The default
                          ``.ondigitalocean.app`` domain assigned to this app"n*
                          PRIMARY: The primary domain for this app that is displayed as
                          the default in the control panel, used in bindable
                          environment variables, and any other places that reference an
                          app's live URL. Only one domain may be set as primary."n*
                          ALIAS: A non-primary domain. Known values are: "UNSPECIFIED",
                          "DEFAULT", "PRIMARY", and "ALIAS".
                        "wildcard": bool,  # Optional.
                          Indicates whether the domain includes all sub-domains, in
                          addition to the given domain.
                        "zone": "str"  # Optional. Optional.
                          If the domain uses DigitalOcean DNS and you would like
                          App"nPlatform to automatically manage it for you, set this to
                          the name of the"ndomain on your account."n"nFor example, If
                          the domain you are adding is ``app.domain.com``"" , the
                          zone"ncould be ``domain.com``.
                    }
                ],
                "functions": [
                    {
                        "alerts": [
                            {
                                "disabled": bool,  #
                                  Optional. Is the alert disabled?.
                                "operator":
                                  "UNSPECIFIED_OPERATOR",  # Optional. Default value is
                                  "UNSPECIFIED_OPERATOR". Known values are:
                                  "UNSPECIFIED_OPERATOR", "GREATER_THAN", and
                                  "LESS_THAN".
                                "rule":
                                  "UNSPECIFIED_RULE",  # Optional. Default value is
                                  "UNSPECIFIED_RULE". Known values are:
                                  "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                                  "MEM_UTILIZATION", "RESTART_COUNT",
                                  "DEPLOYMENT_FAILED", "DEPLOYMENT_LIVE",
                                  "DOMAIN_FAILED", "DOMAIN_LIVE",
                                  "FUNCTIONS_ACTIVATION_COUNT",
                                  "FUNCTIONS_AVERAGE_DURATION_MS",
                                  "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                                  "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                                  "FUNCTIONS_ERROR_COUNT", and
                                  "FUNCTIONS_GB_RATE_PER_SECOND".
                                "value": 0.0,  #
                                  Optional. Threshold value for alert.
                                "window":
                                  "UNSPECIFIED_WINDOW"  # Optional. Default value is
                                  "UNSPECIFIED_WINDOW". Known values are:
                                  "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES",
                                  "THIRTY_MINUTES", and "ONE_HOUR".
                            }
                        ],
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # The name. Must be
                          unique across all components within the same app. Required.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "ingress": {
                    "rules": [
                        {
                            "component": {
                                "name": "str",  # The
                                  name of the component to route to. Required.
"preserve_path_prefix": "str",  # Optional. An
                                  optional flag to preserve the path that is forwarded
                                  to the backend service. By default, the HTTP request
                                  path will be trimmed from the left when forwarded to
                                  the component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``. Note: this is not
                                  applicable for Functions Components and is mutually
                                  exclusive with ``rewrite``.
                                "rewrite": "str"  #
                                  Optional. An optional field that will rewrite the
                                  path of the component to be what is specified here.
                                  By default, the HTTP request path will be trimmed
                                  from the left when forwarded to the component. For
                                  example, a component with ``path=/api`` will have
                                  requests to ``/api/list`` trimmed to ``/list``. If
                                  you specified the rewrite to be ``/v1/``"" , requests
                                  to ``/api/list`` would be rewritten to ``/v1/list``.
                                  Note: this is mutually exclusive with
                                  ``preserve_path_prefix``.
                            },
                            "cors": {
                                "allow_credentials":
                                  bool,  # Optional. Whether browsers should expose the
                                  response to the client-side JavaScript code when the
                                  request"u2019s credentials mode is include. This
                                  configures the ``Access-Control-Allow-Credentials``
                                  header.
                                "allow_headers": [
                                    "str"  #
                                      Optional. The set of allowed HTTP request
                                      headers. This configures the
                                      ``Access-Control-Allow-Headers`` header.
                                ],
                                "allow_methods": [
                                    "str"  #
                                      Optional. The set of allowed HTTP methods. This
                                      configures the ``Access-Control-Allow-Methods``
                                      header.
                                ],
                                "allow_origins": [
                                    {
"exact": "str",  # Optional. Exact string
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"prefix": "str",  # Optional. Prefix-based
                                          match. Only 1 of ``exact``"" , ``prefix``"" ,
                                          or ``regex`` must be set.
"regex": "str"  # Optional. RE2 style
                                          regex-based match. Only 1 of ``exact``"" ,
                                          ``prefix``"" , or ``regex`` must be set. For
                                          more information about RE2 syntax, see:
                                          https://github.com/google/re2/wiki/Syntax.
                                    }
                                ],
                                "expose_headers": [
                                    "str"  #
                                      Optional. The set of HTTP response headers that
                                      browsers are allowed to access. This configures
                                      the ``Access-Control-Expose-Headers`` header.
                                ],
                                "max_age": "str"  #
                                  Optional. An optional duration specifying how long
                                  browsers can cache the results of a preflight
                                  request. This configures the
                                  ``Access-Control-Max-Age`` header.
                            },
                            "match": {
                                "path": {
                                    "prefix":
                                      "str"  # Prefix-based match. For example,
                                      ``/api`` will match ``/api``"" , ``/api/``"" ,
                                      and any nested paths such as
                                      ``/api/v1/endpoint``. Required.
                                }
                            },
                            "redirect": {
                                "authority": "str",
                                  # Optional. The authority/host to redirect to. This
                                  can be a hostname or IP address. Note: use ``port``
                                  to set the port.
                                "port": 0,  #
                                  Optional. The port to redirect to.
                                "redirect_code": 0,
                                  # Optional. The redirect code to use. Defaults to
                                  ``302``. Supported values are 300, 301, 302, 303,
                                  304, 307, 308.
                                "scheme": "str",  #
                                  Optional. The scheme to redirect to. Supported values
                                  are ``http`` or ``https``. Default: ``https``.
                                "uri": "str"  #
                                  Optional. An optional URI path to redirect to. Note:
                                  if this is specified the whole URI of the original
                                  request will be overwritten to this value,
                                  irrespective of the original request URI being
                                  matched.
                            }
                        }
                    ]
                },
                "jobs": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "kind": "UNSPECIFIED",  # Optional.
                          Default value is "UNSPECIFIED". * UNSPECIFIED: Default job
                          type, will auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY:
                          Indicates a job that runs before an app deployment."n*
                          POST_DEPLOY: Indicates a job that runs after an app
                          deployment."n* FAILED_DEPLOY: Indicates a job that runs after
                          a component fails to deploy. Known values are: "UNSPECIFIED",
                          "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "name": "str",  # The name of the app. Must be unique
                  across all apps in the same account. Required.
                "region": "str",  # Optional. The slug form of the
                  geographical origin of the app. Default: ``nearest available``. Known
                  values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon",
                  and "syd".
                "services": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "health_check": {
                            "failure_threshold": 0,  #
                              Optional. The number of failed health checks before
                              considered unhealthy.
                            "http_path": "str",  #
                              Optional. The route path used for the HTTP health check
                              ping. If not set, the HTTP health check will be disabled
                              and a TCP health check used instead.
                            "initial_delay_seconds": 0,
                              # Optional. The number of seconds to wait before
                              beginning health checks.
                            "period_seconds": 0,  #
                              Optional. The number of seconds to wait between health
                              checks.
                            "port": 0,  # Optional. The
                              port on which the health check will be performed. If not
                              set, the health check will be performed on the
                              component's http_port.
                            "success_threshold": 0,  #
                              Optional. The number of successful health checks before
                              considered healthy.
                            "timeout_seconds": 0  #
                              Optional. The number of seconds after which the check
                              times out.
                        },
                        "http_port": 0,  # Optional. The
                          internal port on which this service's run command will
                          listen. Default: 8080"nIf there is not an environment
                          variable with the name ``PORT``"" , one will be automatically
                          added with its value set to the value of this field.
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "internal_ports": [
                            0  # Optional. The ports on
                              which this service will listen for internal traffic.
                        ],
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "static_sites": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "catchall_document": "str",  #
                          Optional. The name of the document to use as the fallback for
                          any requests to documents that are not found when serving
                          this static site. Only 1 of ``catchall_document`` or
                          ``error_document`` can be set.
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "error_document": "404.html",  #
                          Optional. Default value is "404.html". The name of the error
                          document to use when serving this static site. Default:
                          404.html. If no such file exists within the built assets, App
                          Platform will supply one.
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "index_document": "index.html",  #
                          Optional. Default value is "index.html". The name of the
                          index document to use when serving this static site. Default:
                          index.html.
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "output_dir": "str",  # Optional. An
                          optional path to where the built assets will be located,
                          relative to the build context. If not set, App Platform will
                          automatically scan for these directory names: ``_static``"" ,
                          ``dist``"" , ``public``"" , ``build``.
                        "routes": [
                            {
                                "path": "str",  #
                                  Optional. An HTTP path prefix. Paths must start with
                                  / and must be unique across all components within an
                                  app.
"preserve_path_prefix": bool  # Optional. An optional
                                  flag to preserve the path that is forwarded to the
                                  backend service. By default, the HTTP request path
                                  will be trimmed from the left when forwarded to the
                                  component. For example, a component with
                                  ``path=/api`` will have requests to ``/api/list``
                                  trimmed to ``/list``. If this value is ``true``"" ,
                                  the path will remain ``/api/list``.
                            }
                        ],
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ],
                "workers": [
                    {
                        "build_command": "str",  # Optional.
                          An optional build command to run while building this
                          component from source.
                        "dockerfile_path": "str",  #
                          Optional. The path to the Dockerfile relative to the root of
                          the repo. If set, it will be used to build this component.
                          Otherwise, App Platform will attempt to build it using
                          buildpacks.
                        "environment_slug": "str",  #
                          Optional. An environment slug describing the type of this
                          app. For a full list, please refer to `the product
                          documentation
                          <https://www.digitalocean.com/docs/app-platform/>`_.
                        "envs": [
                            {
                                "key": "str",  # The
                                  variable name. Required.
                                "scope":
                                  "RUN_AND_BUILD_TIME",  # Optional. Default value is
                                  "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only
                                  at run-time"n* BUILD_TIME: Made available only at
                                  build-time"n* RUN_AND_BUILD_TIME: Made available at
                                  both build and run-time. Known values are: "UNSET",
                                  "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                                "type": "GENERAL",  #
                                  Optional. Default value is "GENERAL". * GENERAL: A
                                  plain-text environment variable"n* SECRET: A secret
                                  encrypted environment variable. Known values are:
                                  "GENERAL" and "SECRET".
                                "value": "str"  #
                                  Optional. The value. If the type is ``SECRET``"" ,
                                  the value will be encrypted on first submission. On
                                  following submissions, the encrypted value should be
                                  used.
                            }
                        ],
                        "git": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "repo_clone_url": "str"  #
                              Optional. The clone URL of the repo. Example:
                              ``https://github.com/digitalocean/sample-golang.git``.
                        },
                        "github": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "gitlab": {
                            "branch": "str",  # Optional.
                              The name of the branch to use.
                            "deploy_on_push": bool,  #
                              Optional. Whether to automatically deploy new commits
                              made to the repo.
                            "repo": "str"  # Optional.
                              The name of the repo in the format owner/repo. Example:
                              ``digitalocean/sample-golang``.
                        },
                        "image": {
                            "registry": "str",  #
                              Optional. The registry name. Must be left empty for the
                              ``DOCR`` registry type.
                            "registry_type": "str",  #
                              Optional. * DOCKER_HUB: The DockerHub container registry
                              type."n* DOCR: The DigitalOcean container registry type.
                              Known values are: "DOCKER_HUB" and "DOCR".
                            "repository": "str",  #
                              Optional. The repository name.
                            "tag": "latest"  # Optional.
                              Default value is "latest". The repository tag. Defaults
                              to ``latest`` if not provided.
                        },
                        "instance_count": 1,  # Optional.
                          Default value is 1. The amount of instances that this
                          component should be scaled to. Default: 1.
                        "instance_size_slug": "basic-xxs",  #
                          Optional. Default value is "basic-xxs". The instance size to
                          use for this component. Default: ``basic-xxs``. Known values
                          are: "basic-xxs", "basic-xs", "basic-s", "basic-m",
                          "professional-xs", "professional-s", "professional-m",
                          "professional-1l", "professional-l", and "professional-xl".
                        "log_destinations": {
                            "datadog": {
                                "api_key": "str",  #
                                  Datadog API key. Required.
                                "endpoint": "str"  #
                                  Optional. Datadog HTTP log intake endpoint.
                            },
                            "logtail": {
                                "token": "str"  #
                                  Optional. Logtail token.
                            },
                            "name": "str",  # Required.
                            "papertrail": {
                                "endpoint": "str"  #
                                  Papertrail syslog endpoint. Required.
                            }
                        },
                        "name": "str",  # Optional. The name.
                          Must be unique across all components within the same app.
                        "run_command": "str",  # Optional. An
                          optional run command to override the component's default.
                        "source_dir": "str"  # Optional. An
                          optional path to the working directory to use for the build.
                          For Dockerfile builds, this will be used as the build
                          context. Must be relative to the root of the repo.
                    }
                ]
            },
            "static_sites": [
                {
                    "name": "str",  # Optional. The name of this
                      static site.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this static
                      site.
                }
            ],
            "tier_slug": "str",  # Optional. The current pricing tier
              slug of the deployment.
            "updated_at": "2020-02-20 00:00:00",  # Optional. When the
              deployment was last updated.
            "workers": [
                {
                    "name": "str",  # Optional. The name of this
                      worker.
                    "source_commit_hash": "str"  # Optional. The
                      commit hash of the repository that was used to build this worker.
                }
            ]
        },
        "project_id": "str",  # Optional. The ID of the project the app is
          assigned to. This will be empty if there is a lookup failure.
        "region": {
            "continent": "str",  # Optional. The continent that this
              region is in.
            "data_centers": [
                "str"  # Optional. Data centers that are in this
                  region.
            ],
            "default": bool,  # Optional. Whether or not the region is
              presented as the default.
            "disabled": bool,  # Optional. Whether or not the region is
              open for new apps.
            "flag": "str",  # Optional. The flag of this region.
            "label": "str",  # Optional. A human-readable name of the
              region.
            "reason": "str",  # Optional. Reason that this region is not
              available.
            "slug": "str"  # Optional. The slug form of the region name.
        },
        "spec": {
            "databases": [
                {
                    "cluster_name": "str",  # Optional. The name
                      of the underlying DigitalOcean DBaaS cluster. This is required
                      for production databases. For dev databases, if cluster_name is
                      not set, a new cluster will be provisioned.
                    "db_name": "str",  # Optional. The name of
                      the MySQL or PostgreSQL database to configure.
                    "db_user": "str",  # Optional. The name of
                      the MySQL or PostgreSQL user to configure.
                    "engine": "UNSET",  # Optional. Default value
                      is "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis.
                      Known values are: "UNSET", "MYSQL", "PG", and "REDIS".
                    "name": "str",  # The name. Must be unique
                      across all components within the same app. Required.
                    "production": bool,  # Optional. Whether this
                      is a production or dev database.
                    "version": "str"  # Optional. The version of
                      the database engine.
                }
            ],
            "domains": [
                {
                    "domain": "str",  # The hostname for the
                      domain. Required.
                    "minimum_tls_version": "str",  # Optional.
                      The minimum version of TLS a client application can use to access
                      resources for the domain.  Must be one of the following values
                      wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values
                      are: "1.2" and "1.3".
                    "type": "UNSPECIFIED",  # Optional. Default
                      value is "UNSPECIFIED". * DEFAULT: The default
                      ``.ondigitalocean.app`` domain assigned to this app"n* PRIMARY:
                      The primary domain for this app that is displayed as the default
                      in the control panel, used in bindable environment variables, and
                      any other places that reference an app's live URL. Only one
                      domain may be set as primary."n* ALIAS: A non-primary domain.
                      Known values are: "UNSPECIFIED", "DEFAULT", "PRIMARY", and
                      "ALIAS".
                    "wildcard": bool,  # Optional. Indicates
                      whether the domain includes all sub-domains, in addition to the
                      given domain.
                    "zone": "str"  # Optional. Optional. If the
                      domain uses DigitalOcean DNS and you would like App"nPlatform to
                      automatically manage it for you, set this to the name of
                      the"ndomain on your account."n"nFor example, If the domain you
                      are adding is ``app.domain.com``"" , the zone"ncould be
                      ``domain.com``.
                }
            ],
            "functions": [
                {
                    "alerts": [
                        {
                            "disabled": bool,  #
                              Optional. Is the alert disabled?.
                            "operator":
                              "UNSPECIFIED_OPERATOR",  # Optional. Default value is
                              "UNSPECIFIED_OPERATOR". Known values are:
                              "UNSPECIFIED_OPERATOR", "GREATER_THAN", and "LESS_THAN".
                            "rule": "UNSPECIFIED_RULE",
                              # Optional. Default value is "UNSPECIFIED_RULE". Known
                              values are: "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                              "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED",
                              "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE",
                              "FUNCTIONS_ACTIVATION_COUNT",
                              "FUNCTIONS_AVERAGE_DURATION_MS",
                              "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                              "FUNCTIONS_AVERAGE_WAIT_TIME_MS",
                              "FUNCTIONS_ERROR_COUNT", and
                              "FUNCTIONS_GB_RATE_PER_SECOND".
                            "value": 0.0,  # Optional.
                              Threshold value for alert.
                            "window":
                              "UNSPECIFIED_WINDOW"  # Optional. Default value is
                              "UNSPECIFIED_WINDOW". Known values are:
                              "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES",
                              "THIRTY_MINUTES", and "ONE_HOUR".
                        }
                    ],
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # The name. Must be unique
                      across all components within the same app. Required.
                    "routes": [
                        {
                            "path": "str",  # Optional.
                              An HTTP path prefix. Paths must start with / and must be
                              unique across all components within an app.
                            "preserve_path_prefix": bool
                              # Optional. An optional flag to preserve the path that is
                              forwarded to the backend service. By default, the HTTP
                              request path will be trimmed from the left when forwarded
                              to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``.
                        }
                    ],
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "ingress": {
                "rules": [
                    {
                        "component": {
                            "name": "str",  # The name of
                              the component to route to. Required.
                            "preserve_path_prefix":
                              "str",  # Optional. An optional flag to preserve the path
                              that is forwarded to the backend service. By default, the
                              HTTP request path will be trimmed from the left when
                              forwarded to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``. Note: this is not applicable for
                              Functions Components and is mutually exclusive with
                              ``rewrite``.
                            "rewrite": "str"  # Optional.
                              An optional field that will rewrite the path of the
                              component to be what is specified here. By default, the
                              HTTP request path will be trimmed from the left when
                              forwarded to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If you specified the rewrite to be
                              ``/v1/``"" , requests to ``/api/list`` would be rewritten
                              to ``/v1/list``. Note: this is mutually exclusive with
                              ``preserve_path_prefix``.
                        },
                        "cors": {
                            "allow_credentials": bool,  #
                              Optional. Whether browsers should expose the response to
                              the client-side JavaScript code when the request"u2019s
                              credentials mode is include. This configures the
                              ``Access-Control-Allow-Credentials`` header.
                            "allow_headers": [
                                "str"  # Optional.
                                  The set of allowed HTTP request headers. This
                                  configures the ``Access-Control-Allow-Headers``
                                  header.
                            ],
                            "allow_methods": [
                                "str"  # Optional.
                                  The set of allowed HTTP methods. This configures the
                                  ``Access-Control-Allow-Methods`` header.
                            ],
                            "allow_origins": [
                                {
                                    "exact":
                                      "str",  # Optional. Exact string match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "prefix":
                                      "str",  # Optional. Prefix-based match. Only 1 of
                                      ``exact``"" , ``prefix``"" , or ``regex`` must be
                                      set.
                                    "regex":
                                      "str"  # Optional. RE2 style regex-based match.
                                      Only 1 of ``exact``"" , ``prefix``"" , or
                                      ``regex`` must be set. For more information about
                                      RE2 syntax, see:
                                      https://github.com/google/re2/wiki/Syntax.
                                }
                            ],
                            "expose_headers": [
                                "str"  # Optional.
                                  The set of HTTP response headers that browsers are
                                  allowed to access. This configures the
                                  ``Access-Control-Expose-Headers`` header.
                            ],
                            "max_age": "str"  # Optional.
                              An optional duration specifying how long browsers can
                              cache the results of a preflight request. This configures
                              the ``Access-Control-Max-Age`` header.
                        },
                        "match": {
                            "path": {
                                "prefix": "str"  #
                                  Prefix-based match. For example, ``/api`` will match
                                  ``/api``"" , ``/api/``"" , and any nested paths such
                                  as ``/api/v1/endpoint``. Required.
                            }
                        },
                        "redirect": {
                            "authority": "str",  #
                              Optional. The authority/host to redirect to. This can be
                              a hostname or IP address. Note: use ``port`` to set the
                              port.
                            "port": 0,  # Optional. The
                              port to redirect to.
                            "redirect_code": 0,  #
                              Optional. The redirect code to use. Defaults to ``302``.
                              Supported values are 300, 301, 302, 303, 304, 307, 308.
                            "scheme": "str",  # Optional.
                              The scheme to redirect to. Supported values are ``http``
                              or ``https``. Default: ``https``.
                            "uri": "str"  # Optional. An
                              optional URI path to redirect to. Note: if this is
                              specified the whole URI of the original request will be
                              overwritten to this value, irrespective of the original
                              request URI being matched.
                        }
                    }
                ]
            },
            "jobs": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "instance_count": 1,  # Optional. Default
                      value is 1. The amount of instances that this component should be
                      scaled to. Default: 1.
                    "instance_size_slug": "basic-xxs",  #
                      Optional. Default value is "basic-xxs". The instance size to use
                      for this component. Default: ``basic-xxs``. Known values are:
                      "basic-xxs", "basic-xs", "basic-s", "basic-m", "professional-xs",
                      "professional-s", "professional-m", "professional-1l",
                      "professional-l", and "professional-xl".
                    "kind": "UNSPECIFIED",  # Optional. Default
                      value is "UNSPECIFIED". * UNSPECIFIED: Default job type, will
                      auto-complete to POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job
                      that runs before an app deployment."n* POST_DEPLOY: Indicates a
                      job that runs after an app deployment."n* FAILED_DEPLOY:
                      Indicates a job that runs after a component fails to deploy.
                      Known values are: "UNSPECIFIED", "PRE_DEPLOY", "POST_DEPLOY", and
                      "FAILED_DEPLOY".
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "name": "str",  # The name of the app. Must be unique across
              all apps in the same account. Required.
            "region": "str",  # Optional. The slug form of the
              geographical origin of the app. Default: ``nearest available``. Known
              values are: "ams", "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and
              "syd".
            "services": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "health_check": {
                        "failure_threshold": 0,  # Optional.
                          The number of failed health checks before considered
                          unhealthy.
                        "http_path": "str",  # Optional. The
                          route path used for the HTTP health check ping. If not set,
                          the HTTP health check will be disabled and a TCP health check
                          used instead.
                        "initial_delay_seconds": 0,  #
                          Optional. The number of seconds to wait before beginning
                          health checks.
                        "period_seconds": 0,  # Optional. The
                          number of seconds to wait between health checks.
                        "port": 0,  # Optional. The port on
                          which the health check will be performed. If not set, the
                          health check will be performed on the component's http_port.
                        "success_threshold": 0,  # Optional.
                          The number of successful health checks before considered
                          healthy.
                        "timeout_seconds": 0  # Optional. The
                          number of seconds after which the check times out.
                    },
                    "http_port": 0,  # Optional. The internal
                      port on which this service's run command will listen. Default:
                      8080"nIf there is not an environment variable with the name
                      ``PORT``"" , one will be automatically added with its value set
                      to the value of this field.
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "instance_count": 1,  # Optional. Default
                      value is 1. The amount of instances that this component should be
                      scaled to. Default: 1.
                    "instance_size_slug": "basic-xxs",  #
                      Optional. Default value is "basic-xxs". The instance size to use
                      for this component. Default: ``basic-xxs``. Known values are:
                      "basic-xxs", "basic-xs", "basic-s", "basic-m", "professional-xs",
                      "professional-s", "professional-m", "professional-1l",
                      "professional-l", and "professional-xl".
                    "internal_ports": [
                        0  # Optional. The ports on which
                          this service will listen for internal traffic.
                    ],
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "routes": [
                        {
                            "path": "str",  # Optional.
                              An HTTP path prefix. Paths must start with / and must be
                              unique across all components within an app.
                            "preserve_path_prefix": bool
                              # Optional. An optional flag to preserve the path that is
                              forwarded to the backend service. By default, the HTTP
                              request path will be trimmed from the left when forwarded
                              to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``.
                        }
                    ],
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "static_sites": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "catchall_document": "str",  # Optional. The
                      name of the document to use as the fallback for any requests to
                      documents that are not found when serving this static site. Only
                      1 of ``catchall_document`` or ``error_document`` can be set.
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "error_document": "404.html",  # Optional.
                      Default value is "404.html". The name of the error document to
                      use when serving this static site. Default: 404.html. If no such
                      file exists within the built assets, App Platform will supply
                      one.
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "index_document": "index.html",  # Optional.
                      Default value is "index.html". The name of the index document to
                      use when serving this static site. Default: index.html.
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "output_dir": "str",  # Optional. An optional
                      path to where the built assets will be located, relative to the
                      build context. If not set, App Platform will automatically scan
                      for these directory names: ``_static``"" , ``dist``"" ,
                      ``public``"" , ``build``.
                    "routes": [
                        {
                            "path": "str",  # Optional.
                              An HTTP path prefix. Paths must start with / and must be
                              unique across all components within an app.
                            "preserve_path_prefix": bool
                              # Optional. An optional flag to preserve the path that is
                              forwarded to the backend service. By default, the HTTP
                              request path will be trimmed from the left when forwarded
                              to the component. For example, a component with
                              ``path=/api`` will have requests to ``/api/list`` trimmed
                              to ``/list``. If this value is ``true``"" , the path will
                              remain ``/api/list``.
                        }
                    ],
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ],
            "workers": [
                {
                    "build_command": "str",  # Optional. An
                      optional build command to run while building this component from
                      source.
                    "dockerfile_path": "str",  # Optional. The
                      path to the Dockerfile relative to the root of the repo. If set,
                      it will be used to build this component. Otherwise, App Platform
                      will attempt to build it using buildpacks.
                    "environment_slug": "str",  # Optional. An
                      environment slug describing the type of this app. For a full
                      list, please refer to `the product documentation
                      <https://www.digitalocean.com/docs/app-platform/>`_.
                    "envs": [
                        {
                            "key": "str",  # The variable
                              name. Required.
                            "scope":
                              "RUN_AND_BUILD_TIME",  # Optional. Default value is
                              "RUN_AND_BUILD_TIME". * RUN_TIME: Made available only at
                              run-time"n* BUILD_TIME: Made available only at
                              build-time"n* RUN_AND_BUILD_TIME: Made available at both
                              build and run-time. Known values are: "UNSET",
                              "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                            "type": "GENERAL",  #
                              Optional. Default value is "GENERAL". * GENERAL: A
                              plain-text environment variable"n* SECRET: A secret
                              encrypted environment variable. Known values are:
                              "GENERAL" and "SECRET".
                            "value": "str"  # Optional.
                              The value. If the type is ``SECRET``"" , the value will
                              be encrypted on first submission. On following
                              submissions, the encrypted value should be used.
                        }
                    ],
                    "git": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "repo_clone_url": "str"  # Optional.
                          The clone URL of the repo. Example:
                          ``https://github.com/digitalocean/sample-golang.git``.
                    },
                    "github": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "gitlab": {
                        "branch": "str",  # Optional. The
                          name of the branch to use.
                        "deploy_on_push": bool,  # Optional.
                          Whether to automatically deploy new commits made to the repo.
                        "repo": "str"  # Optional. The name
                          of the repo in the format owner/repo. Example:
                          ``digitalocean/sample-golang``.
                    },
                    "image": {
                        "registry": "str",  # Optional. The
                          registry name. Must be left empty for the ``DOCR`` registry
                          type.
                        "registry_type": "str",  # Optional.
                          * DOCKER_HUB: The DockerHub container registry type."n* DOCR:
                          The DigitalOcean container registry type. Known values are:
                          "DOCKER_HUB" and "DOCR".
                        "repository": "str",  # Optional. The
                          repository name.
                        "tag": "latest"  # Optional. Default
                          value is "latest". The repository tag. Defaults to ``latest``
                          if not provided.
                    },
                    "instance_count": 1,  # Optional. Default
                      value is 1. The amount of instances that this component should be
                      scaled to. Default: 1.
                    "instance_size_slug": "basic-xxs",  #
                      Optional. Default value is "basic-xxs". The instance size to use
                      for this component. Default: ``basic-xxs``. Known values are:
                      "basic-xxs", "basic-xs", "basic-s", "basic-m", "professional-xs",
                      "professional-s", "professional-m", "professional-1l",
                      "professional-l", and "professional-xl".
                    "log_destinations": {
                        "datadog": {
                            "api_key": "str",  # Datadog
                              API key. Required.
                            "endpoint": "str"  #
                              Optional. Datadog HTTP log intake endpoint.
                        },
                        "logtail": {
                            "token": "str"  # Optional.
                              Logtail token.
                        },
                        "name": "str",  # Required.
                        "papertrail": {
                            "endpoint": "str"  #
                              Papertrail syslog endpoint. Required.
                        }
                    },
                    "name": "str",  # Optional. The name. Must be
                      unique across all components within the same app.
                    "run_command": "str",  # Optional. An
                      optional run command to override the component's default.
                    "source_dir": "str"  # Optional. An optional
                      path to the working directory to use for the build. For
                      Dockerfile builds, this will be used as the build context. Must
                      be relative to the root of the repo.
                }
            ]
        },
        "tier_slug": "str",  # Optional. The current pricing tier slug of the
          app.
        "updated_at": "2020-02-20 00:00:00"  # Optional. Time of the app's
          last configuration update.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
validate_app_spec(body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
validate_app_spec(body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Propose an App Spec.

To propose and validate a spec for a new or existing app, send a POST request to the /v2/apps/propose endpoint. The request returns some information about the proposed app, including app cost and upgrade cost. If an existing app ID is specified, the app spec is treated as a proposed update to the existing app.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "app_cost": 0,  # Optional. The monthly cost of the proposed app in USD using
      the next pricing plan tier. For example, if you propose an app that uses the
      Basic tier, the ``app_tier_upgrade_cost`` field displays the monthly cost of the
      app if it were to use the Professional tier. If the proposed app already uses the
      most expensive tier, the field is empty.
    "app_is_static": bool,  # Optional. Indicates whether the app is a static
      app.
    "app_name_available": bool,  # Optional. Indicates whether the app name is
      available.
    "app_name_suggestion": "str",  # Optional. The suggested name if the proposed
      app name is unavailable.
    "app_tier_downgrade_cost": 0,  # Optional. The monthly cost of the proposed
      app in USD using the previous pricing plan tier. For example, if you propose an
      app that uses the Professional tier, the ``app_tier_downgrade_cost`` field
      displays the monthly cost of the app if it were to use the Basic tier. If the
      proposed app already uses the lest expensive tier, the field is empty.
    "existing_static_apps": "str",  # Optional. The maximum number of free static
      apps the account can have. We will charge you for any additional static apps.
    "spec": {
        "databases": [
            {
                "cluster_name": "str",  # Optional. The name of the
                  underlying DigitalOcean DBaaS cluster. This is required for
                  production databases. For dev databases, if cluster_name is not set,
                  a new cluster will be provisioned.
                "db_name": "str",  # Optional. The name of the MySQL
                  or PostgreSQL database to configure.
                "db_user": "str",  # Optional. The name of the MySQL
                  or PostgreSQL user to configure.
                "engine": "UNSET",  # Optional. Default value is
                  "UNSET". * MYSQL: MySQL"n* PG: PostgreSQL"n* REDIS: Redis. Known
                  values are: "UNSET", "MYSQL", "PG", and "REDIS".
                "name": "str",  # The name. Must be unique across all
                  components within the same app. Required.
                "production": bool,  # Optional. Whether this is a
                  production or dev database.
                "version": "str"  # Optional. The version of the
                  database engine.
            }
        ],
        "domains": [
            {
                "domain": "str",  # The hostname for the domain.
                  Required.
                "minimum_tls_version": "str",  # Optional. The
                  minimum version of TLS a client application can use to access
                  resources for the domain.  Must be one of the following values
                  wrapped within quotations: ``"1.2"`` or ``"1.3"``. Known values are:
                  "1.2" and "1.3".
                "type": "UNSPECIFIED",  # Optional. Default value is
                  "UNSPECIFIED". * DEFAULT: The default ``.ondigitalocean.app`` domain
                  assigned to this app"n* PRIMARY: The primary domain for this app that
                  is displayed as the default in the control panel, used in bindable
                  environment variables, and any other places that reference an app's
                  live URL. Only one domain may be set as primary."n* ALIAS: A
                  non-primary domain. Known values are: "UNSPECIFIED", "DEFAULT",
                  "PRIMARY", and "ALIAS".
                "wildcard": bool,  # Optional. Indicates whether the
                  domain includes all sub-domains, in addition to the given domain.
                "zone": "str"  # Optional. Optional. If the domain
                  uses DigitalOcean DNS and you would like App"nPlatform to
                  automatically manage it for you, set this to the name of the"ndomain
                  on your account."n"nFor example, If the domain you are adding is
                  ``app.domain.com``"" , the zone"ncould be ``domain.com``.
            }
        ],
        "functions": [
            {
                "alerts": [
                    {
                        "disabled": bool,  # Optional. Is the
                          alert disabled?.
                        "operator": "UNSPECIFIED_OPERATOR",
                          # Optional. Default value is "UNSPECIFIED_OPERATOR". Known
                          values are: "UNSPECIFIED_OPERATOR", "GREATER_THAN", and
                          "LESS_THAN".
                        "rule": "UNSPECIFIED_RULE",  #
                          Optional. Default value is "UNSPECIFIED_RULE". Known values
                          are: "UNSPECIFIED_RULE", "CPU_UTILIZATION",
                          "MEM_UTILIZATION", "RESTART_COUNT", "DEPLOYMENT_FAILED",
                          "DEPLOYMENT_LIVE", "DOMAIN_FAILED", "DOMAIN_LIVE",
                          "FUNCTIONS_ACTIVATION_COUNT",
                          "FUNCTIONS_AVERAGE_DURATION_MS",
                          "FUNCTIONS_ERROR_RATE_PER_MINUTE",
                          "FUNCTIONS_AVERAGE_WAIT_TIME_MS", "FUNCTIONS_ERROR_COUNT",
                          and "FUNCTIONS_GB_RATE_PER_SECOND".
                        "value": 0.0,  # Optional. Threshold
                          value for alert.
                        "window": "UNSPECIFIED_WINDOW"  #
                          Optional. Default value is "UNSPECIFIED_WINDOW". Known values
                          are: "UNSPECIFIED_WINDOW", "FIVE_MINUTES", "TEN_MINUTES",
                          "THIRTY_MINUTES", and "ONE_HOUR".
                    }
                ],
                "cors": {
                    "allow_credentials": bool,  # Optional.
                      Whether browsers should expose the response to the client-side
                      JavaScript code when the request"u2019s credentials mode is
                      include. This configures the ``Access-Control-Allow-Credentials``
                      header.
                    "allow_headers": [
                        "str"  # Optional. The set of allowed
                          HTTP request headers. This configures the
                          ``Access-Control-Allow-Headers`` header.
                    ],
                    "allow_methods": [
                        "str"  # Optional. The set of allowed
                          HTTP methods. This configures the
                          ``Access-Control-Allow-Methods`` header.
                    ],
                    "allow_origins": [
                        {
                            "exact": "str",  # Optional.
                              Exact string match. Only 1 of ``exact``"" , ``prefix``""
                              , or ``regex`` must be set.
                            "prefix": "str",  # Optional.
                              Prefix-based match. Only 1 of ``exact``"" , ``prefix``""
                              , or ``regex`` must be set.
                            "regex": "str"  # Optional.
                              RE2 style regex-based match. Only 1 of ``exact``"" ,
                              ``prefix``"" , or ``regex`` must be set. For more
                              information about RE2 syntax, see:
                              https://github.com/google/re2/wiki/Syntax.
                        }
                    ],
                    "expose_headers": [
                        "str"  # Optional. The set of HTTP
                          response headers that browsers are allowed to access. This
                          configures the ``Access-Control-Expose-Headers`` header.
                    ],
                    "max_age": "str"  # Optional. An optional
                      duration specifying how long browsers can cache the results of a
                      preflight request. This configures the ``Access-Control-Max-Age``
                      header.
                },
                "envs": [
                    {
                        "key": "str",  # The variable name.
                          Required.
                        "scope": "RUN_AND_BUILD_TIME",  #
                          Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME:
                          Made available only at run-time"n* BUILD_TIME: Made available
                          only at build-time"n* RUN_AND_BUILD_TIME: Made available at
                          both build and run-time. Known values are: "UNSET",
                          "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                        "type": "GENERAL",  # Optional.
                          Default value is "GENERAL". * GENERAL: A plain-text
                          environment variable"n* SECRET: A secret encrypted
                          environment variable. Known values are: "GENERAL" and
                          "SECRET".
                        "value": "str"  # Optional. The
                          value. If the type is ``SECRET``"" , the value will be
                          encrypted on first submission. On following submissions, the
                          encrypted value should be used.
                    }
                ],
                "git": {
                    "branch": "str",  # Optional. The name of the
                      branch to use.
                    "repo_clone_url": "str"  # Optional. The
                      clone URL of the repo. Example:
                      ``https://github.com/digitalocean/sample-golang.git``.
                },
                "github": {
                    "branch": "str",  # Optional. The name of the
                      branch to use.
                    "deploy_on_push": bool,  # Optional. Whether
                      to automatically deploy new commits made to the repo.
                    "repo": "str"  # Optional. The name of the
                      repo in the format owner/repo. Example:
                      ``digitalocean/sample-golang``.
                },
                "gitlab": {
                    "branch": "str",  # Optional. The name of the
                      branch to use.
                    "deploy_on_push": bool,  # Optional. Whether
                      to automatically deploy new commits made to the repo.
                    "repo": "str"  # Optional. The name of the
                      repo in the format owner/repo. Example:
                      ``digitalocean/sample-golang``.
                },
                "log_destinations": {
                    "datadog": {
                        "api_key": "str",  # Datadog API key.
                          Required.
                        "endpoint": "str"  # Optional.
                          Datadog HTTP log intake endpoint.
                    },
                    "logtail": {
                        "token": "str"  # Optional. Logtail
                          token.
                    },
                    "name": "str",  # Required.
                    "papertrail": {
                        "endpoint": "str"  # Papertrail
                          syslog endpoint. Required.
                    }
                },
                "name": "str",  # The name. Must be unique across all
                  components within the same app. Required.
                "routes": [
                    {
                        "path": "str",  # Optional. An HTTP
                          path prefix. Paths must start with / and must be unique
                          across all components within an app.
                        "preserve_path_prefix": bool  #
                          Optional. An optional flag to preserve the path that is
                          forwarded to the backend service. By default, the HTTP
                          request path will be trimmed from the left when forwarded to
                          the component. For example, a component with ``path=/api``
                          will have requests to ``/api/list`` trimmed to ``/list``. If
                          this value is ``true``"" , the path will remain
                          ``/api/list``.
                    }
                ],
                "source_dir": "str"  # Optional. An optional path to
                  the working directory to use for the build. For Dockerfile builds,
                  this will be used as the build context. Must be relative to the root
                  of the repo.
            }
        ],
        "ingress": {
            "rules": [
                {
                    "component": {
                        "name": "str",  # The name of the
                          component to route to. Required.
                        "preserve_path_prefix": "str",  #
                          Optional. An optional flag to preserve the path that is
                          forwarded to the backend service. By default, the HTTP
                          request path will be trimmed from the left when forwarded to
                          the component. For example, a component with ``path=/api``
                          will have requests to ``/api/list`` trimmed to ``/list``. If
                          this value is ``true``"" , the path will remain
                          ``/api/list``. Note: this is not applicable for Functions
                          Components and is mutually exclusive with ``rewrite``.
                        "rewrite": "str"  # Optional. An
                          optional field that will rewrite the path of the component to
                          be what is specified here. By default, the HTTP request path
                          will be trimmed from the left when forwarded to the
                          component. For example, a component with ``path=/api`` will
                          have requests to ``/api/list`` trimmed to ``/list``. If you
                          specified the rewrite to be ``/v1/``"" , requests to
                          ``/api/list`` would be rewritten to ``/v1/list``. Note: this
                          is mutually exclusive with ``preserve_path_prefix``.
                    },
                    "cors": {
                        "allow_credentials": bool,  #
                          Optional. Whether browsers should expose the response to the
                          client-side JavaScript code when the request"u2019s
                          credentials mode is include. This configures the
                          ``Access-Control-Allow-Credentials`` header.
                        "allow_headers": [
                            "str"  # Optional. The set of
                              allowed HTTP request headers. This configures the
                              ``Access-Control-Allow-Headers`` header.
                        ],
                        "allow_methods": [
                            "str"  # Optional. The set of
                              allowed HTTP methods. This configures the
                              ``Access-Control-Allow-Methods`` header.
                        ],
                        "allow_origins": [
                            {
                                "exact": "str",  #
                                  Optional. Exact string match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "prefix": "str",  #
                                  Optional. Prefix-based match. Only 1 of ``exact``"" ,
                                  ``prefix``"" , or ``regex`` must be set.
                                "regex": "str"  #
                                  Optional. RE2 style regex-based match. Only 1 of
                                  ``exact``"" , ``prefix``"" , or ``regex`` must be
                                  set. For more information about RE2 syntax, see:
                                  https://github.com/google/re2/wiki/Syntax.
                            }
                        ],
                        "expose_headers": [
                            "str"  # Optional. The set of
                              HTTP response headers that browsers are allowed to
                              access. This configures the
                              ``Access-Control-Expose-Headers`` header.
                        ],
                        "max_age": "str"  # Optional. An
                          optional duration specifying how long browsers can cache the
                          results of a preflight request. This configures the
                          ``Access-Control-Max-Age`` header.
                    },
                    "match": {
                        "path": {
                            "prefix": "str"  #
                              Prefix-based match. For example, ``/api`` will match
                              ``/api``"" , ``/api/``"" , and any nested paths such as
                              ``/api/v1/endpoint``. Required.
                        }
                    },
                    "redirect": {
                        "authority": "str",  # Optional. The
                          authority/host to redirect to. This can be a hostname or IP
                          address. Note: use ``port`` to set the port.
                        "port": 0,  # Optional. The port to
                          redirect to.
                        "redirect_code": 0,  # Optional. The
                          redirect code to use. Defaults to ``302``. Supported values
                          are 300, 301, 302, 303, 304, 307, 308.
                        "scheme": "str",  # Optional. The
                          scheme to redirect to. Supported values are ``http`` or
                          ``https``. Default: ``https``.
                        "uri": "str"  # Optional. An optional
                          URI path to redirect to. Note: if this is specified the whole
                          URI of the original request will be overwritten to this
                          value, irrespective of the original request URI being
                          matched.
                    }
                }
            ]
        },
        "jobs": [
            {
                "build_command": "str",  # Optional. An optional
                  build command to run while building this component from source.
                "dockerfile_path": "str",  # Optional. The path to
                  the Dockerfile relative to the root of the repo. If set, it will be
                  used to build this component. Otherwise, App Platform will attempt to
                  build it using buildpacks.
                "environment_slug": "str",  # Optional. An
                  environment slug describing the type of this app. For a full list,
                  please refer to `the product documentation
                  <https://www.digitalocean.com/docs/app-platform/>`_.
                "envs": [
                    {
                        "key": "str",  # The variable name.
                          Required.
                        "scope": "RUN_AND_BUILD_TIME",  #
                          Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME:
                          Made available only at run-time"n* BUILD_TIME: Made available
                          only at build-time"n* RUN_AND_BUILD_TIME: Made available at
                          both build and run-time. Known values are: "UNSET",
                          "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                        "type": "GENERAL",  # Optional.
                          Default value is "GENERAL". * GENERAL: A plain-text
                          environment variable"n* SECRET: A secret encrypted
                          environment variable. Known values are: "GENERAL" and
                          "SECRET".
                        "value": "str"  # Optional. The
                          value. If the type is ``SECRET``"" , the value will be
                          encrypted on first submission. On following submissions, the
                          encrypted value should be used.
                    }
                ],
                "git": {
                    "branch": "str",  # Optional. The name of the
                      branch to use.
                    "repo_clone_url": "str"  # Optional. The
                      clone URL of the repo. Example:
                      ``https://github.com/digitalocean/sample-golang.git``.
                },
                "github": {
                    "branch": "str",  # Optional. The name of the
                      branch to use.
                    "deploy_on_push": bool,  # Optional. Whether
                      to automatically deploy new commits made to the repo.
                    "repo": "str"  # Optional. The name of the
                      repo in the format owner/repo. Example:
                      ``digitalocean/sample-golang``.
                },
                "gitlab": {
                    "branch": "str",  # Optional. The name of the
                      branch to use.
                    "deploy_on_push": bool,  # Optional. Whether
                      to automatically deploy new commits made to the repo.
                    "repo": "str"  # Optional. The name of the
                      repo in the format owner/repo. Example:
                      ``digitalocean/sample-golang``.
                },
                "image": {
                    "registry": "str",  # Optional. The registry
                      name. Must be left empty for the ``DOCR`` registry type.
                    "registry_type": "str",  # Optional. *
                      DOCKER_HUB: The DockerHub container registry type."n* DOCR: The
                      DigitalOcean container registry type. Known values are:
                      "DOCKER_HUB" and "DOCR".
                    "repository": "str",  # Optional. The
                      repository name.
                    "tag": "latest"  # Optional. Default value is
                      "latest". The repository tag. Defaults to ``latest`` if not
                      provided.
                },
                "instance_count": 1,  # Optional. Default value is 1.
                  The amount of instances that this component should be scaled to.
                  Default: 1.
                "instance_size_slug": "basic-xxs",  # Optional.
                  Default value is "basic-xxs". The instance size to use for this
                  component. Default: ``basic-xxs``. Known values are: "basic-xxs",
                  "basic-xs", "basic-s", "basic-m", "professional-xs",
                  "professional-s", "professional-m", "professional-1l",
                  "professional-l", and "professional-xl".
                "kind": "UNSPECIFIED",  # Optional. Default value is
                  "UNSPECIFIED". * UNSPECIFIED: Default job type, will auto-complete to
                  POST_DEPLOY kind."n* PRE_DEPLOY: Indicates a job that runs before an
                  app deployment."n* POST_DEPLOY: Indicates a job that runs after an
                  app deployment."n* FAILED_DEPLOY: Indicates a job that runs after a
                  component fails to deploy. Known values are: "UNSPECIFIED",
                  "PRE_DEPLOY", "POST_DEPLOY", and "FAILED_DEPLOY".
                "log_destinations": {
                    "datadog": {
                        "api_key": "str",  # Datadog API key.
                          Required.
                        "endpoint": "str"  # Optional.
                          Datadog HTTP log intake endpoint.
                    },
                    "logtail": {
                        "token": "str"  # Optional. Logtail
                          token.
                    },
                    "name": "str",  # Required.
                    "papertrail": {
                        "endpoint": "str"  # Papertrail
                          syslog endpoint. Required.
                    }
                },
                "name": "str",  # Optional. The name. Must be unique
                  across all components within the same app.
                "run_command": "str",  # Optional. An optional run
                  command to override the component's default.
                "source_dir": "str"  # Optional. An optional path to
                  the working directory to use for the build. For Dockerfile builds,
                  this will be used as the build context. Must be relative to the root
                  of the repo.
            }
        ],
        "name": "str",  # The name of the app. Must be unique across all apps
          in the same account. Required.
        "region": "str",  # Optional. The slug form of the geographical
          origin of the app. Default: ``nearest available``. Known values are: "ams",
          "nyc", "fra", "sfo", "sgp", "blr", "tor", "lon", and "syd".
        "services": [
            {
                "build_command": "str",  # Optional. An optional
                  build command to run while building this component from source.
                "cors": {
                    "allow_credentials": bool,  # Optional.
                      Whether browsers should expose the response to the client-side
                      JavaScript code when the request"u2019s credentials mode is
                      include. This configures the ``Access-Control-Allow-Credentials``
                      header.
                    "allow_headers": [
                        "str"  # Optional. The set of allowed
                          HTTP request headers. This configures the
                          ``Access-Control-Allow-Headers`` header.
                    ],
                    "allow_methods": [
                        "str"  # Optional. The set of allowed
                          HTTP methods. This configures the
                          ``Access-Control-Allow-Methods`` header.
                    ],
                    "allow_origins": [
                        {
                            "exact": "str",  # Optional.
                              Exact string match. Only 1 of ``exact``"" , ``prefix``""
                              , or ``regex`` must be set.
                            "prefix": "str",  # Optional.
                              Prefix-based match. Only 1 of ``exact``"" , ``prefix``""
                              , or ``regex`` must be set.
                            "regex": "str"  # Optional.
                              RE2 style regex-based match. Only 1 of ``exact``"" ,
                              ``prefix``"" , or ``regex`` must be set. For more
                              information about RE2 syntax, see:
                              https://github.com/google/re2/wiki/Syntax.
                        }
                    ],
                    "expose_headers": [
                        "str"  # Optional. The set of HTTP
                          response headers that browsers are allowed to access. This
                          configures the ``Access-Control-Expose-Headers`` header.
                    ],
                    "max_age": "str"  # Optional. An optional
                      duration specifying how long browsers can cache the results of a
                      preflight request. This configures the ``Access-Control-Max-Age``
                      header.
                },
                "dockerfile_path": "str",  # Optional. The path to
                  the Dockerfile relative to the root of the repo. If set, it will be
                  used to build this component. Otherwise, App Platform will attempt to
                  build it using buildpacks.
                "environment_slug": "str",  # Optional. An
                  environment slug describing the type of this app. For a full list,
                  please refer to `the product documentation
                  <https://www.digitalocean.com/docs/app-platform/>`_.
                "envs": [
                    {
                        "key": "str",  # The variable name.
                          Required.
                        "scope": "RUN_AND_BUILD_TIME",  #
                          Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME:
                          Made available only at run-time"n* BUILD_TIME: Made available
                          only at build-time"n* RUN_AND_BUILD_TIME: Made available at
                          both build and run-time. Known values are: "UNSET",
                          "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                        "type": "GENERAL",  # Optional.
                          Default value is "GENERAL". * GENERAL: A plain-text
                          environment variable"n* SECRET: A secret encrypted
                          environment variable. Known values are: "GENERAL" and
                          "SECRET".
                        "value": "str"  # Optional. The
                          value. If the type is ``SECRET``"" , the value will be
                          encrypted on first submission. On following submissions, the
                          encrypted value should be used.
                    }
                ],
                "git": {
                    "branch": "str",  # Optional. The name of the
                      branch to use.
                    "repo_clone_url": "str"  # Optional. The
                      clone URL of the repo. Example:
                      ``https://github.com/digitalocean/sample-golang.git``.
                },
                "github": {
                    "branch": "str",  # Optional. The name of the
                      branch to use.
                    "deploy_on_push": bool,  # Optional. Whether
                      to automatically deploy new commits made to the repo.
                    "repo": "str"  # Optional. The name of the
                      repo in the format owner/repo. Example:
                      ``digitalocean/sample-golang``.
                },
                "gitlab": {
                    "branch": "str",  # Optional. The name of the
                      branch to use.
                    "deploy_on_push": bool,  # Optional. Whether
                      to automatically deploy new commits made to the repo.
                    "repo": "str"  # Optional. The name of the
                      repo in the format owner/repo. Example:
                      ``digitalocean/sample-golang``.
                },
                "health_check": {
                    "failure_threshold": 0,  # Optional. The
                      number of failed health checks before considered unhealthy.
                    "http_path": "str",  # Optional. The route
                      path used for the HTTP health check ping. If not set, the HTTP
                      health check will be disabled and a TCP health check used
                      instead.
                    "initial_delay_seconds": 0,  # Optional. The
                      number of seconds to wait before beginning health checks.
                    "period_seconds": 0,  # Optional. The number
                      of seconds to wait between health checks.
                    "port": 0,  # Optional. The port on which the
                      health check will be performed. If not set, the health check will
                      be performed on the component's http_port.
                    "success_threshold": 0,  # Optional. The
                      number of successful health checks before considered healthy.
                    "timeout_seconds": 0  # Optional. The number
                      of seconds after which the check times out.
                },
                "http_port": 0,  # Optional. The internal port on
                  which this service's run command will listen. Default: 8080"nIf there
                  is not an environment variable with the name ``PORT``"" , one will be
                  automatically added with its value set to the value of this field.
                "image": {
                    "registry": "str",  # Optional. The registry
                      name. Must be left empty for the ``DOCR`` registry type.
                    "registry_type": "str",  # Optional. *
                      DOCKER_HUB: The DockerHub container registry type."n* DOCR: The
                      DigitalOcean container registry type. Known values are:
                      "DOCKER_HUB" and "DOCR".
                    "repository": "str",  # Optional. The
                      repository name.
                    "tag": "latest"  # Optional. Default value is
                      "latest". The repository tag. Defaults to ``latest`` if not
                      provided.
                },
                "instance_count": 1,  # Optional. Default value is 1.
                  The amount of instances that this component should be scaled to.
                  Default: 1.
                "instance_size_slug": "basic-xxs",  # Optional.
                  Default value is "basic-xxs". The instance size to use for this
                  component. Default: ``basic-xxs``. Known values are: "basic-xxs",
                  "basic-xs", "basic-s", "basic-m", "professional-xs",
                  "professional-s", "professional-m", "professional-1l",
                  "professional-l", and "professional-xl".
                "internal_ports": [
                    0  # Optional. The ports on which this
                      service will listen for internal traffic.
                ],
                "log_destinations": {
                    "datadog": {
                        "api_key": "str",  # Datadog API key.
                          Required.
                        "endpoint": "str"  # Optional.
                          Datadog HTTP log intake endpoint.
                    },
                    "logtail": {
                        "token": "str"  # Optional. Logtail
                          token.
                    },
                    "name": "str",  # Required.
                    "papertrail": {
                        "endpoint": "str"  # Papertrail
                          syslog endpoint. Required.
                    }
                },
                "name": "str",  # Optional. The name. Must be unique
                  across all components within the same app.
                "routes": [
                    {
                        "path": "str",  # Optional. An HTTP
                          path prefix. Paths must start with / and must be unique
                          across all components within an app.
                        "preserve_path_prefix": bool  #
                          Optional. An optional flag to preserve the path that is
                          forwarded to the backend service. By default, the HTTP
                          request path will be trimmed from the left when forwarded to
                          the component. For example, a component with ``path=/api``
                          will have requests to ``/api/list`` trimmed to ``/list``. If
                          this value is ``true``"" , the path will remain
                          ``/api/list``.
                    }
                ],
                "run_command": "str",  # Optional. An optional run
                  command to override the component's default.
                "source_dir": "str"  # Optional. An optional path to
                  the working directory to use for the build. For Dockerfile builds,
                  this will be used as the build context. Must be relative to the root
                  of the repo.
            }
        ],
        "static_sites": [
            {
                "build_command": "str",  # Optional. An optional
                  build command to run while building this component from source.
                "catchall_document": "str",  # Optional. The name of
                  the document to use as the fallback for any requests to documents
                  that are not found when serving this static site. Only 1 of
                  ``catchall_document`` or ``error_document`` can be set.
                "cors": {
                    "allow_credentials": bool,  # Optional.
                      Whether browsers should expose the response to the client-side
                      JavaScript code when the request"u2019s credentials mode is
                      include. This configures the ``Access-Control-Allow-Credentials``
                      header.
                    "allow_headers": [
                        "str"  # Optional. The set of allowed
                          HTTP request headers. This configures the
                          ``Access-Control-Allow-Headers`` header.
                    ],
                    "allow_methods": [
                        "str"  # Optional. The set of allowed
                          HTTP methods. This configures the
                          ``Access-Control-Allow-Methods`` header.
                    ],
                    "allow_origins": [
                        {
                            "exact": "str",  # Optional.
                              Exact string match. Only 1 of ``exact``"" , ``prefix``""
                              , or ``regex`` must be set.
                            "prefix": "str",  # Optional.
                              Prefix-based match. Only 1 of ``exact``"" , ``prefix``""
                              , or ``regex`` must be set.
                            "regex": "str"  # Optional.
                              RE2 style regex-based match. Only 1 of ``exact``"" ,
                              ``prefix``"" , or ``regex`` must be set. For more
                              information about RE2 syntax, see:
                              https://github.com/google/re2/wiki/Syntax.
                        }
                    ],
                    "expose_headers": [
                        "str"  # Optional. The set of HTTP
                          response headers that browsers are allowed to access. This
                          configures the ``Access-Control-Expose-Headers`` header.
                    ],
                    "max_age": "str"  # Optional. An optional
                      duration specifying how long browsers can cache the results of a
                      preflight request. This configures the ``Access-Control-Max-Age``
                      header.
                },
                "dockerfile_path": "str",  # Optional. The path to
                  the Dockerfile relative to the root of the repo. If set, it will be
                  used to build this component. Otherwise, App Platform will attempt to
                  build it using buildpacks.
                "environment_slug": "str",  # Optional. An
                  environment slug describing the type of this app. For a full list,
                  please refer to `the product documentation
                  <https://www.digitalocean.com/docs/app-platform/>`_.
                "envs": [
                    {
                        "key": "str",  # The variable name.
                          Required.
                        "scope": "RUN_AND_BUILD_TIME",  #
                          Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME:
                          Made available only at run-time"n* BUILD_TIME: Made available
                          only at build-time"n* RUN_AND_BUILD_TIME: Made available at
                          both build and run-time. Known values are: "UNSET",
                          "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                        "type": "GENERAL",  # Optional.
                          Default value is "GENERAL". * GENERAL: A plain-text
                          environment variable"n* SECRET: A secret encrypted
                          environment variable. Known values are: "GENERAL" and
                          "SECRET".
                        "value": "str"  # Optional. The
                          value. If the type is ``SECRET``"" , the value will be
                          encrypted on first submission. On following submissions, the
                          encrypted value should be used.
                    }
                ],
                "error_document": "404.html",  # Optional. Default
                  value is "404.html". The name of the error document to use when
                  serving this static site. Default: 404.html. If no such file exists
                  within the built assets, App Platform will supply one.
                "git": {
                    "branch": "str",  # Optional. The name of the
                      branch to use.
                    "repo_clone_url": "str"  # Optional. The
                      clone URL of the repo. Example:
                      ``https://github.com/digitalocean/sample-golang.git``.
                },
                "github": {
                    "branch": "str",  # Optional. The name of the
                      branch to use.
                    "deploy_on_push": bool,  # Optional. Whether
                      to automatically deploy new commits made to the repo.
                    "repo": "str"  # Optional. The name of the
                      repo in the format owner/repo. Example:
                      ``digitalocean/sample-golang``.
                },
                "gitlab": {
                    "branch": "str",  # Optional. The name of the
                      branch to use.
                    "deploy_on_push": bool,  # Optional. Whether
                      to automatically deploy new commits made to the repo.
                    "repo": "str"  # Optional. The name of the
                      repo in the format owner/repo. Example:
                      ``digitalocean/sample-golang``.
                },
                "image": {
                    "registry": "str",  # Optional. The registry
                      name. Must be left empty for the ``DOCR`` registry type.
                    "registry_type": "str",  # Optional. *
                      DOCKER_HUB: The DockerHub container registry type."n* DOCR: The
                      DigitalOcean container registry type. Known values are:
                      "DOCKER_HUB" and "DOCR".
                    "repository": "str",  # Optional. The
                      repository name.
                    "tag": "latest"  # Optional. Default value is
                      "latest". The repository tag. Defaults to ``latest`` if not
                      provided.
                },
                "index_document": "index.html",  # Optional. Default
                  value is "index.html". The name of the index document to use when
                  serving this static site. Default: index.html.
                "log_destinations": {
                    "datadog": {
                        "api_key": "str",  # Datadog API key.
                          Required.
                        "endpoint": "str"  # Optional.
                          Datadog HTTP log intake endpoint.
                    },
                    "logtail": {
                        "token": "str"  # Optional. Logtail
                          token.
                    },
                    "name": "str",  # Required.
                    "papertrail": {
                        "endpoint": "str"  # Papertrail
                          syslog endpoint. Required.
                    }
                },
                "name": "str",  # Optional. The name. Must be unique
                  across all components within the same app.
                "output_dir": "str",  # Optional. An optional path to
                  where the built assets will be located, relative to the build
                  context. If not set, App Platform will automatically scan for these
                  directory names: ``_static``"" , ``dist``"" , ``public``"" ,
                  ``build``.
                "routes": [
                    {
                        "path": "str",  # Optional. An HTTP
                          path prefix. Paths must start with / and must be unique
                          across all components within an app.
                        "preserve_path_prefix": bool  #
                          Optional. An optional flag to preserve the path that is
                          forwarded to the backend service. By default, the HTTP
                          request path will be trimmed from the left when forwarded to
                          the component. For example, a component with ``path=/api``
                          will have requests to ``/api/list`` trimmed to ``/list``. If
                          this value is ``true``"" , the path will remain
                          ``/api/list``.
                    }
                ],
                "run_command": "str",  # Optional. An optional run
                  command to override the component's default.
                "source_dir": "str"  # Optional. An optional path to
                  the working directory to use for the build. For Dockerfile builds,
                  this will be used as the build context. Must be relative to the root
                  of the repo.
            }
        ],
        "workers": [
            {
                "build_command": "str",  # Optional. An optional
                  build command to run while building this component from source.
                "dockerfile_path": "str",  # Optional. The path to
                  the Dockerfile relative to the root of the repo. If set, it will be
                  used to build this component. Otherwise, App Platform will attempt to
                  build it using buildpacks.
                "environment_slug": "str",  # Optional. An
                  environment slug describing the type of this app. For a full list,
                  please refer to `the product documentation
                  <https://www.digitalocean.com/docs/app-platform/>`_.
                "envs": [
                    {
                        "key": "str",  # The variable name.
                          Required.
                        "scope": "RUN_AND_BUILD_TIME",  #
                          Optional. Default value is "RUN_AND_BUILD_TIME". * RUN_TIME:
                          Made available only at run-time"n* BUILD_TIME: Made available
                          only at build-time"n* RUN_AND_BUILD_TIME: Made available at
                          both build and run-time. Known values are: "UNSET",
                          "RUN_TIME", "BUILD_TIME", and "RUN_AND_BUILD_TIME".
                        "type": "GENERAL",  # Optional.
                          Default value is "GENERAL". * GENERAL: A plain-text
                          environment variable"n* SECRET: A secret encrypted
                          environment variable. Known values are: "GENERAL" and
                          "SECRET".
                        "value": "str"  # Optional. The
                          value. If the type is ``SECRET``"" , the value will be
                          encrypted on first submission. On following submissions, the
                          encrypted value should be used.
                    }
                ],
                "git": {
                    "branch": "str",  # Optional. The name of the
                      branch to use.
                    "repo_clone_url": "str"  # Optional. The
                      clone URL of the repo. Example:
                      ``https://github.com/digitalocean/sample-golang.git``.
                },
                "github": {
                    "branch": "str",  # Optional. The name of the
                      branch to use.
                    "deploy_on_push": bool,  # Optional. Whether
                      to automatically deploy new commits made to the repo.
                    "repo": "str"  # Optional. The name of the
                      repo in the format owner/repo. Example:
                      ``digitalocean/sample-golang``.
                },
                "gitlab": {
                    "branch": "str",  # Optional. The name of the
                      branch to use.
                    "deploy_on_push": bool,  # Optional. Whether
                      to automatically deploy new commits made to the repo.
                    "repo": "str"  # Optional. The name of the
                      repo in the format owner/repo. Example:
                      ``digitalocean/sample-golang``.
                },
                "image": {
                    "registry": "str",  # Optional. The registry
                      name. Must be left empty for the ``DOCR`` registry type.
                    "registry_type": "str",  # Optional. *
                      DOCKER_HUB: The DockerHub container registry type."n* DOCR: The
                      DigitalOcean container registry type. Known values are:
                      "DOCKER_HUB" and "DOCR".
                    "repository": "str",  # Optional. The
                      repository name.
                    "tag": "latest"  # Optional. Default value is
                      "latest". The repository tag. Defaults to ``latest`` if not
                      provided.
                },
                "instance_count": 1,  # Optional. Default value is 1.
                  The amount of instances that this component should be scaled to.
                  Default: 1.
                "instance_size_slug": "basic-xxs",  # Optional.
                  Default value is "basic-xxs". The instance size to use for this
                  component. Default: ``basic-xxs``. Known values are: "basic-xxs",
                  "basic-xs", "basic-s", "basic-m", "professional-xs",
                  "professional-s", "professional-m", "professional-1l",
                  "professional-l", and "professional-xl".
                "log_destinations": {
                    "datadog": {
                        "api_key": "str",  # Datadog API key.
                          Required.
                        "endpoint": "str"  # Optional.
                          Datadog HTTP log intake endpoint.
                    },
                    "logtail": {
                        "token": "str"  # Optional. Logtail
                          token.
                    },
                    "name": "str",  # Required.
                    "papertrail": {
                        "endpoint": "str"  # Papertrail
                          syslog endpoint. Required.
                    }
                },
                "name": "str",  # Optional. The name. Must be unique
                  across all components within the same app.
                "run_command": "str",  # Optional. An optional run
                  command to override the component's default.
                "source_dir": "str"  # Optional. An optional path to
                  the working directory to use for the build. For Dockerfile builds,
                  this will be used as the build context. Must be relative to the root
                  of the repo.
            }
        ]
    }
}
validate_rollback(app_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
validate_rollback(app_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Validate App Rollback.

Check whether an app can be rolled back to a specific deployment. This endpoint can also be used to check if there are any warnings or validation conditions that will cause the rollback to proceed under unideal circumstances. For example, if a component must be rebuilt as part of the rollback causing it to take longer than usual.

Parameters:
  • app_id (str) – The app ID. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "error": {
        "code": "str",  # Optional. A code identifier that represents the
          failing condition."n"nFailing conditions:"n"n"n* ``incompatible_phase`` -
          indicates that the deployment's phase is not suitable for rollback."n*
          ``incompatible_result`` - indicates that the deployment's result is not
          suitable for rollback."n* ``exceeded_revision_limit`` - indicates that the
          app has exceeded the rollback revision limits for its tier."n* ``app_pinned``
          - indicates that there is already a rollback in progress and the app is
          pinned."n* ``database_config_conflict`` - indicates that the deployment's
          database config is different than the current config."n* ``region_conflict``
          - indicates that the deployment's region differs from the current app
          region."n"nWarning conditions:"n"n"n* ``static_site_requires_rebuild`` -
          indicates that the deployment contains at least one static site that will
          require a rebuild."n* ``image_source_missing_digest`` - indicates that the
          deployment contains at least one component with an image source that is
          missing a digest. Known values are: "incompatible_phase",
          "incompatible_result", "exceeded_revision_limit", "app_pinned",
          "database_config_conflict", "region_conflict",
          "static_site_requires_rebuild", and "image_source_missing_digest".
        "components": [
            "str"  # Optional.
        ],
        "message": "str"  # Optional. A human-readable message describing the
          failing condition.
    },
    "valid": bool,  # Optional. Indicates whether the app can be rolled back to
      the specified deployment.
    "warnings": [
        {
            "code": "str",  # Optional. A code identifier that represents
              the failing condition."n"nFailing conditions:"n"n"n*
              ``incompatible_phase`` - indicates that the deployment's phase is not
              suitable for rollback."n* ``incompatible_result`` - indicates that the
              deployment's result is not suitable for rollback."n*
              ``exceeded_revision_limit`` - indicates that the app has exceeded the
              rollback revision limits for its tier."n* ``app_pinned`` - indicates that
              there is already a rollback in progress and the app is pinned."n*
              ``database_config_conflict`` - indicates that the deployment's database
              config is different than the current config."n* ``region_conflict`` -
              indicates that the deployment's region differs from the current app
              region."n"nWarning conditions:"n"n"n* ``static_site_requires_rebuild`` -
              indicates that the deployment contains at least one static site that will
              require a rebuild."n* ``image_source_missing_digest`` - indicates that
              the deployment contains at least one component with an image source that
              is missing a digest. Known values are: "incompatible_phase",
              "incompatible_result", "exceeded_revision_limit", "app_pinned",
              "database_config_conflict", "region_conflict",
              "static_site_requires_rebuild", and "image_source_missing_digest".
            "components": [
                "str"  # Optional. Contains a list of warnings that
                  may cause the rollback to run under unideal circumstances.
            ],
            "message": "str"  # Optional. A human-readable message
              describing the failing condition.
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
class pydo.operations.BalanceOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s balance attribute.

get(**kwargs: Any) MutableMapping[str, Any]

Get Customer Balance.

To retrieve the balances on a customer’s account, send a GET request to /v2/customers/my/balance.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "account_balance": "str",  # Optional. Current balance of the customer's most
      recent billing activity.  Does not reflect ``month_to_date_usage``.
    "generated_at": "2020-02-20 00:00:00",  # Optional. The time at which
      balances were most recently generated.
    "month_to_date_balance": "str",  # Optional. Balance as of the
      ``generated_at`` time.  This value includes the ``account_balance`` and
      ``month_to_date_usage``.
    "month_to_date_usage": "str"  # Optional. Amount used in the current billing
      period as of the ``generated_at`` time.
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
class pydo.operations.BillingHistoryOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s billing_history attribute.

list(**kwargs: Any) MutableMapping[str, Any]

List Billing History.

To retrieve a list of all billing history entries, send a GET request to /v2/customers/my/billing_history.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "billing_history": [
        {
            "amount": "str",  # Optional. Amount of the billing history
              entry.
            "date": "2020-02-20 00:00:00",  # Optional. Time the billing
              history entry occurred.
            "description": "str",  # Optional. Description of the billing
              history entry.
            "invoice_id": "str",  # Optional. ID of the invoice
              associated with the billing history entry, if  applicable.
            "invoice_uuid": "str",  # Optional. UUID of the invoice
              associated with the billing history entry, if  applicable.
            "type": "str"  # Optional. Type of billing history entry.
              Known values are: "ACHFailure", "Adjustment", "AttemptFailed",
              "Chargeback", "Credit", "CreditExpiration", "Invoice", "Payment",
              "Refund", and "Reversal".
        }
    ],
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
class pydo.operations.CdnOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s cdn attribute.

create_endpoint(body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
create_endpoint(body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create a New CDN Endpoint.

To create a new CDN endpoint, send a POST request to /v2/cdn/endpoints. The origin attribute must be set to the fully qualified domain name (FQDN) of a DigitalOcean Space. Optionally, the TTL may be configured by setting the ttl attribute.

A custom subdomain may be configured by specifying the custom_domain and certificate_id attributes.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 201
response == {
    "endpoint": {
        "certificate_id": "str",  # Optional. The ID of a DigitalOcean
          managed TLS certificate used for SSL when a custom subdomain is provided.
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the CDN
          endpoint was created.
        "custom_domain": "str",  # Optional. The fully qualified domain name
          (FQDN) of the custom subdomain used with the CDN endpoint.
        "endpoint": "str",  # Optional. The fully qualified domain name
          (FQDN) from which the CDN-backed content is served.
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference a CDN endpoint.
        "origin": "str",  # The fully qualified domain name (FQDN) for the
          origin server which provides the content for the CDN. This is currently
          restricted to a Space. Required.
        "ttl": 3600  # Optional. Default value is 3600. The amount of time
          the content is cached by the CDN's edge servers in seconds. TTL must be one
          of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when
          excluded. Known values are: 60, 600, 3600, 86400, and 604800.
    }
}
delete_endpoint(cdn_id: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete a CDN Endpoint.

To delete a specific CDN endpoint, send a DELETE request to /v2/cdn/endpoints/$ENDPOINT_ID.

A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.

Parameters:

cdn_id (str) – A unique identifier for a CDN endpoint. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_endpoint(cdn_id: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing CDN Endpoint.

To show information about an existing CDN endpoint, send a GET request to /v2/cdn/endpoints/$ENDPOINT_ID.

Parameters:

cdn_id (str) – A unique identifier for a CDN endpoint. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "endpoint": {
        "certificate_id": "str",  # Optional. The ID of a DigitalOcean
          managed TLS certificate used for SSL when a custom subdomain is provided.
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the CDN
          endpoint was created.
        "custom_domain": "str",  # Optional. The fully qualified domain name
          (FQDN) of the custom subdomain used with the CDN endpoint.
        "endpoint": "str",  # Optional. The fully qualified domain name
          (FQDN) from which the CDN-backed content is served.
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference a CDN endpoint.
        "origin": "str",  # The fully qualified domain name (FQDN) for the
          origin server which provides the content for the CDN. This is currently
          restricted to a Space. Required.
        "ttl": 3600  # Optional. Default value is 3600. The amount of time
          the content is cached by the CDN's edge servers in seconds. TTL must be one
          of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when
          excluded. Known values are: 60, 600, 3600, 86400, and 604800.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_endpoints(*, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All CDN Endpoints.

To list all of the CDN endpoints available on your account, send a GET request to /v2/cdn/endpoints.

Parameters:
  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "endpoints": [
        {
            "certificate_id": "str",  # Optional. The ID of a
              DigitalOcean managed TLS certificate used for SSL when a custom subdomain
              is provided.
            "created_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the CDN endpoint was created.
            "custom_domain": "str",  # Optional. The fully qualified
              domain name (FQDN) of the custom subdomain used with the CDN endpoint.
            "endpoint": "str",  # Optional. The fully qualified domain
              name (FQDN) from which the CDN-backed content is served.
            "id": "str",  # Optional. A unique ID that can be used to
              identify and reference a CDN endpoint.
            "origin": "str",  # The fully qualified domain name (FQDN)
              for the origin server which provides the content for the CDN. This is
              currently restricted to a Space. Required.
            "ttl": 3600  # Optional. Default value is 3600. The amount of
              time the content is cached by the CDN's edge servers in seconds. TTL must
              be one of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour)
              when excluded. Known values are: 60, 600, 3600, 86400, and 604800.
        }
    ],
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
purge_cache(cdn_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
purge_cache(cdn_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Purge the Cache for an Existing CDN Endpoint.

To purge cached content from a CDN endpoint, send a DELETE request to /v2/cdn/endpoints/$ENDPOINT_ID/cache. The body of the request should include a files attribute containing a list of cached file paths to be purged. A path may be for a single file or may contain a wildcard (*) to recursively purge all files under a directory. When only a wildcard is provided, all cached files will be purged. There is a rate limit of 50 files per 20 seconds that can be purged.

Parameters:
  • cdn_id (str) – A unique identifier for a CDN endpoint. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
update_endpoints(cdn_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
update_endpoints(cdn_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Update a CDN Endpoint.

To update the TTL, certificate ID, or the FQDN of the custom subdomain for an existing CDN endpoint, send a PUT request to /v2/cdn/endpoints/$ENDPOINT_ID.

Parameters:
  • cdn_id (str) – A unique identifier for a CDN endpoint. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "endpoint": {
        "certificate_id": "str",  # Optional. The ID of a DigitalOcean
          managed TLS certificate used for SSL when a custom subdomain is provided.
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the CDN
          endpoint was created.
        "custom_domain": "str",  # Optional. The fully qualified domain name
          (FQDN) of the custom subdomain used with the CDN endpoint.
        "endpoint": "str",  # Optional. The fully qualified domain name
          (FQDN) from which the CDN-backed content is served.
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference a CDN endpoint.
        "origin": "str",  # The fully qualified domain name (FQDN) for the
          origin server which provides the content for the CDN. This is currently
          restricted to a Space. Required.
        "ttl": 3600  # Optional. Default value is 3600. The amount of time
          the content is cached by the CDN's edge servers in seconds. TTL must be one
          of 60, 600, 3600, 86400, or 604800. Defaults to 3600 (one hour) when
          excluded. Known values are: 60, 600, 3600, 86400, and 604800.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
class pydo.operations.CertificatesOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s certificates attribute.

create(body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
create(body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create a New Certificate.

To upload new SSL certificate which you have previously generated, send a POST request to /v2/certificates.

When uploading a user-generated certificate, the private_key, leaf_certificate, and optionally the certificate_chain attributes should be provided. The type must be set to custom.

When using Let’s Encrypt to create a certificate, the dns_names attribute must be provided, and the type must be set to lets_encrypt.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 201
response == {
    "certificate": {
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the certificate
          was created.
        "dns_names": [
            "str"  # Optional. An array of fully qualified domain names
              (FQDNs) for which the certificate was issued.
        ],
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference a certificate.
        "name": "str",  # Optional. A unique human-readable name referring to
          a certificate.
        "not_after": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents the certificate's
          expiration date.
        "sha1_fingerprint": "str",  # Optional. A unique identifier generated
          from the SHA-1 fingerprint of the certificate.
        "state": "str",  # Optional. A string representing the current state
          of the certificate. It may be ``pending``"" , ``verified``"" , or ``error``.
          Known values are: "pending", "verified", and "error".
        "type": "str"  # Optional. A string representing the type of the
          certificate. The value will be ``custom`` for a user-uploaded certificate or
          ``lets_encrypt`` for one automatically generated with Let's Encrypt. Known
          values are: "custom" and "lets_encrypt".
    }
}
delete(certificate_id: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete a Certificate.

To delete a specific certificate, send a DELETE request to /v2/certificates/$CERTIFICATE_ID.

Parameters:

certificate_id (str) – A unique identifier for a certificate. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get(certificate_id: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Certificate.

To show information about an existing certificate, send a GET request to /v2/certificates/$CERTIFICATE_ID.

Parameters:

certificate_id (str) – A unique identifier for a certificate. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "certificate": {
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the certificate
          was created.
        "dns_names": [
            "str"  # Optional. An array of fully qualified domain names
              (FQDNs) for which the certificate was issued.
        ],
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference a certificate.
        "name": "str",  # Optional. A unique human-readable name referring to
          a certificate.
        "not_after": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents the certificate's
          expiration date.
        "sha1_fingerprint": "str",  # Optional. A unique identifier generated
          from the SHA-1 fingerprint of the certificate.
        "state": "str",  # Optional. A string representing the current state
          of the certificate. It may be ``pending``"" , ``verified``"" , or ``error``.
          Known values are: "pending", "verified", and "error".
        "type": "str"  # Optional. A string representing the type of the
          certificate. The value will be ``custom`` for a user-uploaded certificate or
          ``lets_encrypt`` for one automatically generated with Let's Encrypt. Known
          values are: "custom" and "lets_encrypt".
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list(*, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All Certificates.

To list all of the certificates available on your account, send a GET request to /v2/certificates.

Parameters:
  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "certificates": [
        {
            "created_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the certificate was created.
            "dns_names": [
                "str"  # Optional. An array of fully qualified domain
                  names (FQDNs) for which the certificate was issued.
            ],
            "id": "str",  # Optional. A unique ID that can be used to
              identify and reference a certificate.
            "name": "str",  # Optional. A unique human-readable name
              referring to a certificate.
            "not_after": "2020-02-20 00:00:00",  # Optional. A time value
              given in ISO8601 combined date and time format that represents the
              certificate's expiration date.
            "sha1_fingerprint": "str",  # Optional. A unique identifier
              generated from the SHA-1 fingerprint of the certificate.
            "state": "str",  # Optional. A string representing the
              current state of the certificate. It may be ``pending``"" ,
              ``verified``"" , or ``error``. Known values are: "pending", "verified",
              and "error".
            "type": "str"  # Optional. A string representing the type of
              the certificate. The value will be ``custom`` for a user-uploaded
              certificate or ``lets_encrypt`` for one automatically generated with
              Let's Encrypt. Known values are: "custom" and "lets_encrypt".
        }
    ],
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
class pydo.operations.DatabasesOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s databases attribute.

add(database_cluster_uuid: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
add(database_cluster_uuid: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Add a New Database.

To add a new database to an existing cluster, send a POST request to /v2/databases/$DATABASE_ID/dbs.

Note: Database management is not supported for Redis clusters.

The response will be a JSON object with a key called db. The value of this will be an object that contains the standard attributes associated with a database.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 201
response == {
    "db": {
        "name": "str"  # The name of the database. Required.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
add_connection_pool(database_cluster_uuid: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
add_connection_pool(database_cluster_uuid: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Add a New Connection Pool (PostgreSQL).

For PostgreSQL database clusters, connection pools can be used to allow a database to share its idle connections. The popular PostgreSQL connection pooling utility PgBouncer is used to provide this service. See here for more information about how and why to use PgBouncer connection pooling including details about the available transaction modes.

To add a new connection pool to a PostgreSQL database cluster, send a POST request to /v2/databases/$DATABASE_ID/pools specifying a name for the pool, the user to connect with, the database to connect to, as well as its desired size and transaction mode.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 201
response == {
    "pool": {
        "connection": {
            "database": "str",  # Optional. The name of the default
              database.
            "host": "str",  # Optional. The FQDN pointing to the database
              cluster's current primary node.
            "password": "str",  # Optional. The randomly generated
              password for the default user.
            "port": 0,  # Optional. The port on which the database
              cluster is listening.
            "ssl": bool,  # Optional. A boolean value indicating if the
              connection should be made over SSL.
            "uri": "str",  # Optional. A connection string in the format
              accepted by the ``psql`` command. This is provided as a convenience and
              should be able to be constructed by the other attributes.
            "user": "str"  # Optional. The default user for the database.
        },
        "db": "str",  # The database for use with the connection pool.
          Required.
        "mode": "str",  # The PGBouncer transaction mode for the connection
          pool. The allowed values are session, transaction, and statement. Required.
        "name": "str",  # A unique name for the connection pool. Must be
          between 3 and 60 characters. Required.
        "private_connection": {
            "database": "str",  # Optional. The name of the default
              database.
            "host": "str",  # Optional. The FQDN pointing to the database
              cluster's current primary node.
            "password": "str",  # Optional. The randomly generated
              password for the default user.
            "port": 0,  # Optional. The port on which the database
              cluster is listening.
            "ssl": bool,  # Optional. A boolean value indicating if the
              connection should be made over SSL.
            "uri": "str",  # Optional. A connection string in the format
              accepted by the ``psql`` command. This is provided as a convenience and
              should be able to be constructed by the other attributes.
            "user": "str"  # Optional. The default user for the database.
        },
        "size": 0,  # The desired size of the PGBouncer connection pool. The
          maximum allowed size is determined by the size of the cluster's primary node.
          25 backend server connections are allowed for every 1GB of RAM. Three are
          reserved for maintenance. For example, a primary node with 1 GB of RAM allows
          for a maximum of 22 backend server connections while one with 4 GB would
          allow for 97. Note that these are shared across all connection pools in a
          cluster. Required.
        "user": "str"  # Optional. The name of the user for use with the
          connection pool. When excluded, all sessions connect to the database as the
          inbound user.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
add_user(database_cluster_uuid: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
add_user(database_cluster_uuid: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Add a Database User.

To add a new database user, send a POST request to /v2/databases/$DATABASE_ID/users with the desired username.

Note: User management is not supported for Redis clusters.

When adding a user to a MySQL cluster, additional options can be configured in the mysql_settings object.

The response will be a JSON object with a key called user. The value of this will be an object that contains the standard attributes associated with a database user including its randomly generated password.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 201
response == {
    "user": {
        "mysql_settings": {
            "auth_plugin": "str"  # A string specifying the
              authentication method to be used for connections"nto the MySQL user
              account. The valid values are ``mysql_native_password``"nor
              ``caching_sha2_password``. If excluded when creating a new user,
              the"ndefault for the version of MySQL in use will be used. As of MySQL
              8.0, the"ndefault is ``caching_sha2_password``. Required. Known values
              are: "mysql_native_password" and "caching_sha2_password".
        },
        "name": "str",  # The name of a database user. Required.
        "password": "str",  # Optional. A randomly generated password for the
          database user.
        "role": "str"  # Optional. A string representing the database user's
          role. The value will be either"n"primary" or "normal". Known values are:
          "primary" and "normal".
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
create_cluster(body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
create_cluster(body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create a New Database Cluster.

To create a database cluster, send a POST request to /v2/databases. The response will be a JSON object with a key called database. The value of this will be an object that contains the standard attributes associated with a database cluster. The initial value of the database cluster’s status attribute will be creating. When the cluster is ready to receive traffic, this will transition to online. The embedded connection and private_connection objects will contain the information needed to access the database cluster. DigitalOcean managed PostgreSQL and MySQL database clusters take automated daily backups. To create a new database cluster based on a backup of an existing cluster, send a POST request to /v2/databases. In addition to the standard database cluster attributes, the JSON body must include a key named backup_restore with the name of the original database cluster and the timestamp of the backup to be restored. Creating a database from a backup is the same as forking a database in the control panel. Note: Backups are not supported for Redis clusters.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 201
response == {
    "database": {
        "connection": {
            "database": "str",  # Optional. The name of the default
              database.
            "host": "str",  # Optional. The FQDN pointing to the database
              cluster's current primary node.
            "password": "str",  # Optional. The randomly generated
              password for the default user.
            "port": 0,  # Optional. The port on which the database
              cluster is listening.
            "ssl": bool,  # Optional. A boolean value indicating if the
              connection should be made over SSL.
            "uri": "str",  # Optional. A connection string in the format
              accepted by the ``psql`` command. This is provided as a convenience and
              should be able to be constructed by the other attributes.
            "user": "str"  # Optional. The default user for the database.
        },
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the database
          cluster was created.
        "db_names": [
            "str"  # Optional. An array of strings containing the names
              of databases created in the database cluster.
        ],
        "engine": "str",  # A slug representing the database engine used for
          the cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL,
          "redis" for Redis, and "mongodb" for MongoDB. Required. Known values are:
          "pg", "mysql", "redis", and "mongodb".
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference a database cluster.
        "maintenance_window": {
            "day": "str",  # The day of the week on which to apply
              maintenance updates. Required.
            "description": [
                "str"  # Optional. A list of strings, each containing
                  information about a pending maintenance update.
            ],
            "hour": "str",  # The hour in UTC at which maintenance
              updates will be applied in 24 hour format. Required.
            "pending": bool  # Optional. A boolean value indicating
              whether any maintenance is scheduled to be performed in the next window.
        },
        "name": "str",  # A unique, human-readable name referring to a
          database cluster. Required.
        "num_nodes": 0,  # The number of nodes in the database cluster.
          Required.
        "private_connection": {
            "database": "str",  # Optional. The name of the default
              database.
            "host": "str",  # Optional. The FQDN pointing to the database
              cluster's current primary node.
            "password": "str",  # Optional. The randomly generated
              password for the default user.
            "port": 0,  # Optional. The port on which the database
              cluster is listening.
            "ssl": bool,  # Optional. A boolean value indicating if the
              connection should be made over SSL.
            "uri": "str",  # Optional. A connection string in the format
              accepted by the ``psql`` command. This is provided as a convenience and
              should be able to be constructed by the other attributes.
            "user": "str"  # Optional. The default user for the database.
        },
        "private_network_uuid": "str",  # Optional. A string specifying the
          UUID of the VPC to which the database cluster will be assigned. If excluded,
          the cluster when creating a new database cluster, it will be assigned to your
          account's default VPC for the region.
        "project_id": "str",  # Optional. The ID of the project that the
          database cluster is assigned to. If excluded when creating a new database
          cluster, it will be assigned to your default project.
        "region": "str",  # The slug identifier for the region where the
          database cluster is located. Required.
        "rules": [
            {
                "cluster_uuid": "str",  # Optional. A unique ID for
                  the database cluster to which the rule is applied.
                "created_at": "2020-02-20 00:00:00",  # Optional. A
                  time value given in ISO8601 combined date and time format that
                  represents when the firewall rule was created.
                "type": "str",  # The type of resource that the
                  firewall rule allows to access the database cluster. Required. Known
                  values are: "droplet", "k8s", "ip_addr", "tag", and "app".
                "uuid": "str",  # Optional. A unique ID for the
                  firewall rule itself.
                "value": "str"  # The ID of the specific resource,
                  the name of a tag applied to a group of resources, or the IP address
                  that the firewall rule allows to access the database cluster.
                  Required.
            }
        ],
        "semantic_version": "str",  # Optional. A string representing the
          semantic version of the database engine in use for the cluster.
        "size": "str",  # The slug identifier representing the size of the
          nodes in the database cluster. Required.
        "status": "str",  # Optional. A string representing the current
          status of the database cluster. Known values are: "creating", "online",
          "resizing", "migrating", and "forking".
        "tags": [
            "str"  # Optional. An array of tags that have been applied to
              the database cluster.
        ],
        "users": [
            {
                "mysql_settings": {
                    "auth_plugin": "str"  # A string specifying
                      the authentication method to be used for connections"nto the
                      MySQL user account. The valid values are
                      ``mysql_native_password``"nor ``caching_sha2_password``. If
                      excluded when creating a new user, the"ndefault for the version
                      of MySQL in use will be used. As of MySQL 8.0, the"ndefault is
                      ``caching_sha2_password``. Required. Known values are:
                      "mysql_native_password" and "caching_sha2_password".
                },
                "name": "str",  # The name of a database user.
                  Required.
                "password": "str",  # Optional. A randomly generated
                  password for the database user.
                "role": "str"  # Optional. A string representing the
                  database user's role. The value will be either"n"primary" or
                  "normal". Known values are: "primary" and "normal".
            }
        ],
        "version": "str",  # Optional. A string representing the version of
          the database engine in use for the cluster.
        "version_end_of_availability": "str",  # Optional. A timestamp
          referring to the date when the particular version will no longer be available
          for creating new clusters. If null, the version does not have an end of
          availability timeline.
        "version_end_of_life": "str"  # Optional. A timestamp referring to
          the date when the particular version will no longer be supported. If null,
          the version does not have an end of life timeline.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
create_replica(database_cluster_uuid: str, body: Optional[JSON] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON
create_replica(database_cluster_uuid: str, body: Optional[IO] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create a Read-only Replica.

To create a read-only replica for a PostgreSQL or MySQL database cluster, send a POST request to /v2/databases/$DATABASE_ID/replicas specifying the name it should be given, the size of the node to be used, and the region where it will be located.

Note: Read-only replicas are not supported for Redis clusters.

The response will be a JSON object with a key called replica. The value of this will be an object that contains the standard attributes associated with a database replica. The initial value of the read-only replica’s status attribute will be forking. When the replica is ready to receive traffic, this will transition to active.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Default value is None.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 201
response == {
    "replica": {
        "connection": {
            "database": "str",  # Optional. The name of the default
              database.
            "host": "str",  # Optional. The FQDN pointing to the database
              cluster's current primary node.
            "password": "str",  # Optional. The randomly generated
              password for the default user.
            "port": 0,  # Optional. The port on which the database
              cluster is listening.
            "ssl": bool,  # Optional. A boolean value indicating if the
              connection should be made over SSL.
            "uri": "str",  # Optional. A connection string in the format
              accepted by the ``psql`` command. This is provided as a convenience and
              should be able to be constructed by the other attributes.
            "user": "str"  # Optional. The default user for the database.
        },
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the database
          cluster was created.
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference a database replica.
        "name": "str",  # The name to give the read-only replicating.
          Required.
        "private_connection": {
            "database": "str",  # Optional. The name of the default
              database.
            "host": "str",  # Optional. The FQDN pointing to the database
              cluster's current primary node.
            "password": "str",  # Optional. The randomly generated
              password for the default user.
            "port": 0,  # Optional. The port on which the database
              cluster is listening.
            "ssl": bool,  # Optional. A boolean value indicating if the
              connection should be made over SSL.
            "uri": "str",  # Optional. A connection string in the format
              accepted by the ``psql`` command. This is provided as a convenience and
              should be able to be constructed by the other attributes.
            "user": "str"  # Optional. The default user for the database.
        },
        "private_network_uuid": "str",  # Optional. A string specifying the
          UUID of the VPC to which the read-only replica will be assigned. If excluded,
          the replica will be assigned to your account's default VPC for the region.
        "region": "str",  # Optional. A slug identifier for the region where
          the read-only replica will be located. If excluded, the replica will be
          placed in the same region as the cluster.
        "size": "str",  # Optional. A slug identifier representing the size
          of the node for the read-only replica. The size of the replica must be at
          least as large as the node size for the database cluster from which it is
          replicating.
        "status": "str",  # Optional. A string representing the current
          status of the database cluster. Known values are: "creating", "online",
          "resizing", "migrating", and "forking".
        "tags": [
            "str"  # Optional. A flat array of tag names as strings to
              apply to the read-only replica after it is created. Tag names can either
              be existing or new tags.
        ]
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
delete(database_cluster_uuid: str, database_name: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete a Database.

To delete a specific database, send a DELETE request to /v2/databases/$DATABASE_ID/dbs/$DB_NAME.

A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.

Note: Database management is not supported for Redis clusters.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • database_name (str) – The name of the database. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
delete_connection_pool(database_cluster_uuid: str, pool_name: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete a Connection Pool (PostgreSQL).

To delete a specific connection pool for a PostgreSQL database cluster, send a DELETE request to /v2/databases/$DATABASE_ID/pools/$POOL_NAME.

A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • pool_name (str) – The name used to identify the connection pool. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
delete_online_migration(database_cluster_uuid: str, migration_id: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Stop an Online Migration.

To stop an online migration, send a DELETE request to /v2/databases/$DATABASE_ID/online-migration/$MIGRATION_ID.

A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • migration_id (str) – A unique identifier assigned to the online migration. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
delete_user(database_cluster_uuid: str, username: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Remove a Database User.

To remove a specific database user, send a DELETE request to /v2/databases/$DATABASE_ID/users/$USERNAME.

A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.

Note: User management is not supported for Redis clusters.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • username (str) – The name of the database user. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
destroy_cluster(database_cluster_uuid: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Destroy a Database Cluster.

To destroy a specific database, send a DELETE request to /v2/databases/$DATABASE_ID. A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.

Parameters:

database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
destroy_replica(database_cluster_uuid: str, replica_name: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Destroy a Read-only Replica.

To destroy a specific read-only replica, send a DELETE request to /v2/databases/$DATABASE_ID/replicas/$REPLICA_NAME.

Note: Read-only replicas are not supported for Redis clusters.

A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • replica_name (str) – The name of the database replica. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get(database_cluster_uuid: str, database_name: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Database.

To show information about an existing database cluster, send a GET request to /v2/databases/$DATABASE_ID/dbs/$DB_NAME.

Note: Database management is not supported for Redis clusters.

The response will be a JSON object with a db key. This will be set to an object containing the standard database attributes.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • database_name (str) – The name of the database. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "db": {
        "name": "str"  # The name of the database. Required.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_ca(database_cluster_uuid: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve the Public Certificate.

To retrieve the public certificate used to secure the connection to the database cluster send a GET request to /v2/databases/$DATABASE_ID/ca.

The response will be a JSON object with a ca key. This will be set to an object containing the base64 encoding of the public key certificate.

Parameters:

database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "ca": {
        "certificate": "str"  # base64 encoding of the certificate used to
          secure database connections. Required.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_cluster(database_cluster_uuid: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Database Cluster.

To show information about an existing database cluster, send a GET request to /v2/databases/$DATABASE_ID. The response will be a JSON object with a database key. This will be set to an object containing the standard database cluster attributes. The embedded connection and private_connection objects will contain the information needed to access the database cluster. The embedded maintenance_window object will contain information about any scheduled maintenance for the database cluster.

Parameters:

database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "database": {
        "connection": {
            "database": "str",  # Optional. The name of the default
              database.
            "host": "str",  # Optional. The FQDN pointing to the database
              cluster's current primary node.
            "password": "str",  # Optional. The randomly generated
              password for the default user.
            "port": 0,  # Optional. The port on which the database
              cluster is listening.
            "ssl": bool,  # Optional. A boolean value indicating if the
              connection should be made over SSL.
            "uri": "str",  # Optional. A connection string in the format
              accepted by the ``psql`` command. This is provided as a convenience and
              should be able to be constructed by the other attributes.
            "user": "str"  # Optional. The default user for the database.
        },
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the database
          cluster was created.
        "db_names": [
            "str"  # Optional. An array of strings containing the names
              of databases created in the database cluster.
        ],
        "engine": "str",  # A slug representing the database engine used for
          the cluster. The possible values are: "pg" for PostgreSQL, "mysql" for MySQL,
          "redis" for Redis, and "mongodb" for MongoDB. Required. Known values are:
          "pg", "mysql", "redis", and "mongodb".
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference a database cluster.
        "maintenance_window": {
            "day": "str",  # The day of the week on which to apply
              maintenance updates. Required.
            "description": [
                "str"  # Optional. A list of strings, each containing
                  information about a pending maintenance update.
            ],
            "hour": "str",  # The hour in UTC at which maintenance
              updates will be applied in 24 hour format. Required.
            "pending": bool  # Optional. A boolean value indicating
              whether any maintenance is scheduled to be performed in the next window.
        },
        "name": "str",  # A unique, human-readable name referring to a
          database cluster. Required.
        "num_nodes": 0,  # The number of nodes in the database cluster.
          Required.
        "private_connection": {
            "database": "str",  # Optional. The name of the default
              database.
            "host": "str",  # Optional. The FQDN pointing to the database
              cluster's current primary node.
            "password": "str",  # Optional. The randomly generated
              password for the default user.
            "port": 0,  # Optional. The port on which the database
              cluster is listening.
            "ssl": bool,  # Optional. A boolean value indicating if the
              connection should be made over SSL.
            "uri": "str",  # Optional. A connection string in the format
              accepted by the ``psql`` command. This is provided as a convenience and
              should be able to be constructed by the other attributes.
            "user": "str"  # Optional. The default user for the database.
        },
        "private_network_uuid": "str",  # Optional. A string specifying the
          UUID of the VPC to which the database cluster will be assigned. If excluded,
          the cluster when creating a new database cluster, it will be assigned to your
          account's default VPC for the region.
        "project_id": "str",  # Optional. The ID of the project that the
          database cluster is assigned to. If excluded when creating a new database
          cluster, it will be assigned to your default project.
        "region": "str",  # The slug identifier for the region where the
          database cluster is located. Required.
        "rules": [
            {
                "cluster_uuid": "str",  # Optional. A unique ID for
                  the database cluster to which the rule is applied.
                "created_at": "2020-02-20 00:00:00",  # Optional. A
                  time value given in ISO8601 combined date and time format that
                  represents when the firewall rule was created.
                "type": "str",  # The type of resource that the
                  firewall rule allows to access the database cluster. Required. Known
                  values are: "droplet", "k8s", "ip_addr", "tag", and "app".
                "uuid": "str",  # Optional. A unique ID for the
                  firewall rule itself.
                "value": "str"  # The ID of the specific resource,
                  the name of a tag applied to a group of resources, or the IP address
                  that the firewall rule allows to access the database cluster.
                  Required.
            }
        ],
        "semantic_version": "str",  # Optional. A string representing the
          semantic version of the database engine in use for the cluster.
        "size": "str",  # The slug identifier representing the size of the
          nodes in the database cluster. Required.
        "status": "str",  # Optional. A string representing the current
          status of the database cluster. Known values are: "creating", "online",
          "resizing", "migrating", and "forking".
        "tags": [
            "str"  # Optional. An array of tags that have been applied to
              the database cluster.
        ],
        "users": [
            {
                "mysql_settings": {
                    "auth_plugin": "str"  # A string specifying
                      the authentication method to be used for connections"nto the
                      MySQL user account. The valid values are
                      ``mysql_native_password``"nor ``caching_sha2_password``. If
                      excluded when creating a new user, the"ndefault for the version
                      of MySQL in use will be used. As of MySQL 8.0, the"ndefault is
                      ``caching_sha2_password``. Required. Known values are:
                      "mysql_native_password" and "caching_sha2_password".
                },
                "name": "str",  # The name of a database user.
                  Required.
                "password": "str",  # Optional. A randomly generated
                  password for the database user.
                "role": "str"  # Optional. A string representing the
                  database user's role. The value will be either"n"primary" or
                  "normal". Known values are: "primary" and "normal".
            }
        ],
        "version": "str",  # Optional. A string representing the version of
          the database engine in use for the cluster.
        "version_end_of_availability": "str",  # Optional. A timestamp
          referring to the date when the particular version will no longer be available
          for creating new clusters. If null, the version does not have an end of
          availability timeline.
        "version_end_of_life": "str"  # Optional. A timestamp referring to
          the date when the particular version will no longer be supported. If null,
          the version does not have an end of life timeline.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_config(database_cluster_uuid: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Database Cluster Configuration.

Shows configuration parameters for an existing database cluster by sending a GET request to /v2/databases/$DATABASE_ID/config. The response is a JSON object with a config key, which is set to an object containing any database configuration parameters.

Parameters:

database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "config": {}
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_connection_pool(database_cluster_uuid: str, pool_name: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve Existing Connection Pool (PostgreSQL).

To show information about an existing connection pool for a PostgreSQL database cluster, send a GET request to /v2/databases/$DATABASE_ID/pools/$POOL_NAME. The response will be a JSON object with a pool key.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • pool_name (str) – The name used to identify the connection pool. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "pool": {
        "connection": {
            "database": "str",  # Optional. The name of the default
              database.
            "host": "str",  # Optional. The FQDN pointing to the database
              cluster's current primary node.
            "password": "str",  # Optional. The randomly generated
              password for the default user.
            "port": 0,  # Optional. The port on which the database
              cluster is listening.
            "ssl": bool,  # Optional. A boolean value indicating if the
              connection should be made over SSL.
            "uri": "str",  # Optional. A connection string in the format
              accepted by the ``psql`` command. This is provided as a convenience and
              should be able to be constructed by the other attributes.
            "user": "str"  # Optional. The default user for the database.
        },
        "db": "str",  # The database for use with the connection pool.
          Required.
        "mode": "str",  # The PGBouncer transaction mode for the connection
          pool. The allowed values are session, transaction, and statement. Required.
        "name": "str",  # A unique name for the connection pool. Must be
          between 3 and 60 characters. Required.
        "private_connection": {
            "database": "str",  # Optional. The name of the default
              database.
            "host": "str",  # Optional. The FQDN pointing to the database
              cluster's current primary node.
            "password": "str",  # Optional. The randomly generated
              password for the default user.
            "port": 0,  # Optional. The port on which the database
              cluster is listening.
            "ssl": bool,  # Optional. A boolean value indicating if the
              connection should be made over SSL.
            "uri": "str",  # Optional. A connection string in the format
              accepted by the ``psql`` command. This is provided as a convenience and
              should be able to be constructed by the other attributes.
            "user": "str"  # Optional. The default user for the database.
        },
        "size": 0,  # The desired size of the PGBouncer connection pool. The
          maximum allowed size is determined by the size of the cluster's primary node.
          25 backend server connections are allowed for every 1GB of RAM. Three are
          reserved for maintenance. For example, a primary node with 1 GB of RAM allows
          for a maximum of 22 backend server connections while one with 4 GB would
          allow for 97. Note that these are shared across all connection pools in a
          cluster. Required.
        "user": "str"  # Optional. The name of the user for use with the
          connection pool. When excluded, all sessions connect to the database as the
          inbound user.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_eviction_policy(database_cluster_uuid: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve the Eviction Policy for a Redis Cluster.

To retrieve the configured eviction policy for an existing Redis cluster, send a GET request to /v2/databases/$DATABASE_ID/eviction_policy. The response will be a JSON object with an eviction_policy key. This will be set to a string representing the eviction policy.

Parameters:

database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "eviction_policy": "str"  # A string specifying the desired eviction policy
      for the Redis cluster."n"n"n* ``noeviction``"" : Don't evict any data, returns
      error when memory limit is reached."n* ``allkeys_lru:`` Evict any key, least
      recently used (LRU) first."n* ``allkeys_random``"" : Evict keys in a random
      order."n* ``volatile_lru``"" : Evict keys with expiration only, least recently
      used (LRU) first."n* ``volatile_random``"" : Evict keys with expiration only in a
      random order."n* ``volatile_ttl``"" : Evict keys with expiration only, shortest
      time-to-live (TTL) first. Required. Known values are: "noeviction",
      "allkeys_lru", "allkeys_random", "volatile_lru", "volatile_random", and
      "volatile_ttl".
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_migration_status(database_cluster_uuid: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve the Status of an Online Migration.

To retrieve the status of the most recent online migration, send a GET request to /v2/databases/$DATABASE_ID/online-migration.

Parameters:

database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "created_at": "str",  # Optional. The time the migration was initiated, in
      ISO 8601 format.
    "id": "str",  # Optional. The ID of the most recent migration.
    "status": "str"  # Optional. The current status of the migration. Known
      values are: "running", "canceled", "error", and "done".
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_replica(database_cluster_uuid: str, replica_name: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Read-only Replica.

To show information about an existing database replica, send a GET request to /v2/databases/$DATABASE_ID/replicas/$REPLICA_NAME.

Note: Read-only replicas are not supported for Redis clusters.

The response will be a JSON object with a replica key. This will be set to an object containing the standard database replica attributes.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • replica_name (str) – The name of the database replica. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "replica": {
        "connection": {
            "database": "str",  # Optional. The name of the default
              database.
            "host": "str",  # Optional. The FQDN pointing to the database
              cluster's current primary node.
            "password": "str",  # Optional. The randomly generated
              password for the default user.
            "port": 0,  # Optional. The port on which the database
              cluster is listening.
            "ssl": bool,  # Optional. A boolean value indicating if the
              connection should be made over SSL.
            "uri": "str",  # Optional. A connection string in the format
              accepted by the ``psql`` command. This is provided as a convenience and
              should be able to be constructed by the other attributes.
            "user": "str"  # Optional. The default user for the database.
        },
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the database
          cluster was created.
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference a database replica.
        "name": "str",  # The name to give the read-only replicating.
          Required.
        "private_connection": {
            "database": "str",  # Optional. The name of the default
              database.
            "host": "str",  # Optional. The FQDN pointing to the database
              cluster's current primary node.
            "password": "str",  # Optional. The randomly generated
              password for the default user.
            "port": 0,  # Optional. The port on which the database
              cluster is listening.
            "ssl": bool,  # Optional. A boolean value indicating if the
              connection should be made over SSL.
            "uri": "str",  # Optional. A connection string in the format
              accepted by the ``psql`` command. This is provided as a convenience and
              should be able to be constructed by the other attributes.
            "user": "str"  # Optional. The default user for the database.
        },
        "private_network_uuid": "str",  # Optional. A string specifying the
          UUID of the VPC to which the read-only replica will be assigned. If excluded,
          the replica will be assigned to your account's default VPC for the region.
        "region": "str",  # Optional. A slug identifier for the region where
          the read-only replica will be located. If excluded, the replica will be
          placed in the same region as the cluster.
        "size": "str",  # Optional. A slug identifier representing the size
          of the node for the read-only replica. The size of the replica must be at
          least as large as the node size for the database cluster from which it is
          replicating.
        "status": "str",  # Optional. A string representing the current
          status of the database cluster. Known values are: "creating", "online",
          "resizing", "migrating", and "forking".
        "tags": [
            "str"  # Optional. A flat array of tag names as strings to
              apply to the read-only replica after it is created. Tag names can either
              be existing or new tags.
        ]
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_sql_mode(database_cluster_uuid: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve the SQL Modes for a MySQL Cluster.

To retrieve the configured SQL modes for an existing MySQL cluster, send a GET request to /v2/databases/$DATABASE_ID/sql_mode. The response will be a JSON object with a sql_mode key. This will be set to a string representing the configured SQL modes.

Parameters:

database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "sql_mode": "str"  # A string specifying the configured SQL modes for the
      MySQL cluster. Required.
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_user(database_cluster_uuid: str, username: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Database User.

To show information about an existing database user, send a GET request to /v2/databases/$DATABASE_ID/users/$USERNAME.

Note: User management is not supported for Redis clusters.

The response will be a JSON object with a user key. This will be set to an object containing the standard database user attributes.

For MySQL clusters, additional options will be contained in the mysql_settings object.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • username (str) – The name of the database user. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "user": {
        "mysql_settings": {
            "auth_plugin": "str"  # A string specifying the
              authentication method to be used for connections"nto the MySQL user
              account. The valid values are ``mysql_native_password``"nor
              ``caching_sha2_password``. If excluded when creating a new user,
              the"ndefault for the version of MySQL in use will be used. As of MySQL
              8.0, the"ndefault is ``caching_sha2_password``. Required. Known values
              are: "mysql_native_password" and "caching_sha2_password".
        },
        "name": "str",  # The name of a database user. Required.
        "password": "str",  # Optional. A randomly generated password for the
          database user.
        "role": "str"  # Optional. A string representing the database user's
          role. The value will be either"n"primary" or "normal". Known values are:
          "primary" and "normal".
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list(database_cluster_uuid: str, **kwargs: Any) MutableMapping[str, Any]

List All Databases.

To list all of the databases in a clusters, send a GET request to /v2/databases/$DATABASE_ID/dbs.

The result will be a JSON object with a dbs key. This will be set to an array of database objects, each of which will contain the standard database attributes.

Note: Database management is not supported for Redis clusters.

Parameters:

database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "dbs": [
        {
            "name": "str"  # The name of the database. Required.
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_backups(database_cluster_uuid: str, **kwargs: Any) MutableMapping[str, Any]

List Backups for a Database Cluster.

To list all of the available backups of a PostgreSQL or MySQL database cluster, send a GET request to /v2/databases/$DATABASE_ID/backups. Note: Backups are not supported for Redis clusters. The result will be a JSON object with a backups key. This will be set to an array of backup objects, each of which will contain the size of the backup and the timestamp at which it was created.

Parameters:

database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "backups": [
        {
            "created_at": "2020-02-20 00:00:00",  # A time value given in
              ISO8601 combined date and time format at which the backup was created.
              Required.
            "size_gigabytes": 0.0  # The size of the database backup in
              GBs. Required.
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_clusters(*, tag_name: Optional[str] = None, **kwargs: Any) MutableMapping[str, Any]

List All Database Clusters.

To list all of the database clusters available on your account, send a GET request to /v2/databases. To limit the results to database clusters with a specific tag, include the tag_name query parameter set to the name of the tag. For example, /v2/databases?tag_name=$TAG_NAME. The result will be a JSON object with a databases key. This will be set to an array of database objects, each of which will contain the standard database attributes. The embedded connection and private_connection objects will contain the information needed to access the database cluster: The embedded maintenance_window object will contain information about any scheduled maintenance for the database cluster.

Parameters:

tag_name (str) – Limits the results to database clusters with a specific tag. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "databases": [
        {
            "connection": {
                "database": "str",  # Optional. The name of the
                  default database.
                "host": "str",  # Optional. The FQDN pointing to the
                  database cluster's current primary node.
                "password": "str",  # Optional. The randomly
                  generated password for the default user.
                "port": 0,  # Optional. The port on which the
                  database cluster is listening.
                "ssl": bool,  # Optional. A boolean value indicating
                  if the connection should be made over SSL.
                "uri": "str",  # Optional. A connection string in the
                  format accepted by the ``psql`` command. This is provided as a
                  convenience and should be able to be constructed by the other
                  attributes.
                "user": "str"  # Optional. The default user for the
                  database.
            },
            "created_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the database cluster was created.
            "db_names": [
                "str"  # Optional. An array of strings containing the
                  names of databases created in the database cluster.
            ],
            "engine": "str",  # A slug representing the database engine
              used for the cluster. The possible values are: "pg" for PostgreSQL,
              "mysql" for MySQL, "redis" for Redis, and "mongodb" for MongoDB.
              Required. Known values are: "pg", "mysql", "redis", and "mongodb".
            "id": "str",  # Optional. A unique ID that can be used to
              identify and reference a database cluster.
            "maintenance_window": {
                "day": "str",  # The day of the week on which to
                  apply maintenance updates. Required.
                "description": [
                    "str"  # Optional. A list of strings, each
                      containing information about a pending maintenance update.
                ],
                "hour": "str",  # The hour in UTC at which
                  maintenance updates will be applied in 24 hour format. Required.
                "pending": bool  # Optional. A boolean value
                  indicating whether any maintenance is scheduled to be performed in
                  the next window.
            },
            "name": "str",  # A unique, human-readable name referring to
              a database cluster. Required.
            "num_nodes": 0,  # The number of nodes in the database
              cluster. Required.
            "private_connection": {
                "database": "str",  # Optional. The name of the
                  default database.
                "host": "str",  # Optional. The FQDN pointing to the
                  database cluster's current primary node.
                "password": "str",  # Optional. The randomly
                  generated password for the default user.
                "port": 0,  # Optional. The port on which the
                  database cluster is listening.
                "ssl": bool,  # Optional. A boolean value indicating
                  if the connection should be made over SSL.
                "uri": "str",  # Optional. A connection string in the
                  format accepted by the ``psql`` command. This is provided as a
                  convenience and should be able to be constructed by the other
                  attributes.
                "user": "str"  # Optional. The default user for the
                  database.
            },
            "private_network_uuid": "str",  # Optional. A string
              specifying the UUID of the VPC to which the database cluster will be
              assigned. If excluded, the cluster when creating a new database cluster,
              it will be assigned to your account's default VPC for the region.
            "project_id": "str",  # Optional. The ID of the project that
              the database cluster is assigned to. If excluded when creating a new
              database cluster, it will be assigned to your default project.
            "region": "str",  # The slug identifier for the region where
              the database cluster is located. Required.
            "rules": [
                {
                    "cluster_uuid": "str",  # Optional. A unique
                      ID for the database cluster to which the rule is applied.
                    "created_at": "2020-02-20 00:00:00",  #
                      Optional. A time value given in ISO8601 combined date and time
                      format that represents when the firewall rule was created.
                    "type": "str",  # The type of resource that
                      the firewall rule allows to access the database cluster.
                      Required. Known values are: "droplet", "k8s", "ip_addr", "tag",
                      and "app".
                    "uuid": "str",  # Optional. A unique ID for
                      the firewall rule itself.
                    "value": "str"  # The ID of the specific
                      resource, the name of a tag applied to a group of resources, or
                      the IP address that the firewall rule allows to access the
                      database cluster. Required.
                }
            ],
            "semantic_version": "str",  # Optional. A string representing
              the semantic version of the database engine in use for the cluster.
            "size": "str",  # The slug identifier representing the size
              of the nodes in the database cluster. Required.
            "status": "str",  # Optional. A string representing the
              current status of the database cluster. Known values are: "creating",
              "online", "resizing", "migrating", and "forking".
            "tags": [
                "str"  # Optional. An array of tags that have been
                  applied to the database cluster.
            ],
            "users": [
                {
                    "mysql_settings": {
                        "auth_plugin": "str"  # A string
                          specifying the authentication method to be used for
                          connections"nto the MySQL user account. The valid values are
                          ``mysql_native_password``"nor ``caching_sha2_password``. If
                          excluded when creating a new user, the"ndefault for the
                          version of MySQL in use will be used. As of MySQL 8.0,
                          the"ndefault is ``caching_sha2_password``. Required. Known
                          values are: "mysql_native_password" and
                          "caching_sha2_password".
                    },
                    "name": "str",  # The name of a database
                      user. Required.
                    "password": "str",  # Optional. A randomly
                      generated password for the database user.
                    "role": "str"  # Optional. A string
                      representing the database user's role. The value will be
                      either"n"primary" or "normal". Known values are: "primary" and
                      "normal".
                }
            ],
            "version": "str",  # Optional. A string representing the
              version of the database engine in use for the cluster.
            "version_end_of_availability": "str",  # Optional. A
              timestamp referring to the date when the particular version will no
              longer be available for creating new clusters. If null, the version does
              not have an end of availability timeline.
            "version_end_of_life": "str"  # Optional. A timestamp
              referring to the date when the particular version will no longer be
              supported. If null, the version does not have an end of life timeline.
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_connection_pools(database_cluster_uuid: str, **kwargs: Any) MutableMapping[str, Any]

List Connection Pools (PostgreSQL).

To list all of the connection pools available to a PostgreSQL database cluster, send a GET request to /v2/databases/$DATABASE_ID/pools. The result will be a JSON object with a pools key. This will be set to an array of connection pool objects.

Parameters:

database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "pools": [
        {
            "connection": {
                "database": "str",  # Optional. The name of the
                  default database.
                "host": "str",  # Optional. The FQDN pointing to the
                  database cluster's current primary node.
                "password": "str",  # Optional. The randomly
                  generated password for the default user.
                "port": 0,  # Optional. The port on which the
                  database cluster is listening.
                "ssl": bool,  # Optional. A boolean value indicating
                  if the connection should be made over SSL.
                "uri": "str",  # Optional. A connection string in the
                  format accepted by the ``psql`` command. This is provided as a
                  convenience and should be able to be constructed by the other
                  attributes.
                "user": "str"  # Optional. The default user for the
                  database.
            },
            "db": "str",  # The database for use with the connection
              pool. Required.
            "mode": "str",  # The PGBouncer transaction mode for the
              connection pool. The allowed values are session, transaction, and
              statement. Required.
            "name": "str",  # A unique name for the connection pool. Must
              be between 3 and 60 characters. Required.
            "private_connection": {
                "database": "str",  # Optional. The name of the
                  default database.
                "host": "str",  # Optional. The FQDN pointing to the
                  database cluster's current primary node.
                "password": "str",  # Optional. The randomly
                  generated password for the default user.
                "port": 0,  # Optional. The port on which the
                  database cluster is listening.
                "ssl": bool,  # Optional. A boolean value indicating
                  if the connection should be made over SSL.
                "uri": "str",  # Optional. A connection string in the
                  format accepted by the ``psql`` command. This is provided as a
                  convenience and should be able to be constructed by the other
                  attributes.
                "user": "str"  # Optional. The default user for the
                  database.
            },
            "size": 0,  # The desired size of the PGBouncer connection
              pool. The maximum allowed size is determined by the size of the cluster's
              primary node. 25 backend server connections are allowed for every 1GB of
              RAM. Three are reserved for maintenance. For example, a primary node with
              1 GB of RAM allows for a maximum of 22 backend server connections while
              one with 4 GB would allow for 97. Note that these are shared across all
              connection pools in a cluster. Required.
            "user": "str"  # Optional. The name of the user for use with
              the connection pool. When excluded, all sessions connect to the database
              as the inbound user.
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_firewall_rules(database_cluster_uuid: str, **kwargs: Any) MutableMapping[str, Any]

List Firewall Rules (Trusted Sources) for a Database Cluster.

To list all of a database cluster’s firewall rules (known as “trusted sources” in the control panel), send a GET request to /v2/databases/$DATABASE_ID/firewall. The result will be a JSON object with a rules key.

Parameters:

database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "rules": [
        {
            "cluster_uuid": "str",  # Optional. A unique ID for the
              database cluster to which the rule is applied.
            "created_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the firewall rule was created.
            "type": "str",  # The type of resource that the firewall rule
              allows to access the database cluster. Required. Known values are:
              "droplet", "k8s", "ip_addr", "tag", and "app".
            "uuid": "str",  # Optional. A unique ID for the firewall rule
              itself.
            "value": "str"  # The ID of the specific resource, the name
              of a tag applied to a group of resources, or the IP address that the
              firewall rule allows to access the database cluster. Required.
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_options(**kwargs: Any) MutableMapping[str, Any]

List Database Options.

To list all of the options available for the offered database engines, send a GET request to /v2/databases/options. The result will be a JSON object with an options key.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "options": {
        "mongodb": {
            "layouts": [
                {
                    "num_nodes": 0,  # Optional. An array of
                      objects, each indicating the node sizes (otherwise referred to as
                      slugs) that are available with various numbers of nodes in the
                      database cluster. Each slugs denotes the node's identifier, CPU,
                      and RAM (in that order).
                    "sizes": [
                        "str"  # Optional. An array of
                          objects containing the slugs available with various node
                          counts.
                    ]
                }
            ],
            "regions": [
                "str"  # Optional. An array of strings containing the
                  names of available regions.
            ],
            "versions": [
                "str"  # Optional. An array of strings containing the
                  names of available regions.
            ]
        },
        "mysql": {
            "layouts": [
                {
                    "num_nodes": 0,  # Optional. An array of
                      objects, each indicating the node sizes (otherwise referred to as
                      slugs) that are available with various numbers of nodes in the
                      database cluster. Each slugs denotes the node's identifier, CPU,
                      and RAM (in that order).
                    "sizes": [
                        "str"  # Optional. An array of
                          objects containing the slugs available with various node
                          counts.
                    ]
                }
            ],
            "regions": [
                "str"  # Optional. An array of strings containing the
                  names of available regions.
            ],
            "versions": [
                "str"  # Optional. An array of strings containing the
                  names of available regions.
            ]
        },
        "pg": {
            "layouts": [
                {
                    "num_nodes": 0,  # Optional. An array of
                      objects, each indicating the node sizes (otherwise referred to as
                      slugs) that are available with various numbers of nodes in the
                      database cluster. Each slugs denotes the node's identifier, CPU,
                      and RAM (in that order).
                    "sizes": [
                        "str"  # Optional. An array of
                          objects containing the slugs available with various node
                          counts.
                    ]
                }
            ],
            "regions": [
                "str"  # Optional. An array of strings containing the
                  names of available regions.
            ],
            "versions": [
                "str"  # Optional. An array of strings containing the
                  names of available regions.
            ]
        },
        "redis": {
            "layouts": [
                {
                    "num_nodes": 0,  # Optional. An array of
                      objects, each indicating the node sizes (otherwise referred to as
                      slugs) that are available with various numbers of nodes in the
                      database cluster. Each slugs denotes the node's identifier, CPU,
                      and RAM (in that order).
                    "sizes": [
                        "str"  # Optional. An array of
                          objects containing the slugs available with various node
                          counts.
                    ]
                }
            ],
            "regions": [
                "str"  # Optional. An array of strings containing the
                  names of available regions.
            ],
            "versions": [
                "str"  # Optional. An array of strings containing the
                  names of available regions.
            ]
        }
    },
    "version_availability": {
        "mongodb": [
            {
                "end_of_availability": "str",  # Optional. A
                  timestamp referring to the date when the particular version will no
                  longer be available for creating new clusters. If null, the version
                  does not have an end of availability timeline.
                "end_of_life": "str",  # Optional. A timestamp
                  referring to the date when the particular version will no longer be
                  supported. If null, the version does not have an end of life
                  timeline.
                "version": "str"  # Optional. The engine version.
            }
        ],
        "mysql": [
            {
                "end_of_availability": "str",  # Optional. A
                  timestamp referring to the date when the particular version will no
                  longer be available for creating new clusters. If null, the version
                  does not have an end of availability timeline.
                "end_of_life": "str",  # Optional. A timestamp
                  referring to the date when the particular version will no longer be
                  supported. If null, the version does not have an end of life
                  timeline.
                "version": "str"  # Optional. The engine version.
            }
        ],
        "pg": [
            {
                "end_of_availability": "str",  # Optional. A
                  timestamp referring to the date when the particular version will no
                  longer be available for creating new clusters. If null, the version
                  does not have an end of availability timeline.
                "end_of_life": "str",  # Optional. A timestamp
                  referring to the date when the particular version will no longer be
                  supported. If null, the version does not have an end of life
                  timeline.
                "version": "str"  # Optional. The engine version.
            }
        ],
        "redis": [
            {
                "end_of_availability": "str",  # Optional. A
                  timestamp referring to the date when the particular version will no
                  longer be available for creating new clusters. If null, the version
                  does not have an end of availability timeline.
                "end_of_life": "str",  # Optional. A timestamp
                  referring to the date when the particular version will no longer be
                  supported. If null, the version does not have an end of life
                  timeline.
                "version": "str"  # Optional. The engine version.
            }
        ]
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_replicas(database_cluster_uuid: str, **kwargs: Any) MutableMapping[str, Any]

List All Read-only Replicas.

To list all of the read-only replicas associated with a database cluster, send a GET request to /v2/databases/$DATABASE_ID/replicas.

Note: Read-only replicas are not supported for Redis clusters.

The result will be a JSON object with a replicas key. This will be set to an array of database replica objects, each of which will contain the standard database replica attributes.

Parameters:

database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "replicas": [
        {
            "connection": {
                "database": "str",  # Optional. The name of the
                  default database.
                "host": "str",  # Optional. The FQDN pointing to the
                  database cluster's current primary node.
                "password": "str",  # Optional. The randomly
                  generated password for the default user.
                "port": 0,  # Optional. The port on which the
                  database cluster is listening.
                "ssl": bool,  # Optional. A boolean value indicating
                  if the connection should be made over SSL.
                "uri": "str",  # Optional. A connection string in the
                  format accepted by the ``psql`` command. This is provided as a
                  convenience and should be able to be constructed by the other
                  attributes.
                "user": "str"  # Optional. The default user for the
                  database.
            },
            "created_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the database cluster was created.
            "id": "str",  # Optional. A unique ID that can be used to
              identify and reference a database replica.
            "name": "str",  # The name to give the read-only replicating.
              Required.
            "private_connection": {
                "database": "str",  # Optional. The name of the
                  default database.
                "host": "str",  # Optional. The FQDN pointing to the
                  database cluster's current primary node.
                "password": "str",  # Optional. The randomly
                  generated password for the default user.
                "port": 0,  # Optional. The port on which the
                  database cluster is listening.
                "ssl": bool,  # Optional. A boolean value indicating
                  if the connection should be made over SSL.
                "uri": "str",  # Optional. A connection string in the
                  format accepted by the ``psql`` command. This is provided as a
                  convenience and should be able to be constructed by the other
                  attributes.
                "user": "str"  # Optional. The default user for the
                  database.
            },
            "private_network_uuid": "str",  # Optional. A string
              specifying the UUID of the VPC to which the read-only replica will be
              assigned. If excluded, the replica will be assigned to your account's
              default VPC for the region.
            "region": "str",  # Optional. A slug identifier for the
              region where the read-only replica will be located. If excluded, the
              replica will be placed in the same region as the cluster.
            "size": "str",  # Optional. A slug identifier representing
              the size of the node for the read-only replica. The size of the replica
              must be at least as large as the node size for the database cluster from
              which it is replicating.
            "status": "str",  # Optional. A string representing the
              current status of the database cluster. Known values are: "creating",
              "online", "resizing", "migrating", and "forking".
            "tags": [
                "str"  # Optional. A flat array of tag names as
                  strings to apply to the read-only replica after it is created. Tag
                  names can either be existing or new tags.
            ]
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_users(database_cluster_uuid: str, **kwargs: Any) MutableMapping[str, Any]

List all Database Users.

To list all of the users for your database cluster, send a GET request to /v2/databases/$DATABASE_ID/users.

Note: User management is not supported for Redis clusters.

The result will be a JSON object with a users key. This will be set to an array of database user objects, each of which will contain the standard database user attributes.

For MySQL clusters, additional options will be contained in the mysql_settings object.

Parameters:

database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "users": [
        {
            "mysql_settings": {
                "auth_plugin": "str"  # A string specifying the
                  authentication method to be used for connections"nto the MySQL user
                  account. The valid values are ``mysql_native_password``"nor
                  ``caching_sha2_password``. If excluded when creating a new user,
                  the"ndefault for the version of MySQL in use will be used. As of
                  MySQL 8.0, the"ndefault is ``caching_sha2_password``. Required. Known
                  values are: "mysql_native_password" and "caching_sha2_password".
            },
            "name": "str",  # The name of a database user. Required.
            "password": "str",  # Optional. A randomly generated password
              for the database user.
            "role": "str"  # Optional. A string representing the database
              user's role. The value will be either"n"primary" or "normal". Known
              values are: "primary" and "normal".
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
patch_config(database_cluster_uuid: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
patch_config(database_cluster_uuid: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Update the Database Configuration for an Existing Database.

To update the configuration for an existing database cluster, send a PATCH request to /v2/databases/$DATABASE_ID/config.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
promote_replica(database_cluster_uuid: str, replica_name: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Promote a Read-only Replica to become a Primary Cluster.

To promote a specific read-only replica, send a PUT request to /v2/databases/$DATABASE_ID/replicas/$REPLICA_NAME/promote.

Note: Read-only replicas are not supported for Redis clusters.

A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • replica_name (str) – The name of the database replica. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
reset_auth(database_cluster_uuid: str, username: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
reset_auth(database_cluster_uuid: str, username: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Reset a Database User’s Password or Authentication Method.

To reset the password for a database user, send a POST request to /v2/databases/$DATABASE_ID/users/$USERNAME/reset_auth.

For mysql databases, the authentication method can be specifying by including a key in the JSON body called mysql_settings with the auth_plugin value specified.

The response will be a JSON object with a user key. This will be set to an object containing the standard database user attributes.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • username (str) – The name of the database user. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "user": {
        "mysql_settings": {
            "auth_plugin": "str"  # A string specifying the
              authentication method to be used for connections"nto the MySQL user
              account. The valid values are ``mysql_native_password``"nor
              ``caching_sha2_password``. If excluded when creating a new user,
              the"ndefault for the version of MySQL in use will be used. As of MySQL
              8.0, the"ndefault is ``caching_sha2_password``. Required. Known values
              are: "mysql_native_password" and "caching_sha2_password".
        },
        "name": "str",  # The name of a database user. Required.
        "password": "str",  # Optional. A randomly generated password for the
          database user.
        "role": "str"  # Optional. A string representing the database user's
          role. The value will be either"n"primary" or "normal". Known values are:
          "primary" and "normal".
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
update_cluster_size(database_cluster_uuid: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
update_cluster_size(database_cluster_uuid: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Resize a Database Cluster.

To resize a database cluster, send a PUT request to /v2/databases/$DATABASE_ID/resize. The body of the request must specify both the size and num_nodes attributes. A successful request will receive a 202 Accepted status code with no body in response. Querying the database cluster will show that its status attribute will now be set to resizing. This will transition back to online when the resize operation has completed.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
update_connection_pool(database_cluster_uuid: str, pool_name: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
update_connection_pool(database_cluster_uuid: str, pool_name: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Update Connection Pools (PostgreSQL).

To update a connection pool for a PostgreSQL database cluster, send a PUT request to /v2/databases/$DATABASE_ID/pools/$POOL_NAME.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • pool_name (str) – The name used to identify the connection pool. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
update_eviction_policy(database_cluster_uuid: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
update_eviction_policy(database_cluster_uuid: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Configure the Eviction Policy for a Redis Cluster.

To configure an eviction policy for an existing Redis cluster, send a PUT request to /v2/databases/$DATABASE_ID/eviction_policy specifying the desired policy.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
update_firewall_rules(database_cluster_uuid: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
update_firewall_rules(database_cluster_uuid: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Update Firewall Rules (Trusted Sources) for a Database.

To update a database cluster’s firewall rules (known as “trusted sources” in the control panel), send a PUT request to /v2/databases/$DATABASE_ID/firewall specifying which resources should be able to open connections to the database. You may limit connections to specific Droplets, Kubernetes clusters, or IP addresses. When a tag is provided, any Droplet or Kubernetes node with that tag applied to it will have access. The firewall is limited to 100 rules (or trusted sources). When possible, we recommend placing your databases into a VPC network to limit access to them instead of using a firewall. A successful.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
update_maintenance_window(database_cluster_uuid: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
update_maintenance_window(database_cluster_uuid: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Configure a Database Cluster’s Maintenance Window.

To configure the window when automatic maintenance should be performed for a database cluster, send a PUT request to /v2/databases/$DATABASE_ID/maintenance. A successful request will receive a 204 No Content status code with no body in response.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
update_major_version(database_cluster_uuid: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
update_major_version(database_cluster_uuid: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Upgrade Major Version for a Database.

To upgrade the major version of a database, send a PUT request to /v2/databases/$DATABASE_ID/upgrade, specifying the target version. A successful request will receive a 204 No Content status code with no body in response.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
update_online_migration(database_cluster_uuid: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
update_online_migration(database_cluster_uuid: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Start an Online Migration.

To start an online migration, send a PUT request to /v2/databases/$DATABASE_ID/online-migration endpoint. Migrating a cluster establishes a connection with an existing cluster and replicates its contents to the target cluster. Online migration is only available for MySQL, PostgreSQL, and Redis clusters.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "created_at": "str",  # Optional. The time the migration was initiated, in
      ISO 8601 format.
    "id": "str",  # Optional. The ID of the most recent migration.
    "status": "str"  # Optional. The current status of the migration. Known
      values are: "running", "canceled", "error", and "done".
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
update_region(database_cluster_uuid: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
update_region(database_cluster_uuid: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Migrate a Database Cluster to a New Region.

To migrate a database cluster to a new region, send a PUT request to /v2/databases/$DATABASE_ID/migrate. The body of the request must specify a region attribute.

A successful request will receive a 202 Accepted status code with no body in response. Querying the database cluster will show that its status attribute will now be set to migrating. This will transition back to online when the migration has completed.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
update_sql_mode(database_cluster_uuid: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
update_sql_mode(database_cluster_uuid: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Update SQL Mode for a Cluster.

To configure the SQL modes for an existing MySQL cluster, send a PUT request to /v2/databases/$DATABASE_ID/sql_mode specifying the desired modes. See the official MySQL 8 documentation for a full list of supported SQL modes. A successful request will receive a 204 No Content status code with no body in response.

Parameters:
  • database_cluster_uuid (str) – A unique identifier for a database cluster. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
class pydo.operations.DomainsOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s domains attribute.

create(body: Optional[JSON] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON
create(body: Optional[IO] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create a New Domain.

To create a new domain, send a POST request to /v2/domains. Set the “name” attribute to the domain name you are adding. Optionally, you may set the “ip_address” attribute, and an A record will be automatically created pointing to the apex domain.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Default value is None.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 201
response == {
    "domain": {
        "ip_address": "str",  # Optional. This optional attribute may contain
          an IP address. When provided, an A record will be automatically created
          pointing to the apex domain.
        "name": "str",  # Optional. The name of the domain itself. This
          should follow the standard domain format of domain.TLD. For instance,
          ``example.com`` is a valid domain name.
        "ttl": 0,  # Optional. This value is the time to live for the records
          on this domain, in seconds. This defines the time frame that clients can
          cache queried information before a refresh should be requested.
        "zone_file": "str"  # Optional. This attribute contains the complete
          contents of the zone file for the selected domain. Individual domain record
          resources should be used to get more granular control over records. However,
          this attribute can also be used to get information about the SOA record,
          which is created automatically and is not accessible as an individual record
          resource.
    }
}
create_record(domain_name: str, body: Optional[JSON] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON
create_record(domain_name: str, body: Optional[IO] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create a New Domain Record.

To create a new record to a domain, send a POST request to /v2/domains/$DOMAIN_NAME/records.

The request must include all of the required fields for the domain record type being added.

See the attribute table for details regarding record types and their respective required attributes.

Parameters:
  • domain_name (str) – The name of the domain itself. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Default value is None.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 201
response == {
    "domain_record": {
        "data": "str",  # Optional. Variable data depending on record type.
          For example, the "data" value for an A record would be the IPv4 address to
          which the domain will be mapped. For a CAA record, it would contain the
          domain name of the CA being granted permission to issue certificates.
        "flags": 0,  # Optional. An unsigned integer between 0-255 used for
          CAA records.
        "id": 0,  # Optional. A unique identifier for each domain record.
        "name": "str",  # Optional. The host name, alias, or service being
          defined by the record.
        "port": 0,  # Optional. The port for SRV records.
        "priority": 0,  # Optional. The priority for SRV and MX records.
        "tag": "str",  # Optional. The parameter tag for CAA records. Valid
          values are "issue", "issuewild", or "iodef".
        "ttl": 0,  # Optional. This value is the time to live for the record,
          in seconds. This defines the time frame that clients can cache queried
          information before a refresh should be requested.
        "type": "str",  # The type of the DNS record. For example: A, CNAME,
          TXT, ... Required.
        "weight": 0  # Optional. The weight for SRV records.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
delete(domain_name: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete a Domain.

To delete a domain, send a DELETE request to /v2/domains/$DOMAIN_NAME.

Parameters:

domain_name (str) – The name of the domain itself. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
delete_record(domain_name: str, domain_record_id: int, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete a Domain Record.

To delete a record for a domain, send a DELETE request to /v2/domains/$DOMAIN_NAME/records/$DOMAIN_RECORD_ID.

The record will be deleted and the response status will be a 204. This indicates a successful request with no body returned.

Parameters:
  • domain_name (str) – The name of the domain itself. Required.

  • domain_record_id (int) – The unique identifier of the domain record. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get(domain_name: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Domain.

To get details about a specific domain, send a GET request to /v2/domains/$DOMAIN_NAME.

Parameters:

domain_name (str) – The name of the domain itself. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "domain": {
        "ip_address": "str",  # Optional. This optional attribute may contain
          an IP address. When provided, an A record will be automatically created
          pointing to the apex domain.
        "name": "str",  # Optional. The name of the domain itself. This
          should follow the standard domain format of domain.TLD. For instance,
          ``example.com`` is a valid domain name.
        "ttl": 0,  # Optional. This value is the time to live for the records
          on this domain, in seconds. This defines the time frame that clients can
          cache queried information before a refresh should be requested.
        "zone_file": "str"  # Optional. This attribute contains the complete
          contents of the zone file for the selected domain. Individual domain record
          resources should be used to get more granular control over records. However,
          this attribute can also be used to get information about the SOA record,
          which is created automatically and is not accessible as an individual record
          resource.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_record(domain_name: str, domain_record_id: int, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Domain Record.

To retrieve a specific domain record, send a GET request to /v2/domains/$DOMAIN_NAME/records/$RECORD_ID.

Parameters:
  • domain_name (str) – The name of the domain itself. Required.

  • domain_record_id (int) – The unique identifier of the domain record. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "domain_record": {
        "data": "str",  # Optional. Variable data depending on record type.
          For example, the "data" value for an A record would be the IPv4 address to
          which the domain will be mapped. For a CAA record, it would contain the
          domain name of the CA being granted permission to issue certificates.
        "flags": 0,  # Optional. An unsigned integer between 0-255 used for
          CAA records.
        "id": 0,  # Optional. A unique identifier for each domain record.
        "name": "str",  # Optional. The host name, alias, or service being
          defined by the record.
        "port": 0,  # Optional. The port for SRV records.
        "priority": 0,  # Optional. The priority for SRV and MX records.
        "tag": "str",  # Optional. The parameter tag for CAA records. Valid
          values are "issue", "issuewild", or "iodef".
        "ttl": 0,  # Optional. This value is the time to live for the record,
          in seconds. This defines the time frame that clients can cache queried
          information before a refresh should be requested.
        "type": "str",  # The type of the DNS record. For example: A, CNAME,
          TXT, ... Required.
        "weight": 0  # Optional. The weight for SRV records.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list(*, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All Domains.

To retrieve a list of all of the domains in your account, send a GET request to /v2/domains.

Parameters:
  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "domains": [
        {
            "ip_address": "str",  # Optional. This optional attribute may
              contain an IP address. When provided, an A record will be automatically
              created pointing to the apex domain.
            "name": "str",  # Optional. The name of the domain itself.
              This should follow the standard domain format of domain.TLD. For
              instance, ``example.com`` is a valid domain name.
            "ttl": 0,  # Optional. This value is the time to live for the
              records on this domain, in seconds. This defines the time frame that
              clients can cache queried information before a refresh should be
              requested.
            "zone_file": "str"  # Optional. This attribute contains the
              complete contents of the zone file for the selected domain. Individual
              domain record resources should be used to get more granular control over
              records. However, this attribute can also be used to get information
              about the SOA record, which is created automatically and is not
              accessible as an individual record resource.
        }
    ],
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
list_records(domain_name: str, *, name: Optional[str] = None, type: Optional[str] = None, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All Domain Records.

To get a listing of all records configured for a domain, send a GET request to /v2/domains/$DOMAIN_NAME/records. The list of records returned can be filtered by using the name and type query parameters. For example, to only include A records for a domain, send a GET request to /v2/domains/$DOMAIN_NAME/records?type=A. name must be a fully qualified record name. For example, to only include records matching sub.example.com, send a GET request to /v2/domains/$DOMAIN_NAME/records?name=sub.example.com. Both name and type may be used together.

Parameters:
  • domain_name (str) – The name of the domain itself. Required.

  • name (str) – A fully qualified record name. For example, to only include records matching sub.example.com, send a GET request to /v2/domains/$DOMAIN_NAME/records?name=sub.example.com. Default value is None.

  • type (str) – The type of the DNS record. For example: A, CNAME, TXT, … Known values are: “A”, “AAAA”, “CAA”, “CNAME”, “MX”, “NS”, “SOA”, “SRV”, and “TXT”. Default value is None.

  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "domain_records": [
        {
            "data": "str",  # Optional. Variable data depending on record
              type. For example, the "data" value for an A record would be the IPv4
              address to which the domain will be mapped. For a CAA record, it would
              contain the domain name of the CA being granted permission to issue
              certificates.
            "flags": 0,  # Optional. An unsigned integer between 0-255
              used for CAA records.
            "id": 0,  # Optional. A unique identifier for each domain
              record.
            "name": "str",  # Optional. The host name, alias, or service
              being defined by the record.
            "port": 0,  # Optional. The port for SRV records.
            "priority": 0,  # Optional. The priority for SRV and MX
              records.
            "tag": "str",  # Optional. The parameter tag for CAA records.
              Valid values are "issue", "issuewild", or "iodef".
            "ttl": 0,  # Optional. This value is the time to live for the
              record, in seconds. This defines the time frame that clients can cache
              queried information before a refresh should be requested.
            "type": "str",  # The type of the DNS record. For example: A,
              CNAME, TXT, ... Required.
            "weight": 0  # Optional. The weight for SRV records.
        }
    ],
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
patch_record(domain_name: str, domain_record_id: int, body: Optional[JSON] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON
patch_record(domain_name: str, domain_record_id: int, body: Optional[IO] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON

Update a Domain Record.

To update an existing record, send a PATCH request to /v2/domains/$DOMAIN_NAME/records/$DOMAIN_RECORD_ID. Any attribute valid for the record type can be set to a new value for the record.

See the attribute table for details regarding record types and their respective attributes.

Parameters:
  • domain_name (str) – The name of the domain itself. Required.

  • domain_record_id (int) – The unique identifier of the domain record. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Default value is None.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "domain_record": {
        "data": "str",  # Optional. Variable data depending on record type.
          For example, the "data" value for an A record would be the IPv4 address to
          which the domain will be mapped. For a CAA record, it would contain the
          domain name of the CA being granted permission to issue certificates.
        "flags": 0,  # Optional. An unsigned integer between 0-255 used for
          CAA records.
        "id": 0,  # Optional. A unique identifier for each domain record.
        "name": "str",  # Optional. The host name, alias, or service being
          defined by the record.
        "port": 0,  # Optional. The port for SRV records.
        "priority": 0,  # Optional. The priority for SRV and MX records.
        "tag": "str",  # Optional. The parameter tag for CAA records. Valid
          values are "issue", "issuewild", or "iodef".
        "ttl": 0,  # Optional. This value is the time to live for the record,
          in seconds. This defines the time frame that clients can cache queried
          information before a refresh should be requested.
        "type": "str",  # The type of the DNS record. For example: A, CNAME,
          TXT, ... Required.
        "weight": 0  # Optional. The weight for SRV records.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
update_record(domain_name: str, domain_record_id: int, body: Optional[JSON] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON
update_record(domain_name: str, domain_record_id: int, body: Optional[IO] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON

Update a Domain Record.

To update an existing record, send a PUT request to /v2/domains/$DOMAIN_NAME/records/$DOMAIN_RECORD_ID. Any attribute valid for the record type can be set to a new value for the record.

See the attribute table for details regarding record types and their respective attributes.

Parameters:
  • domain_name (str) – The name of the domain itself. Required.

  • domain_record_id (int) – The unique identifier of the domain record. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Default value is None.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "domain_record": {
        "data": "str",  # Optional. Variable data depending on record type.
          For example, the "data" value for an A record would be the IPv4 address to
          which the domain will be mapped. For a CAA record, it would contain the
          domain name of the CA being granted permission to issue certificates.
        "flags": 0,  # Optional. An unsigned integer between 0-255 used for
          CAA records.
        "id": 0,  # Optional. A unique identifier for each domain record.
        "name": "str",  # Optional. The host name, alias, or service being
          defined by the record.
        "port": 0,  # Optional. The port for SRV records.
        "priority": 0,  # Optional. The priority for SRV and MX records.
        "tag": "str",  # Optional. The parameter tag for CAA records. Valid
          values are "issue", "issuewild", or "iodef".
        "ttl": 0,  # Optional. This value is the time to live for the record,
          in seconds. This defines the time frame that clients can cache queried
          information before a refresh should be requested.
        "type": "str",  # The type of the DNS record. For example: A, CNAME,
          TXT, ... Required.
        "weight": 0  # Optional. The weight for SRV records.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
class pydo.operations.DropletActionsOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s droplet_actions attribute.

get(droplet_id: int, action_id: int, **kwargs: Any) MutableMapping[str, Any]

Retrieve a Droplet Action.

To retrieve a Droplet action, send a GET request to /v2/droplets/$DROPLET_ID/actions/$ACTION_ID.

The response will be a JSON object with a key called action. The value will be a Droplet action object.

Parameters:
  • droplet_id (int) – A unique identifier for a Droplet instance. Required.

  • action_id (int) – A unique numeric ID that can be used to identify and reference an action. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "action": {
        "completed_at": "2020-02-20 00:00:00",  # Optional. A time value
          given in ISO8601 combined date and time format that represents when the
          action was completed.
        "id": 0,  # Optional. A unique numeric ID that can be used to
          identify and reference an action.
        "region": {
            "available": bool,  # This is a boolean value that represents
              whether new Droplets can be created in this region. Required.
            "features": {},  # This attribute is set to an array which
              contains features available in this region. Required.
            "name": "str",  # The display name of the region.  This will
              be a full name that is used in the control panel and other interfaces.
              Required.
            "sizes": {},  # This attribute is set to an array which
              contains the identifying slugs for the sizes available in this region.
              Required.
            "slug": "str"  # A human-readable string that is used as a
              unique identifier for each region. Required.
        },
        "region_slug": {},  # Optional. Any object.
        "resource_id": 0,  # Optional. A unique identifier for the resource
          that the action is associated with.
        "resource_type": "str",  # Optional. The type of resource that the
          action is associated with.
        "started_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the action was
          initiated.
        "status": "in-progress",  # Optional. Default value is "in-progress".
          The current status of the action. This can be "in-progress", "completed", or
          "errored". Known values are: "in-progress", "completed", and "errored".
        "type": "str"  # Optional. This is the type of action that the object
          represents. For example, this could be "transfer" to represent the state of
          an image transfer action.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list(droplet_id: int, *, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List Actions for a Droplet.

To retrieve a list of all actions that have been executed for a Droplet, send a GET request to /v2/droplets/$DROPLET_ID/actions.

The results will be returned as a JSON object with an actions key. This will be set to an array filled with action objects containing the standard action attributes.

Parameters:
  • droplet_id (int) – A unique identifier for a Droplet instance. Required.

  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "actions": [
        {
            "completed_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the action was completed.
            "id": 0,  # Optional. A unique numeric ID that can be used to
              identify and reference an action.
            "region": {
                "available": bool,  # This is a boolean value that
                  represents whether new Droplets can be created in this region.
                  Required.
                "features": {},  # This attribute is set to an array
                  which contains features available in this region. Required.
                "name": "str",  # The display name of the region.
                  This will be a full name that is used in the control panel and other
                  interfaces. Required.
                "sizes": {},  # This attribute is set to an array
                  which contains the identifying slugs for the sizes available in this
                  region. Required.
                "slug": "str"  # A human-readable string that is used
                  as a unique identifier for each region. Required.
            },
            "region_slug": {},  # Optional. Any object.
            "resource_id": 0,  # Optional. A unique identifier for the
              resource that the action is associated with.
            "resource_type": "str",  # Optional. The type of resource
              that the action is associated with.
            "started_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the action was initiated.
            "status": "in-progress",  # Optional. Default value is
              "in-progress". The current status of the action. This can be
              "in-progress", "completed", or "errored". Known values are:
              "in-progress", "completed", and "errored".
            "type": "str"  # Optional. This is the type of action that
              the object represents. For example, this could be "transfer" to represent
              the state of an image transfer action.
        }
    ],
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
post(droplet_id: int, body: Optional[JSON] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON
post(droplet_id: int, body: Optional[IO] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON

Initiate a Droplet Action.

To initiate an action on a Droplet send a POST request to /v2/droplets/$DROPLET_ID/actions. In the JSON body to the request, set the type attribute to on of the supported action types:

Action

Details

<nobr>`enable_backups`</nobr>

Enables backups for a Droplet

<nobr>`disable_backups`</nobr>

Disables backups for a Droplet

<nobr>`reboot`</nobr>

Reboots a Droplet. A reboot action is an attempt to reboot the Droplet in a graceful

way, similar to using the reboot command from the console.
    • <nobr>`power_cycle`</nobr>

    • Power cycles a Droplet. A powercycle action is similar to pushing the reset button

on a physical machine, it’s similar to booting from scratch.
    • <nobr>`shutdown`</nobr>

    • Shutsdown a Droplet. A shutdown action is an attempt to shutdown the Droplet in a

graceful way, similar to using the shutdown command from the console. Since a shutdown command can fail, this action guarantees that the command is issued, not that it succeeds. The preferred way to turn off a Droplet is to attempt a shutdown, with a reasonable timeout, followed by a power_off action to ensure the Droplet is off.

    • <nobr>`power_off`</nobr>

    • Powers off a Droplet. A power_off event is a hard shutdown and should only be used

if the shutdown action is not successful. It is similar to cutting the power on a server and could lead to complications.

    • <nobr>`power_on`</nobr>

    • Powers on a Droplet.

    • <nobr>`restore`</nobr>

    • Restore a Droplet using a backup image. The image ID that is passed in must be a backup

of the current Droplet instance. The operation will leave any embedded SSH keys intact.
    • <nobr>`password_reset`</nobr>

    • Resets the root password for a Droplet. A new password will be provided via email. It

must be changed after first use.
    • <nobr>`resize`</nobr>

    • Resizes a Droplet. Set the size attribute to a size slug. If a permanent resize with

disk changes included is desired, set the disk attribute to true.
    • <nobr>`rebuild`</nobr>

    • Rebuilds a Droplet from a new base image. Set the image attribute to an image ID or

slug.
    • <nobr>`rename`</nobr>

    • Renames a Droplet.

    • <nobr>`change_kernel`</nobr>

    • Changes a Droplet’s kernel. Only applies to Droplets with externally managed kernels.

All Droplets created after March 2017 use internal kernels by default.
    • <nobr>`enable_ipv6`</nobr>

    • Enables IPv6 for a Droplet.

    • <nobr>`snapshot`</nobr>

    • Takes a snapshot of a Droplet.

Parameters:
  • droplet_id (int) – A unique identifier for a Droplet instance. Required.

  • body (JSON or IO) – The type attribute set in the request body will specify the action that will be taken on the Droplet. Some actions will require additional attributes to be set as well. Is either a model type or a IO type. Default value is None.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 201
response == {
    "action": {
        "completed_at": "2020-02-20 00:00:00",  # Optional. A time value
          given in ISO8601 combined date and time format that represents when the
          action was completed.
        "id": 0,  # Optional. A unique numeric ID that can be used to
          identify and reference an action.
        "region": {
            "available": bool,  # This is a boolean value that represents
              whether new Droplets can be created in this region. Required.
            "features": {},  # This attribute is set to an array which
              contains features available in this region. Required.
            "name": "str",  # The display name of the region.  This will
              be a full name that is used in the control panel and other interfaces.
              Required.
            "sizes": {},  # This attribute is set to an array which
              contains the identifying slugs for the sizes available in this region.
              Required.
            "slug": "str"  # A human-readable string that is used as a
              unique identifier for each region. Required.
        },
        "region_slug": {},  # Optional. Any object.
        "resource_id": 0,  # Optional. A unique identifier for the resource
          that the action is associated with.
        "resource_type": "str",  # Optional. The type of resource that the
          action is associated with.
        "started_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the action was
          initiated.
        "status": "in-progress",  # Optional. Default value is "in-progress".
          The current status of the action. This can be "in-progress", "completed", or
          "errored". Known values are: "in-progress", "completed", and "errored".
        "type": "str"  # Optional. This is the type of action that the object
          represents. For example, this could be "transfer" to represent the state of
          an image transfer action.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
post_by_tag(body: Optional[JSON] = None, *, tag_name: Optional[str] = None, content_type: str = 'application/json', **kwargs: Any) JSON
post_by_tag(body: Optional[IO] = None, *, tag_name: Optional[str] = None, content_type: str = 'application/json', **kwargs: Any) JSON

Acting on Tagged Droplets.

Some actions can be performed in bulk on tagged Droplets. The actions can be initiated by sending a POST to /v2/droplets/actions?tag_name=$TAG_NAME with the action arguments.

Only a sub-set of action types are supported:

  • power_cycle

  • power_on

  • power_off

  • shutdown

  • enable_ipv6

  • enable_backups

  • disable_backups

  • snapshot.

Parameters:
  • body (JSON or IO) – The type attribute set in the request body will specify the action that will be taken on the Droplet. Some actions will require additional attributes to be set as well. Is either a model type or a IO type. Default value is None.

  • tag_name (str) – Used to filter Droplets by a specific tag. Can not be combined with name. Default value is None.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 201
response == {
    "actions": [
        {
            "completed_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the action was completed.
            "id": 0,  # Optional. A unique numeric ID that can be used to
              identify and reference an action.
            "region": {
                "available": bool,  # This is a boolean value that
                  represents whether new Droplets can be created in this region.
                  Required.
                "features": {},  # This attribute is set to an array
                  which contains features available in this region. Required.
                "name": "str",  # The display name of the region.
                  This will be a full name that is used in the control panel and other
                  interfaces. Required.
                "sizes": {},  # This attribute is set to an array
                  which contains the identifying slugs for the sizes available in this
                  region. Required.
                "slug": "str"  # A human-readable string that is used
                  as a unique identifier for each region. Required.
            },
            "region_slug": {},  # Optional. Any object.
            "resource_id": 0,  # Optional. A unique identifier for the
              resource that the action is associated with.
            "resource_type": "str",  # Optional. The type of resource
              that the action is associated with.
            "started_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the action was initiated.
            "status": "in-progress",  # Optional. Default value is
              "in-progress". The current status of the action. This can be
              "in-progress", "completed", or "errored". Known values are:
              "in-progress", "completed", and "errored".
            "type": "str"  # Optional. This is the type of action that
              the object represents. For example, this could be "transfer" to represent
              the state of an image transfer action.
        }
    ]
}
class pydo.operations.DropletsOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s droplets attribute.

create(body: Optional[JSON] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON
create(body: Optional[IO] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create a New Droplet.

To create a new Droplet, send a POST request to /v2/droplets setting the required attributes.

A Droplet will be created using the provided information. The response body will contain a JSON object with a key called droplet. The value will be an object containing the standard attributes for your new Droplet. The response code, 202 Accepted, does not indicate the success or failure of the operation, just that the request has been accepted for processing. The actions returned as part of the response’s links object can be used to check the status of the Droplet create event.

Create Multiple Droplets

Creating multiple Droplets is very similar to creating a single Droplet. Instead of sending name as a string, send names as an array of strings. A Droplet will be created for each name you send using the associated information. Up to ten Droplets may be created this way at a time.

Rather than returning a single Droplet, the response body will contain a JSON array with a key called droplets. This will be set to an array of JSON objects, each of which will contain the standard Droplet attributes. The response code, 202 Accepted, does not indicate the success or failure of any operation, just that the request has been accepted for processing. The array of actions returned as part of the response’s links object can be used to check the status of each individual Droplet create event.

param body:

Is either a model type or a IO type. Default value is None.

type body:

JSON or IO

keyword content_type:

Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

paramtype content_type:

str

return:

JSON object

rtype:

JSON

raises ~azure.core.exceptions.HttpResponseError:

destroy(droplet_id: int, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete an Existing Droplet.

To delete a Droplet, send a DELETE request to /v2/droplets/$DROPLET_ID.

A successful request will receive a 204 status code with no body in response. This indicates that the request was processed successfully.

Parameters:

droplet_id (int) – A unique identifier for a Droplet instance. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
destroy_by_tag(*, tag_name: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Deleting Droplets by Tag.

To delete all Droplets assigned to a specific tag, include the tag_name query parameter set to the name of the tag in your DELETE request. For example, /v2/droplets?tag_name=$TAG_NAME.

A successful request will receive a 204 status code with no body in response. This indicates that the request was processed successfully.

Parameters:

tag_name (str) – Specifies Droplets to be deleted by tag. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
destroy_retry_with_associated_resources(droplet_id: int, **kwargs: Any) Optional[MutableMapping[str, Any]]

Retry a Droplet Destroy with Associated Resources Request.

If the status of a request to destroy a Droplet with its associated resources reported any errors, it can be retried by sending a POST request to the /v2/droplets/$DROPLET_ID/destroy_with_associated_resources/retry endpoint.

Only one destroy can be active at a time per Droplet. If a retry is issued while another destroy is in progress for the Droplet a 409 status code will be returned. A successful response will include a 202 response code and no content.

Parameters:

droplet_id (int) – A unique identifier for a Droplet instance. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404, 409
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
destroy_with_associated_resources_dangerous(droplet_id: int, *, x_dangerous: bool, **kwargs: Any) Optional[MutableMapping[str, Any]]

Destroy a Droplet and All of its Associated Resources (Dangerous).

To destroy a Droplet along with all of its associated resources, send a DELETE request to the /v2/droplets/$DROPLET_ID/destroy_with_associated_resources/dangerous endpoint. The headers of this request must include an X-Dangerous key set to true. To preview which resources will be destroyed, first query the Droplet’s associated resources. This operation can not be reverse and should be used with caution.

A successful response will include a 202 response code and no content. Use the status endpoint to check on the success or failure of the destruction of the individual resources.

Parameters:
  • droplet_id (int) – A unique identifier for a Droplet instance. Required.

  • x_dangerous (bool) – Acknowledge this action will destroy the Droplet and all associated resources and can not be reversed. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
destroy_with_associated_resources_selective(droplet_id: int, body: Optional[JSON] = None, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
destroy_with_associated_resources_selective(droplet_id: int, body: Optional[IO] = None, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Selectively Destroy a Droplet and its Associated Resources.

To destroy a Droplet along with a sub-set of its associated resources, send a DELETE request to the /v2/droplets/$DROPLET_ID/destroy_with_associated_resources/selective endpoint. The JSON body of the request should include reserved_ips, snapshots, volumes, or volume_snapshots keys each set to an array of IDs for the associated resources to be destroyed. The IDs can be found by querying the Droplet’s associated resources. Any associated resource not included in the request will remain and continue to accrue changes on your account.

A successful response will include a 202 response code and no content. Use the status endpoint to check on the success or failure of the destruction of the individual resources.

Parameters:
  • droplet_id (int) – A unique identifier for a Droplet instance. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Default value is None.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get(droplet_id: int, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Droplet.

To show information about an individual Droplet, send a GET request to /v2/droplets/$DROPLET_ID.

Parameters:

droplet_id (int) – A unique identifier for a Droplet instance. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "droplet": {
        "backup_ids": [
            0  # An array of backup IDs of any backups that have been
              taken of the Droplet instance.  Droplet backups are enabled at the time
              of the instance creation. Required.
        ],
        "created_at": "2020-02-20 00:00:00",  # A time value given in ISO8601
          combined date and time format that represents when the Droplet was created.
          Required.
        "disk": 0,  # The size of the Droplet's disk in gigabytes. Required.
        "features": [
            "str"  # An array of features enabled on this Droplet.
              Required.
        ],
        "id": 0,  # A unique identifier for each Droplet instance. This is
          automatically generated upon Droplet creation. Required.
        "image": {
            "created_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the image was created.
            "description": "str",  # Optional. An optional free-form text
              field to describe an image.
            "distribution": "str",  # Optional. The name of a custom
              image's distribution. Currently, the valid values are  ``Arch Linux``"" ,
              ``CentOS``"" , ``CoreOS``"" , ``Debian``"" , ``Fedora``"" , ``Fedora
              Atomic``"" ,  ``FreeBSD``"" , ``Gentoo``"" , ``openSUSE``"" ,
              ``RancherOS``"" , ``Rocky Linux``"" , ``Ubuntu``"" , and ``Unknown``.
              Any other value will be accepted but ignored, and ``Unknown`` will be
              used in its place. Known values are: "Arch Linux", "CentOS", "CoreOS",
              "Debian", "Fedora", "Fedora Atomic", "FreeBSD", "Gentoo", "openSUSE",
              "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown".
            "error_message": "str",  # Optional. A string containing
              information about errors that may occur when importing"n a custom image.
            "id": 0,  # Optional. A unique number that can be used to
              identify and reference a specific image.
            "min_disk_size": 0,  # Optional. The minimum disk size in GB
              required for a Droplet to use this image.
            "name": "str",  # Optional. The display name that has been
              given to an image.  This is what is shown in the control panel and is
              generally a descriptive title for the image in question.
            "public": bool,  # Optional. This is a boolean value that
              indicates whether the image in question is public or not. An image that
              is public is available to all accounts. A non-public image is only
              accessible from your account.
            "regions": [
                "str"  # Optional. This attribute is an array of the
                  regions that the image is available in. The regions are represented
                  by their identifying slug values.
            ],
            "size_gigabytes": 0.0,  # Optional. The size of the image in
              gigabytes.
            "slug": "str",  # Optional. A uniquely identifying string
              that is associated with each of the DigitalOcean-provided public images.
              These can be used to reference a public image as an alternative to the
              numeric id.
            "status": "str",  # Optional. A status string indicating the
              state of a custom image. This may be ``NEW``"" ,"n ``available``"" ,
              ``pending``"" , ``deleted``"" , or ``retired``. Known values are: "NEW",
              "available", "pending", "deleted", and "retired".
            "tags": [
                "str"  # Optional. A flat array of tag names as
                  strings to be applied to the resource. Tag names may be for either
                  existing or new tags.
            ],
            "type": "str"  # Optional. Describes the kind of image. It
              may be one of ``base``"" , ``snapshot``"" , ``backup``"" , ``custom``"" ,
              or ``admin``. Respectively, this specifies whether an image is a
              DigitalOcean base OS image, user-generated Droplet snapshot,
              automatically created Droplet backup, user-provided virtual machine
              image, or an image used for DigitalOcean managed resources (e.g. DOKS
              worker nodes). Known values are: "base", "snapshot", "backup", "custom",
              and "admin".
        },
        "kernel": {
            "id": 0,  # Optional. A unique number used to identify and
              reference a specific kernel.
            "name": "str",  # Optional. The display name of the kernel.
              This is shown in the web UI and is generally a descriptive title for the
              kernel in question.
            "version": "str"  # Optional. A standard kernel version
              string representing the version, patch, and release information.
        },
        "locked": bool,  # A boolean value indicating whether the Droplet has
          been locked, preventing actions by users. Required.
        "memory": 0,  # Memory of the Droplet in megabytes. Required.
        "name": "str",  # The human-readable name set for the Droplet
          instance. Required.
        "networks": {
            "v4": [
                {
                    "gateway": "str",  # Optional. The gateway of
                      the specified IPv4 network interface."n"nFor private interfaces,
                      a gateway is not provided. This is denoted by"nreturning ``nil``
                      as its value.
                    "ip_address": "str",  # Optional. The IP
                      address of the IPv4 network interface.
                    "netmask": "str",  # Optional. The netmask of
                      the IPv4 network interface.
                    "type": "str"  # Optional. The type of the
                      IPv4 network interface. Known values are: "public" and "private".
                }
            ],
            "v6": [
                {
                    "gateway": "str",  # Optional. The gateway of
                      the specified IPv6 network interface.
                    "ip_address": "str",  # Optional. The IP
                      address of the IPv6 network interface.
                    "netmask": 0,  # Optional. The netmask of the
                      IPv6 network interface.
                    "type": "str"  # Optional. The type of the
                      IPv6 network interface."n"n**Note**"" : IPv6 private  networking
                      is not currently supported. "public"
                }
            ]
        },
        "next_backup_window": {
            "end": "2020-02-20 00:00:00",  # Optional. A time value given
              in ISO8601 combined date and time format specifying the end of the
              Droplet's backup window.
            "start": "2020-02-20 00:00:00"  # Optional. A time value
              given in ISO8601 combined date and time format specifying the start of
              the Droplet's backup window.
        },
        "region": {
            "available": bool,  # This is a boolean value that represents
              whether new Droplets can be created in this region. Required.
            "features": {},  # This attribute is set to an array which
              contains features available in this region. Required.
            "name": "str",  # The display name of the region.  This will
              be a full name that is used in the control panel and other interfaces.
              Required.
            "sizes": {},  # This attribute is set to an array which
              contains the identifying slugs for the sizes available in this region.
              Required.
            "slug": "str"  # A human-readable string that is used as a
              unique identifier for each region. Required.
        },
        "size": {
            "available": True,  # Default value is True. This is a
              boolean value that represents whether new Droplets can be created with
              this size.
            "description": "str",  # A string describing the class of
              Droplets created from this size. For example: Basic, General Purpose,
              CPU-Optimized, Memory-Optimized, or Storage-Optimized. Required.
            "disk": 0,  # The amount of disk space set aside for Droplets
              of this size. The value is represented in gigabytes. Required.
            "memory": 0,  # The amount of RAM allocated to Droplets
              created of this size. The value is represented in megabytes. Required.
            "price_hourly": 0.0,  # This describes the price of the
              Droplet size as measured hourly. The value is measured in US dollars.
              Required.
            "price_monthly": 0.0,  # This attribute describes the monthly
              cost of this Droplet size if the Droplet is kept for an entire month. The
              value is measured in US dollars. Required.
            "regions": [
                "str"  # An array containing the region slugs where
                  this size is available for Droplet creates. Required.
            ],
            "slug": "str",  # A human-readable string that is used to
              uniquely identify each size. Required.
            "transfer": 0.0,  # The amount of transfer bandwidth that is
              available for Droplets created in this size. This only counts traffic on
              the public interface. The value is given in terabytes. Required.
            "vcpus": 0  # The integer of number CPUs allocated to
              Droplets of this size. Required.
        },
        "size_slug": "str",  # The unique slug identifier for the size of
          this Droplet. Required.
        "snapshot_ids": [
            0  # An array of snapshot IDs of any snapshots created from
              the Droplet instance. Required.
        ],
        "status": "str",  # A status string indicating the state of the
          Droplet instance. This may be "new", "active", "off", or "archive". Required.
          Known values are: "new", "active", "off", and "archive".
        "tags": [
            "str"  # An array of Tags the Droplet has been tagged with.
              Required.
        ],
        "vcpus": 0,  # The number of virtual CPUs. Required.
        "volume_ids": [
            "str"  # A flat array including the unique identifier for
              each Block Storage volume attached to the Droplet. Required.
        ],
        "vpc_uuid": "str"  # Optional. A string specifying the UUID of the
          VPC to which the Droplet is assigned.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_destroy_associated_resources_status(droplet_id: int, **kwargs: Any) MutableMapping[str, Any]

Check Status of a Droplet Destroy with Associated Resources Request.

To check on the status of a request to destroy a Droplet with its associated resources, send a GET request to the /v2/droplets/$DROPLET_ID/destroy_with_associated_resources/status endpoint.

Parameters:

droplet_id (int) – A unique identifier for a Droplet instance. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "completed_at": "2020-02-20 00:00:00",  # Optional. A time value given in
      ISO8601 combined date and time format indicating when the requested action was
      completed.
    "droplet": {
        "destroyed_at": "2020-02-20 00:00:00",  # Optional. A time value
          given in ISO8601 combined date and time format indicating when the resource
          was destroyed if the request was successful.
        "error_message": "str",  # Optional. A string indicating that the
          resource was not successfully destroyed and providing additional information.
        "id": "str",  # Optional. The unique identifier for the resource
          scheduled for deletion.
        "name": "str"  # Optional. The name of the resource scheduled for
          deletion.
    },
    "failures": 0,  # Optional. A count of the associated resources that failed
      to be destroyed, if any.
    "resources": {
        "floating_ips": [
            {
                "destroyed_at": "2020-02-20 00:00:00",  # Optional. A
                  time value given in ISO8601 combined date and time format indicating
                  when the resource was destroyed if the request was successful.
                "error_message": "str",  # Optional. A string
                  indicating that the resource was not successfully destroyed and
                  providing additional information.
                "id": "str",  # Optional. The unique identifier for
                  the resource scheduled for deletion.
                "name": "str"  # Optional. The name of the resource
                  scheduled for deletion.
            }
        ],
        "reserved_ips": [
            {
                "destroyed_at": "2020-02-20 00:00:00",  # Optional. A
                  time value given in ISO8601 combined date and time format indicating
                  when the resource was destroyed if the request was successful.
                "error_message": "str",  # Optional. A string
                  indicating that the resource was not successfully destroyed and
                  providing additional information.
                "id": "str",  # Optional. The unique identifier for
                  the resource scheduled for deletion.
                "name": "str"  # Optional. The name of the resource
                  scheduled for deletion.
            }
        ],
        "snapshots": [
            {
                "destroyed_at": "2020-02-20 00:00:00",  # Optional. A
                  time value given in ISO8601 combined date and time format indicating
                  when the resource was destroyed if the request was successful.
                "error_message": "str",  # Optional. A string
                  indicating that the resource was not successfully destroyed and
                  providing additional information.
                "id": "str",  # Optional. The unique identifier for
                  the resource scheduled for deletion.
                "name": "str"  # Optional. The name of the resource
                  scheduled for deletion.
            }
        ],
        "volume_snapshots": [
            {
                "destroyed_at": "2020-02-20 00:00:00",  # Optional. A
                  time value given in ISO8601 combined date and time format indicating
                  when the resource was destroyed if the request was successful.
                "error_message": "str",  # Optional. A string
                  indicating that the resource was not successfully destroyed and
                  providing additional information.
                "id": "str",  # Optional. The unique identifier for
                  the resource scheduled for deletion.
                "name": "str"  # Optional. The name of the resource
                  scheduled for deletion.
            }
        ],
        "volumes": [
            {
                "destroyed_at": "2020-02-20 00:00:00",  # Optional. A
                  time value given in ISO8601 combined date and time format indicating
                  when the resource was destroyed if the request was successful.
                "error_message": "str",  # Optional. A string
                  indicating that the resource was not successfully destroyed and
                  providing additional information.
                "id": "str",  # Optional. The unique identifier for
                  the resource scheduled for deletion.
                "name": "str"  # Optional. The name of the resource
                  scheduled for deletion.
            }
        ]
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list(*, per_page: int = 20, page: int = 1, tag_name: Optional[str] = None, name: Optional[str] = None, **kwargs: Any) MutableMapping[str, Any]

List All Droplets.

To list all Droplets in your account, send a GET request to /v2/droplets.

The response body will be a JSON object with a key of droplets. This will be set to an array containing objects each representing a Droplet. These will contain the standard Droplet attributes.

Filtering Results by Tag

It’s possible to request filtered results by including certain query parameters. To only list Droplets assigned to a specific tag, include the tag_name query parameter set to the name of the tag in your GET request. For example, /v2/droplets?tag_name=$TAG_NAME.

keyword per_page:

Number of items returned per page. Default value is 20.

paramtype per_page:

int

keyword page:

Which ‘page’ of paginated results to return. Default value is 1.

paramtype page:

int

keyword tag_name:

Used to filter Droplets by a specific tag. Can not be combined with name. Default value is None.

paramtype tag_name:

str

keyword name:

Used to filter list response by Droplet name returning only exact matches. It is case-insensitive and can not be combined with tag_name. Default value is None.

paramtype name:

str

return:

JSON object

rtype:

JSON

raises ~azure.core.exceptions.HttpResponseError:

Example:
# response body for status code(s): 200
response == {
    "droplets": [
        {
            "backup_ids": [
                0  # An array of backup IDs of any backups that have
                  been taken of the Droplet instance.  Droplet backups are enabled at
                  the time of the instance creation. Required.
            ],
            "created_at": "2020-02-20 00:00:00",  # A time value given in
              ISO8601 combined date and time format that represents when the Droplet
              was created. Required.
            "disk": 0,  # The size of the Droplet's disk in gigabytes.
              Required.
            "features": [
                "str"  # An array of features enabled on this
                  Droplet. Required.
            ],
            "id": 0,  # A unique identifier for each Droplet instance.
              This is automatically generated upon Droplet creation. Required.
            "image": {
                "created_at": "2020-02-20 00:00:00",  # Optional. A
                  time value given in ISO8601 combined date and time format that
                  represents when the image was created.
                "description": "str",  # Optional. An optional
                  free-form text field to describe an image.
                "distribution": "str",  # Optional. The name of a
                  custom image's distribution. Currently, the valid values are  ``Arch
                  Linux``"" , ``CentOS``"" , ``CoreOS``"" , ``Debian``"" , ``Fedora``""
                  , ``Fedora Atomic``"" ,  ``FreeBSD``"" , ``Gentoo``"" ,
                  ``openSUSE``"" , ``RancherOS``"" , ``Rocky Linux``"" , ``Ubuntu``"" ,
                  and ``Unknown``.  Any other value will be accepted but ignored, and
                  ``Unknown`` will be used in its place. Known values are: "Arch
                  Linux", "CentOS", "CoreOS", "Debian", "Fedora", "Fedora Atomic",
                  "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux",
                  "Ubuntu", and "Unknown".
                "error_message": "str",  # Optional. A string
                  containing information about errors that may occur when importing"n a
                  custom image.
                "id": 0,  # Optional. A unique number that can be
                  used to identify and reference a specific image.
                "min_disk_size": 0,  # Optional. The minimum disk
                  size in GB required for a Droplet to use this image.
                "name": "str",  # Optional. The display name that has
                  been given to an image.  This is what is shown in the control panel
                  and is generally a descriptive title for the image in question.
                "public": bool,  # Optional. This is a boolean value
                  that indicates whether the image in question is public or not. An
                  image that is public is available to all accounts. A non-public image
                  is only accessible from your account.
                "regions": [
                    "str"  # Optional. This attribute is an array
                      of the regions that the image is available in. The regions are
                      represented by their identifying slug values.
                ],
                "size_gigabytes": 0.0,  # Optional. The size of the
                  image in gigabytes.
                "slug": "str",  # Optional. A uniquely identifying
                  string that is associated with each of the DigitalOcean-provided
                  public images. These can be used to reference a public image as an
                  alternative to the numeric id.
                "status": "str",  # Optional. A status string
                  indicating the state of a custom image. This may be ``NEW``"" ,"n
                  ``available``"" , ``pending``"" , ``deleted``"" , or ``retired``.
                  Known values are: "NEW", "available", "pending", "deleted", and
                  "retired".
                "tags": [
                    "str"  # Optional. A flat array of tag names
                      as strings to be applied to the resource. Tag names may be for
                      either existing or new tags.
                ],
                "type": "str"  # Optional. Describes the kind of
                  image. It may be one of ``base``"" , ``snapshot``"" , ``backup``"" ,
                  ``custom``"" , or ``admin``. Respectively, this specifies whether an
                  image is a DigitalOcean base OS image, user-generated Droplet
                  snapshot, automatically created Droplet backup, user-provided virtual
                  machine image, or an image used for DigitalOcean managed resources
                  (e.g. DOKS worker nodes). Known values are: "base", "snapshot",
                  "backup", "custom", and "admin".
            },
            "kernel": {
                "id": 0,  # Optional. A unique number used to
                  identify and reference a specific kernel.
                "name": "str",  # Optional. The display name of the
                  kernel. This is shown in the web UI and is generally a descriptive
                  title for the kernel in question.
                "version": "str"  # Optional. A standard kernel
                  version string representing the version, patch, and release
                  information.
            },
            "locked": bool,  # A boolean value indicating whether the
              Droplet has been locked, preventing actions by users. Required.
            "memory": 0,  # Memory of the Droplet in megabytes. Required.
            "name": "str",  # The human-readable name set for the Droplet
              instance. Required.
            "networks": {
                "v4": [
                    {
                        "gateway": "str",  # Optional. The
                          gateway of the specified IPv4 network interface."n"nFor
                          private interfaces, a gateway is not provided. This is
                          denoted by"nreturning ``nil`` as its value.
                        "ip_address": "str",  # Optional. The
                          IP address of the IPv4 network interface.
                        "netmask": "str",  # Optional. The
                          netmask of the IPv4 network interface.
                        "type": "str"  # Optional. The type
                          of the IPv4 network interface. Known values are: "public" and
                          "private".
                    }
                ],
                "v6": [
                    {
                        "gateway": "str",  # Optional. The
                          gateway of the specified IPv6 network interface.
                        "ip_address": "str",  # Optional. The
                          IP address of the IPv6 network interface.
                        "netmask": 0,  # Optional. The
                          netmask of the IPv6 network interface.
                        "type": "str"  # Optional. The type
                          of the IPv6 network interface."n"n**Note**"" : IPv6 private
                          networking is not currently supported. "public"
                    }
                ]
            },
            "next_backup_window": {
                "end": "2020-02-20 00:00:00",  # Optional. A time
                  value given in ISO8601 combined date and time format specifying the
                  end of the Droplet's backup window.
                "start": "2020-02-20 00:00:00"  # Optional. A time
                  value given in ISO8601 combined date and time format specifying the
                  start of the Droplet's backup window.
            },
            "region": {
                "available": bool,  # This is a boolean value that
                  represents whether new Droplets can be created in this region.
                  Required.
                "features": {},  # This attribute is set to an array
                  which contains features available in this region. Required.
                "name": "str",  # The display name of the region.
                  This will be a full name that is used in the control panel and other
                  interfaces. Required.
                "sizes": {},  # This attribute is set to an array
                  which contains the identifying slugs for the sizes available in this
                  region. Required.
                "slug": "str"  # A human-readable string that is used
                  as a unique identifier for each region. Required.
            },
            "size": {
                "available": True,  # Default value is True. This is
                  a boolean value that represents whether new Droplets can be created
                  with this size.
                "description": "str",  # A string describing the
                  class of Droplets created from this size. For example: Basic, General
                  Purpose, CPU-Optimized, Memory-Optimized, or Storage-Optimized.
                  Required.
                "disk": 0,  # The amount of disk space set aside for
                  Droplets of this size. The value is represented in gigabytes.
                  Required.
                "memory": 0,  # The amount of RAM allocated to
                  Droplets created of this size. The value is represented in megabytes.
                  Required.
                "price_hourly": 0.0,  # This describes the price of
                  the Droplet size as measured hourly. The value is measured in US
                  dollars. Required.
                "price_monthly": 0.0,  # This attribute describes the
                  monthly cost of this Droplet size if the Droplet is kept for an
                  entire month. The value is measured in US dollars. Required.
                "regions": [
                    "str"  # An array containing the region slugs
                      where this size is available for Droplet creates. Required.
                ],
                "slug": "str",  # A human-readable string that is
                  used to uniquely identify each size. Required.
                "transfer": 0.0,  # The amount of transfer bandwidth
                  that is available for Droplets created in this size. This only counts
                  traffic on the public interface. The value is given in terabytes.
                  Required.
                "vcpus": 0  # The integer of number CPUs allocated to
                  Droplets of this size. Required.
            },
            "size_slug": "str",  # The unique slug identifier for the
              size of this Droplet. Required.
            "snapshot_ids": [
                0  # An array of snapshot IDs of any snapshots
                  created from the Droplet instance. Required.
            ],
            "status": "str",  # A status string indicating the state of
              the Droplet instance. This may be "new", "active", "off", or "archive".
              Required. Known values are: "new", "active", "off", and "archive".
            "tags": [
                "str"  # An array of Tags the Droplet has been tagged
                  with. Required.
            ],
            "vcpus": 0,  # The number of virtual CPUs. Required.
            "volume_ids": [
                "str"  # A flat array including the unique identifier
                  for each Block Storage volume attached to the Droplet. Required.
            ],
            "vpc_uuid": "str"  # Optional. A string specifying the UUID
              of the VPC to which the Droplet is assigned.
        }
    ],
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
list_associated_resources(droplet_id: int, **kwargs: Any) MutableMapping[str, Any]

List Associated Resources for a Droplet.

To list the associated billable resources that can be destroyed along with a Droplet, send a GET request to the /v2/droplets/$DROPLET_ID/destroy_with_associated_resources endpoint.

The response will be a JSON object containing snapshots, volumes, and volume_snapshots keys. Each will be set to an array of objects containing information about the associated resources.

Parameters:

droplet_id (int) – A unique identifier for a Droplet instance. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "floating_ips": [
        {
            "cost": "str",  # Optional. The cost of the resource in USD
              per month if the resource is retained after the Droplet is destroyed.
            "id": "str",  # Optional. The unique identifier for the
              resource associated with the Droplet.
            "name": "str"  # Optional. The name of the resource
              associated with the Droplet.
        }
    ],
    "reserved_ips": [
        {
            "cost": "str",  # Optional. The cost of the resource in USD
              per month if the resource is retained after the Droplet is destroyed.
            "id": "str",  # Optional. The unique identifier for the
              resource associated with the Droplet.
            "name": "str"  # Optional. The name of the resource
              associated with the Droplet.
        }
    ],
    "snapshots": [
        {
            "cost": "str",  # Optional. The cost of the resource in USD
              per month if the resource is retained after the Droplet is destroyed.
            "id": "str",  # Optional. The unique identifier for the
              resource associated with the Droplet.
            "name": "str"  # Optional. The name of the resource
              associated with the Droplet.
        }
    ],
    "volume_snapshots": [
        {
            "cost": "str",  # Optional. The cost of the resource in USD
              per month if the resource is retained after the Droplet is destroyed.
            "id": "str",  # Optional. The unique identifier for the
              resource associated with the Droplet.
            "name": "str"  # Optional. The name of the resource
              associated with the Droplet.
        }
    ],
    "volumes": [
        {
            "cost": "str",  # Optional. The cost of the resource in USD
              per month if the resource is retained after the Droplet is destroyed.
            "id": "str",  # Optional. The unique identifier for the
              resource associated with the Droplet.
            "name": "str"  # Optional. The name of the resource
              associated with the Droplet.
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_backups(droplet_id: int, *, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List Backups for a Droplet.

To retrieve any backups associated with a Droplet, send a GET request to /v2/droplets/$DROPLET_ID/backups.

You will get back a JSON object that has a backups key. This will be set to an array of backup objects, each of which contain the standard Droplet backup attributes.

Parameters:
  • droplet_id (int) – A unique identifier for a Droplet instance. Required.

  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "backups": [
        {
            "created_at": "2020-02-20 00:00:00",  # A time value given in
              ISO8601 combined date and time format that represents when the snapshot
              was created. Required.
            "min_disk_size": 0,  # The minimum size in GB required for a
              volume or Droplet to use this snapshot. Required.
            "name": "str",  # A human-readable name for the snapshot.
              Required.
            "regions": [
                "str"  # An array of the regions that the snapshot is
                  available in. The regions are represented by their identifying slug
                  values. Required.
            ],
            "size_gigabytes": 0.0,  # The billable size of the snapshot
              in gigabytes. Required.
            "type": "str"  # Describes the kind of image. It may be one
              of ``snapshot`` or ``backup``. This specifies whether an image is a
              user-generated Droplet snapshot or automatically created Droplet backup.
              Required. Known values are: "snapshot" and "backup".
        }
    ],
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_firewalls(droplet_id: int, *, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List all Firewalls Applied to a Droplet.

To retrieve a list of all firewalls available to a Droplet, send a GET request to /v2/droplets/$DROPLET_ID/firewalls

The response will be a JSON object that has a key called firewalls. This will be set to an array of firewall objects, each of which contain the standard firewall attributes.

Parameters:
  • droplet_id (int) – A unique identifier for a Droplet instance. Required.

  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "firewalls": [
        {
            "created_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the firewall was created.
            "droplet_ids": [
                0  # Optional. An array containing the IDs of the
                  Droplets assigned to the firewall.
            ],
            "id": "str",  # Optional. A unique ID that can be used to
              identify and reference a firewall.
            "inbound_rules": [
                {
                    "ports": "str",  # The ports on which traffic
                      will be allowed specified as a string containing a single port, a
                      range (e.g. "8000-9000"), or "0" when all ports are open for a
                      protocol. For ICMP rules this parameter will always return "0".
                      Required.
                    "protocol": "str",  # The type of traffic to
                      be allowed. This may be one of ``tcp``"" , ``udp``"" , or
                      ``icmp``. Required. Known values are: "tcp", "udp", and "icmp".
                    "sources": {
                        "addresses": [
                            "str"  # Optional. An array
                              of strings containing the IPv4 addresses, IPv6 addresses,
                              IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will
                              allow traffic.
                        ],
                        "droplet_ids": [
                            0  # Optional. An array
                              containing the IDs of the Droplets to which the firewall
                              will allow traffic.
                        ],
                        "kubernetes_ids": [
                            "str"  # Optional. An array
                              containing the IDs of the Kubernetes clusters to which
                              the firewall will allow traffic.
                        ],
                        "load_balancer_uids": [
                            "str"  # Optional. An array
                              containing the IDs of the load balancers to which the
                              firewall will allow traffic.
                        ],
                        "tags": {}  # Optional. Any object.
                    }
                }
            ],
            "name": "str",  # Optional. A human-readable name for a
              firewall. The name must begin with an alphanumeric character. Subsequent
              characters must either be alphanumeric characters, a period (.), or a
              dash (-).
            "outbound_rules": [
                {
                    "destinations": {
                        "addresses": [
                            "str"  # Optional. An array
                              of strings containing the IPv4 addresses, IPv6 addresses,
                              IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will
                              allow traffic.
                        ],
                        "droplet_ids": [
                            0  # Optional. An array
                              containing the IDs of the Droplets to which the firewall
                              will allow traffic.
                        ],
                        "kubernetes_ids": [
                            "str"  # Optional. An array
                              containing the IDs of the Kubernetes clusters to which
                              the firewall will allow traffic.
                        ],
                        "load_balancer_uids": [
                            "str"  # Optional. An array
                              containing the IDs of the load balancers to which the
                              firewall will allow traffic.
                        ],
                        "tags": {}  # Optional. Any object.
                    },
                    "ports": "str",  # The ports on which traffic
                      will be allowed specified as a string containing a single port, a
                      range (e.g. "8000-9000"), or "0" when all ports are open for a
                      protocol. For ICMP rules this parameter will always return "0".
                      Required.
                    "protocol": "str"  # The type of traffic to
                      be allowed. This may be one of ``tcp``"" , ``udp``"" , or
                      ``icmp``. Required. Known values are: "tcp", "udp", and "icmp".
                }
            ],
            "pending_changes": [
                {
                    "droplet_id": 0,  # Optional. An array of
                      objects each containing the fields "droplet_id", "removing", and
                      "status". It is provided to detail exactly which Droplets are
                      having their security policies updated. When empty, all changes
                      have been successfully applied.
                    "removing": bool,  # Optional. An array of
                      objects each containing the fields "droplet_id", "removing", and
                      "status". It is provided to detail exactly which Droplets are
                      having their security policies updated. When empty, all changes
                      have been successfully applied.
                    "status": "str"  # Optional. An array of
                      objects each containing the fields "droplet_id", "removing", and
                      "status". It is provided to detail exactly which Droplets are
                      having their security policies updated. When empty, all changes
                      have been successfully applied.
                }
            ],
            "status": "str",  # Optional. A status string indicating the
              current state of the firewall. This can be "waiting", "succeeded", or
              "failed". Known values are: "waiting", "succeeded", and "failed".
            "tags": {}  # Optional. Any object.
        }
    ],
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_kernels(droplet_id: int, *, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All Available Kernels for a Droplet.

To retrieve a list of all kernels available to a Droplet, send a GET request to /v2/droplets/$DROPLET_ID/kernels

The response will be a JSON object that has a key called kernels. This will be set to an array of kernel objects, each of which contain the standard kernel attributes.

Parameters:
  • droplet_id (int) – A unique identifier for a Droplet instance. Required.

  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "kernels": [
        {
            "id": 0,  # Optional. A unique number used to identify and
              reference a specific kernel.
            "name": "str",  # Optional. The display name of the kernel.
              This is shown in the web UI and is generally a descriptive title for the
              kernel in question.
            "version": "str"  # Optional. A standard kernel version
              string representing the version, patch, and release information.
        }
    ],
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_neighbors(droplet_id: int, **kwargs: Any) MutableMapping[str, Any]

List Neighbors for a Droplet.

To retrieve a list of any “neighbors” (i.e. Droplets that are co-located on the same physical hardware) for a specific Droplet, send a GET request to /v2/droplets/$DROPLET_ID/neighbors.

The results will be returned as a JSON object with a key of droplets. This will be set to an array containing objects representing any other Droplets that share the same physical hardware. An empty array indicates that the Droplet is not co-located any other Droplets associated with your account.

Parameters:

droplet_id (int) – A unique identifier for a Droplet instance. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "droplets": [
        {
            "backup_ids": [
                0  # An array of backup IDs of any backups that have
                  been taken of the Droplet instance.  Droplet backups are enabled at
                  the time of the instance creation. Required.
            ],
            "created_at": "2020-02-20 00:00:00",  # A time value given in
              ISO8601 combined date and time format that represents when the Droplet
              was created. Required.
            "disk": 0,  # The size of the Droplet's disk in gigabytes.
              Required.
            "features": [
                "str"  # An array of features enabled on this
                  Droplet. Required.
            ],
            "id": 0,  # A unique identifier for each Droplet instance.
              This is automatically generated upon Droplet creation. Required.
            "image": {
                "created_at": "2020-02-20 00:00:00",  # Optional. A
                  time value given in ISO8601 combined date and time format that
                  represents when the image was created.
                "description": "str",  # Optional. An optional
                  free-form text field to describe an image.
                "distribution": "str",  # Optional. The name of a
                  custom image's distribution. Currently, the valid values are  ``Arch
                  Linux``"" , ``CentOS``"" , ``CoreOS``"" , ``Debian``"" , ``Fedora``""
                  , ``Fedora Atomic``"" ,  ``FreeBSD``"" , ``Gentoo``"" ,
                  ``openSUSE``"" , ``RancherOS``"" , ``Rocky Linux``"" , ``Ubuntu``"" ,
                  and ``Unknown``.  Any other value will be accepted but ignored, and
                  ``Unknown`` will be used in its place. Known values are: "Arch
                  Linux", "CentOS", "CoreOS", "Debian", "Fedora", "Fedora Atomic",
                  "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux",
                  "Ubuntu", and "Unknown".
                "error_message": "str",  # Optional. A string
                  containing information about errors that may occur when importing"n a
                  custom image.
                "id": 0,  # Optional. A unique number that can be
                  used to identify and reference a specific image.
                "min_disk_size": 0,  # Optional. The minimum disk
                  size in GB required for a Droplet to use this image.
                "name": "str",  # Optional. The display name that has
                  been given to an image.  This is what is shown in the control panel
                  and is generally a descriptive title for the image in question.
                "public": bool,  # Optional. This is a boolean value
                  that indicates whether the image in question is public or not. An
                  image that is public is available to all accounts. A non-public image
                  is only accessible from your account.
                "regions": [
                    "str"  # Optional. This attribute is an array
                      of the regions that the image is available in. The regions are
                      represented by their identifying slug values.
                ],
                "size_gigabytes": 0.0,  # Optional. The size of the
                  image in gigabytes.
                "slug": "str",  # Optional. A uniquely identifying
                  string that is associated with each of the DigitalOcean-provided
                  public images. These can be used to reference a public image as an
                  alternative to the numeric id.
                "status": "str",  # Optional. A status string
                  indicating the state of a custom image. This may be ``NEW``"" ,"n
                  ``available``"" , ``pending``"" , ``deleted``"" , or ``retired``.
                  Known values are: "NEW", "available", "pending", "deleted", and
                  "retired".
                "tags": [
                    "str"  # Optional. A flat array of tag names
                      as strings to be applied to the resource. Tag names may be for
                      either existing or new tags.
                ],
                "type": "str"  # Optional. Describes the kind of
                  image. It may be one of ``base``"" , ``snapshot``"" , ``backup``"" ,
                  ``custom``"" , or ``admin``. Respectively, this specifies whether an
                  image is a DigitalOcean base OS image, user-generated Droplet
                  snapshot, automatically created Droplet backup, user-provided virtual
                  machine image, or an image used for DigitalOcean managed resources
                  (e.g. DOKS worker nodes). Known values are: "base", "snapshot",
                  "backup", "custom", and "admin".
            },
            "kernel": {
                "id": 0,  # Optional. A unique number used to
                  identify and reference a specific kernel.
                "name": "str",  # Optional. The display name of the
                  kernel. This is shown in the web UI and is generally a descriptive
                  title for the kernel in question.
                "version": "str"  # Optional. A standard kernel
                  version string representing the version, patch, and release
                  information.
            },
            "locked": bool,  # A boolean value indicating whether the
              Droplet has been locked, preventing actions by users. Required.
            "memory": 0,  # Memory of the Droplet in megabytes. Required.
            "name": "str",  # The human-readable name set for the Droplet
              instance. Required.
            "networks": {
                "v4": [
                    {
                        "gateway": "str",  # Optional. The
                          gateway of the specified IPv4 network interface."n"nFor
                          private interfaces, a gateway is not provided. This is
                          denoted by"nreturning ``nil`` as its value.
                        "ip_address": "str",  # Optional. The
                          IP address of the IPv4 network interface.
                        "netmask": "str",  # Optional. The
                          netmask of the IPv4 network interface.
                        "type": "str"  # Optional. The type
                          of the IPv4 network interface. Known values are: "public" and
                          "private".
                    }
                ],
                "v6": [
                    {
                        "gateway": "str",  # Optional. The
                          gateway of the specified IPv6 network interface.
                        "ip_address": "str",  # Optional. The
                          IP address of the IPv6 network interface.
                        "netmask": 0,  # Optional. The
                          netmask of the IPv6 network interface.
                        "type": "str"  # Optional. The type
                          of the IPv6 network interface."n"n**Note**"" : IPv6 private
                          networking is not currently supported. "public"
                    }
                ]
            },
            "next_backup_window": {
                "end": "2020-02-20 00:00:00",  # Optional. A time
                  value given in ISO8601 combined date and time format specifying the
                  end of the Droplet's backup window.
                "start": "2020-02-20 00:00:00"  # Optional. A time
                  value given in ISO8601 combined date and time format specifying the
                  start of the Droplet's backup window.
            },
            "region": {
                "available": bool,  # This is a boolean value that
                  represents whether new Droplets can be created in this region.
                  Required.
                "features": {},  # This attribute is set to an array
                  which contains features available in this region. Required.
                "name": "str",  # The display name of the region.
                  This will be a full name that is used in the control panel and other
                  interfaces. Required.
                "sizes": {},  # This attribute is set to an array
                  which contains the identifying slugs for the sizes available in this
                  region. Required.
                "slug": "str"  # A human-readable string that is used
                  as a unique identifier for each region. Required.
            },
            "size": {
                "available": True,  # Default value is True. This is
                  a boolean value that represents whether new Droplets can be created
                  with this size.
                "description": "str",  # A string describing the
                  class of Droplets created from this size. For example: Basic, General
                  Purpose, CPU-Optimized, Memory-Optimized, or Storage-Optimized.
                  Required.
                "disk": 0,  # The amount of disk space set aside for
                  Droplets of this size. The value is represented in gigabytes.
                  Required.
                "memory": 0,  # The amount of RAM allocated to
                  Droplets created of this size. The value is represented in megabytes.
                  Required.
                "price_hourly": 0.0,  # This describes the price of
                  the Droplet size as measured hourly. The value is measured in US
                  dollars. Required.
                "price_monthly": 0.0,  # This attribute describes the
                  monthly cost of this Droplet size if the Droplet is kept for an
                  entire month. The value is measured in US dollars. Required.
                "regions": [
                    "str"  # An array containing the region slugs
                      where this size is available for Droplet creates. Required.
                ],
                "slug": "str",  # A human-readable string that is
                  used to uniquely identify each size. Required.
                "transfer": 0.0,  # The amount of transfer bandwidth
                  that is available for Droplets created in this size. This only counts
                  traffic on the public interface. The value is given in terabytes.
                  Required.
                "vcpus": 0  # The integer of number CPUs allocated to
                  Droplets of this size. Required.
            },
            "size_slug": "str",  # The unique slug identifier for the
              size of this Droplet. Required.
            "snapshot_ids": [
                0  # An array of snapshot IDs of any snapshots
                  created from the Droplet instance. Required.
            ],
            "status": "str",  # A status string indicating the state of
              the Droplet instance. This may be "new", "active", "off", or "archive".
              Required. Known values are: "new", "active", "off", and "archive".
            "tags": [
                "str"  # An array of Tags the Droplet has been tagged
                  with. Required.
            ],
            "vcpus": 0,  # The number of virtual CPUs. Required.
            "volume_ids": [
                "str"  # A flat array including the unique identifier
                  for each Block Storage volume attached to the Droplet. Required.
            ],
            "vpc_uuid": "str"  # Optional. A string specifying the UUID
              of the VPC to which the Droplet is assigned.
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_neighbors_ids(**kwargs: Any) MutableMapping[str, Any]

List All Droplet Neighbors.

To retrieve a list of all Droplets that are co-located on the same physical hardware, send a GET request to /v2/reports/droplet_neighbors_ids.

The results will be returned as a JSON object with a key of neighbor_ids. This will be set to an array of arrays. Each array will contain a set of Droplet IDs for Droplets that share a physical server. An empty array indicates that all Droplets associated with your account are located on separate physical hardware.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "neighbor_ids": [
        [
            0  # Optional. An array of arrays. Each array will contain a
              set of Droplet IDs for Droplets that share a physical server.
        ]
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_snapshots(droplet_id: int, *, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List Snapshots for a Droplet.

To retrieve the snapshots that have been created from a Droplet, send a GET request to /v2/droplets/$DROPLET_ID/snapshots.

You will get back a JSON object that has a snapshots key. This will be set to an array of snapshot objects, each of which contain the standard Droplet snapshot attributes.

Parameters:
  • droplet_id (int) – A unique identifier for a Droplet instance. Required.

  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    },
    "snapshots": [
        {
            "created_at": "2020-02-20 00:00:00",  # A time value given in
              ISO8601 combined date and time format that represents when the snapshot
              was created. Required.
            "min_disk_size": 0,  # The minimum size in GB required for a
              volume or Droplet to use this snapshot. Required.
            "name": "str",  # A human-readable name for the snapshot.
              Required.
            "regions": [
                "str"  # An array of the regions that the snapshot is
                  available in. The regions are represented by their identifying slug
                  values. Required.
            ],
            "size_gigabytes": 0.0,  # The billable size of the snapshot
              in gigabytes. Required.
            "type": "str"  # Describes the kind of image. It may be one
              of ``snapshot`` or ``backup``. This specifies whether an image is a
              user-generated Droplet snapshot or automatically created Droplet backup.
              Required. Known values are: "snapshot" and "backup".
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
class pydo.operations.FirewallsOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s firewalls attribute.

add_rules(firewall_id: str, body: Optional[JSON] = None, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
add_rules(firewall_id: str, body: Optional[IO] = None, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Add Rules to a Firewall.

To add additional access rules to a firewall, send a POST request to /v2/firewalls/$FIREWALL_ID/rules. The body of the request may include an inbound_rules and/or outbound_rules attribute containing an array of rules to be added.

No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data.

Parameters:
  • firewall_id (str) – A unique ID that can be used to identify and reference a firewall. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Default value is None.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 400, 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
add_tags(firewall_id: str, body: Optional[JSON] = None, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
add_tags(firewall_id: str, body: Optional[IO] = None, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Add Tags to a Firewall.

To assign a tag representing a group of Droplets to a firewall, send a POST request to /v2/firewalls/$FIREWALL_ID/tags. In the body of the request, there should be a tags attribute containing a list of tag names.

No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data.

Parameters:
  • firewall_id (str) – A unique ID that can be used to identify and reference a firewall. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Default value is None.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 400, 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
assign_droplets(firewall_id: str, body: Optional[JSON] = None, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
assign_droplets(firewall_id: str, body: Optional[IO] = None, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Add Droplets to a Firewall.

To assign a Droplet to a firewall, send a POST request to /v2/firewalls/$FIREWALL_ID/droplets. In the body of the request, there should be a droplet_ids attribute containing a list of Droplet IDs.

No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data.

Parameters:
  • firewall_id (str) – A unique ID that can be used to identify and reference a firewall. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Default value is None.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 400, 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
create(body: Optional[JSON] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON
create(body: Optional[IO] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create a New Firewall.

To create a new firewall, send a POST request to /v2/firewalls. The request must contain at least one inbound or outbound access rule.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Default value is None.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 202
response == {
    "firewall": {
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the firewall
          was created.
        "droplet_ids": [
            0  # Optional. An array containing the IDs of the Droplets
              assigned to the firewall.
        ],
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference a firewall.
        "inbound_rules": [
            {
                "ports": "str",  # The ports on which traffic will be
                  allowed specified as a string containing a single port, a range (e.g.
                  "8000-9000"), or "0" when all ports are open for a protocol. For ICMP
                  rules this parameter will always return "0". Required.
                "protocol": "str",  # The type of traffic to be
                  allowed. This may be one of ``tcp``"" , ``udp``"" , or ``icmp``.
                  Required. Known values are: "tcp", "udp", and "icmp".
                "sources": {
                    "addresses": [
                        "str"  # Optional. An array of
                          strings containing the IPv4 addresses, IPv6 addresses, IPv4
                          CIDRs, and/or IPv6 CIDRs to which the firewall will allow
                          traffic.
                    ],
                    "droplet_ids": [
                        0  # Optional. An array containing
                          the IDs of the Droplets to which the firewall will allow
                          traffic.
                    ],
                    "kubernetes_ids": [
                        "str"  # Optional. An array
                          containing the IDs of the Kubernetes clusters to which the
                          firewall will allow traffic.
                    ],
                    "load_balancer_uids": [
                        "str"  # Optional. An array
                          containing the IDs of the load balancers to which the
                          firewall will allow traffic.
                    ],
                    "tags": {}  # Optional. Any object.
                }
            }
        ],
        "name": "str",  # Optional. A human-readable name for a firewall. The
          name must begin with an alphanumeric character. Subsequent characters must
          either be alphanumeric characters, a period (.), or a dash (-).
        "outbound_rules": [
            {
                "destinations": {
                    "addresses": [
                        "str"  # Optional. An array of
                          strings containing the IPv4 addresses, IPv6 addresses, IPv4
                          CIDRs, and/or IPv6 CIDRs to which the firewall will allow
                          traffic.
                    ],
                    "droplet_ids": [
                        0  # Optional. An array containing
                          the IDs of the Droplets to which the firewall will allow
                          traffic.
                    ],
                    "kubernetes_ids": [
                        "str"  # Optional. An array
                          containing the IDs of the Kubernetes clusters to which the
                          firewall will allow traffic.
                    ],
                    "load_balancer_uids": [
                        "str"  # Optional. An array
                          containing the IDs of the load balancers to which the
                          firewall will allow traffic.
                    ],
                    "tags": {}  # Optional. Any object.
                },
                "ports": "str",  # The ports on which traffic will be
                  allowed specified as a string containing a single port, a range (e.g.
                  "8000-9000"), or "0" when all ports are open for a protocol. For ICMP
                  rules this parameter will always return "0". Required.
                "protocol": "str"  # The type of traffic to be
                  allowed. This may be one of ``tcp``"" , ``udp``"" , or ``icmp``.
                  Required. Known values are: "tcp", "udp", and "icmp".
            }
        ],
        "pending_changes": [
            {
                "droplet_id": 0,  # Optional. An array of objects
                  each containing the fields "droplet_id", "removing", and "status". It
                  is provided to detail exactly which Droplets are having their
                  security policies updated. When empty, all changes have been
                  successfully applied.
                "removing": bool,  # Optional. An array of objects
                  each containing the fields "droplet_id", "removing", and "status". It
                  is provided to detail exactly which Droplets are having their
                  security policies updated. When empty, all changes have been
                  successfully applied.
                "status": "str"  # Optional. An array of objects each
                  containing the fields "droplet_id", "removing", and "status". It is
                  provided to detail exactly which Droplets are having their security
                  policies updated. When empty, all changes have been successfully
                  applied.
            }
        ],
        "status": "str",  # Optional. A status string indicating the current
          state of the firewall. This can be "waiting", "succeeded", or "failed". Known
          values are: "waiting", "succeeded", and "failed".
        "tags": {}  # Optional. Any object.
    }
}
# response body for status code(s): 400
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
delete(firewall_id: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete a Firewall.

To delete a firewall send a DELETE request to /v2/firewalls/$FIREWALL_ID.

No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data.

Parameters:

firewall_id (str) – A unique ID that can be used to identify and reference a firewall. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
delete_droplets(firewall_id: str, body: Optional[JSON] = None, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
delete_droplets(firewall_id: str, body: Optional[IO] = None, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Remove Droplets from a Firewall.

To remove a Droplet from a firewall, send a DELETE request to /v2/firewalls/$FIREWALL_ID/droplets. In the body of the request, there should be a droplet_ids attribute containing a list of Droplet IDs.

No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data.

Parameters:
  • firewall_id (str) – A unique ID that can be used to identify and reference a firewall. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Default value is None.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 400, 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
delete_rules(firewall_id: str, body: Optional[JSON] = None, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
delete_rules(firewall_id: str, body: Optional[IO] = None, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Remove Rules from a Firewall.

To remove access rules from a firewall, send a DELETE request to /v2/firewalls/$FIREWALL_ID/rules. The body of the request may include an inbound_rules and/or outbound_rules attribute containing an array of rules to be removed.

No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data.

Parameters:
  • firewall_id (str) – A unique ID that can be used to identify and reference a firewall. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Default value is None.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 400, 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
delete_tags(firewall_id: str, body: Optional[JSON] = None, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
delete_tags(firewall_id: str, body: Optional[IO] = None, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Remove Tags from a Firewall.

To remove a tag representing a group of Droplets from a firewall, send a DELETE request to /v2/firewalls/$FIREWALL_ID/tags. In the body of the request, there should be a tags attribute containing a list of tag names.

No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data.

Parameters:
  • firewall_id (str) – A unique ID that can be used to identify and reference a firewall. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Default value is None.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 400, 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get(firewall_id: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Firewall.

To show information about an existing firewall, send a GET request to /v2/firewalls/$FIREWALL_ID.

Parameters:

firewall_id (str) – A unique ID that can be used to identify and reference a firewall. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "firewall": {
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the firewall
          was created.
        "droplet_ids": [
            0  # Optional. An array containing the IDs of the Droplets
              assigned to the firewall.
        ],
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference a firewall.
        "inbound_rules": [
            {
                "ports": "str",  # The ports on which traffic will be
                  allowed specified as a string containing a single port, a range (e.g.
                  "8000-9000"), or "0" when all ports are open for a protocol. For ICMP
                  rules this parameter will always return "0". Required.
                "protocol": "str",  # The type of traffic to be
                  allowed. This may be one of ``tcp``"" , ``udp``"" , or ``icmp``.
                  Required. Known values are: "tcp", "udp", and "icmp".
                "sources": {
                    "addresses": [
                        "str"  # Optional. An array of
                          strings containing the IPv4 addresses, IPv6 addresses, IPv4
                          CIDRs, and/or IPv6 CIDRs to which the firewall will allow
                          traffic.
                    ],
                    "droplet_ids": [
                        0  # Optional. An array containing
                          the IDs of the Droplets to which the firewall will allow
                          traffic.
                    ],
                    "kubernetes_ids": [
                        "str"  # Optional. An array
                          containing the IDs of the Kubernetes clusters to which the
                          firewall will allow traffic.
                    ],
                    "load_balancer_uids": [
                        "str"  # Optional. An array
                          containing the IDs of the load balancers to which the
                          firewall will allow traffic.
                    ],
                    "tags": {}  # Optional. Any object.
                }
            }
        ],
        "name": "str",  # Optional. A human-readable name for a firewall. The
          name must begin with an alphanumeric character. Subsequent characters must
          either be alphanumeric characters, a period (.), or a dash (-).
        "outbound_rules": [
            {
                "destinations": {
                    "addresses": [
                        "str"  # Optional. An array of
                          strings containing the IPv4 addresses, IPv6 addresses, IPv4
                          CIDRs, and/or IPv6 CIDRs to which the firewall will allow
                          traffic.
                    ],
                    "droplet_ids": [
                        0  # Optional. An array containing
                          the IDs of the Droplets to which the firewall will allow
                          traffic.
                    ],
                    "kubernetes_ids": [
                        "str"  # Optional. An array
                          containing the IDs of the Kubernetes clusters to which the
                          firewall will allow traffic.
                    ],
                    "load_balancer_uids": [
                        "str"  # Optional. An array
                          containing the IDs of the load balancers to which the
                          firewall will allow traffic.
                    ],
                    "tags": {}  # Optional. Any object.
                },
                "ports": "str",  # The ports on which traffic will be
                  allowed specified as a string containing a single port, a range (e.g.
                  "8000-9000"), or "0" when all ports are open for a protocol. For ICMP
                  rules this parameter will always return "0". Required.
                "protocol": "str"  # The type of traffic to be
                  allowed. This may be one of ``tcp``"" , ``udp``"" , or ``icmp``.
                  Required. Known values are: "tcp", "udp", and "icmp".
            }
        ],
        "pending_changes": [
            {
                "droplet_id": 0,  # Optional. An array of objects
                  each containing the fields "droplet_id", "removing", and "status". It
                  is provided to detail exactly which Droplets are having their
                  security policies updated. When empty, all changes have been
                  successfully applied.
                "removing": bool,  # Optional. An array of objects
                  each containing the fields "droplet_id", "removing", and "status". It
                  is provided to detail exactly which Droplets are having their
                  security policies updated. When empty, all changes have been
                  successfully applied.
                "status": "str"  # Optional. An array of objects each
                  containing the fields "droplet_id", "removing", and "status". It is
                  provided to detail exactly which Droplets are having their security
                  policies updated. When empty, all changes have been successfully
                  applied.
            }
        ],
        "status": "str",  # Optional. A status string indicating the current
          state of the firewall. This can be "waiting", "succeeded", or "failed". Known
          values are: "waiting", "succeeded", and "failed".
        "tags": {}  # Optional. Any object.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list(*, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All Firewalls.

To list all of the firewalls available on your account, send a GET request to /v2/firewalls.

Parameters:
  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "firewalls": [
        {
            "created_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the firewall was created.
            "droplet_ids": [
                0  # Optional. An array containing the IDs of the
                  Droplets assigned to the firewall.
            ],
            "id": "str",  # Optional. A unique ID that can be used to
              identify and reference a firewall.
            "inbound_rules": [
                {
                    "ports": "str",  # The ports on which traffic
                      will be allowed specified as a string containing a single port, a
                      range (e.g. "8000-9000"), or "0" when all ports are open for a
                      protocol. For ICMP rules this parameter will always return "0".
                      Required.
                    "protocol": "str",  # The type of traffic to
                      be allowed. This may be one of ``tcp``"" , ``udp``"" , or
                      ``icmp``. Required. Known values are: "tcp", "udp", and "icmp".
                    "sources": {
                        "addresses": [
                            "str"  # Optional. An array
                              of strings containing the IPv4 addresses, IPv6 addresses,
                              IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will
                              allow traffic.
                        ],
                        "droplet_ids": [
                            0  # Optional. An array
                              containing the IDs of the Droplets to which the firewall
                              will allow traffic.
                        ],
                        "kubernetes_ids": [
                            "str"  # Optional. An array
                              containing the IDs of the Kubernetes clusters to which
                              the firewall will allow traffic.
                        ],
                        "load_balancer_uids": [
                            "str"  # Optional. An array
                              containing the IDs of the load balancers to which the
                              firewall will allow traffic.
                        ],
                        "tags": {}  # Optional. Any object.
                    }
                }
            ],
            "name": "str",  # Optional. A human-readable name for a
              firewall. The name must begin with an alphanumeric character. Subsequent
              characters must either be alphanumeric characters, a period (.), or a
              dash (-).
            "outbound_rules": [
                {
                    "destinations": {
                        "addresses": [
                            "str"  # Optional. An array
                              of strings containing the IPv4 addresses, IPv6 addresses,
                              IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will
                              allow traffic.
                        ],
                        "droplet_ids": [
                            0  # Optional. An array
                              containing the IDs of the Droplets to which the firewall
                              will allow traffic.
                        ],
                        "kubernetes_ids": [
                            "str"  # Optional. An array
                              containing the IDs of the Kubernetes clusters to which
                              the firewall will allow traffic.
                        ],
                        "load_balancer_uids": [
                            "str"  # Optional. An array
                              containing the IDs of the load balancers to which the
                              firewall will allow traffic.
                        ],
                        "tags": {}  # Optional. Any object.
                    },
                    "ports": "str",  # The ports on which traffic
                      will be allowed specified as a string containing a single port, a
                      range (e.g. "8000-9000"), or "0" when all ports are open for a
                      protocol. For ICMP rules this parameter will always return "0".
                      Required.
                    "protocol": "str"  # The type of traffic to
                      be allowed. This may be one of ``tcp``"" , ``udp``"" , or
                      ``icmp``. Required. Known values are: "tcp", "udp", and "icmp".
                }
            ],
            "pending_changes": [
                {
                    "droplet_id": 0,  # Optional. An array of
                      objects each containing the fields "droplet_id", "removing", and
                      "status". It is provided to detail exactly which Droplets are
                      having their security policies updated. When empty, all changes
                      have been successfully applied.
                    "removing": bool,  # Optional. An array of
                      objects each containing the fields "droplet_id", "removing", and
                      "status". It is provided to detail exactly which Droplets are
                      having their security policies updated. When empty, all changes
                      have been successfully applied.
                    "status": "str"  # Optional. An array of
                      objects each containing the fields "droplet_id", "removing", and
                      "status". It is provided to detail exactly which Droplets are
                      having their security policies updated. When empty, all changes
                      have been successfully applied.
                }
            ],
            "status": "str",  # Optional. A status string indicating the
              current state of the firewall. This can be "waiting", "succeeded", or
              "failed". Known values are: "waiting", "succeeded", and "failed".
            "tags": {}  # Optional. Any object.
        }
    ],
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
update(firewall_id: str, body: Optional[JSON] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON
update(firewall_id: str, body: Optional[IO] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON

Update a Firewall.

To update the configuration of an existing firewall, send a PUT request to /v2/firewalls/$FIREWALL_ID. The request should contain a full representation of the firewall including existing attributes. Note that any attributes that are not provided will be reset to their default values..

Parameters:
  • firewall_id (str) – A unique ID that can be used to identify and reference a firewall. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Default value is None.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "firewall": {
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the firewall
          was created.
        "droplet_ids": [
            0  # Optional. An array containing the IDs of the Droplets
              assigned to the firewall.
        ],
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference a firewall.
        "inbound_rules": [
            {
                "ports": "str",  # The ports on which traffic will be
                  allowed specified as a string containing a single port, a range (e.g.
                  "8000-9000"), or "0" when all ports are open for a protocol. For ICMP
                  rules this parameter will always return "0". Required.
                "protocol": "str",  # The type of traffic to be
                  allowed. This may be one of ``tcp``"" , ``udp``"" , or ``icmp``.
                  Required. Known values are: "tcp", "udp", and "icmp".
                "sources": {
                    "addresses": [
                        "str"  # Optional. An array of
                          strings containing the IPv4 addresses, IPv6 addresses, IPv4
                          CIDRs, and/or IPv6 CIDRs to which the firewall will allow
                          traffic.
                    ],
                    "droplet_ids": [
                        0  # Optional. An array containing
                          the IDs of the Droplets to which the firewall will allow
                          traffic.
                    ],
                    "kubernetes_ids": [
                        "str"  # Optional. An array
                          containing the IDs of the Kubernetes clusters to which the
                          firewall will allow traffic.
                    ],
                    "load_balancer_uids": [
                        "str"  # Optional. An array
                          containing the IDs of the load balancers to which the
                          firewall will allow traffic.
                    ],
                    "tags": {}  # Optional. Any object.
                }
            }
        ],
        "name": "str",  # Optional. A human-readable name for a firewall. The
          name must begin with an alphanumeric character. Subsequent characters must
          either be alphanumeric characters, a period (.), or a dash (-).
        "outbound_rules": [
            {
                "destinations": {
                    "addresses": [
                        "str"  # Optional. An array of
                          strings containing the IPv4 addresses, IPv6 addresses, IPv4
                          CIDRs, and/or IPv6 CIDRs to which the firewall will allow
                          traffic.
                    ],
                    "droplet_ids": [
                        0  # Optional. An array containing
                          the IDs of the Droplets to which the firewall will allow
                          traffic.
                    ],
                    "kubernetes_ids": [
                        "str"  # Optional. An array
                          containing the IDs of the Kubernetes clusters to which the
                          firewall will allow traffic.
                    ],
                    "load_balancer_uids": [
                        "str"  # Optional. An array
                          containing the IDs of the load balancers to which the
                          firewall will allow traffic.
                    ],
                    "tags": {}  # Optional. Any object.
                },
                "ports": "str",  # The ports on which traffic will be
                  allowed specified as a string containing a single port, a range (e.g.
                  "8000-9000"), or "0" when all ports are open for a protocol. For ICMP
                  rules this parameter will always return "0". Required.
                "protocol": "str"  # The type of traffic to be
                  allowed. This may be one of ``tcp``"" , ``udp``"" , or ``icmp``.
                  Required. Known values are: "tcp", "udp", and "icmp".
            }
        ],
        "pending_changes": [
            {
                "droplet_id": 0,  # Optional. An array of objects
                  each containing the fields "droplet_id", "removing", and "status". It
                  is provided to detail exactly which Droplets are having their
                  security policies updated. When empty, all changes have been
                  successfully applied.
                "removing": bool,  # Optional. An array of objects
                  each containing the fields "droplet_id", "removing", and "status". It
                  is provided to detail exactly which Droplets are having their
                  security policies updated. When empty, all changes have been
                  successfully applied.
                "status": "str"  # Optional. An array of objects each
                  containing the fields "droplet_id", "removing", and "status". It is
                  provided to detail exactly which Droplets are having their security
                  policies updated. When empty, all changes have been successfully
                  applied.
            }
        ],
        "status": "str",  # Optional. A status string indicating the current
          state of the firewall. This can be "waiting", "succeeded", or "failed". Known
          values are: "waiting", "succeeded", and "failed".
        "tags": {}  # Optional. Any object.
    }
}
# response body for status code(s): 400, 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
class pydo.operations.FunctionsOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s functions attribute.

create_namespace(body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
create_namespace(body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create Namespace.

Creates a new serverless functions namespace in the desired region and associates it with the provided label. A namespace is a collection of functions and their associated packages, triggers, and project specifications. To create a namespace, send a POST request to /v2/functions/namespaces with the region and label properties.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "namespace": {
        "api_host": "str",  # Optional. The namespace's API hostname. Each
          function in a namespace is provided an endpoint at the namespace's hostname.
        "created_at": "str",  # Optional. UTC time string.
        "key": "str",  # Optional. A random alpha numeric string. This key is
          used in conjunction with the namespace's UUID to authenticate "na user to use
          the namespace via ``doctl``"" , DigitalOcean's official CLI.
        "label": "str",  # Optional. The namespace's unique name.
        "namespace": "str",  # Optional. A unique string format of UUID with
          a prefix fn-.
        "region": "str",  # Optional. The namespace's datacenter region.
        "updated_at": "str",  # Optional. UTC time string.
        "uuid": "str"  # Optional. The namespace's Universally Unique
          Identifier.
    }
}
# response body for status code(s): 404, 422
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
create_trigger(namespace_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
create_trigger(namespace_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create Trigger.

Creates a new trigger for a given function in a namespace. To create a trigger, send a POST request to /v2/functions/namespaces/$NAMESPACE_ID/triggers with the name, function, type, is_enabled and scheduled_details properties.

Parameters:
  • namespace_id (str) – The ID of the namespace to be managed. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "trigger": {
        "created_at": "str",  # Optional. UTC time string.
        "function": "str",  # Optional. Name of function(action) that exists
          in the given namespace.
        "is_enabled": bool,  # Optional. Indicates weather the trigger is
          paused or unpaused.
        "name": "str",  # Optional. The trigger's unique name within the
          namespace.
        "namespace": "str",  # Optional. A unique string format of UUID with
          a prefix fn-.
        "scheduled_details": {
            "body": {
                "name": "str"  # Optional. Optional data to be sent
                  to function while triggering the function.
            },
            "cron": "str"  # valid cron expression string which is
              required for SCHEDULED type triggers. Required.
        },
        "scheduled_runs": {
            "last_run_at": "str",  # Optional. Indicates last run time.
              null value indicates trigger not run yet.
            "next_run_at": "str"  # Optional. Indicates next run time.
              null value indicates trigger will not run.
        },
        "type": "str",  # Optional. String which indicates the type of
          trigger source like SCHEDULED.
        "updated_at": "str"  # Optional. UTC time string.
    }
}
# response body for status code(s): 400, 404, 422
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
delete_namespace(namespace_id: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete Namespace.

Deletes the given namespace. When a namespace is deleted all assets, in the namespace are deleted, this includes packages, functions and triggers. Deleting a namespace is a destructive operation and assets in the namespace are not recoverable after deletion. Some metadata is retained, such as activations, or soft deleted for reporting purposes. To delete namespace, send a DELETE request to /v2/functions/namespaces/$NAMESPACE_ID. A successful deletion returns a 204 response.

Parameters:

namespace_id (str) – The ID of the namespace to be managed. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
delete_trigger(namespace_id: str, trigger_name: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete Trigger.

Deletes the given trigger. To delete trigger, send a DELETE request to /v2/functions/namespaces/$NAMESPACE_ID/triggers/$TRIGGER_NAME. A successful deletion returns a 204 response.

Parameters:
  • namespace_id (str) – The ID of the namespace to be managed. Required.

  • trigger_name (str) – The name of the trigger to be managed. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_namespace(namespace_id: str, **kwargs: Any) MutableMapping[str, Any]

Get Namespace.

Gets the namespace details for the given namespace UUID. To get namespace details, send a GET request to /v2/functions/namespaces/$NAMESPACE_ID with no parameters.

Parameters:

namespace_id (str) – The ID of the namespace to be managed. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "namespace": {
        "api_host": "str",  # Optional. The namespace's API hostname. Each
          function in a namespace is provided an endpoint at the namespace's hostname.
        "created_at": "str",  # Optional. UTC time string.
        "key": "str",  # Optional. A random alpha numeric string. This key is
          used in conjunction with the namespace's UUID to authenticate "na user to use
          the namespace via ``doctl``"" , DigitalOcean's official CLI.
        "label": "str",  # Optional. The namespace's unique name.
        "namespace": "str",  # Optional. A unique string format of UUID with
          a prefix fn-.
        "region": "str",  # Optional. The namespace's datacenter region.
        "updated_at": "str",  # Optional. UTC time string.
        "uuid": "str"  # Optional. The namespace's Universally Unique
          Identifier.
    }
}
# response body for status code(s): 403, 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_trigger(namespace_id: str, trigger_name: str, **kwargs: Any) MutableMapping[str, Any]

Get Trigger.

Gets the trigger details. To get the trigger details, send a GET request to /v2/functions/namespaces/$NAMESPACE_ID/triggers/$TRIGGER_NAME.

Parameters:
  • namespace_id (str) – The ID of the namespace to be managed. Required.

  • trigger_name (str) – The name of the trigger to be managed. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "trigger": {
        "created_at": "str",  # Optional. UTC time string.
        "function": "str",  # Optional. Name of function(action) that exists
          in the given namespace.
        "is_enabled": bool,  # Optional. Indicates weather the trigger is
          paused or unpaused.
        "name": "str",  # Optional. The trigger's unique name within the
          namespace.
        "namespace": "str",  # Optional. A unique string format of UUID with
          a prefix fn-.
        "scheduled_details": {
            "body": {
                "name": "str"  # Optional. Optional data to be sent
                  to function while triggering the function.
            },
            "cron": "str"  # valid cron expression string which is
              required for SCHEDULED type triggers. Required.
        },
        "scheduled_runs": {
            "last_run_at": "str",  # Optional. Indicates last run time.
              null value indicates trigger not run yet.
            "next_run_at": "str"  # Optional. Indicates next run time.
              null value indicates trigger will not run.
        },
        "type": "str",  # Optional. String which indicates the type of
          trigger source like SCHEDULED.
        "updated_at": "str"  # Optional. UTC time string.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_namespaces(**kwargs: Any) MutableMapping[str, Any]

List Namespaces.

Returns a list of namespaces associated with the current user. To get all namespaces, send a GET request to /v2/functions/namespaces.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "namespaces": [
        {
            "api_host": "str",  # Optional. The namespace's API hostname.
              Each function in a namespace is provided an endpoint at the namespace's
              hostname.
            "created_at": "str",  # Optional. UTC time string.
            "key": "str",  # Optional. A random alpha numeric string.
              This key is used in conjunction with the namespace's UUID to authenticate
              "na user to use the namespace via ``doctl``"" , DigitalOcean's official
              CLI.
            "label": "str",  # Optional. The namespace's unique name.
            "namespace": "str",  # Optional. A unique string format of
              UUID with a prefix fn-.
            "region": "str",  # Optional. The namespace's datacenter
              region.
            "updated_at": "str",  # Optional. UTC time string.
            "uuid": "str"  # Optional. The namespace's Universally Unique
              Identifier.
        }
    ]
}
list_triggers(namespace_id: str, **kwargs: Any) MutableMapping[str, Any]

List Triggers.

Returns a list of triggers associated with the current user and namespace. To get all triggers, send a GET request to /v2/functions/namespaces/$NAMESPACE_ID/triggers.

Parameters:

namespace_id (str) – The ID of the namespace to be managed. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "triggers": [
        {
            "created_at": "str",  # Optional. UTC time string.
            "function": "str",  # Optional. Name of function(action) that
              exists in the given namespace.
            "is_enabled": bool,  # Optional. Indicates weather the
              trigger is paused or unpaused.
            "name": "str",  # Optional. The trigger's unique name within
              the namespace.
            "namespace": "str",  # Optional. A unique string format of
              UUID with a prefix fn-.
            "scheduled_details": {
                "body": {
                    "name": "str"  # Optional. Optional data to
                      be sent to function while triggering the function.
                },
                "cron": "str"  # valid cron expression string which
                  is required for SCHEDULED type triggers. Required.
            },
            "scheduled_runs": {
                "last_run_at": "str",  # Optional. Indicates last run
                  time. null value indicates trigger not run yet.
                "next_run_at": "str"  # Optional. Indicates next run
                  time. null value indicates trigger will not run.
            },
            "type": "str",  # Optional. String which indicates the type
              of trigger source like SCHEDULED.
            "updated_at": "str"  # Optional. UTC time string.
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
update_trigger(namespace_id: str, trigger_name: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
update_trigger(namespace_id: str, trigger_name: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Update Trigger.

Updates the details of the given trigger. To update a trigger, send a PUT request to /v2/functions/namespaces/$NAMESPACE_ID/triggers/$TRIGGER_NAME with new values for the is_enabled or scheduled_details properties.

Parameters:
  • namespace_id (str) – The ID of the namespace to be managed. Required.

  • trigger_name (str) – The name of the trigger to be managed. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "trigger": {
        "created_at": "str",  # Optional. UTC time string.
        "function": "str",  # Optional. Name of function(action) that exists
          in the given namespace.
        "is_enabled": bool,  # Optional. Indicates weather the trigger is
          paused or unpaused.
        "name": "str",  # Optional. The trigger's unique name within the
          namespace.
        "namespace": "str",  # Optional. A unique string format of UUID with
          a prefix fn-.
        "scheduled_details": {
            "body": {
                "name": "str"  # Optional. Optional data to be sent
                  to function while triggering the function.
            },
            "cron": "str"  # valid cron expression string which is
              required for SCHEDULED type triggers. Required.
        },
        "scheduled_runs": {
            "last_run_at": "str",  # Optional. Indicates last run time.
              null value indicates trigger not run yet.
            "next_run_at": "str"  # Optional. Indicates next run time.
              null value indicates trigger will not run.
        },
        "type": "str",  # Optional. String which indicates the type of
          trigger source like SCHEDULED.
        "updated_at": "str"  # Optional. UTC time string.
    }
}
# response body for status code(s): 400, 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
class pydo.operations.ImageActionsOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s image_actions attribute.

get(image_id: int, action_id: int, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Action.

To retrieve the status of an image action, send a GET request to /v2/images/$IMAGE_ID/actions/$IMAGE_ACTION_ID.

Parameters:
  • image_id (int) – A unique number that can be used to identify and reference a specific image. Required.

  • action_id (int) – A unique numeric ID that can be used to identify and reference an action. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "completed_at": "2020-02-20 00:00:00",  # Optional. A time value given in
      ISO8601 combined date and time format that represents when the action was
      completed.
    "id": 0,  # Optional. A unique numeric ID that can be used to identify and
      reference an action.
    "region": {
        "available": bool,  # This is a boolean value that represents whether
          new Droplets can be created in this region. Required.
        "features": {},  # This attribute is set to an array which contains
          features available in this region. Required.
        "name": "str",  # The display name of the region.  This will be a
          full name that is used in the control panel and other interfaces. Required.
        "sizes": {},  # This attribute is set to an array which contains the
          identifying slugs for the sizes available in this region. Required.
        "slug": "str"  # A human-readable string that is used as a unique
          identifier for each region. Required.
    },
    "region_slug": {},  # Optional. Any object.
    "resource_id": 0,  # Optional. A unique identifier for the resource that the
      action is associated with.
    "resource_type": "str",  # Optional. The type of resource that the action is
      associated with.
    "started_at": "2020-02-20 00:00:00",  # Optional. A time value given in
      ISO8601 combined date and time format that represents when the action was
      initiated.
    "status": "in-progress",  # Optional. Default value is "in-progress". The
      current status of the action. This can be "in-progress", "completed", or
      "errored". Known values are: "in-progress", "completed", and "errored".
    "type": "str"  # Optional. This is the type of action that the object
      represents. For example, this could be "transfer" to represent the state of an
      image transfer action.
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list(image_id: int, **kwargs: Any) MutableMapping[str, Any]

List All Actions for an Image.

To retrieve all actions that have been executed on an image, send a GET request to /v2/images/$IMAGE_ID/actions.

Parameters:

image_id (int) – A unique number that can be used to identify and reference a specific image. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "actions": [
        {
            "completed_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the action was completed.
            "id": 0,  # Optional. A unique numeric ID that can be used to
              identify and reference an action.
            "region": {
                "available": bool,  # This is a boolean value that
                  represents whether new Droplets can be created in this region.
                  Required.
                "features": {},  # This attribute is set to an array
                  which contains features available in this region. Required.
                "name": "str",  # The display name of the region.
                  This will be a full name that is used in the control panel and other
                  interfaces. Required.
                "sizes": {},  # This attribute is set to an array
                  which contains the identifying slugs for the sizes available in this
                  region. Required.
                "slug": "str"  # A human-readable string that is used
                  as a unique identifier for each region. Required.
            },
            "region_slug": {},  # Optional. Any object.
            "resource_id": 0,  # Optional. A unique identifier for the
              resource that the action is associated with.
            "resource_type": "str",  # Optional. The type of resource
              that the action is associated with.
            "started_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the action was initiated.
            "status": "in-progress",  # Optional. Default value is
              "in-progress". The current status of the action. This can be
              "in-progress", "completed", or "errored". Known values are:
              "in-progress", "completed", and "errored".
            "type": "str"  # Optional. This is the type of action that
              the object represents. For example, this could be "transfer" to represent
              the state of an image transfer action.
        }
    ],
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
post(image_id: int, body: Optional[JSON] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON
post(image_id: int, body: Optional[IO] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON

Initiate an Image Action.

The following actions are available on an Image.

Convert an Image to a Snapshot

To convert an image, for example, a backup to a snapshot, send a POST request to /v2/images/$IMAGE_ID/actions. Set the type attribute to convert.

Transfer an Image

To transfer an image to another region, send a POST request to /v2/images/$IMAGE_ID/actions. Set the type attribute to transfer and set region attribute to the slug identifier of the region you wish to transfer to.

param image_id:

A unique number that can be used to identify and reference a specific image. Required.

type image_id:

int

param body:

Is either a model type or a IO type. Default value is None.

type body:

JSON or IO

keyword content_type:

Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

paramtype content_type:

str

return:

JSON object

rtype:

JSON

raises ~azure.core.exceptions.HttpResponseError:

Example:
# response body for status code(s): 201
response == {
    "completed_at": "2020-02-20 00:00:00",  # Optional. A time value given in
      ISO8601 combined date and time format that represents when the action was
      completed.
    "id": 0,  # Optional. A unique numeric ID that can be used to identify and
      reference an action.
    "region": {
        "available": bool,  # This is a boolean value that represents whether
          new Droplets can be created in this region. Required.
        "features": {},  # This attribute is set to an array which contains
          features available in this region. Required.
        "name": "str",  # The display name of the region.  This will be a
          full name that is used in the control panel and other interfaces. Required.
        "sizes": {},  # This attribute is set to an array which contains the
          identifying slugs for the sizes available in this region. Required.
        "slug": "str"  # A human-readable string that is used as a unique
          identifier for each region. Required.
    },
    "region_slug": {},  # Optional. Any object.
    "resource_id": 0,  # Optional. A unique identifier for the resource that the
      action is associated with.
    "resource_type": "str",  # Optional. The type of resource that the action is
      associated with.
    "started_at": "2020-02-20 00:00:00",  # Optional. A time value given in
      ISO8601 combined date and time format that represents when the action was
      initiated.
    "status": "in-progress",  # Optional. Default value is "in-progress". The
      current status of the action. This can be "in-progress", "completed", or
      "errored". Known values are: "in-progress", "completed", and "errored".
    "type": "str"  # Optional. This is the type of action that the object
      represents. For example, this could be "transfer" to represent the state of an
      image transfer action.
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
class pydo.operations.ImagesOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s images attribute.

create_custom(body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
create_custom(body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create a Custom Image.

To create a new custom image, send a POST request to /v2/images. The body must contain a url attribute pointing to a Linux virtual machine image to be imported into DigitalOcean. The image must be in the raw, qcow2, vhdx, vdi, or vmdk format. It may be compressed using gzip or bzip2 and must be smaller than 100 GB after

being decompressed.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 202
response == {
    "image": {
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the image was
          created.
        "description": "str",  # Optional. An optional free-form text field
          to describe an image.
        "distribution": "str",  # Optional. The name of a custom image's
          distribution. Currently, the valid values are  ``Arch Linux``"" ,
          ``CentOS``"" , ``CoreOS``"" , ``Debian``"" , ``Fedora``"" , ``Fedora
          Atomic``"" ,  ``FreeBSD``"" , ``Gentoo``"" , ``openSUSE``"" , ``RancherOS``""
          , ``Rocky Linux``"" , ``Ubuntu``"" , and ``Unknown``.  Any other value will
          be accepted but ignored, and ``Unknown`` will be used in its place. Known
          values are: "Arch Linux", "CentOS", "CoreOS", "Debian", "Fedora", "Fedora
          Atomic", "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux",
          "Ubuntu", and "Unknown".
        "error_message": "str",  # Optional. A string containing information
          about errors that may occur when importing"n a custom image.
        "id": 0,  # Optional. A unique number that can be used to identify
          and reference a specific image.
        "min_disk_size": 0,  # Optional. The minimum disk size in GB required
          for a Droplet to use this image.
        "name": "str",  # Optional. The display name that has been given to
          an image.  This is what is shown in the control panel and is generally a
          descriptive title for the image in question.
        "public": bool,  # Optional. This is a boolean value that indicates
          whether the image in question is public or not. An image that is public is
          available to all accounts. A non-public image is only accessible from your
          account.
        "regions": [
            "str"  # Optional. This attribute is an array of the regions
              that the image is available in. The regions are represented by their
              identifying slug values.
        ],
        "size_gigabytes": 0.0,  # Optional. The size of the image in
          gigabytes.
        "slug": "str",  # Optional. A uniquely identifying string that is
          associated with each of the DigitalOcean-provided public images. These can be
          used to reference a public image as an alternative to the numeric id.
        "status": "str",  # Optional. A status string indicating the state of
          a custom image. This may be ``NEW``"" ,"n ``available``"" , ``pending``"" ,
          ``deleted``"" , or ``retired``. Known values are: "NEW", "available",
          "pending", "deleted", and "retired".
        "tags": [
            "str"  # Optional. A flat array of tag names as strings to be
              applied to the resource. Tag names may be for either existing or new
              tags.
        ],
        "type": "str"  # Optional. Describes the kind of image. It may be one
          of ``base``"" , ``snapshot``"" , ``backup``"" , ``custom``"" , or ``admin``.
          Respectively, this specifies whether an image is a DigitalOcean base OS
          image, user-generated Droplet snapshot, automatically created Droplet backup,
          user-provided virtual machine image, or an image used for DigitalOcean
          managed resources (e.g. DOKS worker nodes). Known values are: "base",
          "snapshot", "backup", "custom", and "admin".
    }
}
delete(image_id: int, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete an Image.

To delete a snapshot or custom image, send a DELETE request to /v2/images/$IMAGE_ID.

Parameters:

image_id (int) – A unique number that can be used to identify and reference a specific image. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get(image_id: MutableMapping[str, Any], **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Image.

To retrieve information about an image, send a GET request to /v2/images/$IDENTIFIER.

Parameters:

image_id (JSON) –

A unique number (id) or string (slug) used to identify and reference a specific image.

Public images can be identified by image id or slug.

Private images must be identified by image id. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "image": {
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the image was
          created.
        "description": "str",  # Optional. An optional free-form text field
          to describe an image.
        "distribution": "str",  # Optional. The name of a custom image's
          distribution. Currently, the valid values are  ``Arch Linux``"" ,
          ``CentOS``"" , ``CoreOS``"" , ``Debian``"" , ``Fedora``"" , ``Fedora
          Atomic``"" ,  ``FreeBSD``"" , ``Gentoo``"" , ``openSUSE``"" , ``RancherOS``""
          , ``Rocky Linux``"" , ``Ubuntu``"" , and ``Unknown``.  Any other value will
          be accepted but ignored, and ``Unknown`` will be used in its place. Known
          values are: "Arch Linux", "CentOS", "CoreOS", "Debian", "Fedora", "Fedora
          Atomic", "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux",
          "Ubuntu", and "Unknown".
        "error_message": "str",  # Optional. A string containing information
          about errors that may occur when importing"n a custom image.
        "id": 0,  # Optional. A unique number that can be used to identify
          and reference a specific image.
        "min_disk_size": 0,  # Optional. The minimum disk size in GB required
          for a Droplet to use this image.
        "name": "str",  # Optional. The display name that has been given to
          an image.  This is what is shown in the control panel and is generally a
          descriptive title for the image in question.
        "public": bool,  # Optional. This is a boolean value that indicates
          whether the image in question is public or not. An image that is public is
          available to all accounts. A non-public image is only accessible from your
          account.
        "regions": [
            "str"  # Optional. This attribute is an array of the regions
              that the image is available in. The regions are represented by their
              identifying slug values.
        ],
        "size_gigabytes": 0.0,  # Optional. The size of the image in
          gigabytes.
        "slug": "str",  # Optional. A uniquely identifying string that is
          associated with each of the DigitalOcean-provided public images. These can be
          used to reference a public image as an alternative to the numeric id.
        "status": "str",  # Optional. A status string indicating the state of
          a custom image. This may be ``NEW``"" ,"n ``available``"" , ``pending``"" ,
          ``deleted``"" , or ``retired``. Known values are: "NEW", "available",
          "pending", "deleted", and "retired".
        "tags": [
            "str"  # Optional. A flat array of tag names as strings to be
              applied to the resource. Tag names may be for either existing or new
              tags.
        ],
        "type": "str"  # Optional. Describes the kind of image. It may be one
          of ``base``"" , ``snapshot``"" , ``backup``"" , ``custom``"" , or ``admin``.
          Respectively, this specifies whether an image is a DigitalOcean base OS
          image, user-generated Droplet snapshot, automatically created Droplet backup,
          user-provided virtual machine image, or an image used for DigitalOcean
          managed resources (e.g. DOKS worker nodes). Known values are: "base",
          "snapshot", "backup", "custom", and "admin".
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list(*, type: Optional[str] = None, private: Optional[bool] = None, tag_name: Optional[str] = None, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All Images.

To list all of the images available on your account, send a GET request to /v2/images.

Filtering Results


It’s possible to request filtered results by including certain query parameters.

Image Type

Either 1-Click Application or OS Distribution images can be filtered by using the type query parameter.

Important: The type query parameter does not directly relate to the type attribute.

To retrieve only **distribution** images, include the type query parameter set to distribution, /v2/images?type=distribution.

To retrieve only **application** images, include the type query parameter set to application, /v2/images?type=application.

User Images

To retrieve only the private images of a user, include the private query parameter set to true, /v2/images?private=true.

Tags

To list all images assigned to a specific tag, include the tag_name query parameter set to the name of the tag in your GET request. For example, /v2/images?tag_name=$TAG_NAME.

keyword type:

Filters results based on image type which can be either application or distribution. Known values are: “application” and “distribution”. Default value is None.

paramtype type:

str

keyword private:

Used to filter only user images. Default value is None.

paramtype private:

bool

keyword tag_name:

Used to filter images by a specific tag. Default value is None.

paramtype tag_name:

str

keyword per_page:

Number of items returned per page. Default value is 20.

paramtype per_page:

int

keyword page:

Which ‘page’ of paginated results to return. Default value is 1.

paramtype page:

int

return:

JSON object

rtype:

JSON

raises ~azure.core.exceptions.HttpResponseError:

Example:
# response body for status code(s): 200
response == {
    "images": [
        {
            "created_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the image was created.
            "description": "str",  # Optional. An optional free-form text
              field to describe an image.
            "distribution": "str",  # Optional. The name of a custom
              image's distribution. Currently, the valid values are  ``Arch Linux``"" ,
              ``CentOS``"" , ``CoreOS``"" , ``Debian``"" , ``Fedora``"" , ``Fedora
              Atomic``"" ,  ``FreeBSD``"" , ``Gentoo``"" , ``openSUSE``"" ,
              ``RancherOS``"" , ``Rocky Linux``"" , ``Ubuntu``"" , and ``Unknown``.
              Any other value will be accepted but ignored, and ``Unknown`` will be
              used in its place. Known values are: "Arch Linux", "CentOS", "CoreOS",
              "Debian", "Fedora", "Fedora Atomic", "FreeBSD", "Gentoo", "openSUSE",
              "RancherOS", "Rocky Linux", "Ubuntu", and "Unknown".
            "error_message": "str",  # Optional. A string containing
              information about errors that may occur when importing"n a custom image.
            "id": 0,  # Optional. A unique number that can be used to
              identify and reference a specific image.
            "min_disk_size": 0,  # Optional. The minimum disk size in GB
              required for a Droplet to use this image.
            "name": "str",  # Optional. The display name that has been
              given to an image.  This is what is shown in the control panel and is
              generally a descriptive title for the image in question.
            "public": bool,  # Optional. This is a boolean value that
              indicates whether the image in question is public or not. An image that
              is public is available to all accounts. A non-public image is only
              accessible from your account.
            "regions": [
                "str"  # Optional. This attribute is an array of the
                  regions that the image is available in. The regions are represented
                  by their identifying slug values.
            ],
            "size_gigabytes": 0.0,  # Optional. The size of the image in
              gigabytes.
            "slug": "str",  # Optional. A uniquely identifying string
              that is associated with each of the DigitalOcean-provided public images.
              These can be used to reference a public image as an alternative to the
              numeric id.
            "status": "str",  # Optional. A status string indicating the
              state of a custom image. This may be ``NEW``"" ,"n ``available``"" ,
              ``pending``"" , ``deleted``"" , or ``retired``. Known values are: "NEW",
              "available", "pending", "deleted", and "retired".
            "tags": [
                "str"  # Optional. A flat array of tag names as
                  strings to be applied to the resource. Tag names may be for either
                  existing or new tags.
            ],
            "type": "str"  # Optional. Describes the kind of image. It
              may be one of ``base``"" , ``snapshot``"" , ``backup``"" , ``custom``"" ,
              or ``admin``. Respectively, this specifies whether an image is a
              DigitalOcean base OS image, user-generated Droplet snapshot,
              automatically created Droplet backup, user-provided virtual machine
              image, or an image used for DigitalOcean managed resources (e.g. DOKS
              worker nodes). Known values are: "base", "snapshot", "backup", "custom",
              and "admin".
        }
    ],
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
update(image_id: int, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
update(image_id: int, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Update an Image.

To update an image, send a PUT request to /v2/images/$IMAGE_ID. Set the name attribute to the new value you would like to use. For custom images, the description and distribution attributes may also be updated.

Parameters:
  • image_id (int) – A unique number that can be used to identify and reference a specific image. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "image": {
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the image was
          created.
        "description": "str",  # Optional. An optional free-form text field
          to describe an image.
        "distribution": "str",  # Optional. The name of a custom image's
          distribution. Currently, the valid values are  ``Arch Linux``"" ,
          ``CentOS``"" , ``CoreOS``"" , ``Debian``"" , ``Fedora``"" , ``Fedora
          Atomic``"" ,  ``FreeBSD``"" , ``Gentoo``"" , ``openSUSE``"" , ``RancherOS``""
          , ``Rocky Linux``"" , ``Ubuntu``"" , and ``Unknown``.  Any other value will
          be accepted but ignored, and ``Unknown`` will be used in its place. Known
          values are: "Arch Linux", "CentOS", "CoreOS", "Debian", "Fedora", "Fedora
          Atomic", "FreeBSD", "Gentoo", "openSUSE", "RancherOS", "Rocky Linux",
          "Ubuntu", and "Unknown".
        "error_message": "str",  # Optional. A string containing information
          about errors that may occur when importing"n a custom image.
        "id": 0,  # Optional. A unique number that can be used to identify
          and reference a specific image.
        "min_disk_size": 0,  # Optional. The minimum disk size in GB required
          for a Droplet to use this image.
        "name": "str",  # Optional. The display name that has been given to
          an image.  This is what is shown in the control panel and is generally a
          descriptive title for the image in question.
        "public": bool,  # Optional. This is a boolean value that indicates
          whether the image in question is public or not. An image that is public is
          available to all accounts. A non-public image is only accessible from your
          account.
        "regions": [
            "str"  # Optional. This attribute is an array of the regions
              that the image is available in. The regions are represented by their
              identifying slug values.
        ],
        "size_gigabytes": 0.0,  # Optional. The size of the image in
          gigabytes.
        "slug": "str",  # Optional. A uniquely identifying string that is
          associated with each of the DigitalOcean-provided public images. These can be
          used to reference a public image as an alternative to the numeric id.
        "status": "str",  # Optional. A status string indicating the state of
          a custom image. This may be ``NEW``"" ,"n ``available``"" , ``pending``"" ,
          ``deleted``"" , or ``retired``. Known values are: "NEW", "available",
          "pending", "deleted", and "retired".
        "tags": [
            "str"  # Optional. A flat array of tag names as strings to be
              applied to the resource. Tag names may be for either existing or new
              tags.
        ],
        "type": "str"  # Optional. Describes the kind of image. It may be one
          of ``base``"" , ``snapshot``"" , ``backup``"" , ``custom``"" , or ``admin``.
          Respectively, this specifies whether an image is a DigitalOcean base OS
          image, user-generated Droplet snapshot, automatically created Droplet backup,
          user-provided virtual machine image, or an image used for DigitalOcean
          managed resources (e.g. DOKS worker nodes). Known values are: "base",
          "snapshot", "backup", "custom", and "admin".
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
class pydo.operations.InvoicesOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s invoices attribute.

get_by_uuid(invoice_uuid: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Invoice by UUID.

To retrieve the invoice items for an invoice, send a GET request to /v2/customers/my/invoices/$INVOICE_UUID.

Parameters:

invoice_uuid (str) – UUID of the invoice. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "invoice_items": [
        {
            "amount": "str",  # Optional. Billed amount of this invoice
              item. Billed in USD.
            "description": "str",  # Optional. Description of the invoice
              item.
            "duration": "str",  # Optional. Duration of time this invoice
              item was used and subsequently billed.
            "duration_unit": "str",  # Optional. Unit of time for
              duration.
            "end_time": "str",  # Optional. Time the invoice item stopped
              being billed for usage.
            "group_description": "str",  # Optional. Description of the
              invoice item when it is a grouped set of usage, such  as DOKS or
              databases.
            "product": "str",  # Optional. Name of the product being
              billed in the invoice item.
            "project_name": "str",  # Optional. Name of the DigitalOcean
              Project this resource belongs to.
            "resource_id": "str",  # Optional. ID of the resource billing
              in the invoice item if available.
            "resource_uuid": "str",  # Optional. UUID of the resource
              billing in the invoice item if available.
            "start_time": "str"  # Optional. Time the invoice item began
              to be billed for usage.
        }
    ],
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_csv_by_uuid(invoice_uuid: str, **kwargs: Any) Union[str, MutableMapping[str, Any]]

Retrieve an Invoice CSV by UUID.

To retrieve a CSV for an invoice, send a GET request to /v2/customers/my/invoices/$INVOICE_UUID/csv.

Parameters:

invoice_uuid (str) – UUID of the invoice. Required.

Returns:

str or JSON object

Return type:

str or JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_pdf_by_uuid(invoice_uuid: str, **kwargs: Any) Union[Iterator[bytes], MutableMapping[str, Any]]

Retrieve an Invoice PDF by UUID.

To retrieve a PDF for an invoice, send a GET request to /v2/customers/my/invoices/$INVOICE_UUID/pdf.

Parameters:

invoice_uuid (str) – UUID of the invoice. Required.

Returns:

Iterator of the response bytes or JSON object

Return type:

Iterator[bytes] or JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_summary_by_uuid(invoice_uuid: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Invoice Summary by UUID.

To retrieve a summary for an invoice, send a GET request to /v2/customers/my/invoices/$INVOICE_UUID/summary.

Parameters:

invoice_uuid (str) – UUID of the invoice. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "amount": "str",  # Optional. Total amount of the invoice, in USD.  This will
      reflect month-to-date usage in the invoice preview.
    "billing_period": "str",  # Optional. Billing period of usage for which the
      invoice is issued, in ``YYYY-MM``  format.
    "credits_and_adjustments": {
        "amount": "str",  # Optional. Total amount charged in USD.
        "name": "str"  # Optional. Name of the charge.
    },
    "invoice_uuid": "str",  # Optional. UUID of the invoice.
    "overages": {
        "amount": "str",  # Optional. Total amount charged in USD.
        "name": "str"  # Optional. Name of the charge.
    },
    "product_charges": {
        "amount": "str",  # Optional. Total amount charged.
        "items": [
            {
                "amount": "str",  # Optional. Amount of the charge.
                "count": "str",  # Optional. Number of times the
                  charge was applied.
                "name": "str"  # Optional. Description of the charge.
            }
        ],
        "name": "str"  # Optional. Description of usage charges.
    },
    "taxes": {
        "amount": "str",  # Optional. Total amount charged in USD.
        "name": "str"  # Optional. Name of the charge.
    },
    "user_billing_address": {
        "address_line1": "str",  # Optional. Street address line 1.
        "address_line2": "str",  # Optional. Street address line 2.
        "city": "str",  # Optional. City.
        "country_iso2_code": "str",  # Optional. Country (ISO2) code.
        "created_at": "str",  # Optional. Timestamp billing address was
          created.
        "postal_code": "str",  # Optional. Postal code.
        "region": "str",  # Optional. Region.
        "updated_at": "str"  # Optional. Timestamp billing address was
          updated.
    },
    "user_company": "str",  # Optional. Company of the DigitalOcean customer
      being invoiced, if set.
    "user_email": "str",  # Optional. Email of the DigitalOcean customer being
      invoiced.
    "user_name": "str"  # Optional. Name of the DigitalOcean customer being
      invoiced.
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list(*, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All Invoices.

To retrieve a list of all invoices, send a GET request to /v2/customers/my/invoices.

Parameters:
  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "invoice_preview": {
        "amount": "str",  # Optional. Total amount of the invoice, in USD.
          This will reflect month-to-date usage in the invoice preview.
        "invoice_period": "str",  # Optional. Billing period of usage for
          which the invoice is issued, in ``YYYY-MM``  format.
        "invoice_uuid": "str",  # Optional. The UUID of the invoice. The
          canonical reference for the invoice.
        "updated_at": "str"  # Optional. Time the invoice was last updated.
          This is only included with the invoice preview.
    },
    "invoices": [
        {
            "amount": "str",  # Optional. Total amount of the invoice, in
              USD.  This will reflect month-to-date usage in the invoice preview.
            "invoice_period": "str",  # Optional. Billing period of usage
              for which the invoice is issued, in ``YYYY-MM``  format.
            "invoice_uuid": "str",  # Optional. The UUID of the invoice.
              The canonical reference for the invoice.
            "updated_at": "str"  # Optional. Time the invoice was last
              updated.  This is only included with the invoice preview.
        }
    ],
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
class pydo.operations.KubernetesOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s kubernetes attribute.

add_node_pool(cluster_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
add_node_pool(cluster_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Add a Node Pool to a Kubernetes Cluster.

To add an additional node pool to a Kubernetes clusters, send a POST request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools with the following attributes.

Parameters:
  • cluster_id (str) – A unique ID that can be used to reference a Kubernetes cluster. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 201
response == {
    "node_pool": {
        "auto_scale": bool,  # Optional. A boolean value indicating whether
          auto-scaling is enabled for this node pool.
        "count": 0,  # Optional. The number of Droplet instances in the node
          pool.
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference a specific node pool.
        "labels": {},  # Optional. An object of key/value mappings specifying
          labels to apply to all nodes in a pool. Labels will automatically be applied
          to all existing nodes and any subsequent nodes added to the pool. Note that
          when a label is removed, it is not deleted from the nodes in the pool.
        "max_nodes": 0,  # Optional. The maximum number of nodes that this
          node pool can be auto-scaled to. The value will be ``0`` if ``auto_scale`` is
          set to ``false``.
        "min_nodes": 0,  # Optional. The minimum number of nodes that this
          node pool can be auto-scaled to. The value will be ``0`` if ``auto_scale`` is
          set to ``false``.
        "name": "str",  # Optional. A human-readable name for the node pool.
        "nodes": [
            {
                "created_at": "2020-02-20 00:00:00",  # Optional. A
                  time value given in ISO8601 combined date and time format that
                  represents when the node was created.
                "droplet_id": "str",  # Optional. The ID of the
                  Droplet used for the worker node.
                "id": "str",  # Optional. A unique ID that can be
                  used to identify and reference the node.
                "name": "str",  # Optional. An automatically
                  generated, human-readable name for the node.
                "status": {
                    "state": "str"  # Optional. A string
                      indicating the current status of the node. Known values are:
                      "provisioning", "running", "draining", and "deleting".
                },
                "updated_at": "2020-02-20 00:00:00"  # Optional. A
                  time value given in ISO8601 combined date and time format that
                  represents when the node was last updated.
            }
        ],
        "size": "str",  # Optional. The slug identifier for the type of
          Droplet used as workers in the node pool.
        "tags": [
            "str"  # Optional. An array containing the tags applied to
              the node pool. All node pools are automatically tagged ``k8s``"" ,
              ``k8s-worker``"" , and ``k8s:$K8S_CLUSTER_ID``.
        ],
        "taints": [
            {
                "effect": "str",  # Optional. How the node reacts to
                  pods that it won't tolerate. Available effect values are
                  ``NoSchedule``"" , ``PreferNoSchedule``"" , and ``NoExecute``. Known
                  values are: "NoSchedule", "PreferNoSchedule", and "NoExecute".
                "key": "str",  # Optional. An arbitrary string. The
                  ``key`` and ``value`` fields of the ``taint`` object form a key-value
                  pair. For example, if the value of the ``key`` field is "special" and
                  the value of the ``value`` field is "gpu", the key value pair would
                  be ``special=gpu``.
                "value": "str"  # Optional. An arbitrary string. The
                  ``key`` and ``value`` fields of the ``taint`` object form a key-value
                  pair. For example, if the value of the ``key`` field is "special" and
                  the value of the ``value`` field is "gpu", the key value pair would
                  be ``special=gpu``.
            }
        ]
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
add_registry(body: Optional[JSON] = None, *, content_type: str = 'application/json', **kwargs: Any) None
add_registry(body: Optional[IO] = None, *, content_type: str = 'application/json', **kwargs: Any) None

Add Container Registry to Kubernetes Clusters.

To integrate the container registry with Kubernetes clusters, send a POST request to /v2/kubernetes/registry.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Default value is None.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

None

Return type:

None

Raises:

HttpResponseError

create_cluster(body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
create_cluster(body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create a New Kubernetes Cluster.

To create a new Kubernetes cluster, send a POST request to /v2/kubernetes/clusters. The request must contain at least one node pool with at least one worker.

The request may contain a maintenance window policy describing a time period when disruptive maintenance tasks may be carried out. Omitting the policy implies that a window will be chosen automatically. See here for details.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 201
response == {
    "kubernetes_cluster": {
        "auto_upgrade": False,  # Optional. Default value is False. A boolean
          value indicating whether the cluster will be automatically upgraded to new
          patch releases during its maintenance window.
        "cluster_subnet": "str",  # Optional. The range of IP addresses in
          the overlay network of the Kubernetes cluster in CIDR notation.
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the Kubernetes
          cluster was created.
        "endpoint": "str",  # Optional. The base URL of the API server on the
          Kubernetes master node.
        "ha": False,  # Optional. Default value is False. A boolean value
          indicating whether the control plane is run in a highly available
          configuration in the cluster. Highly available control planes incur less
          downtime. The property cannot be disabled.
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference a Kubernetes cluster.
        "ipv4": "str",  # Optional. The public IPv4 address of the Kubernetes
          master node. This will not be set if high availability is configured on the
          cluster (v1.21+).
        "maintenance_policy": {
            "day": "str",  # Optional. The day of the maintenance window
              policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to
              indicate an arbitrary week day. Known values are: "any", "monday",
              "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday".
            "duration": "str",  # Optional. The duration of the
              maintenance window policy in human-readable format.
            "start_time": "str"  # Optional. The start time in UTC of the
              maintenance window policy in 24-hour clock format / HH:MM notation (e.g.,
              ``15:00``"" ).
        },
        "name": "str",  # A human-readable name for a Kubernetes cluster.
          Required.
        "node_pools": [
            {
                "auto_scale": bool,  # Optional. A boolean value
                  indicating whether auto-scaling is enabled for this node pool.
                "count": 0,  # Optional. The number of Droplet
                  instances in the node pool.
                "id": "str",  # Optional. A unique ID that can be
                  used to identify and reference a specific node pool.
                "labels": {},  # Optional. An object of key/value
                  mappings specifying labels to apply to all nodes in a pool. Labels
                  will automatically be applied to all existing nodes and any
                  subsequent nodes added to the pool. Note that when a label is
                  removed, it is not deleted from the nodes in the pool.
                "max_nodes": 0,  # Optional. The maximum number of
                  nodes that this node pool can be auto-scaled to. The value will be
                  ``0`` if ``auto_scale`` is set to ``false``.
                "min_nodes": 0,  # Optional. The minimum number of
                  nodes that this node pool can be auto-scaled to. The value will be
                  ``0`` if ``auto_scale`` is set to ``false``.
                "name": "str",  # Optional. A human-readable name for
                  the node pool.
                "nodes": [
                    {
                        "created_at": "2020-02-20 00:00:00",
                          # Optional. A time value given in ISO8601 combined date and
                          time format that represents when the node was created.
                        "droplet_id": "str",  # Optional. The
                          ID of the Droplet used for the worker node.
                        "id": "str",  # Optional. A unique ID
                          that can be used to identify and reference the node.
                        "name": "str",  # Optional. An
                          automatically generated, human-readable name for the node.
                        "status": {
                            "state": "str"  # Optional. A
                              string indicating the current status of the node. Known
                              values are: "provisioning", "running", "draining", and
                              "deleting".
                        },
                        "updated_at": "2020-02-20 00:00:00"
                          # Optional. A time value given in ISO8601 combined date and
                          time format that represents when the node was last updated.
                    }
                ],
                "size": "str",  # Optional. The slug identifier for
                  the type of Droplet used as workers in the node pool.
                "tags": [
                    "str"  # Optional. An array containing the
                      tags applied to the node pool. All node pools are automatically
                      tagged ``k8s``"" , ``k8s-worker``"" , and
                      ``k8s:$K8S_CLUSTER_ID``.
                ],
                "taints": [
                    {
                        "effect": "str",  # Optional. How the
                          node reacts to pods that it won't tolerate. Available effect
                          values are ``NoSchedule``"" , ``PreferNoSchedule``"" , and
                          ``NoExecute``. Known values are: "NoSchedule",
                          "PreferNoSchedule", and "NoExecute".
                        "key": "str",  # Optional. An
                          arbitrary string. The ``key`` and ``value`` fields of the
                          ``taint`` object form a key-value pair. For example, if the
                          value of the ``key`` field is "special" and the value of the
                          ``value`` field is "gpu", the key value pair would be
                          ``special=gpu``.
                        "value": "str"  # Optional. An
                          arbitrary string. The ``key`` and ``value`` fields of the
                          ``taint`` object form a key-value pair. For example, if the
                          value of the ``key`` field is "special" and the value of the
                          ``value`` field is "gpu", the key value pair would be
                          ``special=gpu``.
                    }
                ]
            }
        ],
        "region": "str",  # The slug identifier for the region where the
          Kubernetes cluster is located. Required.
        "registry_enabled": bool,  # Optional. A read-only boolean value
          indicating if a container registry is integrated with the cluster.
        "service_subnet": "str",  # Optional. The range of assignable IP
          addresses for services running in the Kubernetes cluster in CIDR notation.
        "status": {
            "message": "str",  # Optional. An optional message providing
              additional information about the current cluster state.
            "state": "str"  # Optional. A string indicating the current
              status of the cluster. Known values are: "running", "provisioning",
              "degraded", "error", "deleted", "upgrading", and "deleting".
        },
        "surge_upgrade": False,  # Optional. Default value is False. A
          boolean value indicating whether surge upgrade is enabled/disabled for the
          cluster. Surge upgrade makes cluster upgrades fast and reliable by bringing
          up new nodes before destroying the outdated nodes.
        "tags": [
            "str"  # Optional. An array of tags applied to the Kubernetes
              cluster. All clusters are automatically tagged ``k8s`` and
              ``k8s:$K8S_CLUSTER_ID``.
        ],
        "updated_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the Kubernetes
          cluster was last updated.
        "version": "str",  # The slug identifier for the version of
          Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the
          latest version within it will be used (e.g. "1.14.6-do.1"); if set to
          "latest", the latest published version will be used. See the
          ``/v2/kubernetes/options`` endpoint to find all currently available versions.
          Required.
        "vpc_uuid": "str"  # Optional. A string specifying the UUID of the
          VPC to which the Kubernetes cluster is assigned.
    }
}
delete_cluster(cluster_id: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete a Kubernetes Cluster.

To delete a Kubernetes cluster and all services deployed to it, send a DELETE request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID.

A 204 status code with no body will be returned in response to a successful request.

Parameters:

cluster_id (str) – A unique ID that can be used to reference a Kubernetes cluster. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
delete_node(cluster_id: str, node_pool_id: str, node_id: str, *, skip_drain: int = 0, replace: int = 0, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete a Node in a Kubernetes Cluster.

To delete a single node in a pool, send a DELETE request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_ID/nodes/$NODE_ID.

Appending the skip_drain=1 query parameter to the request causes node draining to be skipped. Omitting the query parameter or setting its value to 0 carries out draining prior to deletion.

Appending the replace=1 query parameter to the request causes the node to be replaced by a new one after deletion. Omitting the query parameter or setting its value to 0 deletes without replacement.

Parameters:
  • cluster_id (str) – A unique ID that can be used to reference a Kubernetes cluster. Required.

  • node_pool_id (str) – A unique ID that can be used to reference a Kubernetes node pool. Required.

  • node_id (str) – A unique ID that can be used to reference a node in a Kubernetes node pool. Required.

  • skip_drain (int) – Specifies whether or not to drain workloads from a node before it is deleted. Setting it to 1 causes node draining to be skipped. Omitting the query parameter or setting its value to 0 carries out draining prior to deletion. Default value is 0.

  • replace (int) – Specifies whether or not to replace a node after it has been deleted. Setting it to 1 causes the node to be replaced by a new one after deletion. Omitting the query parameter or setting its value to 0 deletes without replacement. Default value is 0.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
delete_node_pool(cluster_id: str, node_pool_id: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete a Node Pool in a Kubernetes Cluster.

To delete a node pool, send a DELETE request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_ID.

A 204 status code with no body will be returned in response to a successful request. Nodes in the pool will subsequently be drained and deleted.

Parameters:
  • cluster_id (str) – A unique ID that can be used to reference a Kubernetes cluster. Required.

  • node_pool_id (str) – A unique ID that can be used to reference a Kubernetes node pool. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
destroy_associated_resources_dangerous(cluster_id: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete a Cluster and All of its Associated Resources (Dangerous).

To delete a Kubernetes cluster with all of its associated resources, send a DELETE request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/destroy_with_associated_resources/dangerous. A 204 status code with no body will be returned in response to a successful request.

Parameters:

cluster_id (str) – A unique ID that can be used to reference a Kubernetes cluster. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
destroy_associated_resources_selective(cluster_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
destroy_associated_resources_selective(cluster_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Selectively Delete a Cluster and its Associated Resources.

To delete a Kubernetes cluster along with a subset of its associated resources, send a DELETE request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/destroy_with_associated_resources/selective.

The JSON body of the request should include load_balancers, volumes, or volume_snapshots keys each set to an array of IDs for the associated resources to be destroyed.

The IDs can be found by querying the cluster’s associated resources endpoint. Any associated resource not included in the request will remain and continue to accrue changes on your account.

Parameters:
  • cluster_id (str) – A unique ID that can be used to reference a Kubernetes cluster. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_available_upgrades(cluster_id: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve Available Upgrades for an Existing Kubernetes Cluster.

To determine whether a cluster can be upgraded, and the versions to which it can be upgraded, send a GET request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/upgrades.

Parameters:

cluster_id (str) – A unique ID that can be used to reference a Kubernetes cluster. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "available_upgrade_versions": [
        {
            "kubernetes_version": "str",  # Optional. The upstream
              version string for the version of Kubernetes provided by a given slug.
            "slug": "str",  # Optional. The slug identifier for an
              available version of Kubernetes for use when creating or updating a
              cluster. The string contains both the upstream version of Kubernetes as
              well as the DigitalOcean revision.
            "supported_features": [
                "str"  # Optional. The features available with the
                  version of Kubernetes provided by a given slug.
            ]
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_cluster(cluster_id: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Kubernetes Cluster.

To show information about an existing Kubernetes cluster, send a GET request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID.

Parameters:

cluster_id (str) – A unique ID that can be used to reference a Kubernetes cluster. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "kubernetes_cluster": {
        "auto_upgrade": False,  # Optional. Default value is False. A boolean
          value indicating whether the cluster will be automatically upgraded to new
          patch releases during its maintenance window.
        "cluster_subnet": "str",  # Optional. The range of IP addresses in
          the overlay network of the Kubernetes cluster in CIDR notation.
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the Kubernetes
          cluster was created.
        "endpoint": "str",  # Optional. The base URL of the API server on the
          Kubernetes master node.
        "ha": False,  # Optional. Default value is False. A boolean value
          indicating whether the control plane is run in a highly available
          configuration in the cluster. Highly available control planes incur less
          downtime. The property cannot be disabled.
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference a Kubernetes cluster.
        "ipv4": "str",  # Optional. The public IPv4 address of the Kubernetes
          master node. This will not be set if high availability is configured on the
          cluster (v1.21+).
        "maintenance_policy": {
            "day": "str",  # Optional. The day of the maintenance window
              policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to
              indicate an arbitrary week day. Known values are: "any", "monday",
              "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday".
            "duration": "str",  # Optional. The duration of the
              maintenance window policy in human-readable format.
            "start_time": "str"  # Optional. The start time in UTC of the
              maintenance window policy in 24-hour clock format / HH:MM notation (e.g.,
              ``15:00``"" ).
        },
        "name": "str",  # A human-readable name for a Kubernetes cluster.
          Required.
        "node_pools": [
            {
                "auto_scale": bool,  # Optional. A boolean value
                  indicating whether auto-scaling is enabled for this node pool.
                "count": 0,  # Optional. The number of Droplet
                  instances in the node pool.
                "id": "str",  # Optional. A unique ID that can be
                  used to identify and reference a specific node pool.
                "labels": {},  # Optional. An object of key/value
                  mappings specifying labels to apply to all nodes in a pool. Labels
                  will automatically be applied to all existing nodes and any
                  subsequent nodes added to the pool. Note that when a label is
                  removed, it is not deleted from the nodes in the pool.
                "max_nodes": 0,  # Optional. The maximum number of
                  nodes that this node pool can be auto-scaled to. The value will be
                  ``0`` if ``auto_scale`` is set to ``false``.
                "min_nodes": 0,  # Optional. The minimum number of
                  nodes that this node pool can be auto-scaled to. The value will be
                  ``0`` if ``auto_scale`` is set to ``false``.
                "name": "str",  # Optional. A human-readable name for
                  the node pool.
                "nodes": [
                    {
                        "created_at": "2020-02-20 00:00:00",
                          # Optional. A time value given in ISO8601 combined date and
                          time format that represents when the node was created.
                        "droplet_id": "str",  # Optional. The
                          ID of the Droplet used for the worker node.
                        "id": "str",  # Optional. A unique ID
                          that can be used to identify and reference the node.
                        "name": "str",  # Optional. An
                          automatically generated, human-readable name for the node.
                        "status": {
                            "state": "str"  # Optional. A
                              string indicating the current status of the node. Known
                              values are: "provisioning", "running", "draining", and
                              "deleting".
                        },
                        "updated_at": "2020-02-20 00:00:00"
                          # Optional. A time value given in ISO8601 combined date and
                          time format that represents when the node was last updated.
                    }
                ],
                "size": "str",  # Optional. The slug identifier for
                  the type of Droplet used as workers in the node pool.
                "tags": [
                    "str"  # Optional. An array containing the
                      tags applied to the node pool. All node pools are automatically
                      tagged ``k8s``"" , ``k8s-worker``"" , and
                      ``k8s:$K8S_CLUSTER_ID``.
                ],
                "taints": [
                    {
                        "effect": "str",  # Optional. How the
                          node reacts to pods that it won't tolerate. Available effect
                          values are ``NoSchedule``"" , ``PreferNoSchedule``"" , and
                          ``NoExecute``. Known values are: "NoSchedule",
                          "PreferNoSchedule", and "NoExecute".
                        "key": "str",  # Optional. An
                          arbitrary string. The ``key`` and ``value`` fields of the
                          ``taint`` object form a key-value pair. For example, if the
                          value of the ``key`` field is "special" and the value of the
                          ``value`` field is "gpu", the key value pair would be
                          ``special=gpu``.
                        "value": "str"  # Optional. An
                          arbitrary string. The ``key`` and ``value`` fields of the
                          ``taint`` object form a key-value pair. For example, if the
                          value of the ``key`` field is "special" and the value of the
                          ``value`` field is "gpu", the key value pair would be
                          ``special=gpu``.
                    }
                ]
            }
        ],
        "region": "str",  # The slug identifier for the region where the
          Kubernetes cluster is located. Required.
        "registry_enabled": bool,  # Optional. A read-only boolean value
          indicating if a container registry is integrated with the cluster.
        "service_subnet": "str",  # Optional. The range of assignable IP
          addresses for services running in the Kubernetes cluster in CIDR notation.
        "status": {
            "message": "str",  # Optional. An optional message providing
              additional information about the current cluster state.
            "state": "str"  # Optional. A string indicating the current
              status of the cluster. Known values are: "running", "provisioning",
              "degraded", "error", "deleted", "upgrading", and "deleting".
        },
        "surge_upgrade": False,  # Optional. Default value is False. A
          boolean value indicating whether surge upgrade is enabled/disabled for the
          cluster. Surge upgrade makes cluster upgrades fast and reliable by bringing
          up new nodes before destroying the outdated nodes.
        "tags": [
            "str"  # Optional. An array of tags applied to the Kubernetes
              cluster. All clusters are automatically tagged ``k8s`` and
              ``k8s:$K8S_CLUSTER_ID``.
        ],
        "updated_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the Kubernetes
          cluster was last updated.
        "version": "str",  # The slug identifier for the version of
          Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the
          latest version within it will be used (e.g. "1.14.6-do.1"); if set to
          "latest", the latest published version will be used. See the
          ``/v2/kubernetes/options`` endpoint to find all currently available versions.
          Required.
        "vpc_uuid": "str"  # Optional. A string specifying the UUID of the
          VPC to which the Kubernetes cluster is assigned.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_cluster_lint_results(cluster_id: str, *, run_id: Optional[str] = None, **kwargs: Any) MutableMapping[str, Any]

Fetch Clusterlint Diagnostics for a Kubernetes Cluster.

To request clusterlint diagnostics for your cluster, send a GET request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/clusterlint. If the run_id query parameter is provided, then the diagnostics for the specific run is fetched. By default, the latest results are shown.

To find out how to address clusterlint feedback, please refer to the clusterlint check documentation.

Parameters:
  • cluster_id (str) – A unique ID that can be used to reference a Kubernetes cluster. Required.

  • run_id (str) – Specifies the clusterlint run whose results will be retrieved. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "completed_at": "2020-02-20 00:00:00",  # Optional. A time value given in
      ISO8601 combined date and time format that represents when the schedule
      clusterlint run request was completed.
    "diagnostics": [
        {
            "check_name": "str",  # Optional. The clusterlint check that
              resulted in the diagnostic.
            "message": "str",  # Optional. Feedback about the object for
              users to fix.
            "object": {
                "kind": "str",  # Optional. The kind of Kubernetes
                  API object.
                "name": "str",  # Optional. Name of the object.
                "namespace": "str"  # Optional. The namespace the
                  object resides in the cluster.
            },
            "severity": "str"  # Optional. Can be one of error, warning
              or suggestion.
        }
    ],
    "requested_at": "2020-02-20 00:00:00",  # Optional. A time value given in
      ISO8601 combined date and time format that represents when the schedule
      clusterlint run request was made.
    "run_id": "str"  # Optional. Id of the clusterlint run that can be used later
      to fetch the diagnostics.
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_cluster_user(cluster_id: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve User Information for a Kubernetes Cluster.

To show information the user associated with a Kubernetes cluster, send a GET request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/user.

Parameters:

cluster_id (str) – A unique ID that can be used to reference a Kubernetes cluster. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "kubernetes_cluster_user": {
        "groups": [
            "str"  # Optional. A list of in-cluster groups that the user
              belongs to.
        ],
        "username": "str"  # Optional. The username for the cluster admin
          user.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_credentials(cluster_id: str, *, expiry_seconds: int = 0, **kwargs: Any) MutableMapping[str, Any]

Retrieve Credentials for a Kubernetes Cluster.

This endpoint returns a JSON object . It can be used to programmatically construct Kubernetes clients which cannot parse kubeconfig files.

The resulting JSON object contains token-based authentication for clusters supporting it, and certificate-based authentication otherwise. For a list of supported versions and more information, see “How to Connect to a DigitalOcean Kubernetes Cluster with kubectl“.

To retrieve credentials for accessing a Kubernetes cluster, send a GET request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/credentials.

Clusters supporting token-based authentication may define an expiration by passing a duration in seconds as a query parameter to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/credentials?expiry_seconds=$DURATION_IN_SECONDS. If not set or 0, then the token will have a 7 day expiry. The query parameter has no impact in certificate-based authentication.

Parameters:
  • cluster_id (str) – A unique ID that can be used to reference a Kubernetes cluster. Required.

  • expiry_seconds (int) – The duration in seconds that the returned Kubernetes credentials will be valid. If not set or 0, the credentials will have a 7 day expiry. Default value is 0.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "certificate_authority_data": bytes("bytes", encoding="utf-8"),  # Optional.
      A base64 encoding of bytes representing the certificate authority data for
      accessing the cluster.
    "client_certificate_data": bytes("bytes", encoding="utf-8"),  # Optional. A
      base64 encoding of bytes representing the x509 client"ncertificate data for
      access the cluster. This is only returned for clusters"nwithout support for
      token-based authentication."n"nNewly created Kubernetes clusters do not return
      credentials using"ncertificate-based authentication. For additional
      information,"n`see here
      <https://www.digitalocean.com/docs/kubernetes/how-to/connect-to-cluster/#authenticate>`_.
    "client_key_data": bytes("bytes", encoding="utf-8"),  # Optional. A base64
      encoding of bytes representing the x509 client key"ndata for access the cluster.
      This is only returned for clusters without"nsupport for token-based
      authentication."n"nNewly created Kubernetes clusters do not return credentials
      using"ncertificate-based authentication. For additional information,"n`see here
      <https://www.digitalocean.com/docs/kubernetes/how-to/connect-to-cluster/#authenticate>`_.
    "expires_at": "2020-02-20 00:00:00",  # Optional. A time value given in
      ISO8601 combined date and time format that represents when the access token
      expires.
    "server": "str",  # Optional. The URL used to access the cluster API server.
    "token": "str"  # Optional. An access token used to authenticate with the
      cluster. This is only returned for clusters with support for token-based
      authentication.
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_kubeconfig(cluster_id: str, *, expiry_seconds: int = 0, **kwargs: Any) Optional[MutableMapping[str, Any]]

Retrieve the kubeconfig for a Kubernetes Cluster.

This endpoint returns a kubeconfig file in YAML format. It can be used to connect to and administer the cluster using the Kubernetes command line tool, kubectl, or other programs supporting kubeconfig files (e.g., client libraries).

The resulting kubeconfig file uses token-based authentication for clusters supporting it, and certificate-based authentication otherwise. For a list of supported versions and more information, see “How to Connect to a DigitalOcean Kubernetes Cluster with kubectl“.

To retrieve a kubeconfig file for use with a Kubernetes cluster, send a GET request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/kubeconfig.

Clusters supporting token-based authentication may define an expiration by passing a duration in seconds as a query parameter to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/kubeconfig?expiry_seconds=$DURATION_IN_SECONDS. If not set or 0, then the token will have a 7 day expiry. The query parameter has no impact in certificate-based authentication.

Parameters:
  • cluster_id (str) – A unique ID that can be used to reference a Kubernetes cluster. Required.

  • expiry_seconds (int) – The duration in seconds that the returned Kubernetes credentials will be valid. If not set or 0, the credentials will have a 7 day expiry. Default value is 0.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_node_pool(cluster_id: str, node_pool_id: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve a Node Pool for a Kubernetes Cluster.

To show information about a specific node pool in a Kubernetes cluster, send a GET request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_ID.

Parameters:
  • cluster_id (str) – A unique ID that can be used to reference a Kubernetes cluster. Required.

  • node_pool_id (str) – A unique ID that can be used to reference a Kubernetes node pool. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "node_pool": {
        "auto_scale": bool,  # Optional. A boolean value indicating whether
          auto-scaling is enabled for this node pool.
        "count": 0,  # Optional. The number of Droplet instances in the node
          pool.
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference a specific node pool.
        "labels": {},  # Optional. An object of key/value mappings specifying
          labels to apply to all nodes in a pool. Labels will automatically be applied
          to all existing nodes and any subsequent nodes added to the pool. Note that
          when a label is removed, it is not deleted from the nodes in the pool.
        "max_nodes": 0,  # Optional. The maximum number of nodes that this
          node pool can be auto-scaled to. The value will be ``0`` if ``auto_scale`` is
          set to ``false``.
        "min_nodes": 0,  # Optional. The minimum number of nodes that this
          node pool can be auto-scaled to. The value will be ``0`` if ``auto_scale`` is
          set to ``false``.
        "name": "str",  # Optional. A human-readable name for the node pool.
        "nodes": [
            {
                "created_at": "2020-02-20 00:00:00",  # Optional. A
                  time value given in ISO8601 combined date and time format that
                  represents when the node was created.
                "droplet_id": "str",  # Optional. The ID of the
                  Droplet used for the worker node.
                "id": "str",  # Optional. A unique ID that can be
                  used to identify and reference the node.
                "name": "str",  # Optional. An automatically
                  generated, human-readable name for the node.
                "status": {
                    "state": "str"  # Optional. A string
                      indicating the current status of the node. Known values are:
                      "provisioning", "running", "draining", and "deleting".
                },
                "updated_at": "2020-02-20 00:00:00"  # Optional. A
                  time value given in ISO8601 combined date and time format that
                  represents when the node was last updated.
            }
        ],
        "size": "str",  # Optional. The slug identifier for the type of
          Droplet used as workers in the node pool.
        "tags": [
            "str"  # Optional. An array containing the tags applied to
              the node pool. All node pools are automatically tagged ``k8s``"" ,
              ``k8s-worker``"" , and ``k8s:$K8S_CLUSTER_ID``.
        ],
        "taints": [
            {
                "effect": "str",  # Optional. How the node reacts to
                  pods that it won't tolerate. Available effect values are
                  ``NoSchedule``"" , ``PreferNoSchedule``"" , and ``NoExecute``. Known
                  values are: "NoSchedule", "PreferNoSchedule", and "NoExecute".
                "key": "str",  # Optional. An arbitrary string. The
                  ``key`` and ``value`` fields of the ``taint`` object form a key-value
                  pair. For example, if the value of the ``key`` field is "special" and
                  the value of the ``value`` field is "gpu", the key value pair would
                  be ``special=gpu``.
                "value": "str"  # Optional. An arbitrary string. The
                  ``key`` and ``value`` fields of the ``taint`` object form a key-value
                  pair. For example, if the value of the ``key`` field is "special" and
                  the value of the ``value`` field is "gpu", the key value pair would
                  be ``special=gpu``.
            }
        ]
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_associated_resources(cluster_id: str, **kwargs: Any) MutableMapping[str, Any]

List Associated Resources for Cluster Deletion.

To list the associated billable resources that can be destroyed along with a cluster, send a GET request to the /v2/kubernetes/clusters/$K8S_CLUSTER_ID/destroy_with_associated_resources endpoint.

Parameters:

cluster_id (str) – A unique ID that can be used to reference a Kubernetes cluster. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "load_balancers": [
        {
            "id": "str",  # Optional. The ID of a resource associated
              with a Kubernetes cluster.
            "name": "str"  # Optional. The name of a resource associated
              with a Kubernetes cluster.
        }
    ],
    "volume_snapshots": [
        {
            "id": "str",  # Optional. The ID of a resource associated
              with a Kubernetes cluster.
            "name": "str"  # Optional. The name of a resource associated
              with a Kubernetes cluster.
        }
    ],
    "volumes": [
        {
            "id": "str",  # Optional. The ID of a resource associated
              with a Kubernetes cluster.
            "name": "str"  # Optional. The name of a resource associated
              with a Kubernetes cluster.
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_clusters(*, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All Kubernetes Clusters.

To list all of the Kubernetes clusters on your account, send a GET request to /v2/kubernetes/clusters.

Parameters:
  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "kubernetes_clusters": [
        {
            "auto_upgrade": False,  # Optional. Default value is False. A
              boolean value indicating whether the cluster will be automatically
              upgraded to new patch releases during its maintenance window.
            "cluster_subnet": "str",  # Optional. The range of IP
              addresses in the overlay network of the Kubernetes cluster in CIDR
              notation.
            "created_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the Kubernetes cluster was created.
            "endpoint": "str",  # Optional. The base URL of the API
              server on the Kubernetes master node.
            "ha": False,  # Optional. Default value is False. A boolean
              value indicating whether the control plane is run in a highly available
              configuration in the cluster. Highly available control planes incur less
              downtime. The property cannot be disabled.
            "id": "str",  # Optional. A unique ID that can be used to
              identify and reference a Kubernetes cluster.
            "ipv4": "str",  # Optional. The public IPv4 address of the
              Kubernetes master node. This will not be set if high availability is
              configured on the cluster (v1.21+).
            "maintenance_policy": {
                "day": "str",  # Optional. The day of the maintenance
                  window policy. May be one of ``monday`` through ``sunday``"" , or
                  ``any`` to indicate an arbitrary week day. Known values are: "any",
                  "monday", "tuesday", "wednesday", "thursday", "friday", "saturday",
                  and "sunday".
                "duration": "str",  # Optional. The duration of the
                  maintenance window policy in human-readable format.
                "start_time": "str"  # Optional. The start time in
                  UTC of the maintenance window policy in 24-hour clock format / HH:MM
                  notation (e.g., ``15:00``"" ).
            },
            "name": "str",  # A human-readable name for a Kubernetes
              cluster. Required.
            "node_pools": [
                {
                    "auto_scale": bool,  # Optional. A boolean
                      value indicating whether auto-scaling is enabled for this node
                      pool.
                    "count": 0,  # Optional. The number of
                      Droplet instances in the node pool.
                    "id": "str",  # Optional. A unique ID that
                      can be used to identify and reference a specific node pool.
                    "labels": {},  # Optional. An object of
                      key/value mappings specifying labels to apply to all nodes in a
                      pool. Labels will automatically be applied to all existing nodes
                      and any subsequent nodes added to the pool. Note that when a
                      label is removed, it is not deleted from the nodes in the pool.
                    "max_nodes": 0,  # Optional. The maximum
                      number of nodes that this node pool can be auto-scaled to. The
                      value will be ``0`` if ``auto_scale`` is set to ``false``.
                    "min_nodes": 0,  # Optional. The minimum
                      number of nodes that this node pool can be auto-scaled to. The
                      value will be ``0`` if ``auto_scale`` is set to ``false``.
                    "name": "str",  # Optional. A human-readable
                      name for the node pool.
                    "nodes": [
                        {
                            "created_at": "2020-02-20
                              00:00:00",  # Optional. A time value given in ISO8601
                              combined date and time format that represents when the
                              node was created.
                            "droplet_id": "str",  #
                              Optional. The ID of the Droplet used for the worker node.
                            "id": "str",  # Optional. A
                              unique ID that can be used to identify and reference the
                              node.
                            "name": "str",  # Optional.
                              An automatically generated, human-readable name for the
                              node.
                            "status": {
                                "state": "str"  #
                                  Optional. A string indicating the current status of
                                  the node. Known values are: "provisioning",
                                  "running", "draining", and "deleting".
                            },
                            "updated_at": "2020-02-20
                              00:00:00"  # Optional. A time value given in ISO8601
                              combined date and time format that represents when the
                              node was last updated.
                        }
                    ],
                    "size": "str",  # Optional. The slug
                      identifier for the type of Droplet used as workers in the node
                      pool.
                    "tags": [
                        "str"  # Optional. An array
                          containing the tags applied to the node pool. All node pools
                          are automatically tagged ``k8s``"" , ``k8s-worker``"" , and
                          ``k8s:$K8S_CLUSTER_ID``.
                    ],
                    "taints": [
                        {
                            "effect": "str",  # Optional.
                              How the node reacts to pods that it won't tolerate.
                              Available effect values are ``NoSchedule``"" ,
                              ``PreferNoSchedule``"" , and ``NoExecute``. Known values
                              are: "NoSchedule", "PreferNoSchedule", and "NoExecute".
                            "key": "str",  # Optional. An
                              arbitrary string. The ``key`` and ``value`` fields of the
                              ``taint`` object form a key-value pair. For example, if
                              the value of the ``key`` field is "special" and the value
                              of the ``value`` field is "gpu", the key value pair would
                              be ``special=gpu``.
                            "value": "str"  # Optional.
                              An arbitrary string. The ``key`` and ``value`` fields of
                              the ``taint`` object form a key-value pair. For example,
                              if the value of the ``key`` field is "special" and the
                              value of the ``value`` field is "gpu", the key value pair
                              would be ``special=gpu``.
                        }
                    ]
                }
            ],
            "region": "str",  # The slug identifier for the region where
              the Kubernetes cluster is located. Required.
            "registry_enabled": bool,  # Optional. A read-only boolean
              value indicating if a container registry is integrated with the cluster.
            "service_subnet": "str",  # Optional. The range of assignable
              IP addresses for services running in the Kubernetes cluster in CIDR
              notation.
            "status": {
                "message": "str",  # Optional. An optional message
                  providing additional information about the current cluster state.
                "state": "str"  # Optional. A string indicating the
                  current status of the cluster. Known values are: "running",
                  "provisioning", "degraded", "error", "deleted", "upgrading", and
                  "deleting".
            },
            "surge_upgrade": False,  # Optional. Default value is False.
              A boolean value indicating whether surge upgrade is enabled/disabled for
              the cluster. Surge upgrade makes cluster upgrades fast and reliable by
              bringing up new nodes before destroying the outdated nodes.
            "tags": [
                "str"  # Optional. An array of tags applied to the
                  Kubernetes cluster. All clusters are automatically tagged ``k8s`` and
                  ``k8s:$K8S_CLUSTER_ID``.
            ],
            "updated_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the Kubernetes cluster was last updated.
            "version": "str",  # The slug identifier for the version of
              Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"),
              the latest version within it will be used (e.g. "1.14.6-do.1"); if set to
              "latest", the latest published version will be used. See the
              ``/v2/kubernetes/options`` endpoint to find all currently available
              versions. Required.
            "vpc_uuid": "str"  # Optional. A string specifying the UUID
              of the VPC to which the Kubernetes cluster is assigned.
        }
    ],
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
list_node_pools(cluster_id: str, **kwargs: Any) MutableMapping[str, Any]

List All Node Pools in a Kubernetes Clusters.

To list all of the node pools in a Kubernetes clusters, send a GET request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools.

Parameters:

cluster_id (str) – A unique ID that can be used to reference a Kubernetes cluster. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "node_pools": [
        {
            "auto_scale": bool,  # Optional. A boolean value indicating
              whether auto-scaling is enabled for this node pool.
            "count": 0,  # Optional. The number of Droplet instances in
              the node pool.
            "id": "str",  # Optional. A unique ID that can be used to
              identify and reference a specific node pool.
            "labels": {},  # Optional. An object of key/value mappings
              specifying labels to apply to all nodes in a pool. Labels will
              automatically be applied to all existing nodes and any subsequent nodes
              added to the pool. Note that when a label is removed, it is not deleted
              from the nodes in the pool.
            "max_nodes": 0,  # Optional. The maximum number of nodes that
              this node pool can be auto-scaled to. The value will be ``0`` if
              ``auto_scale`` is set to ``false``.
            "min_nodes": 0,  # Optional. The minimum number of nodes that
              this node pool can be auto-scaled to. The value will be ``0`` if
              ``auto_scale`` is set to ``false``.
            "name": "str",  # Optional. A human-readable name for the
              node pool.
            "nodes": [
                {
                    "created_at": "2020-02-20 00:00:00",  #
                      Optional. A time value given in ISO8601 combined date and time
                      format that represents when the node was created.
                    "droplet_id": "str",  # Optional. The ID of
                      the Droplet used for the worker node.
                    "id": "str",  # Optional. A unique ID that
                      can be used to identify and reference the node.
                    "name": "str",  # Optional. An automatically
                      generated, human-readable name for the node.
                    "status": {
                        "state": "str"  # Optional. A string
                          indicating the current status of the node. Known values are:
                          "provisioning", "running", "draining", and "deleting".
                    },
                    "updated_at": "2020-02-20 00:00:00"  #
                      Optional. A time value given in ISO8601 combined date and time
                      format that represents when the node was last updated.
                }
            ],
            "size": "str",  # Optional. The slug identifier for the type
              of Droplet used as workers in the node pool.
            "tags": [
                "str"  # Optional. An array containing the tags
                  applied to the node pool. All node pools are automatically tagged
                  ``k8s``"" , ``k8s-worker``"" , and ``k8s:$K8S_CLUSTER_ID``.
            ],
            "taints": [
                {
                    "effect": "str",  # Optional. How the node
                      reacts to pods that it won't tolerate. Available effect values
                      are ``NoSchedule``"" , ``PreferNoSchedule``"" , and
                      ``NoExecute``. Known values are: "NoSchedule",
                      "PreferNoSchedule", and "NoExecute".
                    "key": "str",  # Optional. An arbitrary
                      string. The ``key`` and ``value`` fields of the ``taint`` object
                      form a key-value pair. For example, if the value of the ``key``
                      field is "special" and the value of the ``value`` field is "gpu",
                      the key value pair would be ``special=gpu``.
                    "value": "str"  # Optional. An arbitrary
                      string. The ``key`` and ``value`` fields of the ``taint`` object
                      form a key-value pair. For example, if the value of the ``key``
                      field is "special" and the value of the ``value`` field is "gpu",
                      the key value pair would be ``special=gpu``.
                }
            ]
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_options(**kwargs: Any) MutableMapping[str, Any]

List Available Regions, Node Sizes, and Versions of Kubernetes.

To list the versions of Kubernetes available for use, the regions that support Kubernetes, and the available node sizes, send a GET request to /v2/kubernetes/options.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "options": {
        "regions": [
            {
                "name": "str",  # Optional. A DigitalOcean region
                  where Kubernetes is available.
                "slug": "str"  # Optional. The identifier for a
                  region for use when creating a new cluster.
            }
        ],
        "sizes": [
            {
                "name": "str",  # Optional. A Droplet size available
                  for use in a Kubernetes node pool.
                "slug": "str"  # Optional. The identifier for a size
                  for use when creating a new cluster.
            }
        ],
        "versions": [
            {
                "kubernetes_version": "str",  # Optional. The
                  upstream version string for the version of Kubernetes provided by a
                  given slug.
                "slug": "str",  # Optional. The slug identifier for
                  an available version of Kubernetes for use when creating or updating
                  a cluster. The string contains both the upstream version of
                  Kubernetes as well as the DigitalOcean revision.
                "supported_features": [
                    "str"  # Optional. The features available
                      with the version of Kubernetes provided by a given slug.
                ]
            }
        ]
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
recycle_node_pool(cluster_id: str, node_pool_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
recycle_node_pool(cluster_id: str, node_pool_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Recycle a Kubernetes Node Pool.

The endpoint has been deprecated. Please use the DELETE /v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_ID/nodes/$NODE_ID method instead.

Parameters:
  • cluster_id (str) – A unique ID that can be used to reference a Kubernetes cluster. Required.

  • node_pool_id (str) – A unique ID that can be used to reference a Kubernetes node pool. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
remove_registry(body: Optional[JSON] = None, *, content_type: str = 'application/json', **kwargs: Any) None
remove_registry(body: Optional[IO] = None, *, content_type: str = 'application/json', **kwargs: Any) None

Remove Container Registry from Kubernetes Clusters.

To remove the container registry from Kubernetes clusters, send a DELETE request to /v2/kubernetes/registry.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Default value is None.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

None

Return type:

None

Raises:

HttpResponseError

run_cluster_lint(cluster_id: str, body: Optional[JSON] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON
run_cluster_lint(cluster_id: str, body: Optional[IO] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON

Run Clusterlint Checks on a Kubernetes Cluster.

Clusterlint helps operators conform to Kubernetes best practices around resources, security and reliability to avoid common problems while operating or upgrading the clusters.

To request a clusterlint run on your cluster, send a POST request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/clusterlint. This will run all checks present in the doks group by default, if a request body is not specified. Optionally specify the below attributes.

For information about the available checks, please refer to the clusterlint check documentation.

Parameters:
  • cluster_id (str) – A unique ID that can be used to reference a Kubernetes cluster. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Default value is None.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 202
response == {
    "run_id": "str"  # Optional. ID of the clusterlint run that can be used later
      to fetch the diagnostics.
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
update_cluster(cluster_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
update_cluster(cluster_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Update a Kubernetes Cluster.

To update a Kubernetes cluster, send a PUT request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID and specify one or more of the attributes below.

Parameters:
  • cluster_id (str) – A unique ID that can be used to reference a Kubernetes cluster. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 202
response == {
    "kubernetes_cluster": {
        "auto_upgrade": False,  # Optional. Default value is False. A boolean
          value indicating whether the cluster will be automatically upgraded to new
          patch releases during its maintenance window.
        "cluster_subnet": "str",  # Optional. The range of IP addresses in
          the overlay network of the Kubernetes cluster in CIDR notation.
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the Kubernetes
          cluster was created.
        "endpoint": "str",  # Optional. The base URL of the API server on the
          Kubernetes master node.
        "ha": False,  # Optional. Default value is False. A boolean value
          indicating whether the control plane is run in a highly available
          configuration in the cluster. Highly available control planes incur less
          downtime. The property cannot be disabled.
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference a Kubernetes cluster.
        "ipv4": "str",  # Optional. The public IPv4 address of the Kubernetes
          master node. This will not be set if high availability is configured on the
          cluster (v1.21+).
        "maintenance_policy": {
            "day": "str",  # Optional. The day of the maintenance window
              policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to
              indicate an arbitrary week day. Known values are: "any", "monday",
              "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday".
            "duration": "str",  # Optional. The duration of the
              maintenance window policy in human-readable format.
            "start_time": "str"  # Optional. The start time in UTC of the
              maintenance window policy in 24-hour clock format / HH:MM notation (e.g.,
              ``15:00``"" ).
        },
        "name": "str",  # A human-readable name for a Kubernetes cluster.
          Required.
        "node_pools": [
            {
                "auto_scale": bool,  # Optional. A boolean value
                  indicating whether auto-scaling is enabled for this node pool.
                "count": 0,  # Optional. The number of Droplet
                  instances in the node pool.
                "id": "str",  # Optional. A unique ID that can be
                  used to identify and reference a specific node pool.
                "labels": {},  # Optional. An object of key/value
                  mappings specifying labels to apply to all nodes in a pool. Labels
                  will automatically be applied to all existing nodes and any
                  subsequent nodes added to the pool. Note that when a label is
                  removed, it is not deleted from the nodes in the pool.
                "max_nodes": 0,  # Optional. The maximum number of
                  nodes that this node pool can be auto-scaled to. The value will be
                  ``0`` if ``auto_scale`` is set to ``false``.
                "min_nodes": 0,  # Optional. The minimum number of
                  nodes that this node pool can be auto-scaled to. The value will be
                  ``0`` if ``auto_scale`` is set to ``false``.
                "name": "str",  # Optional. A human-readable name for
                  the node pool.
                "nodes": [
                    {
                        "created_at": "2020-02-20 00:00:00",
                          # Optional. A time value given in ISO8601 combined date and
                          time format that represents when the node was created.
                        "droplet_id": "str",  # Optional. The
                          ID of the Droplet used for the worker node.
                        "id": "str",  # Optional. A unique ID
                          that can be used to identify and reference the node.
                        "name": "str",  # Optional. An
                          automatically generated, human-readable name for the node.
                        "status": {
                            "state": "str"  # Optional. A
                              string indicating the current status of the node. Known
                              values are: "provisioning", "running", "draining", and
                              "deleting".
                        },
                        "updated_at": "2020-02-20 00:00:00"
                          # Optional. A time value given in ISO8601 combined date and
                          time format that represents when the node was last updated.
                    }
                ],
                "size": "str",  # Optional. The slug identifier for
                  the type of Droplet used as workers in the node pool.
                "tags": [
                    "str"  # Optional. An array containing the
                      tags applied to the node pool. All node pools are automatically
                      tagged ``k8s``"" , ``k8s-worker``"" , and
                      ``k8s:$K8S_CLUSTER_ID``.
                ],
                "taints": [
                    {
                        "effect": "str",  # Optional. How the
                          node reacts to pods that it won't tolerate. Available effect
                          values are ``NoSchedule``"" , ``PreferNoSchedule``"" , and
                          ``NoExecute``. Known values are: "NoSchedule",
                          "PreferNoSchedule", and "NoExecute".
                        "key": "str",  # Optional. An
                          arbitrary string. The ``key`` and ``value`` fields of the
                          ``taint`` object form a key-value pair. For example, if the
                          value of the ``key`` field is "special" and the value of the
                          ``value`` field is "gpu", the key value pair would be
                          ``special=gpu``.
                        "value": "str"  # Optional. An
                          arbitrary string. The ``key`` and ``value`` fields of the
                          ``taint`` object form a key-value pair. For example, if the
                          value of the ``key`` field is "special" and the value of the
                          ``value`` field is "gpu", the key value pair would be
                          ``special=gpu``.
                    }
                ]
            }
        ],
        "region": "str",  # The slug identifier for the region where the
          Kubernetes cluster is located. Required.
        "registry_enabled": bool,  # Optional. A read-only boolean value
          indicating if a container registry is integrated with the cluster.
        "service_subnet": "str",  # Optional. The range of assignable IP
          addresses for services running in the Kubernetes cluster in CIDR notation.
        "status": {
            "message": "str",  # Optional. An optional message providing
              additional information about the current cluster state.
            "state": "str"  # Optional. A string indicating the current
              status of the cluster. Known values are: "running", "provisioning",
              "degraded", "error", "deleted", "upgrading", and "deleting".
        },
        "surge_upgrade": False,  # Optional. Default value is False. A
          boolean value indicating whether surge upgrade is enabled/disabled for the
          cluster. Surge upgrade makes cluster upgrades fast and reliable by bringing
          up new nodes before destroying the outdated nodes.
        "tags": [
            "str"  # Optional. An array of tags applied to the Kubernetes
              cluster. All clusters are automatically tagged ``k8s`` and
              ``k8s:$K8S_CLUSTER_ID``.
        ],
        "updated_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the Kubernetes
          cluster was last updated.
        "version": "str",  # The slug identifier for the version of
          Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the
          latest version within it will be used (e.g. "1.14.6-do.1"); if set to
          "latest", the latest published version will be used. See the
          ``/v2/kubernetes/options`` endpoint to find all currently available versions.
          Required.
        "vpc_uuid": "str"  # Optional. A string specifying the UUID of the
          VPC to which the Kubernetes cluster is assigned.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
update_node_pool(cluster_id: str, node_pool_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
update_node_pool(cluster_id: str, node_pool_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Update a Node Pool in a Kubernetes Cluster.

To update the name of a node pool, edit the tags applied to it, or adjust its number of nodes, send a PUT request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_ID with the following attributes.

Parameters:
  • cluster_id (str) – A unique ID that can be used to reference a Kubernetes cluster. Required.

  • node_pool_id (str) – A unique ID that can be used to reference a Kubernetes node pool. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 202
response == {
    "node_pool": {
        "auto_scale": bool,  # Optional. A boolean value indicating whether
          auto-scaling is enabled for this node pool.
        "count": 0,  # Optional. The number of Droplet instances in the node
          pool.
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference a specific node pool.
        "labels": {},  # Optional. An object of key/value mappings specifying
          labels to apply to all nodes in a pool. Labels will automatically be applied
          to all existing nodes and any subsequent nodes added to the pool. Note that
          when a label is removed, it is not deleted from the nodes in the pool.
        "max_nodes": 0,  # Optional. The maximum number of nodes that this
          node pool can be auto-scaled to. The value will be ``0`` if ``auto_scale`` is
          set to ``false``.
        "min_nodes": 0,  # Optional. The minimum number of nodes that this
          node pool can be auto-scaled to. The value will be ``0`` if ``auto_scale`` is
          set to ``false``.
        "name": "str",  # Optional. A human-readable name for the node pool.
        "nodes": [
            {
                "created_at": "2020-02-20 00:00:00",  # Optional. A
                  time value given in ISO8601 combined date and time format that
                  represents when the node was created.
                "droplet_id": "str",  # Optional. The ID of the
                  Droplet used for the worker node.
                "id": "str",  # Optional. A unique ID that can be
                  used to identify and reference the node.
                "name": "str",  # Optional. An automatically
                  generated, human-readable name for the node.
                "status": {
                    "state": "str"  # Optional. A string
                      indicating the current status of the node. Known values are:
                      "provisioning", "running", "draining", and "deleting".
                },
                "updated_at": "2020-02-20 00:00:00"  # Optional. A
                  time value given in ISO8601 combined date and time format that
                  represents when the node was last updated.
            }
        ],
        "size": "str",  # Optional. The slug identifier for the type of
          Droplet used as workers in the node pool.
        "tags": [
            "str"  # Optional. An array containing the tags applied to
              the node pool. All node pools are automatically tagged ``k8s``"" ,
              ``k8s-worker``"" , and ``k8s:$K8S_CLUSTER_ID``.
        ],
        "taints": [
            {
                "effect": "str",  # Optional. How the node reacts to
                  pods that it won't tolerate. Available effect values are
                  ``NoSchedule``"" , ``PreferNoSchedule``"" , and ``NoExecute``. Known
                  values are: "NoSchedule", "PreferNoSchedule", and "NoExecute".
                "key": "str",  # Optional. An arbitrary string. The
                  ``key`` and ``value`` fields of the ``taint`` object form a key-value
                  pair. For example, if the value of the ``key`` field is "special" and
                  the value of the ``value`` field is "gpu", the key value pair would
                  be ``special=gpu``.
                "value": "str"  # Optional. An arbitrary string. The
                  ``key`` and ``value`` fields of the ``taint`` object form a key-value
                  pair. For example, if the value of the ``key`` field is "special" and
                  the value of the ``value`` field is "gpu", the key value pair would
                  be ``special=gpu``.
            }
        ]
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
upgrade_cluster(cluster_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
upgrade_cluster(cluster_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Upgrade a Kubernetes Cluster.

To immediately upgrade a Kubernetes cluster to a newer patch release of Kubernetes, send a POST request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/upgrade. The body of the request must specify a version attribute.

Available upgrade versions for a cluster can be fetched from /v2/kubernetes/clusters/$K8S_CLUSTER_ID/upgrades.

Parameters:
  • cluster_id (str) – A unique ID that can be used to reference a Kubernetes cluster. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
class pydo.operations.LoadBalancersOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s load_balancers attribute.

add_droplets(lb_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
add_droplets(lb_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Add Droplets to a Load Balancer.

To assign a Droplet to a load balancer instance, send a POST request to /v2/load_balancers/$LOAD_BALANCER_ID/droplets. In the body of the request, there should be a droplet_ids attribute containing a list of Droplet IDs. Individual Droplets can not be added to a load balancer configured with a Droplet tag. Attempting to do so will result in a “422 Unprocessable Entity” response from the API.

No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data.

Parameters:
  • lb_id (str) – A unique identifier for a load balancer. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
add_forwarding_rules(lb_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
add_forwarding_rules(lb_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Add Forwarding Rules to a Load Balancer.

To add an additional forwarding rule to a load balancer instance, send a POST request to /v2/load_balancers/$LOAD_BALANCER_ID/forwarding_rules. In the body of the request, there should be a forwarding_rules attribute containing an array of rules to be added.

No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data.

Parameters:
  • lb_id (str) – A unique identifier for a load balancer. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
create(body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
create(body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create a New Load Balancer.

To create a new load balancer instance, send a POST request to /v2/load_balancers.

You can specify the Droplets that will sit behind the load balancer using one of two methods:

  • Set droplet_ids to a list of specific Droplet IDs.

  • Set tag to the name of a tag. All Droplets with this tag applied will be assigned to the load balancer. Additional Droplets will be automatically assigned as they are tagged.

These methods are mutually exclusive.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 202
response == {
    "load_balancer": {
        "algorithm": "round_robin",  # Optional. Default value is
          "round_robin". This field has been deprecated. You can no longer specify an
          algorithm for load balancers. Known values are: "round_robin" and
          "least_connections".
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the load
          balancer was created.
        "disable_lets_encrypt_dns_records": False,  # Optional. Default value
          is False. A boolean value indicating whether to disable automatic DNS record
          creation for Let's Encrypt certificates that are added to the load balancer.
        "enable_backend_keepalive": False,  # Optional. Default value is
          False. A boolean value indicating whether HTTP keepalive connections are
          maintained to target Droplets.
        "enable_proxy_protocol": False,  # Optional. Default value is False.
          A boolean value indicating whether PROXY Protocol is in use.
        "firewall": {
            "allow": [
                "str"  # Optional. the rules for allowing traffic to
                  the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16').
            ],
            "deny": [
                "str"  # Optional. the rules for denying traffic to
                  the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16').
            ]
        },
        "forwarding_rules": [
            {
                "certificate_id": "str",  # Optional. The ID of the
                  TLS certificate used for SSL termination if enabled.
                "entry_port": 0,  # An integer representing the port
                  on which the load balancer instance will listen. Required.
                "entry_protocol": "str",  # The protocol used for
                  traffic to the load balancer. The possible values are: ``http``"" ,
                  ``https``"" , ``http2``"" , ``http3``"" , ``tcp``"" , or ``udp``. If
                  you set the  ``entry_protocol`` to ``udp``"" , the
                  ``target_protocol`` must be set to ``udp``.  When using UDP, the load
                  balancer requires that you set up a health  check with a port that
                  uses TCP, HTTP, or HTTPS to work properly. Required. Known values
                  are: "http", "https", "http2", "http3", "tcp", and "udp".
                "target_port": 0,  # An integer representing the port
                  on the backend Droplets to which the load balancer will send traffic.
                  Required.
                "target_protocol": "str",  # The protocol used for
                  traffic from the load balancer to the backend Droplets. The possible
                  values are: ``http``"" , ``https``"" , ``http2``"" , ``tcp``"" , or
                  ``udp``. If you set the ``target_protocol`` to ``udp``"" , the
                  ``entry_protocol`` must be set to  ``udp``. When using UDP, the load
                  balancer requires that you set up a health  check with a port that
                  uses TCP, HTTP, or HTTPS to work properly. Required. Known values
                  are: "http", "https", "http2", "tcp", and "udp".
                "tls_passthrough": bool  # Optional. A boolean value
                  indicating whether SSL encrypted traffic will be passed through to
                  the backend Droplets.
            }
        ],
        "health_check": {
            "check_interval_seconds": 10,  # Optional. Default value is
              10. The number of seconds between between two consecutive health checks.
            "healthy_threshold": 3,  # Optional. Default value is 3. The
              number of times a health check must pass for a backend Droplet to be
              marked "healthy" and be re-added to the pool.
            "path": "/",  # Optional. Default value is "/". The path on
              the backend Droplets to which the load balancer instance will send a
              request.
            "port": 80,  # Optional. Default value is 80. An integer
              representing the port on the backend Droplets on which the health check
              will attempt a connection.
            "protocol": "http",  # Optional. Default value is "http". The
              protocol used for health checks sent to the backend Droplets. The
              possible values are ``http``"" , ``https``"" , or ``tcp``. Known values
              are: "http", "https", and "tcp".
            "response_timeout_seconds": 5,  # Optional. Default value is
              5. The number of seconds the load balancer instance will wait for a
              response until marking a health check as failed.
            "unhealthy_threshold": 5  # Optional. Default value is 5. The
              number of times a health check must fail for a backend Droplet to be
              marked "unhealthy" and be removed from the pool.
        },
        "http_idle_timeout_seconds": 60,  # Optional. Default value is 60. An
          integer value which configures the idle timeout for HTTP requests to the
          target droplets.
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference a load balancer.
        "ip": "str",  # Optional. An attribute containing the public-facing
          IP address of the load balancer.
        "name": "str",  # Optional. A human-readable name for a load balancer
          instance.
        "project_id": "str",  # Optional. The ID of the project that the load
          balancer is associated with. If no ID is provided at creation, the load
          balancer associates with the user's default project. If an invalid project ID
          is provided, the load balancer will not be created.
        "redirect_http_to_https": False,  # Optional. Default value is False.
          A boolean value indicating whether HTTP requests to the load balancer on port
          80 will be redirected to HTTPS on port 443.
        "size": "lb-small",  # Optional. Default value is "lb-small". This
          field has been replaced by the ``size_unit`` field for all regions except in
          AMS2, NYC2, and SFO1. Each available load balancer size now equates to the
          load balancer having a set number of nodes."n"n"n* ``lb-small`` = 1 node"n*
          ``lb-medium`` = 3 nodes"n* ``lb-large`` = 6 nodes"n"nYou can resize load
          balancers after creation up to once per hour. You cannot resize a load
          balancer within the first hour of its creation. Known values are: "lb-small",
          "lb-medium", and "lb-large".
        "size_unit": 1,  # Optional. Default value is 1. How many nodes the
          load balancer contains. Each additional node increases the load balancer's
          ability to manage more connections. Load balancers can be scaled up or down,
          and you can change the number of nodes after creation up to once per hour.
          This field is currently not available in the AMS2, NYC2, or SFO1 regions. Use
          the ``size`` field to scale load balancers that reside in these regions.
        "status": "str",  # Optional. A status string indicating the current
          state of the load balancer. This can be ``new``"" , ``active``"" , or
          ``errored``. Known values are: "new", "active", and "errored".
        "sticky_sessions": {
            "cookie_name": "str",  # Optional. The name of the cookie
              sent to the client. This attribute is only returned when using
              ``cookies`` for the sticky sessions type.
            "cookie_ttl_seconds": 0,  # Optional. The number of seconds
              until the cookie set by the load balancer expires. This attribute is only
              returned when using ``cookies`` for the sticky sessions type.
            "type": "none"  # Optional. Default value is "none". An
              attribute indicating how and if requests from a client will be
              persistently served by the same backend Droplet. The possible values are
              ``cookies`` or ``none``. Known values are: "cookies" and "none".
        },
        "tag": "str",  # Optional. The name of a Droplet tag corresponding to
          Droplets assigned to the load balancer.
        "vpc_uuid": "str"  # Optional. A string specifying the UUID of the
          VPC to which the load balancer is assigned.
    }
}
delete(lb_id: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete a Load Balancer.

To delete a load balancer instance, disassociating any Droplets assigned to it and removing it from your account, send a DELETE request to /v2/load_balancers/$LOAD_BALANCER_ID.

A successful request will receive a 204 status code with no body in response. This indicates that the request was processed successfully.

Parameters:

lb_id (str) – A unique identifier for a load balancer. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get(lb_id: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Load Balancer.

To show information about a load balancer instance, send a GET request to /v2/load_balancers/$LOAD_BALANCER_ID.

Parameters:

lb_id (str) – A unique identifier for a load balancer. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "load_balancer": {
        "algorithm": "round_robin",  # Optional. Default value is
          "round_robin". This field has been deprecated. You can no longer specify an
          algorithm for load balancers. Known values are: "round_robin" and
          "least_connections".
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the load
          balancer was created.
        "disable_lets_encrypt_dns_records": False,  # Optional. Default value
          is False. A boolean value indicating whether to disable automatic DNS record
          creation for Let's Encrypt certificates that are added to the load balancer.
        "enable_backend_keepalive": False,  # Optional. Default value is
          False. A boolean value indicating whether HTTP keepalive connections are
          maintained to target Droplets.
        "enable_proxy_protocol": False,  # Optional. Default value is False.
          A boolean value indicating whether PROXY Protocol is in use.
        "firewall": {
            "allow": [
                "str"  # Optional. the rules for allowing traffic to
                  the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16').
            ],
            "deny": [
                "str"  # Optional. the rules for denying traffic to
                  the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16').
            ]
        },
        "forwarding_rules": [
            {
                "certificate_id": "str",  # Optional. The ID of the
                  TLS certificate used for SSL termination if enabled.
                "entry_port": 0,  # An integer representing the port
                  on which the load balancer instance will listen. Required.
                "entry_protocol": "str",  # The protocol used for
                  traffic to the load balancer. The possible values are: ``http``"" ,
                  ``https``"" , ``http2``"" , ``http3``"" , ``tcp``"" , or ``udp``. If
                  you set the  ``entry_protocol`` to ``udp``"" , the
                  ``target_protocol`` must be set to ``udp``.  When using UDP, the load
                  balancer requires that you set up a health  check with a port that
                  uses TCP, HTTP, or HTTPS to work properly. Required. Known values
                  are: "http", "https", "http2", "http3", "tcp", and "udp".
                "target_port": 0,  # An integer representing the port
                  on the backend Droplets to which the load balancer will send traffic.
                  Required.
                "target_protocol": "str",  # The protocol used for
                  traffic from the load balancer to the backend Droplets. The possible
                  values are: ``http``"" , ``https``"" , ``http2``"" , ``tcp``"" , or
                  ``udp``. If you set the ``target_protocol`` to ``udp``"" , the
                  ``entry_protocol`` must be set to  ``udp``. When using UDP, the load
                  balancer requires that you set up a health  check with a port that
                  uses TCP, HTTP, or HTTPS to work properly. Required. Known values
                  are: "http", "https", "http2", "tcp", and "udp".
                "tls_passthrough": bool  # Optional. A boolean value
                  indicating whether SSL encrypted traffic will be passed through to
                  the backend Droplets.
            }
        ],
        "health_check": {
            "check_interval_seconds": 10,  # Optional. Default value is
              10. The number of seconds between between two consecutive health checks.
            "healthy_threshold": 3,  # Optional. Default value is 3. The
              number of times a health check must pass for a backend Droplet to be
              marked "healthy" and be re-added to the pool.
            "path": "/",  # Optional. Default value is "/". The path on
              the backend Droplets to which the load balancer instance will send a
              request.
            "port": 80,  # Optional. Default value is 80. An integer
              representing the port on the backend Droplets on which the health check
              will attempt a connection.
            "protocol": "http",  # Optional. Default value is "http". The
              protocol used for health checks sent to the backend Droplets. The
              possible values are ``http``"" , ``https``"" , or ``tcp``. Known values
              are: "http", "https", and "tcp".
            "response_timeout_seconds": 5,  # Optional. Default value is
              5. The number of seconds the load balancer instance will wait for a
              response until marking a health check as failed.
            "unhealthy_threshold": 5  # Optional. Default value is 5. The
              number of times a health check must fail for a backend Droplet to be
              marked "unhealthy" and be removed from the pool.
        },
        "http_idle_timeout_seconds": 60,  # Optional. Default value is 60. An
          integer value which configures the idle timeout for HTTP requests to the
          target droplets.
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference a load balancer.
        "ip": "str",  # Optional. An attribute containing the public-facing
          IP address of the load balancer.
        "name": "str",  # Optional. A human-readable name for a load balancer
          instance.
        "project_id": "str",  # Optional. The ID of the project that the load
          balancer is associated with. If no ID is provided at creation, the load
          balancer associates with the user's default project. If an invalid project ID
          is provided, the load balancer will not be created.
        "redirect_http_to_https": False,  # Optional. Default value is False.
          A boolean value indicating whether HTTP requests to the load balancer on port
          80 will be redirected to HTTPS on port 443.
        "size": "lb-small",  # Optional. Default value is "lb-small". This
          field has been replaced by the ``size_unit`` field for all regions except in
          AMS2, NYC2, and SFO1. Each available load balancer size now equates to the
          load balancer having a set number of nodes."n"n"n* ``lb-small`` = 1 node"n*
          ``lb-medium`` = 3 nodes"n* ``lb-large`` = 6 nodes"n"nYou can resize load
          balancers after creation up to once per hour. You cannot resize a load
          balancer within the first hour of its creation. Known values are: "lb-small",
          "lb-medium", and "lb-large".
        "size_unit": 1,  # Optional. Default value is 1. How many nodes the
          load balancer contains. Each additional node increases the load balancer's
          ability to manage more connections. Load balancers can be scaled up or down,
          and you can change the number of nodes after creation up to once per hour.
          This field is currently not available in the AMS2, NYC2, or SFO1 regions. Use
          the ``size`` field to scale load balancers that reside in these regions.
        "status": "str",  # Optional. A status string indicating the current
          state of the load balancer. This can be ``new``"" , ``active``"" , or
          ``errored``. Known values are: "new", "active", and "errored".
        "sticky_sessions": {
            "cookie_name": "str",  # Optional. The name of the cookie
              sent to the client. This attribute is only returned when using
              ``cookies`` for the sticky sessions type.
            "cookie_ttl_seconds": 0,  # Optional. The number of seconds
              until the cookie set by the load balancer expires. This attribute is only
              returned when using ``cookies`` for the sticky sessions type.
            "type": "none"  # Optional. Default value is "none". An
              attribute indicating how and if requests from a client will be
              persistently served by the same backend Droplet. The possible values are
              ``cookies`` or ``none``. Known values are: "cookies" and "none".
        },
        "tag": "str",  # Optional. The name of a Droplet tag corresponding to
          Droplets assigned to the load balancer.
        "vpc_uuid": "str"  # Optional. A string specifying the UUID of the
          VPC to which the load balancer is assigned.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list(*, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All Load Balancers.

To list all of the load balancer instances on your account, send a GET request to /v2/load_balancers.

Parameters:
  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "links": {
        "pages": {}
    },
    "load_balancers": [
        {
            "algorithm": "round_robin",  # Optional. Default value is
              "round_robin". This field has been deprecated. You can no longer specify
              an algorithm for load balancers. Known values are: "round_robin" and
              "least_connections".
            "created_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the load balancer was created.
            "disable_lets_encrypt_dns_records": False,  # Optional.
              Default value is False. A boolean value indicating whether to disable
              automatic DNS record creation for Let's Encrypt certificates that are
              added to the load balancer.
            "enable_backend_keepalive": False,  # Optional. Default value
              is False. A boolean value indicating whether HTTP keepalive connections
              are maintained to target Droplets.
            "enable_proxy_protocol": False,  # Optional. Default value is
              False. A boolean value indicating whether PROXY Protocol is in use.
            "firewall": {
                "allow": [
                    "str"  # Optional. the rules for allowing
                      traffic to the load balancer (in the form 'ip:1.2.3.4' or
                      'cidr:1.2.0.0/16').
                ],
                "deny": [
                    "str"  # Optional. the rules for denying
                      traffic to the load balancer (in the form 'ip:1.2.3.4' or
                      'cidr:1.2.0.0/16').
                ]
            },
            "forwarding_rules": [
                {
                    "certificate_id": "str",  # Optional. The ID
                      of the TLS certificate used for SSL termination if enabled.
                    "entry_port": 0,  # An integer representing
                      the port on which the load balancer instance will listen.
                      Required.
                    "entry_protocol": "str",  # The protocol used
                      for traffic to the load balancer. The possible values are:
                      ``http``"" , ``https``"" , ``http2``"" , ``http3``"" , ``tcp``""
                      , or ``udp``. If you set the  ``entry_protocol`` to ``udp``"" ,
                      the ``target_protocol`` must be set to ``udp``.  When using UDP,
                      the load balancer requires that you set up a health  check with a
                      port that uses TCP, HTTP, or HTTPS to work properly. Required.
                      Known values are: "http", "https", "http2", "http3", "tcp", and
                      "udp".
                    "target_port": 0,  # An integer representing
                      the port on the backend Droplets to which the load balancer will
                      send traffic. Required.
                    "target_protocol": "str",  # The protocol
                      used for traffic from the load balancer to the backend Droplets.
                      The possible values are: ``http``"" , ``https``"" , ``http2``"" ,
                      ``tcp``"" , or ``udp``. If you set the ``target_protocol`` to
                      ``udp``"" , the ``entry_protocol`` must be set to  ``udp``. When
                      using UDP, the load balancer requires that you set up a health
                      check with a port that uses TCP, HTTP, or HTTPS to work properly.
                      Required. Known values are: "http", "https", "http2", "tcp", and
                      "udp".
                    "tls_passthrough": bool  # Optional. A
                      boolean value indicating whether SSL encrypted traffic will be
                      passed through to the backend Droplets.
                }
            ],
            "health_check": {
                "check_interval_seconds": 10,  # Optional. Default
                  value is 10. The number of seconds between between two consecutive
                  health checks.
                "healthy_threshold": 3,  # Optional. Default value is
                  3. The number of times a health check must pass for a backend Droplet
                  to be marked "healthy" and be re-added to the pool.
                "path": "/",  # Optional. Default value is "/". The
                  path on the backend Droplets to which the load balancer instance will
                  send a request.
                "port": 80,  # Optional. Default value is 80. An
                  integer representing the port on the backend Droplets on which the
                  health check will attempt a connection.
                "protocol": "http",  # Optional. Default value is
                  "http". The protocol used for health checks sent to the backend
                  Droplets. The possible values are ``http``"" , ``https``"" , or
                  ``tcp``. Known values are: "http", "https", and "tcp".
                "response_timeout_seconds": 5,  # Optional. Default
                  value is 5. The number of seconds the load balancer instance will
                  wait for a response until marking a health check as failed.
                "unhealthy_threshold": 5  # Optional. Default value
                  is 5. The number of times a health check must fail for a backend
                  Droplet to be marked "unhealthy" and be removed from the pool.
            },
            "http_idle_timeout_seconds": 60,  # Optional. Default value
              is 60. An integer value which configures the idle timeout for HTTP
              requests to the target droplets.
            "id": "str",  # Optional. A unique ID that can be used to
              identify and reference a load balancer.
            "ip": "str",  # Optional. An attribute containing the
              public-facing IP address of the load balancer.
            "name": "str",  # Optional. A human-readable name for a load
              balancer instance.
            "project_id": "str",  # Optional. The ID of the project that
              the load balancer is associated with. If no ID is provided at creation,
              the load balancer associates with the user's default project. If an
              invalid project ID is provided, the load balancer will not be created.
            "redirect_http_to_https": False,  # Optional. Default value
              is False. A boolean value indicating whether HTTP requests to the load
              balancer on port 80 will be redirected to HTTPS on port 443.
            "size": "lb-small",  # Optional. Default value is "lb-small".
              This field has been replaced by the ``size_unit`` field for all regions
              except in AMS2, NYC2, and SFO1. Each available load balancer size now
              equates to the load balancer having a set number of nodes."n"n"n*
              ``lb-small`` = 1 node"n* ``lb-medium`` = 3 nodes"n* ``lb-large`` = 6
              nodes"n"nYou can resize load balancers after creation up to once per
              hour. You cannot resize a load balancer within the first hour of its
              creation. Known values are: "lb-small", "lb-medium", and "lb-large".
            "size_unit": 1,  # Optional. Default value is 1. How many
              nodes the load balancer contains. Each additional node increases the load
              balancer's ability to manage more connections. Load balancers can be
              scaled up or down, and you can change the number of nodes after creation
              up to once per hour. This field is currently not available in the AMS2,
              NYC2, or SFO1 regions. Use the ``size`` field to scale load balancers
              that reside in these regions.
            "status": "str",  # Optional. A status string indicating the
              current state of the load balancer. This can be ``new``"" , ``active``""
              , or ``errored``. Known values are: "new", "active", and "errored".
            "sticky_sessions": {
                "cookie_name": "str",  # Optional. The name of the
                  cookie sent to the client. This attribute is only returned when using
                  ``cookies`` for the sticky sessions type.
                "cookie_ttl_seconds": 0,  # Optional. The number of
                  seconds until the cookie set by the load balancer expires. This
                  attribute is only returned when using ``cookies`` for the sticky
                  sessions type.
                "type": "none"  # Optional. Default value is "none".
                  An attribute indicating how and if requests from a client will be
                  persistently served by the same backend Droplet. The possible values
                  are ``cookies`` or ``none``. Known values are: "cookies" and "none".
            },
            "tag": "str",  # Optional. The name of a Droplet tag
              corresponding to Droplets assigned to the load balancer.
            "vpc_uuid": "str"  # Optional. A string specifying the UUID
              of the VPC to which the load balancer is assigned.
        }
    ],
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
remove_droplets(lb_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
remove_droplets(lb_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Remove Droplets from a Load Balancer.

To remove a Droplet from a load balancer instance, send a DELETE request to /v2/load_balancers/$LOAD_BALANCER_ID/droplets. In the body of the request, there should be a droplet_ids attribute containing a list of Droplet IDs.

No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data.

Parameters:
  • lb_id (str) – A unique identifier for a load balancer. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
remove_forwarding_rules(lb_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
remove_forwarding_rules(lb_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Remove Forwarding Rules from a Load Balancer.

To remove forwarding rules from a load balancer instance, send a DELETE request to /v2/load_balancers/$LOAD_BALANCER_ID/forwarding_rules. In the body of the request, there should be a forwarding_rules attribute containing an array of rules to be removed.

No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data.

Parameters:
  • lb_id (str) – A unique identifier for a load balancer. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
update(lb_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
update(lb_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Update a Load Balancer.

To update a load balancer’s settings, send a PUT request to /v2/load_balancers/$LOAD_BALANCER_ID. The request should contain a full representation of the load balancer including existing attributes. It may contain one of the droplets_ids or tag attributes as they are mutually exclusive. Note that any attribute that is not provided will be reset to its default value..

Parameters:
  • lb_id (str) – A unique identifier for a load balancer. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "load_balancer": {
        "algorithm": "round_robin",  # Optional. Default value is
          "round_robin". This field has been deprecated. You can no longer specify an
          algorithm for load balancers. Known values are: "round_robin" and
          "least_connections".
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the load
          balancer was created.
        "disable_lets_encrypt_dns_records": False,  # Optional. Default value
          is False. A boolean value indicating whether to disable automatic DNS record
          creation for Let's Encrypt certificates that are added to the load balancer.
        "enable_backend_keepalive": False,  # Optional. Default value is
          False. A boolean value indicating whether HTTP keepalive connections are
          maintained to target Droplets.
        "enable_proxy_protocol": False,  # Optional. Default value is False.
          A boolean value indicating whether PROXY Protocol is in use.
        "firewall": {
            "allow": [
                "str"  # Optional. the rules for allowing traffic to
                  the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16').
            ],
            "deny": [
                "str"  # Optional. the rules for denying traffic to
                  the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16').
            ]
        },
        "forwarding_rules": [
            {
                "certificate_id": "str",  # Optional. The ID of the
                  TLS certificate used for SSL termination if enabled.
                "entry_port": 0,  # An integer representing the port
                  on which the load balancer instance will listen. Required.
                "entry_protocol": "str",  # The protocol used for
                  traffic to the load balancer. The possible values are: ``http``"" ,
                  ``https``"" , ``http2``"" , ``http3``"" , ``tcp``"" , or ``udp``. If
                  you set the  ``entry_protocol`` to ``udp``"" , the
                  ``target_protocol`` must be set to ``udp``.  When using UDP, the load
                  balancer requires that you set up a health  check with a port that
                  uses TCP, HTTP, or HTTPS to work properly. Required. Known values
                  are: "http", "https", "http2", "http3", "tcp", and "udp".
                "target_port": 0,  # An integer representing the port
                  on the backend Droplets to which the load balancer will send traffic.
                  Required.
                "target_protocol": "str",  # The protocol used for
                  traffic from the load balancer to the backend Droplets. The possible
                  values are: ``http``"" , ``https``"" , ``http2``"" , ``tcp``"" , or
                  ``udp``. If you set the ``target_protocol`` to ``udp``"" , the
                  ``entry_protocol`` must be set to  ``udp``. When using UDP, the load
                  balancer requires that you set up a health  check with a port that
                  uses TCP, HTTP, or HTTPS to work properly. Required. Known values
                  are: "http", "https", "http2", "tcp", and "udp".
                "tls_passthrough": bool  # Optional. A boolean value
                  indicating whether SSL encrypted traffic will be passed through to
                  the backend Droplets.
            }
        ],
        "health_check": {
            "check_interval_seconds": 10,  # Optional. Default value is
              10. The number of seconds between between two consecutive health checks.
            "healthy_threshold": 3,  # Optional. Default value is 3. The
              number of times a health check must pass for a backend Droplet to be
              marked "healthy" and be re-added to the pool.
            "path": "/",  # Optional. Default value is "/". The path on
              the backend Droplets to which the load balancer instance will send a
              request.
            "port": 80,  # Optional. Default value is 80. An integer
              representing the port on the backend Droplets on which the health check
              will attempt a connection.
            "protocol": "http",  # Optional. Default value is "http". The
              protocol used for health checks sent to the backend Droplets. The
              possible values are ``http``"" , ``https``"" , or ``tcp``. Known values
              are: "http", "https", and "tcp".
            "response_timeout_seconds": 5,  # Optional. Default value is
              5. The number of seconds the load balancer instance will wait for a
              response until marking a health check as failed.
            "unhealthy_threshold": 5  # Optional. Default value is 5. The
              number of times a health check must fail for a backend Droplet to be
              marked "unhealthy" and be removed from the pool.
        },
        "http_idle_timeout_seconds": 60,  # Optional. Default value is 60. An
          integer value which configures the idle timeout for HTTP requests to the
          target droplets.
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference a load balancer.
        "ip": "str",  # Optional. An attribute containing the public-facing
          IP address of the load balancer.
        "name": "str",  # Optional. A human-readable name for a load balancer
          instance.
        "project_id": "str",  # Optional. The ID of the project that the load
          balancer is associated with. If no ID is provided at creation, the load
          balancer associates with the user's default project. If an invalid project ID
          is provided, the load balancer will not be created.
        "redirect_http_to_https": False,  # Optional. Default value is False.
          A boolean value indicating whether HTTP requests to the load balancer on port
          80 will be redirected to HTTPS on port 443.
        "size": "lb-small",  # Optional. Default value is "lb-small". This
          field has been replaced by the ``size_unit`` field for all regions except in
          AMS2, NYC2, and SFO1. Each available load balancer size now equates to the
          load balancer having a set number of nodes."n"n"n* ``lb-small`` = 1 node"n*
          ``lb-medium`` = 3 nodes"n* ``lb-large`` = 6 nodes"n"nYou can resize load
          balancers after creation up to once per hour. You cannot resize a load
          balancer within the first hour of its creation. Known values are: "lb-small",
          "lb-medium", and "lb-large".
        "size_unit": 1,  # Optional. Default value is 1. How many nodes the
          load balancer contains. Each additional node increases the load balancer's
          ability to manage more connections. Load balancers can be scaled up or down,
          and you can change the number of nodes after creation up to once per hour.
          This field is currently not available in the AMS2, NYC2, or SFO1 regions. Use
          the ``size`` field to scale load balancers that reside in these regions.
        "status": "str",  # Optional. A status string indicating the current
          state of the load balancer. This can be ``new``"" , ``active``"" , or
          ``errored``. Known values are: "new", "active", and "errored".
        "sticky_sessions": {
            "cookie_name": "str",  # Optional. The name of the cookie
              sent to the client. This attribute is only returned when using
              ``cookies`` for the sticky sessions type.
            "cookie_ttl_seconds": 0,  # Optional. The number of seconds
              until the cookie set by the load balancer expires. This attribute is only
              returned when using ``cookies`` for the sticky sessions type.
            "type": "none"  # Optional. Default value is "none". An
              attribute indicating how and if requests from a client will be
              persistently served by the same backend Droplet. The possible values are
              ``cookies`` or ``none``. Known values are: "cookies" and "none".
        },
        "tag": "str",  # Optional. The name of a Droplet tag corresponding to
          Droplets assigned to the load balancer.
        "vpc_uuid": "str"  # Optional. A string specifying the UUID of the
          VPC to which the load balancer is assigned.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
class pydo.operations.MonitoringOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s monitoring attribute.

create_alert_policy(body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
create_alert_policy(body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create Alert Policy.

To create a new alert, send a POST request to /v2/monitoring/alerts.

Parameters:
  • body (JSON or IO) –

    The type field dictates what type of entity that the alert policy applies to and hence what type of entity is passed in the entities array. If both the tags array and entities array are empty the alert policy applies to all entities of the relevant type that are owned by the user account. Otherwise the following table shows the valid entity types for each type of alert policy:

    Type

    Description

    Valid Entity Type

    v1/insights/droplet/memory_utilization_percent

    alert on the percent of memory utilization

    Droplet ID

    v1/insights/droplet/disk_read

    alert on the rate of disk read I/O in MBps

    Droplet ID

    v1/insights/droplet/load_5

    alert on the 5 minute load average

    Droplet ID

    v1/insights/droplet/load_15

    alert on the 15 minute load average

    Droplet ID

    v1/insights/droplet/disk_utilization_percent

    alert on the percent of disk utilization

    Droplet ID

    v1/insights/droplet/cpu

    alert on the percent of CPU utilization

    Droplet ID

    v1/insights/droplet/disk_write

    alert on the rate of disk write I/O in MBps

    Droplet ID

    v1/insights/droplet/public_outbound_bandwidth

    alert on the rate of public outbound bandwidth in Mbps

    Droplet ID

    v1/insights/droplet/public_inbound_bandwidth

    alert on the rate of public inbound bandwidth in Mbps

    Droplet ID

    v1/insights/droplet/private_outbound_bandwidth

    alert on the rate of private outbound bandwidth in Mbps

    Droplet ID

    v1/insights/droplet/private_inbound_bandwidth

    alert on the rate of private inbound bandwidth in Mbps

    Droplet ID

    v1/insights/droplet/load_1

    alert on the 1 minute load average

    Droplet ID

    v1/insights/lbaas/avg_cpu_utilization_percent

    alert on the percent of CPU utilization

    load balancer ID

    v1/insights/lbaas/connection_utilization_percent

    alert on the percent of connection utilization

    load balancer ID

    v1/insights/lbaas/droplet_health

    alert on Droplet health status changes

    load balancer ID

    v1/insights/lbaas/tls_connections_per_second_utilization_percent

    alert on the percent of TLS connections per second utilization

    load balancer ID

    v1/insights/lbaas/increase_in_http_error_rate_percentage_5xx

    alert on the percent increase of 5xx level http errors over 5m

    load balancer ID

    v1/insights/lbaas/increase_in_http_error_rate_percentage_4xx

    alert on the percent increase of 4xx level http errors over 5m

    load balancer ID

    v1/insights/lbaas/increase_in_http_error_rate_count_5xx

    alert on the count of 5xx level http errors over 5m

    load balancer ID

    v1/insights/lbaas/increase_in_http_error_rate_count_4xx

    alert on the count of 4xx level http errors over 5m

    load balancer ID

    v1/insights/lbaas/high_http_request_response_time

    alert on high average http response time

    load balancer ID

    v1/insights/lbaas/high_http_request_response_time_50p

    alert on high 50th percentile http response time

    load balancer ID

    v1/insights/lbaas/high_http_request_response_time_95p

    alert on high 95th percentile http response time

    load balancer ID

    v1/insights/lbaas/high_http_request_response_time_99p

    alert on high 99th percentile http response time

    load balancer ID

    v1/dbaas/alerts/load_15_alerts

    alert on 15 minute load average across the database cluster

    database cluster UUID

    v1/dbaas/alerts/memory_utilization_alerts

    alert on the percent memory utilization average across the database cluster

    database cluster UUID

    v1/dbaas/alerts/disk_utilization_alerts

    alert on the percent disk utilization average across the database cluster

    database cluster UUID

    v1/dbaas/alerts/cpu_alerts

    alert on the percent CPU usage average across the database cluster

    database cluster UUID. Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "policy": {
        "alerts": {
            "email": [
                "str"  # An email to notify on an alert trigger.
                  Required.
            ],
            "slack": [
                {
                    "channel": "str",  # Slack channel to notify
                      of an alert trigger. Required.
                    "url": "str"  # Slack Webhook URL. Required.
                }
            ]
        },
        "compare": "str",  # Required. Known values are: "GreaterThan" and
          "LessThan".
        "description": "str",  # Required.
        "enabled": bool,  # Required.
        "entities": [
            "str"  # Required.
        ],
        "tags": [
            "str"  # Required.
        ],
        "type": "str",  # Required. Known values are:
          "v1/insights/droplet/load_1", "v1/insights/droplet/load_5",
          "v1/insights/droplet/load_15",
          "v1/insights/droplet/memory_utilization_percent",
          "v1/insights/droplet/disk_utilization_percent", "v1/insights/droplet/cpu",
          "v1/insights/droplet/disk_read", "v1/insights/droplet/disk_write",
          "v1/insights/droplet/public_outbound_bandwidth",
          "v1/insights/droplet/public_inbound_bandwidth",
          "v1/insights/droplet/private_outbound_bandwidth",
          "v1/insights/droplet/private_inbound_bandwidth",
          "v1/insights/lbaas/avg_cpu_utilization_percent",
          "v1/insights/lbaas/connection_utilization_percent",
          "v1/insights/lbaas/droplet_health",
          "v1/insights/lbaas/tls_connections_per_second_utilization_percent",
          "v1/insights/lbaas/increase_in_http_error_rate_percentage_5xx",
          "v1/insights/lbaas/increase_in_http_error_rate_percentage_4xx",
          "v1/insights/lbaas/increase_in_http_error_rate_count_5xx",
          "v1/insights/lbaas/increase_in_http_error_rate_count_4xx",
          "v1/insights/lbaas/high_http_request_response_time",
          "v1/insights/lbaas/high_http_request_response_time_50p",
          "v1/insights/lbaas/high_http_request_response_time_95p",
          "v1/insights/lbaas/high_http_request_response_time_99p",
          "v1/dbaas/alerts/load_15_alerts",
          "v1/dbaas/alerts/memory_utilization_alerts",
          "v1/dbaas/alerts/disk_utilization_alerts", and "v1/dbaas/alerts/cpu_alerts".
        "uuid": "str",  # Required.
        "value": 0.0,  # Required.
        "window": "str"  # Required. Known values are: "5m", "10m", "30m",
          and "1h".
    }
}
delete_alert_policy(alert_uuid: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete an Alert Policy.

To delete an alert policy, send a DELETE request to /v2/monitoring/alerts/{alert_uuid}.

Parameters:

alert_uuid (str) – A unique identifier for an alert policy. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_alert_policy(alert_uuid: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Alert Policy.

To retrieve a given alert policy, send a GET request to /v2/monitoring/alerts/{alert_uuid}.

Parameters:

alert_uuid (str) – A unique identifier for an alert policy. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "policy": {
        "alerts": {
            "email": [
                "str"  # An email to notify on an alert trigger.
                  Required.
            ],
            "slack": [
                {
                    "channel": "str",  # Slack channel to notify
                      of an alert trigger. Required.
                    "url": "str"  # Slack Webhook URL. Required.
                }
            ]
        },
        "compare": "str",  # Required. Known values are: "GreaterThan" and
          "LessThan".
        "description": "str",  # Required.
        "enabled": bool,  # Required.
        "entities": [
            "str"  # Required.
        ],
        "tags": [
            "str"  # Required.
        ],
        "type": "str",  # Required. Known values are:
          "v1/insights/droplet/load_1", "v1/insights/droplet/load_5",
          "v1/insights/droplet/load_15",
          "v1/insights/droplet/memory_utilization_percent",
          "v1/insights/droplet/disk_utilization_percent", "v1/insights/droplet/cpu",
          "v1/insights/droplet/disk_read", "v1/insights/droplet/disk_write",
          "v1/insights/droplet/public_outbound_bandwidth",
          "v1/insights/droplet/public_inbound_bandwidth",
          "v1/insights/droplet/private_outbound_bandwidth",
          "v1/insights/droplet/private_inbound_bandwidth",
          "v1/insights/lbaas/avg_cpu_utilization_percent",
          "v1/insights/lbaas/connection_utilization_percent",
          "v1/insights/lbaas/droplet_health",
          "v1/insights/lbaas/tls_connections_per_second_utilization_percent",
          "v1/insights/lbaas/increase_in_http_error_rate_percentage_5xx",
          "v1/insights/lbaas/increase_in_http_error_rate_percentage_4xx",
          "v1/insights/lbaas/increase_in_http_error_rate_count_5xx",
          "v1/insights/lbaas/increase_in_http_error_rate_count_4xx",
          "v1/insights/lbaas/high_http_request_response_time",
          "v1/insights/lbaas/high_http_request_response_time_50p",
          "v1/insights/lbaas/high_http_request_response_time_95p",
          "v1/insights/lbaas/high_http_request_response_time_99p",
          "v1/dbaas/alerts/load_15_alerts",
          "v1/dbaas/alerts/memory_utilization_alerts",
          "v1/dbaas/alerts/disk_utilization_alerts", and "v1/dbaas/alerts/cpu_alerts".
        "uuid": "str",  # Required.
        "value": 0.0,  # Required.
        "window": "str"  # Required. Known values are: "5m", "10m", "30m",
          and "1h".
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_droplet_bandwidth_metrics(*, host_id: str, interface: str, direction: str, start: str, end: str, **kwargs: Any) MutableMapping[str, Any]

Get Droplet Bandwidth Metrics.

To retrieve bandwidth metrics for a given Droplet, send a GET request to /v2/monitoring/metrics/droplet/bandwidth. Use the interface query parameter to specify if the results should be for the private or public interface. Use the direction query parameter to specify if the results should be for inbound or outbound traffic.

Parameters:
  • host_id (str) – The droplet ID. Required.

  • interface (str) – The network interface. Known values are: “private” and “public”. Required.

  • direction (str) – The traffic direction. Known values are: “inbound” and “outbound”. Required.

  • start (str) – Timestamp to start metric window. Required.

  • end (str) – Timestamp to end metric window. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "data": {
        "result": [
            {
                "metric": {
                    "str": "str"  # An object containing the
                      metric labels. Required.
                },
                "values": [
                    [
                        {}
                    ]
                ]
            }
        ],
        "resultType": "str"  # Required. "matrix"
    },
    "status": "str"  # Required. Known values are: "success" and "error".
}
get_droplet_cpu_metrics(*, host_id: str, start: str, end: str, **kwargs: Any) MutableMapping[str, Any]

Get Droplet CPU Metrics.

To retrieve CPU metrics for a given droplet, send a GET request to /v2/monitoring/metrics/droplet/cpu.

Parameters:
  • host_id (str) – The droplet ID. Required.

  • start (str) – Timestamp to start metric window. Required.

  • end (str) – Timestamp to end metric window. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "data": {
        "result": [
            {
                "metric": {
                    "str": "str"  # An object containing the
                      metric labels. Required.
                },
                "values": [
                    [
                        {}
                    ]
                ]
            }
        ],
        "resultType": "str"  # Required. "matrix"
    },
    "status": "str"  # Required. Known values are: "success" and "error".
}
get_droplet_filesystem_free_metrics(*, host_id: str, start: str, end: str, **kwargs: Any) MutableMapping[str, Any]

Get Droplet Filesystem Free Metrics.

To retrieve filesystem free metrics for a given droplet, send a GET request to /v2/monitoring/metrics/droplet/filesystem_free.

Parameters:
  • host_id (str) – The droplet ID. Required.

  • start (str) – Timestamp to start metric window. Required.

  • end (str) – Timestamp to end metric window. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "data": {
        "result": [
            {
                "metric": {
                    "str": "str"  # An object containing the
                      metric labels. Required.
                },
                "values": [
                    [
                        {}
                    ]
                ]
            }
        ],
        "resultType": "str"  # Required. "matrix"
    },
    "status": "str"  # Required. Known values are: "success" and "error".
}
get_droplet_filesystem_size_metrics(*, host_id: str, start: str, end: str, **kwargs: Any) MutableMapping[str, Any]

Get Droplet Filesystem Size Metrics.

To retrieve filesystem size metrics for a given droplet, send a GET request to /v2/monitoring/metrics/droplet/filesystem_size.

Parameters:
  • host_id (str) – The droplet ID. Required.

  • start (str) – Timestamp to start metric window. Required.

  • end (str) – Timestamp to end metric window. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "data": {
        "result": [
            {
                "metric": {
                    "str": "str"  # An object containing the
                      metric labels. Required.
                },
                "values": [
                    [
                        {}
                    ]
                ]
            }
        ],
        "resultType": "str"  # Required. "matrix"
    },
    "status": "str"  # Required. Known values are: "success" and "error".
}
get_droplet_load15_metrics(*, host_id: str, start: str, end: str, **kwargs: Any) MutableMapping[str, Any]

Get Droplet Load15 Metrics.

To retrieve 15 minute load average metrics for a given droplet, send a GET request to /v2/monitoring/metrics/droplet/load_15.

Parameters:
  • host_id (str) – The droplet ID. Required.

  • start (str) – Timestamp to start metric window. Required.

  • end (str) – Timestamp to end metric window. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "data": {
        "result": [
            {
                "metric": {
                    "str": "str"  # An object containing the
                      metric labels. Required.
                },
                "values": [
                    [
                        {}
                    ]
                ]
            }
        ],
        "resultType": "str"  # Required. "matrix"
    },
    "status": "str"  # Required. Known values are: "success" and "error".
}
get_droplet_load1_metrics(*, host_id: str, start: str, end: str, **kwargs: Any) MutableMapping[str, Any]

Get Droplet Load1 Metrics.

To retrieve 1 minute load average metrics for a given droplet, send a GET request to /v2/monitoring/metrics/droplet/load_1.

Parameters:
  • host_id (str) – The droplet ID. Required.

  • start (str) – Timestamp to start metric window. Required.

  • end (str) – Timestamp to end metric window. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "data": {
        "result": [
            {
                "metric": {
                    "str": "str"  # An object containing the
                      metric labels. Required.
                },
                "values": [
                    [
                        {}
                    ]
                ]
            }
        ],
        "resultType": "str"  # Required. "matrix"
    },
    "status": "str"  # Required. Known values are: "success" and "error".
}
get_droplet_load5_metrics(*, host_id: str, start: str, end: str, **kwargs: Any) MutableMapping[str, Any]

Get Droplet Load5 Metrics.

To retrieve 5 minute load average metrics for a given droplet, send a GET request to /v2/monitoring/metrics/droplet/load_5.

Parameters:
  • host_id (str) – The droplet ID. Required.

  • start (str) – Timestamp to start metric window. Required.

  • end (str) – Timestamp to end metric window. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "data": {
        "result": [
            {
                "metric": {
                    "str": "str"  # An object containing the
                      metric labels. Required.
                },
                "values": [
                    [
                        {}
                    ]
                ]
            }
        ],
        "resultType": "str"  # Required. "matrix"
    },
    "status": "str"  # Required. Known values are: "success" and "error".
}
get_droplet_memory_available_metrics(*, host_id: str, start: str, end: str, **kwargs: Any) MutableMapping[str, Any]

Get Droplet Available Memory Metrics.

To retrieve available memory metrics for a given droplet, send a GET request to /v2/monitoring/metrics/droplet/memory_available.

Parameters:
  • host_id (str) – The droplet ID. Required.

  • start (str) – Timestamp to start metric window. Required.

  • end (str) – Timestamp to end metric window. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "data": {
        "result": [
            {
                "metric": {
                    "str": "str"  # An object containing the
                      metric labels. Required.
                },
                "values": [
                    [
                        {}
                    ]
                ]
            }
        ],
        "resultType": "str"  # Required. "matrix"
    },
    "status": "str"  # Required. Known values are: "success" and "error".
}
get_droplet_memory_cached_metrics(*, host_id: str, start: str, end: str, **kwargs: Any) MutableMapping[str, Any]

Get Droplet Cached Memory Metrics.

To retrieve cached memory metrics for a given droplet, send a GET request to /v2/monitoring/metrics/droplet/memory_cached.

Parameters:
  • host_id (str) – The droplet ID. Required.

  • start (str) – Timestamp to start metric window. Required.

  • end (str) – Timestamp to end metric window. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "data": {
        "result": [
            {
                "metric": {
                    "str": "str"  # An object containing the
                      metric labels. Required.
                },
                "values": [
                    [
                        {}
                    ]
                ]
            }
        ],
        "resultType": "str"  # Required. "matrix"
    },
    "status": "str"  # Required. Known values are: "success" and "error".
}
get_droplet_memory_free_metrics(*, host_id: str, start: str, end: str, **kwargs: Any) MutableMapping[str, Any]

Get Droplet Free Memory Metrics.

To retrieve free memory metrics for a given droplet, send a GET request to /v2/monitoring/metrics/droplet/memory_free.

Parameters:
  • host_id (str) – The droplet ID. Required.

  • start (str) – Timestamp to start metric window. Required.

  • end (str) – Timestamp to end metric window. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "data": {
        "result": [
            {
                "metric": {
                    "str": "str"  # An object containing the
                      metric labels. Required.
                },
                "values": [
                    [
                        {}
                    ]
                ]
            }
        ],
        "resultType": "str"  # Required. "matrix"
    },
    "status": "str"  # Required. Known values are: "success" and "error".
}
get_droplet_memory_total_metrics(*, host_id: str, start: str, end: str, **kwargs: Any) MutableMapping[str, Any]

Get Droplet Total Memory Metrics.

To retrieve total memory metrics for a given droplet, send a GET request to /v2/monitoring/metrics/droplet/memory_total.

Parameters:
  • host_id (str) – The droplet ID. Required.

  • start (str) – Timestamp to start metric window. Required.

  • end (str) – Timestamp to end metric window. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "data": {
        "result": [
            {
                "metric": {
                    "str": "str"  # An object containing the
                      metric labels. Required.
                },
                "values": [
                    [
                        {}
                    ]
                ]
            }
        ],
        "resultType": "str"  # Required. "matrix"
    },
    "status": "str"  # Required. Known values are: "success" and "error".
}
list_alert_policy(*, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List Alert Policies.

Returns all alert policies that are configured for the given account. To List all alert policies, send a GET request to /v2/monitoring/alerts.

Parameters:
  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    },
    "policies": [
        {
            "alerts": {
                "email": [
                    "str"  # An email to notify on an alert
                      trigger. Required.
                ],
                "slack": [
                    {
                        "channel": "str",  # Slack channel to
                          notify of an alert trigger. Required.
                        "url": "str"  # Slack Webhook URL.
                          Required.
                    }
                ]
            },
            "compare": "str",  # Required. Known values are:
              "GreaterThan" and "LessThan".
            "description": "str",  # Required.
            "enabled": bool,  # Required.
            "entities": [
                "str"  # Required.
            ],
            "tags": [
                "str"  # Required.
            ],
            "type": "str",  # Required. Known values are:
              "v1/insights/droplet/load_1", "v1/insights/droplet/load_5",
              "v1/insights/droplet/load_15",
              "v1/insights/droplet/memory_utilization_percent",
              "v1/insights/droplet/disk_utilization_percent",
              "v1/insights/droplet/cpu", "v1/insights/droplet/disk_read",
              "v1/insights/droplet/disk_write",
              "v1/insights/droplet/public_outbound_bandwidth",
              "v1/insights/droplet/public_inbound_bandwidth",
              "v1/insights/droplet/private_outbound_bandwidth",
              "v1/insights/droplet/private_inbound_bandwidth",
              "v1/insights/lbaas/avg_cpu_utilization_percent",
              "v1/insights/lbaas/connection_utilization_percent",
              "v1/insights/lbaas/droplet_health",
              "v1/insights/lbaas/tls_connections_per_second_utilization_percent",
              "v1/insights/lbaas/increase_in_http_error_rate_percentage_5xx",
              "v1/insights/lbaas/increase_in_http_error_rate_percentage_4xx",
              "v1/insights/lbaas/increase_in_http_error_rate_count_5xx",
              "v1/insights/lbaas/increase_in_http_error_rate_count_4xx",
              "v1/insights/lbaas/high_http_request_response_time",
              "v1/insights/lbaas/high_http_request_response_time_50p",
              "v1/insights/lbaas/high_http_request_response_time_95p",
              "v1/insights/lbaas/high_http_request_response_time_99p",
              "v1/dbaas/alerts/load_15_alerts",
              "v1/dbaas/alerts/memory_utilization_alerts",
              "v1/dbaas/alerts/disk_utilization_alerts", and
              "v1/dbaas/alerts/cpu_alerts".
            "uuid": "str",  # Required.
            "value": 0.0,  # Required.
            "window": "str"  # Required. Known values are: "5m", "10m",
              "30m", and "1h".
        }
    ]
}
update_alert_policy(alert_uuid: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
update_alert_policy(alert_uuid: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Update an Alert Policy.

To update en existing policy, send a PUT request to v2/monitoring/alerts/{alert_uuid}.

Parameters:
  • alert_uuid (str) – A unique identifier for an alert policy. Required.

  • body (JSON or IO) –

    The type field dictates what type of entity that the alert policy applies to and hence what type of entity is passed in the entities array. If both the tags array and entities array are empty the alert policy applies to all entities of the relevant type that are owned by the user account. Otherwise the following table shows the valid entity types for each type of alert policy:

    Type

    Description

    Valid Entity Type

    v1/insights/droplet/memory_utilization_percent

    alert on the percent of memory utilization

    Droplet ID

    v1/insights/droplet/disk_read

    alert on the rate of disk read I/O in MBps

    Droplet ID

    v1/insights/droplet/load_5

    alert on the 5 minute load average

    Droplet ID

    v1/insights/droplet/load_15

    alert on the 15 minute load average

    Droplet ID

    v1/insights/droplet/disk_utilization_percent

    alert on the percent of disk utilization

    Droplet ID

    v1/insights/droplet/cpu

    alert on the percent of CPU utilization

    Droplet ID

    v1/insights/droplet/disk_write

    alert on the rate of disk write I/O in MBps

    Droplet ID

    v1/insights/droplet/public_outbound_bandwidth

    alert on the rate of public outbound bandwidth in Mbps

    Droplet ID

    v1/insights/droplet/public_inbound_bandwidth

    alert on the rate of public inbound bandwidth in Mbps

    Droplet ID

    v1/insights/droplet/private_outbound_bandwidth

    alert on the rate of private outbound bandwidth in Mbps

    Droplet ID

    v1/insights/droplet/private_inbound_bandwidth

    alert on the rate of private inbound bandwidth in Mbps

    Droplet ID

    v1/insights/droplet/load_1

    alert on the 1 minute load average

    Droplet ID

    v1/insights/lbaas/avg_cpu_utilization_percent

    alert on the percent of CPU utilization

    load balancer ID

    v1/insights/lbaas/connection_utilization_percent

    alert on the percent of connection utilization

    load balancer ID

    v1/insights/lbaas/droplet_health

    alert on Droplet health status changes

    load balancer ID

    v1/insights/lbaas/tls_connections_per_second_utilization_percent

    alert on the percent of TLS connections per second utilization

    load balancer ID

    v1/insights/lbaas/increase_in_http_error_rate_percentage_5xx

    alert on the percent increase of 5xx level http errors over 5m

    load balancer ID

    v1/insights/lbaas/increase_in_http_error_rate_percentage_4xx

    alert on the percent increase of 4xx level http errors over 5m

    load balancer ID

    v1/insights/lbaas/increase_in_http_error_rate_count_5xx

    alert on the count of 5xx level http errors over 5m

    load balancer ID

    v1/insights/lbaas/increase_in_http_error_rate_count_4xx

    alert on the count of 4xx level http errors over 5m

    load balancer ID

    v1/insights/lbaas/high_http_request_response_time

    alert on high average http response time

    load balancer ID

    v1/insights/lbaas/high_http_request_response_time_50p

    alert on high 50th percentile http response time

    load balancer ID

    v1/insights/lbaas/high_http_request_response_time_95p

    alert on high 95th percentile http response time

    load balancer ID

    v1/insights/lbaas/high_http_request_response_time_99p

    alert on high 99th percentile http response time

    load balancer ID

    v1/dbaas/alerts/load_15_alerts

    alert on 15 minute load average across the database cluster

    database cluster UUID

    v1/dbaas/alerts/memory_utilization_alerts

    alert on the percent memory utilization average across the database cluster

    database cluster UUID

    v1/dbaas/alerts/disk_utilization_alerts

    alert on the percent disk utilization average across the database cluster

    database cluster UUID

    v1/dbaas/alerts/cpu_alerts

    alert on the percent CPU usage average across the database cluster

    database cluster UUID. Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "policy": {
        "alerts": {
            "email": [
                "str"  # An email to notify on an alert trigger.
                  Required.
            ],
            "slack": [
                {
                    "channel": "str",  # Slack channel to notify
                      of an alert trigger. Required.
                    "url": "str"  # Slack Webhook URL. Required.
                }
            ]
        },
        "compare": "str",  # Required. Known values are: "GreaterThan" and
          "LessThan".
        "description": "str",  # Required.
        "enabled": bool,  # Required.
        "entities": [
            "str"  # Required.
        ],
        "tags": [
            "str"  # Required.
        ],
        "type": "str",  # Required. Known values are:
          "v1/insights/droplet/load_1", "v1/insights/droplet/load_5",
          "v1/insights/droplet/load_15",
          "v1/insights/droplet/memory_utilization_percent",
          "v1/insights/droplet/disk_utilization_percent", "v1/insights/droplet/cpu",
          "v1/insights/droplet/disk_read", "v1/insights/droplet/disk_write",
          "v1/insights/droplet/public_outbound_bandwidth",
          "v1/insights/droplet/public_inbound_bandwidth",
          "v1/insights/droplet/private_outbound_bandwidth",
          "v1/insights/droplet/private_inbound_bandwidth",
          "v1/insights/lbaas/avg_cpu_utilization_percent",
          "v1/insights/lbaas/connection_utilization_percent",
          "v1/insights/lbaas/droplet_health",
          "v1/insights/lbaas/tls_connections_per_second_utilization_percent",
          "v1/insights/lbaas/increase_in_http_error_rate_percentage_5xx",
          "v1/insights/lbaas/increase_in_http_error_rate_percentage_4xx",
          "v1/insights/lbaas/increase_in_http_error_rate_count_5xx",
          "v1/insights/lbaas/increase_in_http_error_rate_count_4xx",
          "v1/insights/lbaas/high_http_request_response_time",
          "v1/insights/lbaas/high_http_request_response_time_50p",
          "v1/insights/lbaas/high_http_request_response_time_95p",
          "v1/insights/lbaas/high_http_request_response_time_99p",
          "v1/dbaas/alerts/load_15_alerts",
          "v1/dbaas/alerts/memory_utilization_alerts",
          "v1/dbaas/alerts/disk_utilization_alerts", and "v1/dbaas/alerts/cpu_alerts".
        "uuid": "str",  # Required.
        "value": 0.0,  # Required.
        "window": "str"  # Required. Known values are: "5m", "10m", "30m",
          and "1h".
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
class pydo.operations.OneClicksOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s one_clicks attribute.

install_kubernetes(body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
install_kubernetes(body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Install Kubernetes 1-Click Applications.

To install a Kubernetes 1-Click application on a cluster, send a POST request to /v2/1-clicks/kubernetes. The addon_slugs and cluster_uuid must be provided as body parameter in order to specify which 1-Click application(s) to install. To list all available 1-Click Kubernetes applications, send a request to /v2/1-clicks?type=kubernetes.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "message": "str"  # Optional. A message about the result of the request.
}
list(*, type: Optional[str] = None, **kwargs: Any) MutableMapping[str, Any]

List 1-Click Applications.

To list all available 1-Click applications, send a GET request to /v2/1-clicks. The type may be provided as query paramater in order to restrict results to a certain type of 1-Click, for example: /v2/1-clicks?type=droplet. Current supported types are kubernetes and droplet.

The response will be a JSON object with a key called 1_clicks. This will be set to an array of 1-Click application data, each of which will contain the the slug and type for the 1-Click.

Parameters:

type (str) – Restrict results to a certain type of 1-Click. Known values are: “droplet” and “kubernetes”. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "1_clicks": [
        {
            "slug": "str",  # The slug identifier for the 1-Click
              application. Required.
            "type": "str"  # The type of the 1-Click application.
              Required.
        }
    ]
}
class pydo.operations.ProjectsOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s projects attribute.

assign_resources(project_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
assign_resources(project_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Assign Resources to a Project.

To assign resources to a project, send a POST request to /v2/projects/$PROJECT_ID/resources.

Parameters:
  • project_id (str) – A unique identifier for a project. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "resources": [
        {
            "assigned_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the project was created.
            "links": {
                "self": "str"  # Optional. A URI that can be used to
                  retrieve the resource.
            },
            "status": "str",  # Optional. The status of assigning and
              fetching the resources. Known values are: "ok", "not_found", "assigned",
              "already_assigned", and "service_down".
            "urn": "str"  # Optional. The uniform resource name (URN) for
              the resource in the format do:resource_type:resource_id.
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
assign_resources_default(body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
assign_resources_default(body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Assign Resources to Default Project.

To assign resources to your default project, send a POST request to /v2/projects/default/resources.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "resources": [
        {
            "assigned_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the project was created.
            "links": {
                "self": "str"  # Optional. A URI that can be used to
                  retrieve the resource.
            },
            "status": "str",  # Optional. The status of assigning and
              fetching the resources. Known values are: "ok", "not_found", "assigned",
              "already_assigned", and "service_down".
            "urn": "str"  # Optional. The uniform resource name (URN) for
              the resource in the format do:resource_type:resource_id.
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
create(body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
create(body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create a Project.

To create a project, send a POST request to /v2/projects.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 201
response == {
    "project": {
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the project was
          created.
        "description": "str",  # Optional. The description of the project.
          The maximum length is 255 characters.
        "environment": "str",  # Optional. The environment of the project's
          resources. Known values are: "Development", "Staging", and "Production".
        "id": "str",  # Optional. The unique universal identifier of this
          project.
        "is_default": bool,  # Optional. If true, all resources will be added
          to this project if no project is specified.
        "name": "str",  # Optional. The human-readable name for the project.
          The maximum length is 175 characters and the name must be unique.
        "owner_id": 0,  # Optional. The integer id of the project owner.
        "owner_uuid": "str",  # Optional. The unique universal identifier of
          the project owner.
        "purpose": "str",  # Optional. The purpose of the project. The
          maximum length is 255 characters. It can"nhave one of the following
          values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational
          purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile
          Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational
          / Developer tooling"n"nIf another value for purpose is specified, for
          example, "your custom purpose","nyour purpose will be stored as ``Other: your
          custom purpose``.
        "updated_at": "2020-02-20 00:00:00"  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the project was
          updated.
    }
}
delete(project_id: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete an Existing Project.

To delete a project, send a DELETE request to /v2/projects/$PROJECT_ID. To be deleted, a project must not have any resources assigned to it. Any existing resources must first be reassigned or destroyed, or you will receive a 412 error.

A successful request will receive a 204 status code with no body in response. This indicates that the request was processed successfully.

Parameters:

project_id (str) – A unique identifier for a project. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404, 412
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get(project_id: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Project.

To get a project, send a GET request to /v2/projects/$PROJECT_ID.

Parameters:

project_id (str) – A unique identifier for a project. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "project": {
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the project was
          created.
        "description": "str",  # Optional. The description of the project.
          The maximum length is 255 characters.
        "environment": "str",  # Optional. The environment of the project's
          resources. Known values are: "Development", "Staging", and "Production".
        "id": "str",  # Optional. The unique universal identifier of this
          project.
        "is_default": bool,  # Optional. If true, all resources will be added
          to this project if no project is specified.
        "name": "str",  # Optional. The human-readable name for the project.
          The maximum length is 175 characters and the name must be unique.
        "owner_id": 0,  # Optional. The integer id of the project owner.
        "owner_uuid": "str",  # Optional. The unique universal identifier of
          the project owner.
        "purpose": "str",  # Optional. The purpose of the project. The
          maximum length is 255 characters. It can"nhave one of the following
          values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational
          purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile
          Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational
          / Developer tooling"n"nIf another value for purpose is specified, for
          example, "your custom purpose","nyour purpose will be stored as ``Other: your
          custom purpose``.
        "updated_at": "2020-02-20 00:00:00"  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the project was
          updated.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_default(**kwargs: Any) MutableMapping[str, Any]

Retrieve the Default Project.

To get your default project, send a GET request to /v2/projects/default.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "project": {
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the project was
          created.
        "description": "str",  # Optional. The description of the project.
          The maximum length is 255 characters.
        "environment": "str",  # Optional. The environment of the project's
          resources. Known values are: "Development", "Staging", and "Production".
        "id": "str",  # Optional. The unique universal identifier of this
          project.
        "is_default": bool,  # Optional. If true, all resources will be added
          to this project if no project is specified.
        "name": "str",  # Optional. The human-readable name for the project.
          The maximum length is 175 characters and the name must be unique.
        "owner_id": 0,  # Optional. The integer id of the project owner.
        "owner_uuid": "str",  # Optional. The unique universal identifier of
          the project owner.
        "purpose": "str",  # Optional. The purpose of the project. The
          maximum length is 255 characters. It can"nhave one of the following
          values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational
          purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile
          Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational
          / Developer tooling"n"nIf another value for purpose is specified, for
          example, "your custom purpose","nyour purpose will be stored as ``Other: your
          custom purpose``.
        "updated_at": "2020-02-20 00:00:00"  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the project was
          updated.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list(*, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All Projects.

To list all your projects, send a GET request to /v2/projects.

Parameters:
  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    },
    "projects": [
        {
            "created_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the project was created.
            "description": "str",  # Optional. The description of the
              project. The maximum length is 255 characters.
            "environment": "str",  # Optional. The environment of the
              project's resources. Known values are: "Development", "Staging", and
              "Production".
            "id": "str",  # Optional. The unique universal identifier of
              this project.
            "is_default": bool,  # Optional. If true, all resources will
              be added to this project if no project is specified.
            "name": "str",  # Optional. The human-readable name for the
              project. The maximum length is 175 characters and the name must be
              unique.
            "owner_id": 0,  # Optional. The integer id of the project
              owner.
            "owner_uuid": "str",  # Optional. The unique universal
              identifier of the project owner.
            "purpose": "str",  # Optional. The purpose of the project.
              The maximum length is 255 characters. It can"nhave one of the following
              values:"n"n"n* Just trying out DigitalOcean"n* Class project /
              Educational purposes"n* Website or blog"n* Web Application"n* Service or
              API"n* Mobile Application"n* Machine learning / AI / Data processing"n*
              IoT"n* Operational / Developer tooling"n"nIf another value for purpose is
              specified, for example, "your custom purpose","nyour purpose will be
              stored as ``Other: your custom purpose``.
            "updated_at": "2020-02-20 00:00:00"  # Optional. A time value
              given in ISO8601 combined date and time format that represents when the
              project was updated.
        }
    ]
}
list_resources(project_id: str, *, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List Project Resources.

To list all your resources in a project, send a GET request to /v2/projects/$PROJECT_ID/resources.

Parameters:
  • project_id (str) – A unique identifier for a project. Required.

  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    },
    "resources": [
        {
            "assigned_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the project was created.
            "links": {
                "self": "str"  # Optional. A URI that can be used to
                  retrieve the resource.
            },
            "status": "str",  # Optional. The status of assigning and
              fetching the resources. Known values are: "ok", "not_found", "assigned",
              "already_assigned", and "service_down".
            "urn": "str"  # Optional. The uniform resource name (URN) for
              the resource in the format do:resource_type:resource_id.
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_resources_default(**kwargs: Any) MutableMapping[str, Any]

List Default Project Resources.

To list all your resources in your default project, send a GET request to /v2/projects/default/resources.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    },
    "resources": [
        {
            "assigned_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the project was created.
            "links": {
                "self": "str"  # Optional. A URI that can be used to
                  retrieve the resource.
            },
            "status": "str",  # Optional. The status of assigning and
              fetching the resources. Known values are: "ok", "not_found", "assigned",
              "already_assigned", and "service_down".
            "urn": "str"  # Optional. The uniform resource name (URN) for
              the resource in the format do:resource_type:resource_id.
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
patch(project_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
patch(project_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Patch a Project.

To update only specific attributes of a project, send a PATCH request to /v2/projects/$PROJECT_ID. At least one of the following attributes needs to be sent.

Parameters:
  • project_id (str) – A unique identifier for a project. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "project": {
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the project was
          created.
        "description": "str",  # Optional. The description of the project.
          The maximum length is 255 characters.
        "environment": "str",  # Optional. The environment of the project's
          resources. Known values are: "Development", "Staging", and "Production".
        "id": "str",  # Optional. The unique universal identifier of this
          project.
        "is_default": bool,  # Optional. If true, all resources will be added
          to this project if no project is specified.
        "name": "str",  # Optional. The human-readable name for the project.
          The maximum length is 175 characters and the name must be unique.
        "owner_id": 0,  # Optional. The integer id of the project owner.
        "owner_uuid": "str",  # Optional. The unique universal identifier of
          the project owner.
        "purpose": "str",  # Optional. The purpose of the project. The
          maximum length is 255 characters. It can"nhave one of the following
          values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational
          purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile
          Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational
          / Developer tooling"n"nIf another value for purpose is specified, for
          example, "your custom purpose","nyour purpose will be stored as ``Other: your
          custom purpose``.
        "updated_at": "2020-02-20 00:00:00"  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the project was
          updated.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
patch_default(body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
patch_default(body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Patch the Default Project.

To update only specific attributes of your default project, send a PATCH request to /v2/projects/default. At least one of the following attributes needs to be sent.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "project": {
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the project was
          created.
        "description": "str",  # Optional. The description of the project.
          The maximum length is 255 characters.
        "environment": "str",  # Optional. The environment of the project's
          resources. Known values are: "Development", "Staging", and "Production".
        "id": "str",  # Optional. The unique universal identifier of this
          project.
        "is_default": bool,  # Optional. If true, all resources will be added
          to this project if no project is specified.
        "name": "str",  # Optional. The human-readable name for the project.
          The maximum length is 175 characters and the name must be unique.
        "owner_id": 0,  # Optional. The integer id of the project owner.
        "owner_uuid": "str",  # Optional. The unique universal identifier of
          the project owner.
        "purpose": "str",  # Optional. The purpose of the project. The
          maximum length is 255 characters. It can"nhave one of the following
          values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational
          purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile
          Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational
          / Developer tooling"n"nIf another value for purpose is specified, for
          example, "your custom purpose","nyour purpose will be stored as ``Other: your
          custom purpose``.
        "updated_at": "2020-02-20 00:00:00"  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the project was
          updated.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
update(project_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
update(project_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Update a Project.

To update a project, send a PUT request to /v2/projects/$PROJECT_ID. All of the following attributes must be sent.

Parameters:
  • project_id (str) – A unique identifier for a project. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "project": {
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the project was
          created.
        "description": "str",  # Optional. The description of the project.
          The maximum length is 255 characters.
        "environment": "str",  # Optional. The environment of the project's
          resources. Known values are: "Development", "Staging", and "Production".
        "id": "str",  # Optional. The unique universal identifier of this
          project.
        "is_default": bool,  # Optional. If true, all resources will be added
          to this project if no project is specified.
        "name": "str",  # Optional. The human-readable name for the project.
          The maximum length is 175 characters and the name must be unique.
        "owner_id": 0,  # Optional. The integer id of the project owner.
        "owner_uuid": "str",  # Optional. The unique universal identifier of
          the project owner.
        "purpose": "str",  # Optional. The purpose of the project. The
          maximum length is 255 characters. It can"nhave one of the following
          values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational
          purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile
          Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational
          / Developer tooling"n"nIf another value for purpose is specified, for
          example, "your custom purpose","nyour purpose will be stored as ``Other: your
          custom purpose``.
        "updated_at": "2020-02-20 00:00:00"  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the project was
          updated.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
update_default(body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
update_default(body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Update the Default Project.

To update you default project, send a PUT request to /v2/projects/default. All of the following attributes must be sent.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "project": {
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the project was
          created.
        "description": "str",  # Optional. The description of the project.
          The maximum length is 255 characters.
        "environment": "str",  # Optional. The environment of the project's
          resources. Known values are: "Development", "Staging", and "Production".
        "id": "str",  # Optional. The unique universal identifier of this
          project.
        "is_default": bool,  # Optional. If true, all resources will be added
          to this project if no project is specified.
        "name": "str",  # Optional. The human-readable name for the project.
          The maximum length is 175 characters and the name must be unique.
        "owner_id": 0,  # Optional. The integer id of the project owner.
        "owner_uuid": "str",  # Optional. The unique universal identifier of
          the project owner.
        "purpose": "str",  # Optional. The purpose of the project. The
          maximum length is 255 characters. It can"nhave one of the following
          values:"n"n"n* Just trying out DigitalOcean"n* Class project / Educational
          purposes"n* Website or blog"n* Web Application"n* Service or API"n* Mobile
          Application"n* Machine learning / AI / Data processing"n* IoT"n* Operational
          / Developer tooling"n"nIf another value for purpose is specified, for
          example, "your custom purpose","nyour purpose will be stored as ``Other: your
          custom purpose``.
        "updated_at": "2020-02-20 00:00:00"  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the project was
          updated.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
class pydo.operations.RegionsOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s regions attribute.

list(*, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All Data Center Regions.

To list all of the regions that are available, send a GET request to /v2/regions. The response will be a JSON object with a key called regions. The value of this will be an array of region objects, each of which will contain the standard region attributes.

Parameters:
  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    },
    "regions": [
        {
            "available": bool,  # This is a boolean value that represents
              whether new Droplets can be created in this region. Required.
            "features": {},  # This attribute is set to an array which
              contains features available in this region. Required.
            "name": "str",  # The display name of the region.  This will
              be a full name that is used in the control panel and other interfaces.
              Required.
            "sizes": {},  # This attribute is set to an array which
              contains the identifying slugs for the sizes available in this region.
              Required.
            "slug": "str"  # A human-readable string that is used as a
              unique identifier for each region. Required.
        }
    ]
}
class pydo.operations.RegistryOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s registry attribute.

create(body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
create(body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create Container Registry.

To create your container registry, send a POST request to /v2/registry.

The name becomes part of the URL for images stored in the registry. For example, if your registry is called example, an image in it will have the URL registry.digitalocean.com/example/image:tag.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 201
response == {
    "registry": {
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the registry
          was created.
        "name": "str",  # Optional. A globally unique name for the container
          registry. Must be lowercase and be composed only of numbers, letters and
          ``-``"" , up to a limit of 63 characters.
        "region": "str",  # Optional. Slug of the region where registry data
          is stored.
        "storage_usage_bytes": 0,  # Optional. The amount of storage used in
          the registry in bytes.
        "storage_usage_bytes_updated_at": "2020-02-20 00:00:00",  # Optional.
          The time at which the storage usage was updated. Storage usage is calculated
          asynchronously, and may not immediately reflect pushes to the registry.
        "subscription": {
            "created_at": "2020-02-20 00:00:00",  # Optional. The time at
              which the subscription was created.
            "tier": {
                "allow_storage_overage": bool,  # Optional. A boolean
                  indicating whether the subscription tier supports additional storage
                  above what is included in the base plan at an additional cost per GiB
                  used.
                "included_bandwidth_bytes": 0,  # Optional. The
                  amount of outbound data transfer included in the subscription tier in
                  bytes.
                "included_repositories": 0,  # Optional. The number
                  of repositories included in the subscription tier. ``0`` indicates
                  that the subscription tier includes unlimited repositories.
                "included_storage_bytes": 0,  # Optional. The amount
                  of storage included in the subscription tier in bytes.
                "monthly_price_in_cents": 0,  # Optional. The monthly
                  cost of the subscription tier in cents.
                "name": "str",  # Optional. The name of the
                  subscription tier.
                "slug": "str",  # Optional. The slug identifier of
                  the subscription tier.
                "storage_overage_price_in_cents": 0  # Optional. The
                  price paid in cents per GiB for additional storage beyond what is
                  included in the subscription plan.
            },
            "updated_at": "2020-02-20 00:00:00"  # Optional. The time at
              which the subscription was last updated.
        }
    }
}
delete(**kwargs: Any) Optional[MutableMapping[str, Any]]

Delete Container Registry.

To delete your container registry, destroying all container image data stored in it, send a DELETE request to /v2/registry.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
delete_repository_manifest(registry_name: str, repository_name: str, manifest_digest: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete Container Registry Repository Manifest.

To delete a container repository manifest by digest, send a DELETE request to /v2/registry/$REGISTRY_NAME/repositories/$REPOSITORY_NAME/digests/$MANIFEST_DIGEST.

Note that if your repository name contains / characters, it must be URL-encoded in the request URL. For example, to delete registry.digitalocean.com/example/my/repo@sha256:abcd, the path would be /v2/registry/example/repositories/my%2Frepo/digests/sha256:abcd.

A successful request will receive a 204 status code with no body in response. This indicates that the request was processed successfully.

Parameters:
  • registry_name (str) – The name of a container registry. Required.

  • repository_name (str) – The name of a container registry repository. If the name contains / characters, they must be URL-encoded, e.g. %2F. Required.

  • manifest_digest (str) – The manifest digest of a container registry repository tag. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
delete_repository_tag(registry_name: str, repository_name: str, repository_tag: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete Container Registry Repository Tag.

To delete a container repository tag, send a DELETE request to /v2/registry/$REGISTRY_NAME/repositories/$REPOSITORY_NAME/tags/$TAG.

Note that if your repository name contains / characters, it must be URL-encoded in the request URL. For example, to delete registry.digitalocean.com/example/my/repo:mytag, the path would be /v2/registry/example/repositories/my%2Frepo/tags/mytag.

A successful request will receive a 204 status code with no body in response. This indicates that the request was processed successfully.

Parameters:
  • registry_name (str) – The name of a container registry. Required.

  • repository_name (str) – The name of a container registry repository. If the name contains / characters, they must be URL-encoded, e.g. %2F. Required.

  • repository_tag (str) – The name of a container registry repository tag. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get(**kwargs: Any) MutableMapping[str, Any]

Get Container Registry Information.

To get information about your container registry, send a GET request to /v2/registry.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "registry": {
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the registry
          was created.
        "name": "str",  # Optional. A globally unique name for the container
          registry. Must be lowercase and be composed only of numbers, letters and
          ``-``"" , up to a limit of 63 characters.
        "region": "str",  # Optional. Slug of the region where registry data
          is stored.
        "storage_usage_bytes": 0,  # Optional. The amount of storage used in
          the registry in bytes.
        "storage_usage_bytes_updated_at": "2020-02-20 00:00:00",  # Optional.
          The time at which the storage usage was updated. Storage usage is calculated
          asynchronously, and may not immediately reflect pushes to the registry.
        "subscription": {
            "created_at": "2020-02-20 00:00:00",  # Optional. The time at
              which the subscription was created.
            "tier": {
                "allow_storage_overage": bool,  # Optional. A boolean
                  indicating whether the subscription tier supports additional storage
                  above what is included in the base plan at an additional cost per GiB
                  used.
                "included_bandwidth_bytes": 0,  # Optional. The
                  amount of outbound data transfer included in the subscription tier in
                  bytes.
                "included_repositories": 0,  # Optional. The number
                  of repositories included in the subscription tier. ``0`` indicates
                  that the subscription tier includes unlimited repositories.
                "included_storage_bytes": 0,  # Optional. The amount
                  of storage included in the subscription tier in bytes.
                "monthly_price_in_cents": 0,  # Optional. The monthly
                  cost of the subscription tier in cents.
                "name": "str",  # Optional. The name of the
                  subscription tier.
                "slug": "str",  # Optional. The slug identifier of
                  the subscription tier.
                "storage_overage_price_in_cents": 0  # Optional. The
                  price paid in cents per GiB for additional storage beyond what is
                  included in the subscription plan.
            },
            "updated_at": "2020-02-20 00:00:00"  # Optional. The time at
              which the subscription was last updated.
        }
    }
}
get_docker_credentials(*, expiry_seconds: int = 0, read_write: bool = False, **kwargs: Any) MutableMapping[str, Any]

Get Docker Credentials for Container Registry.

In order to access your container registry with the Docker client or from a Kubernetes cluster, you will need to configure authentication. The necessary JSON configuration can be retrieved by sending a GET request to /v2/registry/docker-credentials.

The response will be in the format of a Docker config.json file. To use the config in your Kubernetes cluster, create a Secret with:

kubectl create secret generic docr              --from-file=.dockerconfigjson=config.json              --type=kubernetes.io/dockerconfigjson

By default, the returned credentials have read-only access to your registry and cannot be used to push images. This is appropriate for most Kubernetes clusters. To retrieve read/write credentials, suitable for use with the Docker client or in a CI system, read_write may be provided as query parameter. For example: /v2/registry/docker-credentials?read_write=true

By default, the returned credentials will not expire. To retrieve credentials with an expiry set, expiry_seconds may be provided as a query parameter. For example: /v2/registry/docker-credentials?expiry_seconds=3600 will return credentials that expire after one hour.

Parameters:
  • expiry_seconds (int) – The duration in seconds that the returned registry credentials will be valid. If not set or 0, the credentials will not expire. Default value is 0.

  • read_write (bool) – By default, the registry credentials allow for read-only access. Set this query parameter to true to obtain read-write credentials. Default value is False.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "auths": {
        "registry.digitalocean.com": {
            "auth": "str"  # Optional. A base64 encoded string containing
              credentials for the container registry.
        }
    }
}
get_garbage_collection(registry_name: str, **kwargs: Any) MutableMapping[str, Any]

Get Active Garbage Collection.

To get information about the currently-active garbage collection for a registry, send a GET request to /v2/registry/$REGISTRY_NAME/garbage-collection.

Parameters:

registry_name (str) – The name of a container registry. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "garbage_collection": {
        "blobs_deleted": 0,  # Optional. The number of blobs deleted as a
          result of this garbage collection.
        "created_at": "2020-02-20 00:00:00",  # Optional. The time the
          garbage collection was created.
        "freed_bytes": 0,  # Optional. The number of bytes freed as a result
          of this garbage collection.
        "registry_name": "str",  # Optional. The name of the container
          registry.
        "status": "str",  # Optional. The current status of this garbage
          collection. Known values are: "requested", "waiting for write JWTs to
          expire", "scanning manifests", "deleting unreferenced blobs", "cancelling",
          "failed", "succeeded", and "cancelled".
        "updated_at": "2020-02-20 00:00:00",  # Optional. The time the
          garbage collection was last updated.
        "uuid": "str"  # Optional. A string specifying the UUID of the
          garbage collection.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_options(**kwargs: Any) MutableMapping[str, Any]

List Registry Options (Subscription Tiers and Available Regions).

This endpoint serves to provide additional information as to which option values are available when creating a container registry. There are multiple subscription tiers available for container registry. Each tier allows a different number of image repositories to be created in your registry, and has a different amount of storage and transfer included. There are multiple regions available for container registry and controls where your data is stored. To list the available options, send a GET request to /v2/registry/options.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "options": {
        "available_regions": [
            "str"  # Optional.
        ],
        "subscription_tiers": [
            {
                "allow_storage_overage": bool,  # Optional. A boolean
                  indicating whether the subscription tier supports additional storage
                  above what is included in the base plan at an additional cost per GiB
                  used.
                "eligibility_reasons": [
                    "str"  # Optional. If your account is not
                      eligible to use a certain subscription tier, this will include a
                      list of reasons that prevent you from using the tier.
                ],
                "eligible": bool,  # Optional. A boolean indicating
                  whether your account it eligible to use a certain subscription tier.
                "included_bandwidth_bytes": 0,  # Optional. The
                  amount of outbound data transfer included in the subscription tier in
                  bytes.
                "included_repositories": 0,  # Optional. The number
                  of repositories included in the subscription tier. ``0`` indicates
                  that the subscription tier includes unlimited repositories.
                "included_storage_bytes": 0,  # Optional. The amount
                  of storage included in the subscription tier in bytes.
                "monthly_price_in_cents": 0,  # Optional. The monthly
                  cost of the subscription tier in cents.
                "name": "str",  # Optional. The name of the
                  subscription tier.
                "slug": "str",  # Optional. The slug identifier of
                  the subscription tier.
                "storage_overage_price_in_cents": 0  # Optional. The
                  price paid in cents per GiB for additional storage beyond what is
                  included in the subscription plan.
            }
        ]
    }
}
get_subscription(**kwargs: Any) MutableMapping[str, Any]

Get Subscription Information.

A subscription is automatically created when you configure your container registry. To get information about your subscription, send a GET request to /v2/registry/subscription.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "subscription": {
        "created_at": "2020-02-20 00:00:00",  # Optional. The time at which
          the subscription was created.
        "tier": {
            "allow_storage_overage": bool,  # Optional. A boolean
              indicating whether the subscription tier supports additional storage
              above what is included in the base plan at an additional cost per GiB
              used.
            "included_bandwidth_bytes": 0,  # Optional. The amount of
              outbound data transfer included in the subscription tier in bytes.
            "included_repositories": 0,  # Optional. The number of
              repositories included in the subscription tier. ``0`` indicates that the
              subscription tier includes unlimited repositories.
            "included_storage_bytes": 0,  # Optional. The amount of
              storage included in the subscription tier in bytes.
            "monthly_price_in_cents": 0,  # Optional. The monthly cost of
              the subscription tier in cents.
            "name": "str",  # Optional. The name of the subscription
              tier.
            "slug": "str",  # Optional. The slug identifier of the
              subscription tier.
            "storage_overage_price_in_cents": 0  # Optional. The price
              paid in cents per GiB for additional storage beyond what is included in
              the subscription plan.
        },
        "updated_at": "2020-02-20 00:00:00"  # Optional. The time at which
          the subscription was last updated.
    }
}
list_garbage_collections(registry_name: str, *, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List Garbage Collections.

To get information about past garbage collections for a registry, send a GET request to /v2/registry/$REGISTRY_NAME/garbage-collections.

Parameters:
  • registry_name (str) – The name of a container registry. Required.

  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "garbage_collections": [
        {
            "blobs_deleted": 0,  # Optional. The number of blobs deleted
              as a result of this garbage collection.
            "created_at": "2020-02-20 00:00:00",  # Optional. The time
              the garbage collection was created.
            "freed_bytes": 0,  # Optional. The number of bytes freed as a
              result of this garbage collection.
            "registry_name": "str",  # Optional. The name of the
              container registry.
            "status": "str",  # Optional. The current status of this
              garbage collection. Known values are: "requested", "waiting for write
              JWTs to expire", "scanning manifests", "deleting unreferenced blobs",
              "cancelling", "failed", "succeeded", and "cancelled".
            "updated_at": "2020-02-20 00:00:00",  # Optional. The time
              the garbage collection was last updated.
            "uuid": "str"  # Optional. A string specifying the UUID of
              the garbage collection.
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_repositories(registry_name: str, *, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All Container Registry Repositories.

This endpoint has been deprecated in favor of the List All Container Registry Repositories [V2] endpoint.

To list all repositories in your container registry, send a GET request to /v2/registry/$REGISTRY_NAME/repositories.

Parameters:
  • registry_name (str) – The name of a container registry. Required.

  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    },
    "repositories": [
        {
            "latest_tag": {
                "compressed_size_bytes": 0,  # Optional. The
                  compressed size of the tag in bytes.
                "manifest_digest": "str",  # Optional. The digest of
                  the manifest associated with the tag.
                "registry_name": "str",  # Optional. The name of the
                  container registry.
                "repository": "str",  # Optional. The name of the
                  repository.
                "size_bytes": 0,  # Optional. The uncompressed size
                  of the tag in bytes (this size is calculated asynchronously so it may
                  not be immediately available).
                "tag": "str",  # Optional. The name of the tag.
                "updated_at": "2020-02-20 00:00:00"  # Optional. The
                  time the tag was last updated.
            },
            "name": "str",  # Optional. The name of the repository.
            "registry_name": "str",  # Optional. The name of the
              container registry.
            "tag_count": 0  # Optional. The number of tags in the
              repository.
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_repositories_v2(registry_name: str, *, per_page: int = 20, page: int = 1, page_token: Optional[str] = None, **kwargs: Any) MutableMapping[str, Any]

List All Container Registry Repositories (V2).

To list all repositories in your container registry, send a GET request to /v2/registry/$REGISTRY_NAME/repositoriesV2.

Parameters:
  • registry_name (str) – The name of a container registry. Required.

  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Ignored when ‘page_token’ is provided. Default value is 1.

  • page_token (str) – Token to retrieve of the next or previous set of results more quickly than using ‘page’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    },
    "repositories": [
        {
            "latest_manifest": {
                "blobs": [
                    {
                        "compressed_size_bytes": 0,  #
                          Optional. The compressed size of the blob in bytes.
                        "digest": "str"  # Optional. The
                          digest of the blob.
                    }
                ],
                "compressed_size_bytes": 0,  # Optional. The
                  compressed size of the manifest in bytes.
                "digest": "str",  # Optional. The manifest digest.
                "registry_name": "str",  # Optional. The name of the
                  container registry.
                "repository": "str",  # Optional. The name of the
                  repository.
                "size_bytes": 0,  # Optional. The uncompressed size
                  of the manifest in bytes (this size is calculated asynchronously so
                  it may not be immediately available).
                "tags": [
                    "str"  # Optional. All tags associated with
                      this manifest.
                ],
                "updated_at": "2020-02-20 00:00:00"  # Optional. The
                  time the manifest was last updated.
            },
            "manifest_count": 0,  # Optional. The number of manifests in
              the repository.
            "name": "str",  # Optional. The name of the repository.
            "registry_name": "str",  # Optional. The name of the
              container registry.
            "tag_count": 0  # Optional. The number of tags in the
              repository.
        }
    ]
}
# response body for status code(s): 400, 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_repository_manifests(registry_name: str, repository_name: str, *, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All Container Registry Repository Manifests.

To list all manifests in your container registry repository, send a GET request to /v2/registry/$REGISTRY_NAME/repositories/$REPOSITORY_NAME/digests.

Note that if your repository name contains / characters, it must be URL-encoded in the request URL. For example, to list manifests for registry.digitalocean.com/example/my/repo, the path would be /v2/registry/example/repositories/my%2Frepo/digests.

Parameters:
  • registry_name (str) – The name of a container registry. Required.

  • repository_name (str) – The name of a container registry repository. If the name contains / characters, they must be URL-encoded, e.g. %2F. Required.

  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "links": {
        "pages": {}
    },
    "manifests": [
        {
            "blobs": [
                {
                    "compressed_size_bytes": 0,  # Optional. The
                      compressed size of the blob in bytes.
                    "digest": "str"  # Optional. The digest of
                      the blob.
                }
            ],
            "compressed_size_bytes": 0,  # Optional. The compressed size
              of the manifest in bytes.
            "digest": "str",  # Optional. The manifest digest.
            "registry_name": "str",  # Optional. The name of the
              container registry.
            "repository": "str",  # Optional. The name of the repository.
            "size_bytes": 0,  # Optional. The uncompressed size of the
              manifest in bytes (this size is calculated asynchronously so it may not
              be immediately available).
            "tags": [
                "str"  # Optional. All tags associated with this
                  manifest.
            ],
            "updated_at": "2020-02-20 00:00:00"  # Optional. The time the
              manifest was last updated.
        }
    ],
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_repository_tags(registry_name: str, repository_name: str, *, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All Container Registry Repository Tags.

To list all tags in your container registry repository, send a GET request to /v2/registry/$REGISTRY_NAME/repositories/$REPOSITORY_NAME/tags.

Note that if your repository name contains / characters, it must be URL-encoded in the request URL. For example, to list tags for registry.digitalocean.com/example/my/repo, the path would be /v2/registry/example/repositories/my%2Frepo/tags.

Parameters:
  • registry_name (str) – The name of a container registry. Required.

  • repository_name (str) – The name of a container registry repository. If the name contains / characters, they must be URL-encoded, e.g. %2F. Required.

  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    },
    "tags": [
        {
            "compressed_size_bytes": 0,  # Optional. The compressed size
              of the tag in bytes.
            "manifest_digest": "str",  # Optional. The digest of the
              manifest associated with the tag.
            "registry_name": "str",  # Optional. The name of the
              container registry.
            "repository": "str",  # Optional. The name of the repository.
            "size_bytes": 0,  # Optional. The uncompressed size of the
              tag in bytes (this size is calculated asynchronously so it may not be
              immediately available).
            "tag": "str",  # Optional. The name of the tag.
            "updated_at": "2020-02-20 00:00:00"  # Optional. The time the
              tag was last updated.
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
run_garbage_collection(registry_name: str, **kwargs: Any) MutableMapping[str, Any]

Start Garbage Collection.

Garbage collection enables users to clear out unreferenced blobs (layer & manifest data) after deleting one or more manifests from a repository. If there are no unreferenced blobs resulting from the deletion of one or more manifests, garbage collection is effectively a noop. See here for more information about how and why you should clean up your container registry periodically.

To request a garbage collection run on your registry, send a POST request to /v2/registry/$REGISTRY_NAME/garbage-collection. This will initiate the following sequence of events on your registry.

  • Set the registry to read-only mode, meaning no further write-scoped JWTs will be issued to registry clients. Existing write-scoped JWTs will continue to work until they expire which can take up to 15 minutes.

  • Wait until all existing write-scoped JWTs have expired.

  • Scan all registry manifests to determine which blobs are unreferenced.

  • Delete all unreferenced blobs from the registry.

  • Record the number of blobs deleted and bytes freed, mark the garbage collection status as success.

  • Remove the read-only mode restriction from the registry, meaning write-scoped JWTs will once again be issued to registry clients.

Parameters:

registry_name (str) – The name of a container registry. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 201
response == {
    "garbage_collection": {
        "blobs_deleted": 0,  # Optional. The number of blobs deleted as a
          result of this garbage collection.
        "created_at": "2020-02-20 00:00:00",  # Optional. The time the
          garbage collection was created.
        "freed_bytes": 0,  # Optional. The number of bytes freed as a result
          of this garbage collection.
        "registry_name": "str",  # Optional. The name of the container
          registry.
        "status": "str",  # Optional. The current status of this garbage
          collection. Known values are: "requested", "waiting for write JWTs to
          expire", "scanning manifests", "deleting unreferenced blobs", "cancelling",
          "failed", "succeeded", and "cancelled".
        "updated_at": "2020-02-20 00:00:00",  # Optional. The time the
          garbage collection was last updated.
        "uuid": "str"  # Optional. A string specifying the UUID of the
          garbage collection.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
update_garbage_collection(registry_name: str, garbage_collection_uuid: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
update_garbage_collection(registry_name: str, garbage_collection_uuid: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Update Garbage Collection.

To cancel the currently-active garbage collection for a registry, send a PUT request to /v2/registry/$REGISTRY_NAME/garbage-collection/$GC_UUID and specify one or more of the attributes below.

Parameters:
  • registry_name (str) – The name of a container registry. Required.

  • garbage_collection_uuid (str) – The UUID of a garbage collection run. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "garbage_collection": {
        "blobs_deleted": 0,  # Optional. The number of blobs deleted as a
          result of this garbage collection.
        "created_at": "2020-02-20 00:00:00",  # Optional. The time the
          garbage collection was created.
        "freed_bytes": 0,  # Optional. The number of bytes freed as a result
          of this garbage collection.
        "registry_name": "str",  # Optional. The name of the container
          registry.
        "status": "str",  # Optional. The current status of this garbage
          collection. Known values are: "requested", "waiting for write JWTs to
          expire", "scanning manifests", "deleting unreferenced blobs", "cancelling",
          "failed", "succeeded", and "cancelled".
        "updated_at": "2020-02-20 00:00:00",  # Optional. The time the
          garbage collection was last updated.
        "uuid": "str"  # Optional. A string specifying the UUID of the
          garbage collection.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
update_subscription(body: Optional[JSON] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON
update_subscription(body: Optional[IO] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON

Update Subscription Tier.

After creating your registry, you can switch to a different subscription tier to better suit your needs. To do this, send a POST request to /v2/registry/subscription.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Default value is None.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "subscription": {
        "created_at": "2020-02-20 00:00:00",  # Optional. The time at which
          the subscription was created.
        "tier": {
            "allow_storage_overage": bool,  # Optional. A boolean
              indicating whether the subscription tier supports additional storage
              above what is included in the base plan at an additional cost per GiB
              used.
            "included_bandwidth_bytes": 0,  # Optional. The amount of
              outbound data transfer included in the subscription tier in bytes.
            "included_repositories": 0,  # Optional. The number of
              repositories included in the subscription tier. ``0`` indicates that the
              subscription tier includes unlimited repositories.
            "included_storage_bytes": 0,  # Optional. The amount of
              storage included in the subscription tier in bytes.
            "monthly_price_in_cents": 0,  # Optional. The monthly cost of
              the subscription tier in cents.
            "name": "str",  # Optional. The name of the subscription
              tier.
            "slug": "str",  # Optional. The slug identifier of the
              subscription tier.
            "storage_overage_price_in_cents": 0  # Optional. The price
              paid in cents per GiB for additional storage beyond what is included in
              the subscription plan.
        },
        "updated_at": "2020-02-20 00:00:00"  # Optional. The time at which
          the subscription was last updated.
    }
}
validate_name(body: JSON, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
validate_name(body: IO, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Validate a Container Registry Name.

To validate that a container registry name is available for use, send a POST request to /v2/registry/validate-name.

If the name is both formatted correctly and available, the response code will be 204 and contain no body. If the name is already in use, the response will be a 409 Conflict.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 409
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
class pydo.operations.ReservedIPsActionsOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s reserved_ips_actions attribute.

get(reserved_ip: str, action_id: int, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Reserved IP Action.

To retrieve the status of a reserved IP action, send a GET request to /v2/reserved_ips/$RESERVED_IP/actions/$ACTION_ID.

Parameters:
  • reserved_ip (str) – A reserved IP address. Required.

  • action_id (int) – A unique numeric ID that can be used to identify and reference an action. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "action": {
        "completed_at": "2020-02-20 00:00:00",  # Optional. A time value
          given in ISO8601 combined date and time format that represents when the
          action was completed.
        "id": 0,  # Optional. A unique numeric ID that can be used to
          identify and reference an action.
        "project_id": "str",  # Optional. The UUID of the project to which
          the reserved IP currently belongs.
        "region": {
            "available": bool,  # This is a boolean value that represents
              whether new Droplets can be created in this region. Required.
            "features": {},  # This attribute is set to an array which
              contains features available in this region. Required.
            "name": "str",  # The display name of the region.  This will
              be a full name that is used in the control panel and other interfaces.
              Required.
            "sizes": {},  # This attribute is set to an array which
              contains the identifying slugs for the sizes available in this region.
              Required.
            "slug": "str"  # A human-readable string that is used as a
              unique identifier for each region. Required.
        },
        "region_slug": {},  # Optional. Any object.
        "resource_id": 0,  # Optional. A unique identifier for the resource
          that the action is associated with.
        "resource_type": "str",  # Optional. The type of resource that the
          action is associated with.
        "started_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the action was
          initiated.
        "status": "in-progress",  # Optional. Default value is "in-progress".
          The current status of the action. This can be "in-progress", "completed", or
          "errored". Known values are: "in-progress", "completed", and "errored".
        "type": "str"  # Optional. This is the type of action that the object
          represents. For example, this could be "transfer" to represent the state of
          an image transfer action.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list(reserved_ip: str, **kwargs: Any) MutableMapping[str, Any]

List All Actions for a Reserved IP.

To retrieve all actions that have been executed on a reserved IP, send a GET request to /v2/reserved_ips/$RESERVED_IP/actions.

Parameters:

reserved_ip (str) – A reserved IP address. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "actions": [
        {
            "completed_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the action was completed.
            "id": 0,  # Optional. A unique numeric ID that can be used to
              identify and reference an action.
            "region": {
                "available": bool,  # This is a boolean value that
                  represents whether new Droplets can be created in this region.
                  Required.
                "features": {},  # This attribute is set to an array
                  which contains features available in this region. Required.
                "name": "str",  # The display name of the region.
                  This will be a full name that is used in the control panel and other
                  interfaces. Required.
                "sizes": {},  # This attribute is set to an array
                  which contains the identifying slugs for the sizes available in this
                  region. Required.
                "slug": "str"  # A human-readable string that is used
                  as a unique identifier for each region. Required.
            },
            "region_slug": {},  # Optional. Any object.
            "resource_id": 0,  # Optional. A unique identifier for the
              resource that the action is associated with.
            "resource_type": "str",  # Optional. The type of resource
              that the action is associated with.
            "started_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the action was initiated.
            "status": "in-progress",  # Optional. Default value is
              "in-progress". The current status of the action. This can be
              "in-progress", "completed", or "errored". Known values are:
              "in-progress", "completed", and "errored".
            "type": "str"  # Optional. This is the type of action that
              the object represents. For example, this could be "transfer" to represent
              the state of an image transfer action.
        }
    ],
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
post(reserved_ip: str, body: Optional[JSON] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON
post(reserved_ip: str, body: Optional[IO] = None, *, content_type: str = 'application/json', **kwargs: Any) JSON

Initiate a Reserved IP Action.

To initiate an action on a reserved IP send a POST request to /v2/reserved_ips/$RESERVED_IP/actions. In the JSON body to the request, set the type attribute to on of the supported action types:

Action

Details

assign

Assigns a reserved IP to a Droplet

unassign

Unassign a reserved IP from a Droplet.

Parameters:
  • reserved_ip (str) – A reserved IP address. Required.

  • body (JSON or IO) – The type attribute set in the request body will specify the action that will be taken on the reserved IP. Is either a model type or a IO type. Default value is None.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 201
response == {
    "action": {
        "completed_at": "2020-02-20 00:00:00",  # Optional. A time value
          given in ISO8601 combined date and time format that represents when the
          action was completed.
        "id": 0,  # Optional. A unique numeric ID that can be used to
          identify and reference an action.
        "project_id": "str",  # Optional. The UUID of the project to which
          the reserved IP currently belongs.
        "region": {
            "available": bool,  # This is a boolean value that represents
              whether new Droplets can be created in this region. Required.
            "features": {},  # This attribute is set to an array which
              contains features available in this region. Required.
            "name": "str",  # The display name of the region.  This will
              be a full name that is used in the control panel and other interfaces.
              Required.
            "sizes": {},  # This attribute is set to an array which
              contains the identifying slugs for the sizes available in this region.
              Required.
            "slug": "str"  # A human-readable string that is used as a
              unique identifier for each region. Required.
        },
        "region_slug": {},  # Optional. Any object.
        "resource_id": 0,  # Optional. A unique identifier for the resource
          that the action is associated with.
        "resource_type": "str",  # Optional. The type of resource that the
          action is associated with.
        "started_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the action was
          initiated.
        "status": "in-progress",  # Optional. Default value is "in-progress".
          The current status of the action. This can be "in-progress", "completed", or
          "errored". Known values are: "in-progress", "completed", and "errored".
        "type": "str"  # Optional. This is the type of action that the object
          represents. For example, this could be "transfer" to represent the state of
          an image transfer action.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
class pydo.operations.ReservedIPsOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s reserved_ips attribute.

create(body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
create(body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create a New Reserved IP.

On creation, a reserved IP must be either assigned to a Droplet or reserved to a region.

  • To create a new reserved IP assigned to a Droplet, send a POST request to /v2/reserved_ips with the droplet_id attribute.

  • To create a new reserved IP reserved to a region, send a POST request to /v2/reserved_ips with the region attribute.

Note: In addition to the standard rate limiting, only 12 reserved IPs may be created per 60 seconds.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 202
response == {
    "links": {
        "actions": [
            {
                "href": "str",  # Optional. A URL that can be used to
                  access the action.
                "id": 0,  # Optional. A unique numeric ID that can be
                  used to identify and reference an action.
                "rel": "str"  # Optional. A string specifying the
                  type of the related action.
            }
        ],
        "droplets": [
            {
                "href": "str",  # Optional. A URL that can be used to
                  access the action.
                "id": 0,  # Optional. A unique numeric ID that can be
                  used to identify and reference an action.
                "rel": "str"  # Optional. A string specifying the
                  type of the related action.
            }
        ]
    },
    "reserved_ip": {
        "droplet": {},
        "ip": "str",  # Optional. The public IP address of the reserved IP.
          It also serves as its identifier.
        "locked": bool,  # Optional. A boolean value indicating whether or
          not the reserved IP has pending actions preventing new ones from being
          submitted.
        "project_id": "str",  # Optional. The UUID of the project to which
          the reserved IP currently belongs.
        "region": {
            "available": bool,  # This is a boolean value that represents
              whether new Droplets can be created in this region. Required.
            "features": {},  # This attribute is set to an array which
              contains features available in this region. Required.
            "name": "str",  # The display name of the region.  This will
              be a full name that is used in the control panel and other interfaces.
              Required.
            "sizes": {},  # This attribute is set to an array which
              contains the identifying slugs for the sizes available in this region.
              Required.
            "slug": "str"  # A human-readable string that is used as a
              unique identifier for each region. Required.
        }
    }
}
delete(reserved_ip: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete a Reserved IP.

To delete a reserved IP and remove it from your account, send a DELETE request to /v2/reserved_ips/$RESERVED_IP_ADDR.

A successful request will receive a 204 status code with no body in response. This indicates that the request was processed successfully.

Parameters:

reserved_ip (str) – A reserved IP address. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get(reserved_ip: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Reserved IP.

To show information about a reserved IP, send a GET request to /v2/reserved_ips/$RESERVED_IP_ADDR.

Parameters:

reserved_ip (str) – A reserved IP address. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "reserved_ip": {
        "droplet": {},
        "ip": "str",  # Optional. The public IP address of the reserved IP.
          It also serves as its identifier.
        "locked": bool,  # Optional. A boolean value indicating whether or
          not the reserved IP has pending actions preventing new ones from being
          submitted.
        "project_id": "str",  # Optional. The UUID of the project to which
          the reserved IP currently belongs.
        "region": {
            "available": bool,  # This is a boolean value that represents
              whether new Droplets can be created in this region. Required.
            "features": {},  # This attribute is set to an array which
              contains features available in this region. Required.
            "name": "str",  # The display name of the region.  This will
              be a full name that is used in the control panel and other interfaces.
              Required.
            "sizes": {},  # This attribute is set to an array which
              contains the identifying slugs for the sizes available in this region.
              Required.
            "slug": "str"  # A human-readable string that is used as a
              unique identifier for each region. Required.
        }
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list(*, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All Reserved IPs.

To list all of the reserved IPs available on your account, send a GET request to /v2/reserved_ips.

Parameters:
  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    },
    "reserved_ips": [
        {
            "droplet": {},
            "ip": "str",  # Optional. The public IP address of the
              reserved IP. It also serves as its identifier.
            "locked": bool,  # Optional. A boolean value indicating
              whether or not the reserved IP has pending actions preventing new ones
              from being submitted.
            "project_id": "str",  # Optional. The UUID of the project to
              which the reserved IP currently belongs.
            "region": {
                "available": bool,  # This is a boolean value that
                  represents whether new Droplets can be created in this region.
                  Required.
                "features": {},  # This attribute is set to an array
                  which contains features available in this region. Required.
                "name": "str",  # The display name of the region.
                  This will be a full name that is used in the control panel and other
                  interfaces. Required.
                "sizes": {},  # This attribute is set to an array
                  which contains the identifying slugs for the sizes available in this
                  region. Required.
                "slug": "str"  # A human-readable string that is used
                  as a unique identifier for each region. Required.
            }
        }
    ]
}
class pydo.operations.SizesOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s sizes attribute.

list(*, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All Droplet Sizes.

To list all of available Droplet sizes, send a GET request to /v2/sizes. The response will be a JSON object with a key called sizes. The value of this will be an array of size objects each of which contain the standard size attributes.

Parameters:
  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    },
    "sizes": [
        {
            "available": True,  # Default value is True. This is a
              boolean value that represents whether new Droplets can be created with
              this size.
            "description": "str",  # A string describing the class of
              Droplets created from this size. For example: Basic, General Purpose,
              CPU-Optimized, Memory-Optimized, or Storage-Optimized. Required.
            "disk": 0,  # The amount of disk space set aside for Droplets
              of this size. The value is represented in gigabytes. Required.
            "memory": 0,  # The amount of RAM allocated to Droplets
              created of this size. The value is represented in megabytes. Required.
            "price_hourly": 0.0,  # This describes the price of the
              Droplet size as measured hourly. The value is measured in US dollars.
              Required.
            "price_monthly": 0.0,  # This attribute describes the monthly
              cost of this Droplet size if the Droplet is kept for an entire month. The
              value is measured in US dollars. Required.
            "regions": [
                "str"  # An array containing the region slugs where
                  this size is available for Droplet creates. Required.
            ],
            "slug": "str",  # A human-readable string that is used to
              uniquely identify each size. Required.
            "transfer": 0.0,  # The amount of transfer bandwidth that is
              available for Droplets created in this size. This only counts traffic on
              the public interface. The value is given in terabytes. Required.
            "vcpus": 0  # The integer of number CPUs allocated to
              Droplets of this size. Required.
        }
    ]
}
class pydo.operations.SnapshotsOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s snapshots attribute.

delete(snapshot_id: MutableMapping[str, Any], **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete a Snapshot.

Both Droplet and volume snapshots are managed through the /v2/snapshots/ endpoint. To delete a snapshot, send a DELETE request to /v2/snapshots/$SNAPSHOT_ID.

A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.

Parameters:

snapshot_id (JSON) – Either the ID of an existing snapshot. This will be an integer for a Droplet snapshot or a string for a volume snapshot. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get(snapshot_id: MutableMapping[str, Any], **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Snapshot.

To retrieve information about a snapshot, send a GET request to /v2/snapshots/$SNAPSHOT_ID.

The response will be a JSON object with a key called snapshot. The value of this will be an snapshot object containing the standard snapshot attributes.

Parameters:

snapshot_id (JSON) – Either the ID of an existing snapshot. This will be an integer for a Droplet snapshot or a string for a volume snapshot. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "snapshot": {
        "created_at": "2020-02-20 00:00:00",  # A time value given in ISO8601
          combined date and time format that represents when the snapshot was created.
          Required.
        "min_disk_size": 0,  # The minimum size in GB required for a volume
          or Droplet to use this snapshot. Required.
        "name": "str",  # A human-readable name for the snapshot. Required.
        "regions": [
            "str"  # An array of the regions that the snapshot is
              available in. The regions are represented by their identifying slug
              values. Required.
        ],
        "resource_id": "str",  # The unique identifier for the resource that
          the snapshot originated from. Required.
        "resource_type": "str",  # The type of resource that the snapshot
          originated from. Required. Known values are: "droplet" and "volume".
        "size_gigabytes": 0.0,  # The billable size of the snapshot in
          gigabytes. Required.
        "tags": [
            "str"  # An array of Tags the snapshot has been tagged with.
              Required.
        ]
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list(*, per_page: int = 20, page: int = 1, resource_type: Optional[str] = None, **kwargs: Any) MutableMapping[str, Any]

List All Snapshots.

To list all of the snapshots available on your account, send a GET request to /v2/snapshots.

The response will be a JSON object with a key called snapshots. This will be set to an array of snapshot objects, each of which will contain the standard snapshot attributes.

Filtering Results by Resource Type

It’s possible to request filtered results by including certain query parameters.

List Droplet Snapshots

To retrieve only snapshots based on Droplets, include the resource_type query parameter set to droplet. For example, /v2/snapshots?resource_type=droplet.

List Volume Snapshots

To retrieve only snapshots based on volumes, include the resource_type query parameter set to volume. For example, /v2/snapshots?resource_type=volume.

keyword per_page:

Number of items returned per page. Default value is 20.

paramtype per_page:

int

keyword page:

Which ‘page’ of paginated results to return. Default value is 1.

paramtype page:

int

keyword resource_type:

Used to filter snapshots by a resource type. Known values are: “droplet” and “volume”. Default value is None.

paramtype resource_type:

str

return:

JSON object

rtype:

JSON

raises ~azure.core.exceptions.HttpResponseError:

Example:
# response body for status code(s): 200
response == {
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    },
    "snapshots": [
        {
            "created_at": "2020-02-20 00:00:00",  # A time value given in
              ISO8601 combined date and time format that represents when the snapshot
              was created. Required.
            "min_disk_size": 0,  # The minimum size in GB required for a
              volume or Droplet to use this snapshot. Required.
            "name": "str",  # A human-readable name for the snapshot.
              Required.
            "regions": [
                "str"  # An array of the regions that the snapshot is
                  available in. The regions are represented by their identifying slug
                  values. Required.
            ],
            "resource_id": "str",  # The unique identifier for the
              resource that the snapshot originated from. Required.
            "resource_type": "str",  # The type of resource that the
              snapshot originated from. Required. Known values are: "droplet" and
              "volume".
            "size_gigabytes": 0.0,  # The billable size of the snapshot
              in gigabytes. Required.
            "tags": [
                "str"  # An array of Tags the snapshot has been
                  tagged with. Required.
            ]
        }
    ]
}
class pydo.operations.SshKeysOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s ssh_keys attribute.

create(body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
create(body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create a New SSH Key.

To add a new SSH public key to your DigitalOcean account, send a POST request to /v2/account/keys. Set the name attribute to the name you wish to use and the public_key attribute to the full public key you are adding.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 201
response == {
    "ssh_key": {
        "fingerprint": "str",  # Optional. A unique identifier that
          differentiates this key from other keys using  a format that SSH recognizes.
          The fingerprint is created when the key is added to your account.
        "id": 0,  # Optional. A unique identification number for this key.
          Can be used to embed a  specific SSH key into a Droplet.
        "name": "str",  # A human-readable display name for this key, used to
          easily identify the SSH keys when they are displayed. Required.
        "public_key": "str"  # The entire public key string that was
          uploaded. Embedded into the root user's ``authorized_keys`` file if you
          include this key during Droplet creation. Required.
    }
}
delete(ssh_key_identifier: MutableMapping[str, Any], **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete an SSH Key.

To destroy a public SSH key that you have in your account, send a DELETE request to /v2/account/keys/$KEY_ID or /v2/account/keys/$KEY_FINGERPRINT. A 204 status will be returned, indicating that the action was successful and that the response body is empty.

Parameters:

ssh_key_identifier (JSON) – Either the ID or the fingerprint of an existing SSH key. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get(ssh_key_identifier: MutableMapping[str, Any], **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing SSH Key.

To get information about a key, send a GET request to /v2/account/keys/$KEY_ID or /v2/account/keys/$KEY_FINGERPRINT. The response will be a JSON object with the key ssh_key and value an ssh_key object which contains the standard ssh_key attributes.

Parameters:

ssh_key_identifier (JSON) – Either the ID or the fingerprint of an existing SSH key. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "ssh_key": {
        "fingerprint": "str",  # Optional. A unique identifier that
          differentiates this key from other keys using  a format that SSH recognizes.
          The fingerprint is created when the key is added to your account.
        "id": 0,  # Optional. A unique identification number for this key.
          Can be used to embed a  specific SSH key into a Droplet.
        "name": "str",  # A human-readable display name for this key, used to
          easily identify the SSH keys when they are displayed. Required.
        "public_key": "str"  # The entire public key string that was
          uploaded. Embedded into the root user's ``authorized_keys`` file if you
          include this key during Droplet creation. Required.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list(*, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All SSH Keys.

To list all of the keys in your account, send a GET request to /v2/account/keys. The response will be a JSON object with a key set to ssh_keys. The value of this will be an array of ssh_key objects, each of which contains the standard ssh_key attributes.

Parameters:
  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    },
    "ssh_keys": [
        {
            "fingerprint": "str",  # Optional. A unique identifier that
              differentiates this key from other keys using  a format that SSH
              recognizes. The fingerprint is created when the key is added to your
              account.
            "id": 0,  # Optional. A unique identification number for this
              key. Can be used to embed a  specific SSH key into a Droplet.
            "name": "str",  # A human-readable display name for this key,
              used to easily identify the SSH keys when they are displayed. Required.
            "public_key": "str"  # The entire public key string that was
              uploaded. Embedded into the root user's ``authorized_keys`` file if you
              include this key during Droplet creation. Required.
        }
    ]
}
update(ssh_key_identifier: JSON, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
update(ssh_key_identifier: JSON, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Update an SSH Key’s Name.

To update the name of an SSH key, send a PUT request to either /v2/account/keys/$SSH_KEY_ID or /v2/account/keys/$SSH_KEY_FINGERPRINT. Set the name attribute to the new name you want to use.

Parameters:
  • ssh_key_identifier (JSON) – Either the ID or the fingerprint of an existing SSH key. Required.

  • body (JSON or IO) – Set the name attribute to the new name you want to use. Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "ssh_key": {
        "fingerprint": "str",  # Optional. A unique identifier that
          differentiates this key from other keys using  a format that SSH recognizes.
          The fingerprint is created when the key is added to your account.
        "id": 0,  # Optional. A unique identification number for this key.
          Can be used to embed a  specific SSH key into a Droplet.
        "name": "str",  # A human-readable display name for this key, used to
          easily identify the SSH keys when they are displayed. Required.
        "public_key": "str"  # The entire public key string that was
          uploaded. Embedded into the root user's ``authorized_keys`` file if you
          include this key during Droplet creation. Required.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
class pydo.operations.TagsOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s tags attribute.

assign_resources(tag_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
assign_resources(tag_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Tag a Resource.

Resources can be tagged by sending a POST request to /v2/tags/$TAG_NAME/resources with an array of json objects containing resource_id and resource_type attributes. Currently only tagging of Droplets, Databases, Images, Volumes, and Volume Snapshots is supported. resource_type is expected to be the string droplet, database, image, volume or volume_snapshot. resource_id is expected to be the ID of the resource as a string.

Parameters:
  • tag_id (str) – The name of the tag. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
create(body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
create(body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create a New Tag.

To create a tag you can send a POST request to /v2/tags with a name attribute.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 201
response == {
    "tag": {
        "name": "str",  # Optional. The name of the tag. Tags may contain
          letters, numbers, colons, dashes, and underscores."nThere is a limit of 255
          characters per tag."n"n**Note:** Tag names are case stable, which means the
          capitalization you use when you first create a tag is canonical."n"nWhen
          working with tags in the API, you must use the tag's canonical
          capitalization. For example, if you create a tag named "PROD", the URL to add
          that tag to a resource would be
          ``https://api.digitalocean.com/v2/tags/PROD/resources`` (not
          ``/v2/tags/prod/resources``"" )."n"nTagged resources in the control panel
          will always display the canonical capitalization. For example, if you create
          a tag named "PROD", you can tag resources in the control panel by entering
          "prod". The tag will still display with its canonical capitalization, "PROD".
        "resources": {
            "count": 0,  # Optional. The number of tagged objects for
              this type of resource.
            "databases": {
                "count": 0,  # Optional. The number of tagged objects
                  for this type of resource.
                "last_tagged_uri": "str"  # Optional. The URI for the
                  last tagged object for this type of resource.
            },
            "droplets": {
                "count": 0,  # Optional. The number of tagged objects
                  for this type of resource.
                "last_tagged_uri": "str"  # Optional. The URI for the
                  last tagged object for this type of resource.
            },
            "imgages": {
                "count": 0,  # Optional. The number of tagged objects
                  for this type of resource.
                "last_tagged_uri": "str"  # Optional. The URI for the
                  last tagged object for this type of resource.
            },
            "last_tagged_uri": "str",  # Optional. The URI for the last
              tagged object for this type of resource.
            "volume_snapshots": {
                "count": 0,  # Optional. The number of tagged objects
                  for this type of resource.
                "last_tagged_uri": "str"  # Optional. The URI for the
                  last tagged object for this type of resource.
            },
            "volumes": {
                "count": 0,  # Optional. The number of tagged objects
                  for this type of resource.
                "last_tagged_uri": "str"  # Optional. The URI for the
                  last tagged object for this type of resource.
            }
        }
    }
}
# response body for status code(s): 400
response == {
    "error": "str",  # A message providing information about the error. Required.
    "messages": [
        "str"  # Optional. A list of error messages.
    ],
    "root_causes": [
        "str"  # A list of underlying causes for the error, including details
          to help  resolve it when possible. Required.
    ]
}
delete(tag_id: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete a Tag.

A tag can be deleted by sending a DELETE request to /v2/tags/$TAG_NAME. Deleting a tag also untags all the resources that have previously been tagged by the Tag.

Parameters:

tag_id (str) – The name of the tag. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get(tag_id: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve a Tag.

To retrieve an individual tag, you can send a GET request to /v2/tags/$TAG_NAME.

Parameters:

tag_id (str) – The name of the tag. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "tag": {
        "name": "str",  # Optional. The name of the tag. Tags may contain
          letters, numbers, colons, dashes, and underscores."nThere is a limit of 255
          characters per tag."n"n**Note:** Tag names are case stable, which means the
          capitalization you use when you first create a tag is canonical."n"nWhen
          working with tags in the API, you must use the tag's canonical
          capitalization. For example, if you create a tag named "PROD", the URL to add
          that tag to a resource would be
          ``https://api.digitalocean.com/v2/tags/PROD/resources`` (not
          ``/v2/tags/prod/resources``"" )."n"nTagged resources in the control panel
          will always display the canonical capitalization. For example, if you create
          a tag named "PROD", you can tag resources in the control panel by entering
          "prod". The tag will still display with its canonical capitalization, "PROD".
        "resources": {
            "count": 0,  # Optional. The number of tagged objects for
              this type of resource.
            "databases": {
                "count": 0,  # Optional. The number of tagged objects
                  for this type of resource.
                "last_tagged_uri": "str"  # Optional. The URI for the
                  last tagged object for this type of resource.
            },
            "droplets": {
                "count": 0,  # Optional. The number of tagged objects
                  for this type of resource.
                "last_tagged_uri": "str"  # Optional. The URI for the
                  last tagged object for this type of resource.
            },
            "imgages": {
                "count": 0,  # Optional. The number of tagged objects
                  for this type of resource.
                "last_tagged_uri": "str"  # Optional. The URI for the
                  last tagged object for this type of resource.
            },
            "last_tagged_uri": "str",  # Optional. The URI for the last
              tagged object for this type of resource.
            "volume_snapshots": {
                "count": 0,  # Optional. The number of tagged objects
                  for this type of resource.
                "last_tagged_uri": "str"  # Optional. The URI for the
                  last tagged object for this type of resource.
            },
            "volumes": {
                "count": 0,  # Optional. The number of tagged objects
                  for this type of resource.
                "last_tagged_uri": "str"  # Optional. The URI for the
                  last tagged object for this type of resource.
            }
        }
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list(*, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All Tags.

To list all of your tags, you can send a GET request to /v2/tags.

Parameters:
  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    },
    "tags": [
        {
            "name": "str",  # Optional. The name of the tag. Tags may
              contain letters, numbers, colons, dashes, and underscores."nThere is a
              limit of 255 characters per tag."n"n**Note:** Tag names are case stable,
              which means the capitalization you use when you first create a tag is
              canonical."n"nWhen working with tags in the API, you must use the tag's
              canonical capitalization. For example, if you create a tag named "PROD",
              the URL to add that tag to a resource would be
              ``https://api.digitalocean.com/v2/tags/PROD/resources`` (not
              ``/v2/tags/prod/resources``"" )."n"nTagged resources in the control panel
              will always display the canonical capitalization. For example, if you
              create a tag named "PROD", you can tag resources in the control panel by
              entering "prod". The tag will still display with its canonical
              capitalization, "PROD".
            "resources": {
                "count": 0,  # Optional. The number of tagged objects
                  for this type of resource.
                "databases": {
                    "count": 0,  # Optional. The number of tagged
                      objects for this type of resource.
                    "last_tagged_uri": "str"  # Optional. The URI
                      for the last tagged object for this type of resource.
                },
                "droplets": {
                    "count": 0,  # Optional. The number of tagged
                      objects for this type of resource.
                    "last_tagged_uri": "str"  # Optional. The URI
                      for the last tagged object for this type of resource.
                },
                "imgages": {
                    "count": 0,  # Optional. The number of tagged
                      objects for this type of resource.
                    "last_tagged_uri": "str"  # Optional. The URI
                      for the last tagged object for this type of resource.
                },
                "last_tagged_uri": "str",  # Optional. The URI for
                  the last tagged object for this type of resource.
                "volume_snapshots": {
                    "count": 0,  # Optional. The number of tagged
                      objects for this type of resource.
                    "last_tagged_uri": "str"  # Optional. The URI
                      for the last tagged object for this type of resource.
                },
                "volumes": {
                    "count": 0,  # Optional. The number of tagged
                      objects for this type of resource.
                    "last_tagged_uri": "str"  # Optional. The URI
                      for the last tagged object for this type of resource.
                }
            }
        }
    ]
}
unassign_resources(tag_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]
unassign_resources(tag_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) Optional[JSON]

Untag a Resource.

Resources can be untagged by sending a DELETE request to /v2/tags/$TAG_NAME/resources with an array of json objects containing resource_id and resource_type attributes. Currently only untagging of Droplets, Databases, Images, Volumes, and Volume Snapshots is supported. resource_type is expected to be the string droplet, database, image, volume or volume_snapshot. resource_id is expected to be the ID of the resource as a string.

Parameters:
  • tag_id (str) – The name of the tag. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
class pydo.operations.UptimeOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s uptime attribute.

create_alert(check_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
create_alert(check_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create a New Alert.

To create an Uptime alert, send a POST request to /v2/uptime/checks/$CHECK_ID/alerts specifying the attributes in the table below in the JSON body.

Parameters:
  • check_id (str) – A unique identifier for a check. Required.

  • body (JSON or IO) – The ‘’type’’ field dictates the type of alert, and hence what type of value to pass into the threshold property. Type | Description | Threshold Value —–|-------------|——————– latency | alerts on the response latency | milliseconds down | alerts on a target registering as down in any region | N/A (Not required) down_global | alerts on a target registering as down globally | N/A (Not required) ssl_expiry | alerts on a SSL certificate expiring within $threshold days | days. Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 201
response == {
    "alert": {
        "comparison": "str",  # Optional. The comparison operator used
          against the alert's threshold. Known values are: "greater_than" and
          "less_than".
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference the alert.
        "name": "str",  # Optional. A human-friendly display name.
        "notifications": {
            "email": [
                "str"  # An email to notify on an alert trigger.
                  Required.
            ],
            "slack": [
                {
                    "channel": "str",  # Slack channel to notify
                      of an alert trigger. Required.
                    "url": "str"  # Slack Webhook URL. Required.
                }
            ]
        },
        "period": "str",  # Optional. Period of time the threshold must be
          exceeded to trigger the alert. Known values are: "2m", "3m", "5m", "10m",
          "15m", "30m", and "1h".
        "threshold": 0,  # Optional. The threshold at which the alert will
          enter a trigger state. The specific threshold is dependent on the alert type.
        "type": "str"  # Optional. The type of alert. Known values are:
          "latency", "down", "down_global", and "ssl_expiry".
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
create_check(body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
create_check(body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create a New Check.

To create an Uptime check, send a POST request to /v2/uptime/checks specifying the attributes in the table below in the JSON body.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 201
response == {
    "check": {
        "enabled": True,  # Optional. Default value is True. A boolean value
          indicating whether the check is enabled/disabled.
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference the check.
        "name": "str",  # Optional. A human-friendly display name.
        "regions": [
            "str"  # Optional. An array containing the selected regions
              to perform healthchecks from.
        ],
        "target": "str",  # Optional. The endpoint to perform healthchecks
          on.
        "type": "str"  # Optional. The type of health check to perform. Known
          values are: "ping", "http", and "https".
    }
}
delete_alert(check_id: str, alert_id: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete an Alert.

To delete an Uptime alert, send a DELETE request to /v2/uptime/checks/$CHECK_ID/alerts/$ALERT_ID. A 204 status code with no body will be returned in response to a successful request.

Parameters:
  • check_id (str) – A unique identifier for a check. Required.

  • alert_id (str) – A unique identifier for an alert. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
delete_check(check_id: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete a Check.

To delete an Uptime check, send a DELETE request to /v2/uptime/checks/$CHECK_ID. A 204 status code with no body will be returned in response to a successful request.

Deleting a check will also delete alerts associated with the check.

Parameters:

check_id (str) – A unique identifier for a check. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_alert(check_id: str, alert_id: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Alert.

To show information about an existing alert, send a GET request to /v2/uptime/checks/$CHECK_ID/alerts/$ALERT_ID.

Parameters:
  • check_id (str) – A unique identifier for a check. Required.

  • alert_id (str) – A unique identifier for an alert. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "alert": {
        "comparison": "str",  # Optional. The comparison operator used
          against the alert's threshold. Known values are: "greater_than" and
          "less_than".
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference the alert.
        "name": "str",  # Optional. A human-friendly display name.
        "notifications": {
            "email": [
                "str"  # An email to notify on an alert trigger.
                  Required.
            ],
            "slack": [
                {
                    "channel": "str",  # Slack channel to notify
                      of an alert trigger. Required.
                    "url": "str"  # Slack Webhook URL. Required.
                }
            ]
        },
        "period": "str",  # Optional. Period of time the threshold must be
          exceeded to trigger the alert. Known values are: "2m", "3m", "5m", "10m",
          "15m", "30m", and "1h".
        "threshold": 0,  # Optional. The threshold at which the alert will
          enter a trigger state. The specific threshold is dependent on the alert type.
        "type": "str"  # Optional. The type of alert. Known values are:
          "latency", "down", "down_global", and "ssl_expiry".
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_check(check_id: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Check.

To show information about an existing check, send a GET request to /v2/uptime/checks/$CHECK_ID.

Parameters:

check_id (str) – A unique identifier for a check. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "check": {
        "enabled": True,  # Optional. Default value is True. A boolean value
          indicating whether the check is enabled/disabled.
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference the check.
        "name": "str",  # Optional. A human-friendly display name.
        "regions": [
            "str"  # Optional. An array containing the selected regions
              to perform healthchecks from.
        ],
        "target": "str",  # Optional. The endpoint to perform healthchecks
          on.
        "type": "str"  # Optional. The type of health check to perform. Known
          values are: "ping", "http", and "https".
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_check_state(check_id: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve Check State.

To show information about an existing check’s state, send a GET request to /v2/uptime/checks/$CHECK_ID/state.

Parameters:

check_id (str) – A unique identifier for a check. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "state": {
        "previous_outage": {
            "duration_seconds": 0,  # Optional.
            "ended_at": "str",  # Optional.
            "region": "str",  # Optional.
            "started_at": "str"  # Optional.
        },
        "regions": {
            "eu_west": {
                "status": "str",  # Optional. Known values are:
                  "DOWN", "UP", and "CHECKING".
                "status_changed_at": "str",  # Optional. A map of
                  region to regional state.
                "thirty_day_uptime_percentage": 0.0  # Optional. A
                  map of region to regional state.
            },
            "us_east": {
                "status": "str",  # Optional. Known values are:
                  "DOWN", "UP", and "CHECKING".
                "status_changed_at": "str",  # Optional. A map of
                  region to regional state.
                "thirty_day_uptime_percentage": 0.0  # Optional. A
                  map of region to regional state.
            }
        }
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_alerts(check_id: str, *, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All Alerts.

To list all of the alerts for an Uptime check, send a GET request to /v2/uptime/checks/$CHECK_ID/alerts.

Parameters:
  • check_id (str) – A unique identifier for a check. Required.

  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "alerts": [
        {
            "comparison": "str",  # Optional. The comparison operator
              used against the alert's threshold. Known values are: "greater_than" and
              "less_than".
            "id": "str",  # Optional. A unique ID that can be used to
              identify and reference the alert.
            "name": "str",  # Optional. A human-friendly display name.
            "notifications": {
                "email": [
                    "str"  # An email to notify on an alert
                      trigger. Required.
                ],
                "slack": [
                    {
                        "channel": "str",  # Slack channel to
                          notify of an alert trigger. Required.
                        "url": "str"  # Slack Webhook URL.
                          Required.
                    }
                ]
            },
            "period": "str",  # Optional. Period of time the threshold
              must be exceeded to trigger the alert. Known values are: "2m", "3m",
              "5m", "10m", "15m", "30m", and "1h".
            "threshold": 0,  # Optional. The threshold at which the alert
              will enter a trigger state. The specific threshold is dependent on the
              alert type.
            "type": "str"  # Optional. The type of alert. Known values
              are: "latency", "down", "down_global", and "ssl_expiry".
        }
    ],
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_checks(*, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All Checks.

To list all of the Uptime checks on your account, send a GET request to /v2/uptime/checks.

Parameters:
  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "checks": [
        {
            "enabled": True,  # Optional. Default value is True. A
              boolean value indicating whether the check is enabled/disabled.
            "id": "str",  # Optional. A unique ID that can be used to
              identify and reference the check.
            "name": "str",  # Optional. A human-friendly display name.
            "regions": [
                "str"  # Optional. An array containing the selected
                  regions to perform healthchecks from.
            ],
            "target": "str",  # Optional. The endpoint to perform
              healthchecks on.
            "type": "str"  # Optional. The type of health check to
              perform. Known values are: "ping", "http", and "https".
        }
    ],
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
update_alert(check_id: str, alert_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
update_alert(check_id: str, alert_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Update an Alert.

To update the settings of an Uptime alert, send a PUT request to /v2/uptime/checks/$CHECK_ID/alerts/$ALERT_ID.

Parameters:
  • check_id (str) – A unique identifier for a check. Required.

  • alert_id (str) – A unique identifier for an alert. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "alert": {
        "comparison": "str",  # Optional. The comparison operator used
          against the alert's threshold. Known values are: "greater_than" and
          "less_than".
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference the alert.
        "name": "str",  # Optional. A human-friendly display name.
        "notifications": {
            "email": [
                "str"  # An email to notify on an alert trigger.
                  Required.
            ],
            "slack": [
                {
                    "channel": "str",  # Slack channel to notify
                      of an alert trigger. Required.
                    "url": "str"  # Slack Webhook URL. Required.
                }
            ]
        },
        "period": "str",  # Optional. Period of time the threshold must be
          exceeded to trigger the alert. Known values are: "2m", "3m", "5m", "10m",
          "15m", "30m", and "1h".
        "threshold": 0,  # Optional. The threshold at which the alert will
          enter a trigger state. The specific threshold is dependent on the alert type.
        "type": "str"  # Optional. The type of alert. Known values are:
          "latency", "down", "down_global", and "ssl_expiry".
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
update_check(check_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
update_check(check_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Update a Check.

To update the settings of an Uptime check, send a PUT request to /v2/uptime/checks/$CHECK_ID.

Parameters:
  • check_id (str) – A unique identifier for a check. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "check": {
        "enabled": True,  # Optional. Default value is True. A boolean value
          indicating whether the check is enabled/disabled.
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference the check.
        "name": "str",  # Optional. A human-friendly display name.
        "regions": [
            "str"  # Optional. An array containing the selected regions
              to perform healthchecks from.
        ],
        "target": "str",  # Optional. The endpoint to perform healthchecks
          on.
        "type": "str"  # Optional. The type of health check to perform. Known
          values are: "ping", "http", and "https".
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
class pydo.operations.VolumeActionsOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s volume_actions attribute.

get(volume_id: str, action_id: int, *, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Volume Action.

To retrieve the status of a volume action, send a GET request to /v2/volumes/$VOLUME_ID/actions/$ACTION_ID.

Parameters:
  • volume_id (str) – The ID of the block storage volume. Required.

  • action_id (int) – A unique numeric ID that can be used to identify and reference an action. Required.

  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "action": {
        "completed_at": "2020-02-20 00:00:00",  # Optional. A time value
          given in ISO8601 combined date and time format that represents when the
          action was completed.
        "id": 0,  # Optional. A unique numeric ID that can be used to
          identify and reference an action.
        "region": {
            "available": bool,  # This is a boolean value that represents
              whether new Droplets can be created in this region. Required.
            "features": {},  # This attribute is set to an array which
              contains features available in this region. Required.
            "name": "str",  # The display name of the region.  This will
              be a full name that is used in the control panel and other interfaces.
              Required.
            "sizes": {},  # This attribute is set to an array which
              contains the identifying slugs for the sizes available in this region.
              Required.
            "slug": "str"  # A human-readable string that is used as a
              unique identifier for each region. Required.
        },
        "region_slug": {},  # Optional. Any object.
        "resource_id": 0,  # Optional.
        "resource_type": "str",  # Optional. The type of resource that the
          action is associated with.
        "started_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the action was
          initiated.
        "status": "in-progress",  # Optional. Default value is "in-progress".
          The current status of the action. This can be "in-progress", "completed", or
          "errored". Known values are: "in-progress", "completed", and "errored".
        "type": "str"  # Optional. This is the type of action that the object
          represents. For example, this could be "attach_volume" to represent the state
          of a volume attach action.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list(volume_id: str, *, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All Actions for a Volume.

To retrieve all actions that have been executed on a volume, send a GET request to /v2/volumes/$VOLUME_ID/actions.

Parameters:
  • volume_id (str) – The ID of the block storage volume. Required.

  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "actions": [
        {
            "completed_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the action was completed.
            "id": 0,  # Optional. A unique numeric ID that can be used to
              identify and reference an action.
            "region": {
                "available": bool,  # This is a boolean value that
                  represents whether new Droplets can be created in this region.
                  Required.
                "features": {},  # This attribute is set to an array
                  which contains features available in this region. Required.
                "name": "str",  # The display name of the region.
                  This will be a full name that is used in the control panel and other
                  interfaces. Required.
                "sizes": {},  # This attribute is set to an array
                  which contains the identifying slugs for the sizes available in this
                  region. Required.
                "slug": "str"  # A human-readable string that is used
                  as a unique identifier for each region. Required.
            },
            "region_slug": {},  # Optional. Any object.
            "resource_id": 0,  # Optional.
            "resource_type": "str",  # Optional. The type of resource
              that the action is associated with.
            "started_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format that represents when
              the action was initiated.
            "status": "in-progress",  # Optional. Default value is
              "in-progress". The current status of the action. This can be
              "in-progress", "completed", or "errored". Known values are:
              "in-progress", "completed", and "errored".
            "type": "str"  # Optional. This is the type of action that
              the object represents. For example, this could be "attach_volume" to
              represent the state of a volume attach action.
        }
    ],
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
post(body: JSON, *, per_page: int = 20, page: int = 1, content_type: str = 'application/json', **kwargs: Any) JSON
post(body: IO, *, per_page: int = 20, page: int = 1, content_type: str = 'application/json', **kwargs: Any) JSON

Initiate A Block Storage Action By Volume Name.

To initiate an action on a block storage volume by Name, send a POST request to ~/v2/volumes/actions. The body should contain the appropriate attributes for the respective action.

Attach a Block Storage Volume to a Droplet

Attribute

Details

type

This must be attach

volume_name

The name of the block storage volume

droplet_id

Set to the Droplet’s ID

region

Set to the slug representing the region where the volume is located

Each volume may only be attached to a single Droplet. However, up to five volumes may be attached to a Droplet at a time. Pre-formatted volumes will be automatically mounted to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOS Droplets created on or after April 26, 2018 when attached. On older Droplets, additional configuration is required.

Remove a Block Storage Volume from a Droplet

Attribute

Details

type

This must be detach

volume_name

The name of the block storage volume

droplet_id

Set to the Droplet’s ID

region

Set to the slug representing the region where the volume is located.

param body:

Is either a model type or a IO type. Required.

type body:

JSON or IO

keyword per_page:

Number of items returned per page. Default value is 20.

paramtype per_page:

int

keyword page:

Which ‘page’ of paginated results to return. Default value is 1.

paramtype page:

int

keyword content_type:

Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

paramtype content_type:

str

return:

JSON object

rtype:

JSON

raises ~azure.core.exceptions.HttpResponseError:

Example:
# response body for status code(s): 202
response == {
    "action": {
        "completed_at": "2020-02-20 00:00:00",  # Optional. A time value
          given in ISO8601 combined date and time format that represents when the
          action was completed.
        "id": 0,  # Optional. A unique numeric ID that can be used to
          identify and reference an action.
        "region": {
            "available": bool,  # This is a boolean value that represents
              whether new Droplets can be created in this region. Required.
            "features": {},  # This attribute is set to an array which
              contains features available in this region. Required.
            "name": "str",  # The display name of the region.  This will
              be a full name that is used in the control panel and other interfaces.
              Required.
            "sizes": {},  # This attribute is set to an array which
              contains the identifying slugs for the sizes available in this region.
              Required.
            "slug": "str"  # A human-readable string that is used as a
              unique identifier for each region. Required.
        },
        "region_slug": {},  # Optional. Any object.
        "resource_id": 0,  # Optional.
        "resource_type": "str",  # Optional. The type of resource that the
          action is associated with.
        "started_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the action was
          initiated.
        "status": "in-progress",  # Optional. Default value is "in-progress".
          The current status of the action. This can be "in-progress", "completed", or
          "errored". Known values are: "in-progress", "completed", and "errored".
        "type": "str"  # Optional. This is the type of action that the object
          represents. For example, this could be "attach_volume" to represent the state
          of a volume attach action.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
post_by_id(volume_id: str, body: JSON, *, per_page: int = 20, page: int = 1, content_type: str = 'application/json', **kwargs: Any) JSON
post_by_id(volume_id: str, body: IO, *, per_page: int = 20, page: int = 1, content_type: str = 'application/json', **kwargs: Any) JSON

Initiate A Block Storage Action By Volume Id.

To initiate an action on a block storage volume by Id, send a POST request to ~/v2/volumes/$VOLUME_ID/actions. The body should contain the appropriate attributes for the respective action.

Attach a Block Storage Volume to a Droplet

Attribute

Details

type

This must be attach

droplet_id

Set to the Droplet’s ID

region

Set to the slug representing the region where the volume is located

Each volume may only be attached to a single Droplet. However, up to seven volumes may be attached to a Droplet at a time. Pre-formatted volumes will be automatically mounted to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOS Droplets created on or after April 26, 2018 when attached. On older Droplets, additional configuration is required.

Remove a Block Storage Volume from a Droplet

Attribute

Details

type

This must be detach

droplet_id

Set to the Droplet’s ID

region

Set to the slug representing the region where the volume is located

Resize a Volume

Attribute

Details

type

This must be resize

size_gigabytes

The new size of the block storage volume in GiB (1024^3)

region

Set to the slug representing the region where the volume is located

Volumes may only be resized upwards. The maximum size for a volume is 16TiB.

param volume_id:

The ID of the block storage volume. Required.

type volume_id:

str

param body:

Is either a model type or a IO type. Required.

type body:

JSON or IO

keyword per_page:

Number of items returned per page. Default value is 20.

paramtype per_page:

int

keyword page:

Which ‘page’ of paginated results to return. Default value is 1.

paramtype page:

int

keyword content_type:

Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

paramtype content_type:

str

return:

JSON object

rtype:

JSON

raises ~azure.core.exceptions.HttpResponseError:

Example:
# response body for status code(s): 202
response == {
    "action": {
        "completed_at": "2020-02-20 00:00:00",  # Optional. A time value
          given in ISO8601 combined date and time format that represents when the
          action was completed.
        "id": 0,  # Optional. A unique numeric ID that can be used to
          identify and reference an action.
        "region": {
            "available": bool,  # This is a boolean value that represents
              whether new Droplets can be created in this region. Required.
            "features": {},  # This attribute is set to an array which
              contains features available in this region. Required.
            "name": "str",  # The display name of the region.  This will
              be a full name that is used in the control panel and other interfaces.
              Required.
            "sizes": {},  # This attribute is set to an array which
              contains the identifying slugs for the sizes available in this region.
              Required.
            "slug": "str"  # A human-readable string that is used as a
              unique identifier for each region. Required.
        },
        "region_slug": {},  # Optional. Any object.
        "resource_id": 0,  # Optional.
        "resource_type": "str",  # Optional. The type of resource that the
          action is associated with.
        "started_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format that represents when the action was
          initiated.
        "status": "in-progress",  # Optional. Default value is "in-progress".
          The current status of the action. This can be "in-progress", "completed", or
          "errored". Known values are: "in-progress", "completed", and "errored".
        "type": "str"  # Optional. This is the type of action that the object
          represents. For example, this could be "attach_volume" to represent the state
          of a volume attach action.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
class pydo.operations.VolumeSnapshotsOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s volume_snapshots attribute.

create(volume_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
create(volume_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create Snapshot from a Volume.

To create a snapshot from a volume, sent a POST request to /v2/volumes/$VOLUME_ID/snapshots.

Parameters:
  • volume_id (str) – The ID of the block storage volume. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 201
response == {
    "snapshot": {
        "created_at": "2020-02-20 00:00:00",  # A time value given in ISO8601
          combined date and time format that represents when the snapshot was created.
          Required.
        "min_disk_size": 0,  # The minimum size in GB required for a volume
          or Droplet to use this snapshot. Required.
        "name": "str",  # A human-readable name for the snapshot. Required.
        "regions": [
            "str"  # An array of the regions that the snapshot is
              available in. The regions are represented by their identifying slug
              values. Required.
        ],
        "resource_id": "str",  # The unique identifier for the resource that
          the snapshot originated from. Required.
        "resource_type": "str",  # The type of resource that the snapshot
          originated from. Required. Known values are: "droplet" and "volume".
        "size_gigabytes": 0.0,  # The billable size of the snapshot in
          gigabytes. Required.
        "tags": [
            "str"  # An array of Tags the snapshot has been tagged with.
              Required.
        ]
    }
}
# response body for status code(s): 400, 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
delete_by_id(snapshot_id: MutableMapping[str, Any], **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete a Volume Snapshot.

To delete a volume snapshot, send a DELETE request to /v2/snapshots/$SNAPSHOT_ID.

A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.

Parameters:

snapshot_id (JSON) – Either the ID of an existing snapshot. This will be an integer for a Droplet snapshot or a string for a volume snapshot. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get_by_id(snapshot_id: MutableMapping[str, Any], **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Volume Snapshot.

To retrieve the details of a snapshot that has been created from a volume, send a GET request to /v2/volumes/snapshots/$SNAPSHOT_ID.

Parameters:

snapshot_id (JSON) – Either the ID of an existing snapshot. This will be an integer for a Droplet snapshot or a string for a volume snapshot. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "snapshot": {
        "created_at": "2020-02-20 00:00:00",  # A time value given in ISO8601
          combined date and time format that represents when the snapshot was created.
          Required.
        "min_disk_size": 0,  # The minimum size in GB required for a volume
          or Droplet to use this snapshot. Required.
        "name": "str",  # A human-readable name for the snapshot. Required.
        "regions": [
            "str"  # An array of the regions that the snapshot is
              available in. The regions are represented by their identifying slug
              values. Required.
        ],
        "resource_id": "str",  # The unique identifier for the resource that
          the snapshot originated from. Required.
        "resource_type": "str",  # The type of resource that the snapshot
          originated from. Required. Known values are: "droplet" and "volume".
        "size_gigabytes": 0.0,  # The billable size of the snapshot in
          gigabytes. Required.
        "tags": [
            "str"  # An array of Tags the snapshot has been tagged with.
              Required.
        ]
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list(volume_id: str, *, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List Snapshots for a Volume.

To retrieve the snapshots that have been created from a volume, send a GET request to /v2/volumes/$VOLUME_ID/snapshots.

Parameters:
  • volume_id (str) – The ID of the block storage volume. Required.

  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    },
    "snapshots": [
        {
            "created_at": "2020-02-20 00:00:00",  # A time value given in
              ISO8601 combined date and time format that represents when the snapshot
              was created. Required.
            "min_disk_size": 0,  # The minimum size in GB required for a
              volume or Droplet to use this snapshot. Required.
            "name": "str",  # A human-readable name for the snapshot.
              Required.
            "regions": [
                "str"  # An array of the regions that the snapshot is
                  available in. The regions are represented by their identifying slug
                  values. Required.
            ],
            "resource_id": "str",  # The unique identifier for the
              resource that the snapshot originated from. Required.
            "resource_type": "str",  # The type of resource that the
              snapshot originated from. Required. Known values are: "droplet" and
              "volume".
            "size_gigabytes": 0.0,  # The billable size of the snapshot
              in gigabytes. Required.
            "tags": [
                "str"  # An array of Tags the snapshot has been
                  tagged with. Required.
            ]
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
class pydo.operations.VolumesOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s volumes attribute.

create(body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
create(body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create a New Block Storage Volume.

To create a new volume, send a POST request to /v2/volumes. Optionally, a filesystem_type attribute may be provided in order to automatically format the volume’s filesystem. Pre-formatted volumes are automatically mounted when attached to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOS Droplets created on or after April 26, 2018. Attaching pre-formatted volumes to Droplets without support for auto-mounting is not recommended.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 201
response == {
    "volume": {
        "created_at": "str",  # Optional. A time value given in ISO8601
          combined date and time format that represents when the block storage volume
          was created.
        "description": "str",  # Optional. An optional free-form text field
          to describe a block storage volume.
        "droplet_ids": [
            0  # Optional. An array containing the IDs of the Droplets
              the volume is attached to. Note that at this time, a volume can only be
              attached to a single Droplet.
        ],
        "filesystem_label": "str",  # Optional. The label currently applied
          to the filesystem.
        "filesystem_type": "str",  # Optional. The type of filesystem
          currently in-use on the volume.
        "id": "str",  # Optional. The unique identifier for the block storage
          volume.
        "name": "str",  # Optional. A human-readable name for the block
          storage volume. Must be lowercase and be composed only of numbers, letters
          and "-", up to a limit of 64 characters. The name must begin with a letter.
        "region": {
            "available": bool,  # This is a boolean value that represents
              whether new Droplets can be created in this region. Required.
            "features": {},  # This attribute is set to an array which
              contains features available in this region. Required.
            "name": "str",  # The display name of the region.  This will
              be a full name that is used in the control panel and other interfaces.
              Required.
            "sizes": {},  # This attribute is set to an array which
              contains the identifying slugs for the sizes available in this region.
              Required.
            "slug": "str"  # A human-readable string that is used as a
              unique identifier for each region. Required.
        },
        "size_gigabytes": 0,  # Optional. The size of the block storage
          volume in GiB (1024^3). This field does not apply  when creating a volume
          from a snapshot.
        "tags": [
            "str"  # Optional. A flat array of tag names as strings to be
              applied to the resource. Tag names may be for either existing or new
              tags.
        ]
    }
}
# response body for status code(s): 400, 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
delete(volume_id: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete a Block Storage Volume.

To delete a block storage volume, destroying all data and removing it from your account, send a DELETE request to /v2/volumes/$VOLUME_ID. No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data.

Parameters:

volume_id (str) – The ID of the block storage volume. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
delete_by_name(*, name: Optional[str] = None, region: Optional[str] = None, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete a Block Storage Volume by Name.

Block storage volumes may also be deleted by name by sending a DELETE request with the volume’s name and the region slug for the region it is located in as query parameters to /v2/volumes?name=$VOLUME_NAME&region=nyc1. No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data.

Parameters:
  • name (str) – The block storage volume’s name. Default value is None.

  • region (str) – The slug identifier for the region where the resource is available. Known values are: “ams1”, “ams2”, “ams3”, “blr1”, “fra1”, “lon1”, “nyc1”, “nyc2”, “nyc3”, “sfo1”, “sfo2”, “sfo3”, “sgp1”, and “tor1”. Default value is None.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get(volume_id: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing Block Storage Volume.

To show information about a block storage volume, send a GET request to /v2/volumes/$VOLUME_ID.

Parameters:

volume_id (str) – The ID of the block storage volume. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "volume": {
        "created_at": "str",  # Optional. A time value given in ISO8601
          combined date and time format that represents when the block storage volume
          was created.
        "description": "str",  # Optional. An optional free-form text field
          to describe a block storage volume.
        "droplet_ids": [
            0  # Optional. An array containing the IDs of the Droplets
              the volume is attached to. Note that at this time, a volume can only be
              attached to a single Droplet.
        ],
        "filesystem_label": "str",  # Optional. The label currently applied
          to the filesystem.
        "filesystem_type": "str",  # Optional. The type of filesystem
          currently in-use on the volume.
        "id": "str",  # Optional. The unique identifier for the block storage
          volume.
        "name": "str",  # Optional. A human-readable name for the block
          storage volume. Must be lowercase and be composed only of numbers, letters
          and "-", up to a limit of 64 characters. The name must begin with a letter.
        "region": {
            "available": bool,  # This is a boolean value that represents
              whether new Droplets can be created in this region. Required.
            "features": {},  # This attribute is set to an array which
              contains features available in this region. Required.
            "name": "str",  # The display name of the region.  This will
              be a full name that is used in the control panel and other interfaces.
              Required.
            "sizes": {},  # This attribute is set to an array which
              contains the identifying slugs for the sizes available in this region.
              Required.
            "slug": "str"  # A human-readable string that is used as a
              unique identifier for each region. Required.
        },
        "size_gigabytes": 0,  # Optional. The size of the block storage
          volume in GiB (1024^3). This field does not apply  when creating a volume
          from a snapshot.
        "tags": [
            "str"  # Optional. A flat array of tag names as strings to be
              applied to the resource. Tag names may be for either existing or new
              tags.
        ]
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list(*, name: Optional[str] = None, region: Optional[str] = None, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All Block Storage Volumes.

To list all of the block storage volumes available on your account, send a GET request to /v2/volumes.

Filtering Results

By Region

The region may be provided as query parameter in order to restrict results to volumes available in a specific region. For example: /v2/volumes?region=nyc1

By Name

It is also possible to list volumes on your account that match a specified name. To do so, send a GET request with the volume’s name as a query parameter to /v2/volumes?name=$VOLUME_NAME. Note: You can only create one volume per region with the same name.

By Name and Region

It is also possible to retrieve information about a block storage volume by name. To do so, send a GET request with the volume’s name and the region slug for the region it is located in as query parameters to /v2/volumes?name=$VOLUME_NAME&region=nyc1.

keyword name:

The block storage volume’s name. Default value is None.

paramtype name:

str

keyword region:

The slug identifier for the region where the resource is available. Known values are: “ams1”, “ams2”, “ams3”, “blr1”, “fra1”, “lon1”, “nyc1”, “nyc2”, “nyc3”, “sfo1”, “sfo2”, “sfo3”, “sgp1”, and “tor1”. Default value is None.

paramtype region:

str

keyword per_page:

Number of items returned per page. Default value is 20.

paramtype per_page:

int

keyword page:

Which ‘page’ of paginated results to return. Default value is 1.

paramtype page:

int

return:

JSON object

rtype:

JSON

raises ~azure.core.exceptions.HttpResponseError:

Example:
# response body for status code(s): 200
response == {
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    },
    "volumes": [
        {
            "created_at": "str",  # Optional. A time value given in
              ISO8601 combined date and time format that represents when the block
              storage volume was created.
            "description": "str",  # Optional. An optional free-form text
              field to describe a block storage volume.
            "droplet_ids": [
                0  # Optional. An array containing the IDs of the
                  Droplets the volume is attached to. Note that at this time, a volume
                  can only be attached to a single Droplet.
            ],
            "filesystem_label": "str",  # Optional. The label currently
              applied to the filesystem.
            "filesystem_type": "str",  # Optional. The type of filesystem
              currently in-use on the volume.
            "id": "str",  # Optional. The unique identifier for the block
              storage volume.
            "name": "str",  # Optional. A human-readable name for the
              block storage volume. Must be lowercase and be composed only of numbers,
              letters and "-", up to a limit of 64 characters. The name must begin with
              a letter.
            "region": {
                "available": bool,  # This is a boolean value that
                  represents whether new Droplets can be created in this region.
                  Required.
                "features": {},  # This attribute is set to an array
                  which contains features available in this region. Required.
                "name": "str",  # The display name of the region.
                  This will be a full name that is used in the control panel and other
                  interfaces. Required.
                "sizes": {},  # This attribute is set to an array
                  which contains the identifying slugs for the sizes available in this
                  region. Required.
                "slug": "str"  # A human-readable string that is used
                  as a unique identifier for each region. Required.
            },
            "size_gigabytes": 0,  # Optional. The size of the block
              storage volume in GiB (1024^3). This field does not apply  when creating
              a volume from a snapshot.
            "tags": [
                "str"  # Optional. A flat array of tag names as
                  strings to be applied to the resource. Tag names may be for either
                  existing or new tags.
            ]
        }
    ]
}
class pydo.operations.VpcsOperations(*args, **kwargs)

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through GeneratedClient’s vpcs attribute.

create(body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
create(body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Create a New VPC.

To create a VPC, send a POST request to /v2/vpcs specifying the attributes in the table below in the JSON body.

Note: If you do not currently have a VPC network in a specific datacenter region, the first one that you create will be set as the default for that region. The default VPC for a region cannot be changed or deleted.

Parameters:
  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 201
response == {
    "vpc": {
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format.
        "default": bool,  # Optional. A boolean value indicating whether or
          not the VPC is the default network for the region. All applicable resources
          are placed into the default VPC network unless otherwise specified during
          their creation. The ``default`` field cannot be unset from ``true``. If you
          want to set a new default VPC network, update the ``default`` field of
          another VPC network in the same region. The previous network's ``default``
          field will be set to ``false`` when a new default VPC has been defined.
        "description": "str",  # Optional. A free-form text field for
          describing the VPC's purpose. It may be a maximum of 255 characters.
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference the VPC.
        "ip_range": "str",  # Optional. The range of IP addresses in the VPC
          in CIDR notation. Network ranges cannot overlap with other networks in the
          same account and must be in range of private addresses as defined in RFC1918.
          It may not be smaller than ``/28`` nor larger than ``/16``. If no IP range is
          specified, a ``/20`` network range is generated that won't conflict with
          other VPC networks in your account.
        "name": "str",  # Optional. The name of the VPC. Must be unique and
          may only contain alphanumeric characters, dashes, and periods.
        "region": "str",  # Optional. The slug identifier for the region
          where the VPC will be created.
        "urn": "str"  # Optional. The uniform resource name (URN) for the
          resource in the format do:resource_type:resource_id.
    }
}
delete(vpc_id: str, **kwargs: Any) Optional[MutableMapping[str, Any]]

Delete a VPC.

To delete a VPC, send a DELETE request to /v2/vpcs/$VPC_ID. A 204 status code with no body will be returned in response to a successful request.

The default VPC for a region can not be deleted. Additionally, a VPC can only be deleted if it does not contain any member resources. Attempting to delete a region’s default VPC or a VPC that still has members will result in a 403 Forbidden error response.

Parameters:

vpc_id (str) – A unique identifier for a VPC. Required.

Returns:

JSON object or None

Return type:

JSON or None

Raises:

HttpResponseError

Example:
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
get(vpc_id: str, **kwargs: Any) MutableMapping[str, Any]

Retrieve an Existing VPC.

To show information about an existing VPC, send a GET request to /v2/vpcs/$VPC_ID.

Parameters:

vpc_id (str) – A unique identifier for a VPC. Required.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "vpc": {
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format.
        "default": bool,  # Optional. A boolean value indicating whether or
          not the VPC is the default network for the region. All applicable resources
          are placed into the default VPC network unless otherwise specified during
          their creation. The ``default`` field cannot be unset from ``true``. If you
          want to set a new default VPC network, update the ``default`` field of
          another VPC network in the same region. The previous network's ``default``
          field will be set to ``false`` when a new default VPC has been defined.
        "description": "str",  # Optional. A free-form text field for
          describing the VPC's purpose. It may be a maximum of 255 characters.
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference the VPC.
        "ip_range": "str",  # Optional. The range of IP addresses in the VPC
          in CIDR notation. Network ranges cannot overlap with other networks in the
          same account and must be in range of private addresses as defined in RFC1918.
          It may not be smaller than ``/28`` nor larger than ``/16``. If no IP range is
          specified, a ``/20`` network range is generated that won't conflict with
          other VPC networks in your account.
        "name": "str",  # Optional. The name of the VPC. Must be unique and
          may only contain alphanumeric characters, dashes, and periods.
        "region": "str",  # Optional. The slug identifier for the region
          where the VPC will be created.
        "urn": "str"  # Optional. The uniform resource name (URN) for the
          resource in the format do:resource_type:resource_id.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list(*, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List All VPCs.

To list all of the VPCs on your account, send a GET request to /v2/vpcs.

Parameters:
  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "links": {
        "pages": {}
    },
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    },
    "vpcs": [
        {
            "created_at": "2020-02-20 00:00:00",  # Optional. A time
              value given in ISO8601 combined date and time format.
            "default": bool,  # Optional. A boolean value indicating
              whether or not the VPC is the default network for the region. All
              applicable resources are placed into the default VPC network unless
              otherwise specified during their creation. The ``default`` field cannot
              be unset from ``true``. If you want to set a new default VPC network,
              update the ``default`` field of another VPC network in the same region.
              The previous network's ``default`` field will be set to ``false`` when a
              new default VPC has been defined.
            "description": "str",  # Optional. A free-form text field for
              describing the VPC's purpose. It may be a maximum of 255 characters.
            "id": "str",  # Optional. A unique ID that can be used to
              identify and reference the VPC.
            "ip_range": "str",  # Optional. The range of IP addresses in
              the VPC in CIDR notation. Network ranges cannot overlap with other
              networks in the same account and must be in range of private addresses as
              defined in RFC1918. It may not be smaller than ``/28`` nor larger than
              ``/16``. If no IP range is specified, a ``/20`` network range is
              generated that won't conflict with other VPC networks in your account.
            "name": "str",  # Optional. The name of the VPC. Must be
              unique and may only contain alphanumeric characters, dashes, and periods.
            "region": "str",  # Optional. The slug identifier for the
              region where the VPC will be created.
            "urn": "str"  # Optional. The uniform resource name (URN) for
              the resource in the format do:resource_type:resource_id.
        }
    ]
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
list_members(vpc_id: str, *, resource_type: Optional[str] = None, per_page: int = 20, page: int = 1, **kwargs: Any) MutableMapping[str, Any]

List the Member Resources of a VPC.

To list all of the resources that are members of a VPC, send a GET request to /v2/vpcs/$VPC_ID/members.

To only list resources of a specific type that are members of the VPC, included a resource_type query parameter. For example, to only list Droplets in the VPC, send a GET request to /v2/vpcs/$VPC_ID/members?resource_type=droplet.

Parameters:
  • vpc_id (str) – A unique identifier for a VPC. Required.

  • resource_type (str) – Used to filter VPC members by a resource type. Default value is None.

  • per_page (int) – Number of items returned per page. Default value is 20.

  • page (int) – Which ‘page’ of paginated results to return. Default value is 1.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "links": {
        "pages": {}
    },
    "members": [
        {
            "created_at": "str",  # Optional. A time value given in
              ISO8601 combined date and time format that represents when the resource
              was created.
            "name": "str",  # Optional. The name of the resource.
            "urn": "str"  # Optional. The uniform resource name (URN) for
              the resource in the format do:resource_type:resource_id.
        }
    ],
    "meta": {
        "total": 0  # Optional. Number of objects returned by the request.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
patch(vpc_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
patch(vpc_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Partially Update a VPC.

To update a subset of information about a VPC, send a PATCH request to /v2/vpcs/$VPC_ID.

Parameters:
  • vpc_id (str) – A unique identifier for a VPC. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "vpc": {
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format.
        "default": bool,  # Optional. A boolean value indicating whether or
          not the VPC is the default network for the region. All applicable resources
          are placed into the default VPC network unless otherwise specified during
          their creation. The ``default`` field cannot be unset from ``true``. If you
          want to set a new default VPC network, update the ``default`` field of
          another VPC network in the same region. The previous network's ``default``
          field will be set to ``false`` when a new default VPC has been defined.
        "description": "str",  # Optional. A free-form text field for
          describing the VPC's purpose. It may be a maximum of 255 characters.
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference the VPC.
        "ip_range": "str",  # Optional. The range of IP addresses in the VPC
          in CIDR notation. Network ranges cannot overlap with other networks in the
          same account and must be in range of private addresses as defined in RFC1918.
          It may not be smaller than ``/28`` nor larger than ``/16``. If no IP range is
          specified, a ``/20`` network range is generated that won't conflict with
          other VPC networks in your account.
        "name": "str",  # Optional. The name of the VPC. Must be unique and
          may only contain alphanumeric characters, dashes, and periods.
        "region": "str",  # Optional. The slug identifier for the region
          where the VPC will be created.
        "urn": "str"  # Optional. The uniform resource name (URN) for the
          resource in the format do:resource_type:resource_id.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}
update(vpc_id: str, body: JSON, *, content_type: str = 'application/json', **kwargs: Any) JSON
update(vpc_id: str, body: IO, *, content_type: str = 'application/json', **kwargs: Any) JSON

Update a VPC.

To update information about a VPC, send a PUT request to /v2/vpcs/$VPC_ID.

Parameters:
  • vpc_id (str) – A unique identifier for a VPC. Required.

  • body (JSON or IO) – Is either a model type or a IO type. Required.

  • content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.

Returns:

JSON object

Return type:

JSON

Raises:

HttpResponseError

Example:
# response body for status code(s): 200
response == {
    "vpc": {
        "created_at": "2020-02-20 00:00:00",  # Optional. A time value given
          in ISO8601 combined date and time format.
        "default": bool,  # Optional. A boolean value indicating whether or
          not the VPC is the default network for the region. All applicable resources
          are placed into the default VPC network unless otherwise specified during
          their creation. The ``default`` field cannot be unset from ``true``. If you
          want to set a new default VPC network, update the ``default`` field of
          another VPC network in the same region. The previous network's ``default``
          field will be set to ``false`` when a new default VPC has been defined.
        "description": "str",  # Optional. A free-form text field for
          describing the VPC's purpose. It may be a maximum of 255 characters.
        "id": "str",  # Optional. A unique ID that can be used to identify
          and reference the VPC.
        "ip_range": "str",  # Optional. The range of IP addresses in the VPC
          in CIDR notation. Network ranges cannot overlap with other networks in the
          same account and must be in range of private addresses as defined in RFC1918.
          It may not be smaller than ``/28`` nor larger than ``/16``. If no IP range is
          specified, a ``/20`` network range is generated that won't conflict with
          other VPC networks in your account.
        "name": "str",  # Optional. The name of the VPC. Must be unique and
          may only contain alphanumeric characters, dashes, and periods.
        "region": "str",  # Optional. The slug identifier for the region
          where the VPC will be created.
        "urn": "str"  # Optional. The uniform resource name (URN) for the
          resource in the format do:resource_type:resource_id.
    }
}
# response body for status code(s): 404
response == {
    "id": "str",  # A short identifier corresponding to the HTTP status code
      returned. For  example, the ID for a response returning a 404 status code would
      be "not_found.". Required.
    "message": "str",  # A message providing additional information about the
      error, including  details to help resolve it when possible. Required.
    "request_id": "str"  # Optional. Optionally, some endpoints may include a
      request ID that should be  provided when reporting bugs or opening support
      tickets to help  identify the issue.
}