openapi: 3.0.0 info: title: DigitalOcean Apps API version: '2.0' description: "# Introduction\n\nThe DigitalOcean API allows you to manage Droplets and resources within the\nDigitalOcean cloud in a simple, programmatic way using conventional HTTP requests.\n\nAll of the functionality that you are familiar with in the DigitalOcean\ncontrol panel is also available through the API, allowing you to script the\ncomplex actions that your situation requires.\n\nThe API documentation will start with a general overview about the design\nand technology that has been implemented, followed by reference information\nabout specific endpoints.\n\n## Requests\n\nAny tool that is fluent in HTTP can communicate with the API simply by\nrequesting the correct URI. Requests should be made using the HTTPS protocol\nso that traffic is encrypted. The interface responds to different methods\ndepending on the action required.\n\n|Method|Usage|\n|--- |--- |\n|GET|For simple retrieval of information about your account, Droplets, or environment, you should use the GET method. The information you request will be returned to you as a JSON object. The attributes defined by the JSON object can be used to form additional requests. Any request using the GET method is read-only and will not affect any of the objects you are querying.|\n|DELETE|To destroy a resource and remove it from your account and environment, the DELETE method should be used. This will remove the specified object if it is found. If it is not found, the operation will return a response indicating that the object was not found. This idempotency means that you do not have to check for a resource's availability prior to issuing a delete command, the final state will be the same regardless of its existence.|\n|PUT|To update the information about a resource in your account, the PUT method is available. Like the DELETE Method, the PUT method is idempotent. It sets the state of the target using the provided values, regardless of their current values. Requests using the PUT method do not need to check the current attributes of the object.|\n|PATCH|Some resources support partial modification. In these cases, the PATCH method is available. Unlike PUT which generally requires a complete representation of a resource, a PATCH request is a set of instructions on how to modify a resource updating only specific attributes.|\n|POST|To create a new object, your request should specify the POST method. The POST request includes all of the attributes necessary to create a new object. When you wish to create a new object, send a POST request to the target endpoint.|\n|HEAD|Finally, to retrieve metadata information, you should use the HEAD method to get the headers. This returns only the header of what would be returned with an associated GET request. Response headers contain some useful information about your API access and the results that are available for your request. For instance, the headers contain your current rate-limit value and the amount of time available until the limit resets. It also contains metrics about the total number of objects found, pagination information, and the total content length.|\n\n\n## HTTP Statuses\n\nAlong with the HTTP methods that the API responds to, it will also return\nstandard HTTP statuses, including error codes.\n\nIn the event of a problem, the status will contain the error code, while the\nbody of the response will usually contain additional information about the\nproblem that was encountered.\n\nIn general, if the status returned is in the 200 range, it indicates that\nthe request was fulfilled successfully and that no error was encountered.\n\nReturn codes in the 400 range typically indicate that there was an issue\nwith the request that was sent. Among other things, this could mean that you\ndid not authenticate correctly, that you are requesting an action that you\ndo not have authorization for, that the object you are requesting does not\nexist, or that your request is malformed.\n\nIf you receive a status in the 500 range, this generally indicates a\nserver-side problem. This means that we are having an issue on our end and\ncannot fulfill your request currently.\n\n400 and 500 level error responses will include a JSON object in their body,\nincluding the following attributes:\n\n|Name|Type|Description|\n|--- |--- |--- |\n|id|string|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.\"|\n|message|string|A message providing additional information about the error, including details to help resolve it when possible.|\n|request_id|string|Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.|\n\n### Example Error Response\n\n```\n HTTP/1.1 403 Forbidden\n {\n \"id\": \"forbidden\",\n \"message\": \"You do not have access for the attempted action.\"\n }\n```\n\n## Responses\n\nWhen a request is successful, a response body will typically be sent back in\nthe form of a JSON object. An exception to this is when a DELETE request is\nprocessed, which will result in a successful HTTP 204 status and an empty\nresponse body.\n\nInside of this JSON object, the resource root that was the target of the\nrequest will be set as the key. This will be the singular form of the word\nif the request operated on a single object, and the plural form of the word\nif a collection was processed.\n\nFor example, if you send a GET request to `/v2/droplets/$DROPLET_ID` you\nwill get back an object with a key called \"`droplet`\". However, if you send\nthe GET request to the general collection at `/v2/droplets`, you will get\nback an object with a key called \"`droplets`\".\n\nThe value of these keys will generally be a JSON object for a request on a\nsingle object and an array of objects for a request on a collection of\nobjects.\n\n### Response for a Single Object\n\n```json\n {\n \"droplet\": {\n \"name\": \"example.com\"\n . . .\n }\n }\n```\n\n### Response for an Object Collection\n\n```json\n {\n \"droplets\": [\n {\n \"name\": \"example.com\"\n . . .\n },\n {\n \"name\": \"second.com\"\n . . .\n }\n ]\n }\n```\n\n## Meta\n\nIn addition to the main resource root, the response may also contain a\n`meta` object. This object contains information about the response itself.\n\nThe `meta` object contains a `total` key that is set to the total number of\nobjects returned by the request. This has implications on the `links` object\nand pagination.\n\nThe `meta` object will only be displayed when it has a value. Currently, the\n`meta` object will have a value when a request is made on a collection (like\n`droplets` or `domains`).\n\n\n### Sample Meta Object\n\n```json\n {\n . . .\n \"meta\": {\n \"total\": 43\n }\n . . .\n }\n```\n\n## Links & Pagination\n\nThe `links` object is returned as part of the response body when pagination\nis enabled. By default, 20 objects are returned per page. If the response\ncontains 20 objects or fewer, no `links` object will be returned. If the\nresponse contains more than 20 objects, the first 20 will be returned along\nwith the `links` object.\n\nYou can request a different pagination limit or force pagination by\nappending `?per_page=` to the request with the number of items you would\nlike per page. For instance, to show only two results per page, you could\nadd `?per_page=2` to the end of your query. The maximum number of results\nper page is 200.\n\nThe `links` object contains a `pages` object. The `pages` object, in turn,\ncontains keys indicating the relationship of additional pages. The values of\nthese are the URLs of the associated pages. The keys will be one of the\nfollowing:\n\n* **first**: The URI of the first page of results.\n* **prev**: The URI of the previous sequential page of results.\n* **next**: The URI of the next sequential page of results.\n* **last**: The URI of the last page of results.\n\nThe `pages` object will only include the links that make sense. So for the\nfirst page of results, no `first` or `prev` links will ever be set. This\nconvention holds true in other situations where a link would not make sense.\n\n### Sample Links Object\n\n```json\n {\n . . .\n \"links\": {\n \"pages\": {\n \"last\": \"https://api.digitalocean.com/v2/images?page=2\",\n \"next\": \"https://api.digitalocean.com/v2/images?page=2\"\n }\n }\n . . .\n }\n```\n\n## Rate Limit\n\nRequests through the API are rate limited per OAuth token. Current rate limits:\n\n* 5,000 requests per hour\n* 250 requests per minute (5% of the hourly total)\n\nOnce you exceed either limit, you will be rate limited until the next cycle\nstarts. Space out any requests that you would otherwise issue in bursts for\nthe best results.\n\nThe rate limiting information is contained within the response headers of\neach request. The relevant headers are:\n\n* **ratelimit-limit**: The number of requests that can be made per hour.\n* **ratelimit-remaining**: The number of requests that remain before you hit your request limit. See the information below for how the request limits expire.\n* **ratelimit-reset**: This represents the time when the oldest request will expire. The value is given in [Unix epoch time](http://en.wikipedia.org/wiki/Unix_time). See below for more information about how request limits expire.\n\nMore rate limiting information is returned only within burst limit error response headers:\n* **retry-after**: The number of seconds to wait before making another request when rate limited.\n\nAs long as the `ratelimit-remaining` count is above zero, you will be able\nto make additional requests.\n\nThe way that a request expires and is removed from the current limit count\nis important to understand. Rather than counting all of the requests for an\nhour and resetting the `ratelimit-remaining` value at the end of the hour,\neach request instead has its own timer.\n\nThis means that each request contributes toward the `ratelimit-remaining`\ncount for one complete hour after the request is made. When that request's\ntimer runs out, it is no longer counted towards the request limit.\n\nThis has implications on the meaning of the `ratelimit-reset` header as\nwell. Because the entire rate limit is not reset at one time, the value of\nthis header is set to the time when the _oldest_ request will expire.\n\nKeep this in mind if you see your `ratelimit-reset` value change, but not\nmove an entire hour into the future.\n\nIf the `ratelimit-remaining` reaches zero, subsequent requests will receive\na 429 error code until the request reset has been reached. \n\n`ratelimit-remaining` reaching zero can also indicate that the \"burst limit\" of 250 \nrequests per minute limit was met, even if the 5,000 requests per hour limit was not. \nIn this case, the 429 error response will include a `retry-after` header to indicate how \nlong to wait (in seconds) until the request may be retried.\n\nYou can see the format of the response in the examples. \n\n**Note:** The following endpoints have special rate limit requirements that\nare independent of the limits defined above.\n\n* Only 12 `POST` requests to the `/v2/floating_ips` endpoint to create Floating IPs can be made per 60 seconds.\n* Only 10 `GET` requests to the `/v2/account/keys` endpoint to list SSH keys can be made per 60 seconds.\n* Only 5 requests to any and all `v2/cdn/endpoints` can be made per 10 seconds. This includes `v2/cdn/endpoints`, \n `v2/cdn/endpoints/$ENDPOINT_ID`, and `v2/cdn/endpoints/$ENDPOINT_ID/cache`.\n* Only 50 strings within the `files` json struct in the `v2/cdn/endpoints/$ENDPOINT_ID/cache` [payload](https://docs.digitalocean.com/reference/api/api-reference/#operation/cdn_purge_cache) \n can be requested every 20 seconds.\n\n### Sample Rate Limit Headers\n\n```\n . . .\n ratelimit-limit: 1200\n ratelimit-remaining: 1193\n rateLimit-reset: 1402425459\n . . .\n```\n\n ### Sample Rate Limit Headers When Burst Limit is Reached:\n\n```\n . . .\n ratelimit-limit: 5000\n ratelimit-remaining: 0\n rateLimit-reset: 1402425459\n retry-after: 29\n . . .\n```\n\n### Sample Rate Exceeded Response\n\n```\n 429 Too Many Requests\n {\n id: \"too_many_requests\",\n message: \"API Rate limit exceeded.\"\n }\n```\n\n## Curl Examples\n\nThroughout this document, some example API requests will be given using the\n`curl` command. This will allow us to demonstrate the various endpoints in a\nsimple, textual format.\n \n These examples assume that you are using a Linux or macOS command line. To run\nthese commands on a Windows machine, you can either use cmd.exe, PowerShell, or WSL:\n\n* For cmd.exe, use the `set VAR=VALUE` [syntax](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/set_1)\nto define environment variables, call them with `%VAR%`, then replace all backslashes (`\\`) in the examples with carets (`^`).\n\n* For PowerShell, use the `$Env:VAR = \"VALUE\"` [syntax](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_environment_variables?view=powershell-7.2)\nto define environment variables, call them with `$Env:VAR`, then replace `curl` with `curl.exe` and all backslashes (`\\`) in the examples with backticks (`` ` ``).\n\n* WSL is a compatibility layer that allows you to emulate a Linux terminal on a Windows machine.\nInstall WSL with our [community tutorial](https://www.digitalocean.com/community/tutorials/how-to-install-the-windows-subsystem-for-linux-2-on-microsoft-windows-10), \nthen follow this API documentation normally.\n\nThe names of account-specific references (like Droplet IDs, for instance)\nwill be represented by variables. For instance, a Droplet ID may be\nrepresented by a variable called `$DROPLET_ID`. You can set the associated\nvariables in your environment if you wish to use the examples without\nmodification.\n\nThe first variable that you should set to get started is your OAuth\nauthorization token. The next section will go over the details of this, but\nyou can set an environmental variable for it now.\n\nGenerate a token by going to the [Apps & API](https://cloud.digitalocean.com/settings/applications)\nsection of the DigitalOcean control panel. Use an existing token if you have\nsaved one, or generate a new token with the \"Generate new token\" button.\nCopy the generated token and use it to set and export the TOKEN variable in\nyour environment as the example shows.\n\nYou may also wish to set some other variables now or as you go along. For\nexample, you may wish to set the `DROPLET_ID` variable to one of your\nDroplet IDs since this will be used frequently in the API.\n\nIf you are following along, make sure you use a Droplet ID that you control\nso that your commands will execute correctly.\n\nIf you need access to the headers of a response through `curl`, you can pass\nthe `-i` flag to display the header information along with the body. If you\nare only interested in the header, you can instead pass the `-I` flag, which\nwill exclude the response body entirely.\n\n\n### Set and Export your OAuth Token\n\n```\nexport DIGITALOCEAN_TOKEN=your_token_here\n```\n\n### Set and Export a Variable\n\n```\nexport DROPLET_ID=1111111\n```\n\n## Parameters\n\nThere are two different ways to pass parameters in a request with the API.\n\nWhen passing parameters to create or update an object, parameters should be\npassed as a JSON object containing the appropriate attribute names and\nvalues as key-value pairs. When you use this format, you should specify that\nyou are sending a JSON object in the header. This is done by setting the\n`Content-Type` header to `application/json`. This ensures that your request\nis interpreted correctly.\n\nWhen passing parameters to filter a response on GET requests, parameters can\nbe passed using standard query attributes. In this case, the parameters\nwould be embedded into the URI itself by appending a `?` to the end of the\nURI and then setting each attribute with an equal sign. Attributes can be\nseparated with a `&`. Tools like `curl` can create the appropriate URI when\ngiven parameters and values; this can also be done using the `-F` flag and\nthen passing the key and value as an argument. The argument should take the\nform of a quoted string with the attribute being set to a value with an\nequal sign.\n\n### Pass Parameters as a JSON Object\n\n```\n curl -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"name\": \"example.com\", \"ip_address\": \"127.0.0.1\"}' \\\n -X POST \"https://api.digitalocean.com/v2/domains\"\n```\n\n### Pass Filter Parameters as a Query String\n\n```\n curl -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n -X GET \\\n \"https://api.digitalocean.com/v2/images?private=true\"\n```\n\n## Cross Origin Resource Sharing\n\nIn order to make requests to the API from other domains, the API implements\nCross Origin Resource Sharing (CORS) support.\n\nCORS support is generally used to create AJAX requests outside of the domain\nthat the request originated from. This is necessary to implement projects\nlike control panels utilizing the API. This tells the browser that it can\nsend requests to an outside domain.\n\nThe procedure that the browser initiates in order to perform these actions\n(other than GET requests) begins by sending a \"preflight\" request. This sets\nthe `Origin` header and uses the `OPTIONS` method. The server will reply\nback with the methods it allows and some of the limits it imposes. The\nclient then sends the actual request if it falls within the allowed\nconstraints.\n\nThis process is usually done in the background by the browser, but you can\nuse curl to emulate this process using the example provided. The headers\nthat will be set to show the constraints are:\n\n* **Access-Control-Allow-Origin**: This is the domain that is sent by the client or browser as the origin of the request. It is set through an `Origin` header.\n* **Access-Control-Allow-Methods**: This specifies the allowed options for requests from that domain. This will generally be all available methods.\n* **Access-Control-Expose-Headers**: This will contain the headers that will be available to requests from the origin domain.\n* **Access-Control-Max-Age**: This is the length of time that the access is considered valid. After this expires, a new preflight should be sent.\n* **Access-Control-Allow-Credentials**: This will be set to `true`. It basically allows you to send your OAuth token for authentication.\n\nYou should not need to be concerned with the details of these headers,\nbecause the browser will typically do all of the work for you.\n" license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html contact: name: DigitalOcean API Team email: api-engineering@digitalocean.com termsOfService: https://www.digitalocean.com/legal/terms-of-service-agreement/ servers: - url: https://api.digitalocean.com description: production security: - bearer_auth: [] tags: - name: Apps description: 'App Platform is a Platform-as-a-Service (PaaS) offering from DigitalOcean that allows developers to publish code directly to DigitalOcean servers without worrying about the underlying infrastructure. Most API operations are centered around a few core object types. Following are the definitions of these types. These definitions will be omitted from the operation-specific documentation. For documentation on app specifications (`AppSpec` objects), please refer to the [product documentation](https://docs.digitalocean.com/products/app-platform/reference/app-spec/)).' paths: /v2/apps: get: operationId: apps_list summary: List All Apps description: 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. tags: - Apps parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/per_page' - $ref: '#/components/parameters/with_projects' responses: '200': $ref: '#/components/responses/list_apps' '401': $ref: '#/components/responses/unauthorized' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X GET \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/apps\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) get_resp = client.apps.list()' security: - bearer_auth: - app:read post: operationId: apps_create summary: Create a New App description: Create a new app by submitting an app specification. For documentation on app specifications (`AppSpec` objects), please refer to [the product documentation](https://docs.digitalocean.com/products/app-platform/reference/app-spec/). tags: - Apps parameters: - $ref: '#/components/parameters/accept' - $ref: '#/components/parameters/content-type' requestBody: content: application/json: schema: $ref: '#/components/schemas/apps_create_app_request' example: spec: name: web-app region: nyc services: - name: api github: branch: main deploy_on_push: true repo: digitalocean/sample-golang run_command: bin/api environment_slug: node-js instance_count: 2 instance_size_slug: apps-s-1vcpu-0.5gb routes: - path: /api egress: type: DEDICATED_IP required: true responses: '200': $ref: '#/components/responses/new_app' '401': $ref: '#/components/responses/unauthorized' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X POST \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/apps\"\n -d '{\"spec\":{\"name\":\"web-app\",\"region\":\"nyc\", \\\n \"services\":[{\"name\":\"api\",\"github\":{\"branch\":\"main\",\\\n \"deploy_on_push\":true,\"repo\":\"digitalocean/sample-golang\"}, \\\n \"run_command\":\"bin/api\",\"environment_slug\":\"node-js\", \\\n \"instance_count\":2,\"instance_size_slug\":\"apps-s-1vcpu-0.5gb\", \\\n \"routes\":[{\"path\":\"/api\"}]}]}}'" - lang: Python source: "import os\nfrom pydo import Client\n\nclient = Client(token=os.environ.get(\"DIGITALOCEAN_TOKEN\"))\n\ncreate_resp = client.apps.create(\n {\n \"spec\": {\n \"name\": \"web-app\",\n \"region\": \"nyc\",\n \"services\": [\n {\n \"name\": \"api\",\n \"github\": {},\n \"run_command\": \"bin/api\",\n \"environment_slug\": \"node-js\",\n \"instance_count\": 2,\n \"instance_size_slug\": \"apps-s-1vcpu-0.5gb\",\n \"routes\": [],\n }\n ],\n }\n }\n)" security: - bearer_auth: - app:create /v2/apps/{id}: delete: operationId: apps_delete summary: Delete an App description: 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. tags: - Apps parameters: - $ref: '#/components/parameters/id_app' responses: '200': $ref: '#/components/responses/delete_app' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X DELETE \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/apps/{id}\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) delete_resp = client.apps.delete(id="b7d64052")' security: - bearer_auth: - app:delete get: operationId: apps_get summary: Retrieve an Existing App description: 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. tags: - Apps parameters: - $ref: '#/components/parameters/id_app' - $ref: '#/components/parameters/app_name' responses: '200': $ref: '#/components/responses/apps_get' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X GET \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/apps/{id}\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) create_resp = client.apps.get(id="4f6c71e2")' security: - bearer_auth: - app:read put: operationId: apps_update summary: Update an App description: Update an existing app by submitting a new app specification. For documentation on app specifications (`AppSpec` objects), please refer to [the product documentation](https://docs.digitalocean.com/products/app-platform/reference/app-spec/). tags: - Apps parameters: - $ref: '#/components/parameters/id_app' requestBody: content: application/json: schema: $ref: '#/components/schemas/apps_update_app_request' required: true responses: '200': $ref: '#/components/responses/update_app' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: 'curl -X PUT \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ "https://api.digitalocean.com/v2/apps/{id}" \ -d ''{"alerts":[{"rule":"DEPLOYMENT_FAILED"},{"rule":"DOMAIN_FAILED"}],"domains":[{"domain":"example.com","type":"PRIMARY","zone":"example.com"}],"envs":[{"key":"API_KEY","scope":"RUN_AND_BUILD_TIME","type":"SECRET","value":"EV[1:zqiRIeaaYK/NqctZDYzy6t0pTrtRDez8:wqGpZRrsKN5nPhWQrS479cfBiXT0WQ==]"}],"features":["buildpack-stack=ubuntu-22"],"ingress":{},"name":"example-app","region":"nyc","services":[{"autoscaling":{"max_instance_count":4,"metrics":{"cpu":{"percent":70}},"min_instance_count":2},"git":{"branch":"main","repo_clone_url":"https://github.com/digitalocean/sample-nodejs.git"},"internal_ports":[8080],"log_destinations":[{"name":"your_log_consumer_name","open_search":{"endpoint":"logs.example.com:12345","basic_auth":{"user":"doadmin","password":"1234567890abcdef"},"index_name":"example-index","cluster_name":"example-cluster"}}],"name":"sample-nodejs","run_command":"yarn start","source_dir":"/"}]}''' - lang: Python source: "import os\nfrom pydo import Client\n\nclient = Client(token=os.environ.get(\"DIGITALOCEAN_TOKEN\"))\nreq = {\n\"spec\": {\n \"name\": \"web-app-01\",\n \"region\": \"nyc\",\n \"domains\": [\n {\n \"domain\": \"app.example.com\",\n \"type\": \"DEFAULT\",\n \"wildcard\": True,\n \"zone\": \"example.com\",\n \"minimum_tls_version\": \"1.3\",\n }\n ],\n \"services\": [],\n \"static_sites\": [\n {\n \"cors\": {\n \"allow_origins\": [\n {\"exact\": \"https://www.example.com\"},\n {\"regex\": \"^.*example.com\"},\n ],\n \"allow_methods\": [\n \"GET\",\n \"OPTIONS\",\n \"POST\",\n \"PUT\",\n \"PATCH\",\n \"DELETE\",\n ],\n \"allow_headers\": [\"Content-Type\", \"X-Custom-Header\"],\n \"expose_headers\": [\"Content-Encoding\", \"X-Custom-Header\"],\n \"max_age\": \"5h30m\",\n \"allow_credentials\": False,\n },\n \"routes\": [{\"path\": \"/api\", \"preserve_path_prefix\": True}],\n }\n ],\n \"jobs\": [\n {\n \"name\": \"api\",\n \"gitlab\": {\n \"branch\": \"main\",\n \"deploy_on_push\": True,\n \"repo\": \"digitalocean/sample-golang\",\n },\n \"image\": {\n \"registry\": \"registry.hub.docker.com\",\n \"registry_type\": \"DOCR\",\n \"repository\": \"origin/master\",\n \"tag\": \"latest\",\n },\n \"dockerfile_path\": \"path/to/Dockerfile\",\n \"build_command\": \"npm run build\",\n \"run_command\": \"bin/api\",\n \"source_dir\": \"path/to/dir\",\n \"envs\": [\n {\n \"key\": \"BASE_URL\",\n \"scope\": \"BUILD_TIME\",\n \"type\": \"GENERAL\",\n \"value\": \"http://example.com\",\n }\n ],\n \"environment_slug\": \"node-js\",\n \"log_destinations\": {\n \"name\": \"my_log_destination\",\n \"papertrail\": {\n \"endpoint\": \"https://mypapertrailendpoint.com\"\n },\n \"datadog\": {\n \"endpoint\": \"https://mydatadogendpoint.com\",\n \"api_key\": \"abcdefghijklmnopqrstuvwxyz0123456789\",\n },\n \"logtail\": {\n \"token\": \"abcdefghijklmnopqrstuvwxyz0123456789\"\n },\n \"open_search\": {\n \"endpoint\": \"https://myopensearchendpoint.com:9300\"\n \"index_name\": \"logs\"\n \"basic_auth\": {\n \"user\": \"doadmin\",\n \"password\": \"password\"\n }\n },\n },\n \"instance_count\": 2,\n \"instance_size_slug\": \"apps-s-1vcpu-0.5gb\",\n \"kind\": \"PRE_DEPLOY\",\n }\n ],\n \"workers\": [\n {\n \"name\": \"api\",\n \"gitlab\": {\n \"branch\": \"main\",\n \"deploy_on_push\": True,\n \"repo\": \"digitalocean/sample-golang\",\n },\n \"image\": {\n \"registry\": \"registry.hub.docker.com\",\n \"registry_type\": \"DOCR\",\n \"repository\": \"origin/master\",\n \"tag\": \"latest\",\n },\n \"dockerfile_path\": \"path/to/Dockerfile\",\n \"build_command\": \"npm run build\",\n \"run_command\": \"bin/api\",\n \"source_dir\": \"path/to/dir\",\n \"envs\": [\n {\n \"key\": \"BASE_URL\",\n \"scope\": \"BUILD_TIME\",\n \"type\": \"GENERAL\",\n \"value\": \"http://example.com\",\n }\n ],\n \"environment_slug\": \"node-js\",\n \"log_destinations\": {\n \"name\": \"my_log_destination\",\n \"papertrail\": {\n \"endpoint\": \"https://mypapertrailendpoint.com\"\n },\n \"datadog\": {\n \"endpoint\": \"https://mydatadogendpoint.com\",\n \"api_key\": \"abcdefghijklmnopqrstuvwxyz0123456789\",\n },\n \"logtail\": {\n \"token\": \"abcdefghijklmnopqrstuvwxyz0123456789\"\n },\n \"open_search\": {\n \"endpoint\": \"https://myopensearchendpoint.com:9300\"\n \"index_name\": \"logs\"\n \"basic_auth\": {\n \"user\": \"doadmin\",\n \"password\": \"password\"\n }\n },\n },\n \"instance_count\": 2,\n \"instance_size_slug\": \"apps-s-1vcpu-0.5gb\",\n }\n ],\n \"functions\": [\n {\n \"cors\": {\n \"allow_origins\": [\n {\"exact\": \"https://www.example.com\"},\n {\"regex\": \"^.*example.com\"},\n ],\n \"allow_methods\": [\n \"GET\",\n \"OPTIONS\",\n \"POST\",\n \"PUT\",\n \"PATCH\",\n \"DELETE\",\n ],\n \"allow_headers\": [\"Content-Type\", \"X-Custom-Header\"],\n \"expose_headers\": [\"Content-Encoding\", \"X-Custom-Header\"],\n \"max_age\": \"5h30m\",\n \"allow_credentials\": False,\n },\n \"routes\": [{\"path\": \"/api\", \"preserve_path_prefix\": True}],\n \"name\": \"api\",\n \"source_dir\": \"path/to/dir\",\n \"alerts\": [\n {\n \"rule\": \"CPU_UTILIZATION\",\n \"disabled\": False,\n \"operator\": \"GREATER_THAN\",\n \"value\": 2.32,\n \"window\": \"FIVE_MINUTES\",\n }\n ],\n \"envs\": [\n {\n \"key\": \"BASE_URL\",\n \"scope\": \"BUILD_TIME\",\n \"type\": \"GENERAL\",\n \"value\": \"http://example.com\",\n }\n ],\n \"gitlab\": {\n \"branch\": \"main\",\n \"deploy_on_push\": True,\n \"repo\": \"digitalocean/sample-golang\",\n },\n \"log_destinations\": {\n \"name\": \"my_log_destination\",\n \"papertrail\": {\n \"endpoint\": \"https://mypapertrailendpoint.com\"\n },\n \"datadog\": {\n \"endpoint\": \"https://mydatadogendpoint.com\",\n \"api_key\": \"abcdefghijklmnopqrstuvwxyz0123456789\",\n },\n \"logtail\": {\n \"token\": \"abcdefghijklmnopqrstuvwxyz0123456789\"\n },\n \"open_search\": {\n \"endpoint\": \"https://myopensearchendpoint.com:9300\"\n \"index_name\": \"logs\"\n \"basic_auth\": {\n \"user\": \"doadmin\",\n \"password\": \"password\"\n }\n },\n },\n }\n ],\n \"databases\": [\n {\n \"cluster_name\": \"cluster_name\",\n \"db_name\": \"my_db\",\n \"db_user\": \"superuser\",\n \"engine\": \"PG\",\n \"name\": \"prod-db\",\n \"production\": True,\n \"version\": \"12\",\n }\n ],\n}\n}\nupdate_resp = client.apps.update(id=\"bb245ba\", body=req)" security: - bearer_auth: - app:update /v2/apps/{app_id}/restart: post: operationId: apps_restart summary: Restart an App description: Perform a rolling restart of all or specific components in an app. tags: - Apps parameters: - $ref: '#/components/parameters/app_id' requestBody: content: application/json: schema: $ref: '#/components/schemas/apps_restart_request' responses: '200': $ref: '#/components/responses/new_app_deployment' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X POST \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/apps/{app_id}/restart\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) create_resp = client.apps.restart(app_id="b6bdf840", body={"components": ["component1", "component2"]})' security: - bearer_auth: - app:update /v2/apps/{app_id}/components/{component_name}/logs: get: operationId: apps_get_logs_active_deployment summary: Retrieve Active Deployment Logs description: 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. tags: - Apps parameters: - $ref: '#/components/parameters/app_id' - $ref: '#/components/parameters/component' - $ref: '#/components/parameters/live_updates' - $ref: '#/components/parameters/log_type' - $ref: '#/components/parameters/time_wait' responses: '200': $ref: '#/components/responses/list_logs' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X GET \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/apps/{app_id}/components/{component_name}/logs\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) get_resp = client.apps.get_logs_active_deployment(app_id="a6adf840", component_name="component")' security: - bearer_auth: - app:read /v2/apps/{app_id}/components/{component_name}/exec: get: operationId: apps_get_exec_active_deployment summary: Retrieve Exec URL description: Returns a websocket URL that allows sending/receiving console input and output to a component of the active deployment if one exists. tags: - Apps parameters: - $ref: '#/components/parameters/app_id' - $ref: '#/components/parameters/component' responses: '200': $ref: '#/components/responses/get_exec' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X GET \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/apps/{app_id}/components/{component_name}/exec\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) get_resp = client.apps.get_exec_active_deployment(app_id="a6adf840", component_name="component")' security: - bearer_auth: - app:update /v2/apps/{app_id}/deployments: get: operationId: apps_list_deployments summary: List App Deployments description: List all deployments of an app. tags: - Apps parameters: - $ref: '#/components/parameters/app_id' - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/per_page' responses: '200': $ref: '#/components/responses/existing_deployments' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X GET \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/apps/{app_id}/deployments\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) get_resp = client.apps.list_deployments(app_id="4f6c71e2")' security: - bearer_auth: - app:read post: operationId: apps_create_deployment summary: Create an App Deployment description: Creating an app deployment will pull the latest changes from your repository and schedule a new deployment for your app. tags: - Apps parameters: - $ref: '#/components/parameters/app_id' requestBody: content: application/json: schema: $ref: '#/components/schemas/apps_create_deployment_request' required: true responses: '200': $ref: '#/components/responses/new_app_deployment' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X POST \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/apps/{app_id}/deployments\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) create_resp = client.apps.create_deployment(app_id="b6bdf840", body={"force_build": True})' security: - bearer_auth: - app:create /v2/apps/{app_id}/deployments/{deployment_id}: get: operationId: apps_get_deployment summary: Retrieve an App Deployment description: Retrieve information about an app deployment. tags: - Apps parameters: - $ref: '#/components/parameters/app_id' - $ref: '#/components/parameters/deployment_id' responses: '200': $ref: '#/components/responses/list_deployment' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X GET \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/apps/{app_id}/deployments/{deployment_id}\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) get_resp = client.apps.get_deployment(app_id="a6adf840", deployment_id="b6bdf840")' security: - bearer_auth: - app:read /v2/apps/{app_id}/deployments/{deployment_id}/cancel: post: operationId: apps_cancel_deployment summary: Cancel a Deployment description: Immediately cancel an in-progress deployment. tags: - Apps parameters: - $ref: '#/components/parameters/app_id' - $ref: '#/components/parameters/deployment_id' responses: '200': $ref: '#/components/responses/cancel_deployment' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X POST \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/apps/{app_id}/deployments/{deployment_id}/cancel\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) cancel_resp = client.apps.cancel_deployment("12345", "24556")' security: - bearer_auth: - app:update /v2/apps/{app_id}/deployments/{deployment_id}/components/{component_name}/logs: get: operationId: apps_get_logs summary: Retrieve Deployment Logs description: 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. tags: - Apps parameters: - $ref: '#/components/parameters/app_id' - $ref: '#/components/parameters/deployment_id' - $ref: '#/components/parameters/component' - $ref: '#/components/parameters/live_updates' - $ref: '#/components/parameters/log_type' - $ref: '#/components/parameters/time_wait' responses: '200': $ref: '#/components/responses/list_logs' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X GET \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/apps/{app_id}/deployments/{deployment_id}/components/{component_name}/logs\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) get_resp = client.apps.get_logs(app_id="4f6c71e2", deployment_id="3aa4d20e", component_name="component")' security: - bearer_auth: - app:read /v2/apps/{app_id}/deployments/{deployment_id}/logs: get: operationId: apps_get_logs_aggregate summary: Retrieve Aggregate Deployment Logs description: 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. tags: - Apps parameters: - $ref: '#/components/parameters/app_id' - $ref: '#/components/parameters/deployment_id' - $ref: '#/components/parameters/live_updates' - $ref: '#/components/parameters/log_type' - $ref: '#/components/parameters/time_wait' responses: '200': $ref: '#/components/responses/list_logs' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X GET \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/apps/{app_id}/deployments/{deployment_id}/logs\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) get_resp = client.apps.get_logs_aggregate(app_id="b6bdf840", deployment_id="a6adf840")' security: - bearer_auth: - app:read /v2/apps/{app_id}/deployments/{deployment_id}/components/{component_name}/exec: get: operationId: apps_get_exec summary: Retrieve Exec URL for Deployment description: Returns a websocket URL that allows sending/receiving console input and output to a component of the specified deployment if one exists. tags: - Apps parameters: - $ref: '#/components/parameters/app_id' - $ref: '#/components/parameters/deployment_id' - $ref: '#/components/parameters/component' responses: '200': $ref: '#/components/responses/get_exec' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X GET \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/apps/{app_id}/deployments/{deployment_id}/components/{component_name}/exec\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) get_resp = client.apps.get_exec(app_id="4f6c71e2", deployment_id="3aa4d20e", component_name="component")' security: - bearer_auth: - app:update /v2/apps/{app_id}/logs: get: operationId: apps_get_logs_active_deployment_aggregate summary: Retrieve Active Deployment Aggregate Logs description: 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. tags: - Apps parameters: - $ref: '#/components/parameters/app_id' - $ref: '#/components/parameters/live_updates' - $ref: '#/components/parameters/log_type' - $ref: '#/components/parameters/time_wait' responses: '200': $ref: '#/components/responses/list_logs' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X GET \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/apps/{app_id}/logs\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) get_resp = client.apps.get_logs_active_deployment_aggregate(app_id="a6adf840")' security: - bearer_auth: - app:read /v2/apps/tiers/instance_sizes: get: operationId: apps_list_instanceSizes summary: List Instance Sizes description: List all instance sizes for `service`, `worker`, and `job` components. tags: - Apps responses: '200': $ref: '#/components/responses/list_instance' '401': $ref: '#/components/responses/unauthorized' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X GET \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/apps/tiers/instance_sizes\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) get_resp = client.apps.list_instance_sizes()' security: - bearer_auth: - app:read /v2/apps/tiers/instance_sizes/{slug}: get: operationId: apps_get_instanceSize summary: Retrieve an Instance Size description: Retrieve information about a specific instance size for `service`, `worker`, and `job` components. tags: - Apps parameters: - $ref: '#/components/parameters/slug_size' responses: '200': $ref: '#/components/responses/get_instance' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X GET \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/apps/tiers/instance_sizes/{slug}\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) get_resp = client.apps.get_instance_size(slug="apps-s-1vcpu-0.5gb")' security: - bearer_auth: - app:read /v2/apps/regions: get: operationId: apps_list_regions summary: List App Regions description: List all regions supported by App Platform. tags: - Apps responses: '200': $ref: '#/components/responses/list_regions' '401': $ref: '#/components/responses/unauthorized' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X GET \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/apps/regions\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) get_resp = client.apps.list_regions()' security: - bearer_auth: - app:read /v2/apps/propose: post: operationId: apps_validate_appSpec summary: Propose an App Spec description: 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. tags: - Apps requestBody: content: application/json: schema: $ref: '#/components/schemas/app_propose' example: spec: name: web-app region: nyc services: - name: api github: branch: main deploy_on_push: true repo: digitalocean/sample-golang run_command: bin/api environment_slug: node-js instance_count: 2 instance_size_slug: apps-s-1vcpu-0.5gb routes: - path: /api app_id: b6bdf840-2854-4f87-a36c-5f231c617c84 required: true responses: '200': $ref: '#/components/responses/propose_app' '401': $ref: '#/components/responses/unauthorized' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' security: - bearer_auth: - app:read /v2/apps/{app_id}/alerts: get: operationId: apps_list_alerts summary: List all app alerts description: 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. tags: - Apps parameters: - $ref: '#/components/parameters/app_id' responses: '200': $ref: '#/components/responses/list_alerts' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X GET \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/apps/{app_id}/alerts\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) get_resp = client.apps.list_alerts(app_id="4f6c71e2")' security: - bearer_auth: - app:read /v2/apps/{app_id}/alerts/{alert_id}/destinations: post: operationId: apps_assign_alertDestinations summary: Update destinations for alerts description: Updates the emails and slack webhook destinations for app alerts. Emails must be associated to a user with access to the app. tags: - Apps parameters: - $ref: '#/components/parameters/app_id' - $ref: '#/components/parameters/alert_id' requestBody: content: application/json: schema: $ref: '#/components/schemas/apps_assign_app_alert_destinations_request' required: true responses: '200': $ref: '#/components/responses/assign_alert_destinations' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X PUT \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/apps/{id}/alerts/{alert_id}/destinations\"" - lang: Python source: "import os\nfrom pydo import Client\n\nclient = Client(token=os.environ.get(\"DIGITALOCEAN_TOKEN\"))\n\nreq = {\n \"emails\": [\"sammy@digitalocean.com\"],\n \"slack_webhooks\": [\n {\n \"url\": \"https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX\",\n \"channel\": \"Channel Name\",\n }\n ],\n}\n\npost_resp = client.apps.assign_alert_destinations(\"12345\", \"24556\", req)" security: - bearer_auth: - app:update /v2/apps/{app_id}/rollback: post: operationId: apps_create_rollback summary: Rollback App description: '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. ' tags: - Apps parameters: - $ref: '#/components/parameters/app_id' requestBody: content: application/json: schema: $ref: '#/components/schemas/apps_rollback_app_request' required: true responses: '200': $ref: '#/components/responses/new_app_deployment' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X POST \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n -d '{ \"deployment_id\": \"3aa4d20e-5527-4c00-b496-601fbd22520a\" }' \\\n \"https://api.digitalocean.com/v2/apps/{app_id}/rollback\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) create_resp = client.apps.create_rollback(app_id="b6bdf840")' security: - bearer_auth: - app:update /v2/apps/{app_id}/rollback/validate: post: operationId: apps_validate_rollback summary: Validate App Rollback description: '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. ' tags: - Apps parameters: - $ref: '#/components/parameters/app_id' requestBody: content: application/json: schema: $ref: '#/components/schemas/apps_rollback_app_request' required: true responses: '200': $ref: '#/components/responses/apps_validate_rollback' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X POST \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n -d '{ \"deployment_id\": \"3aa4d20e-5527-4c00-b496-601fbd22520a\" }' \\\n \"https://api.digitalocean.com/v2/apps/{app_id}/rollback/validate\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) validate_req = {"deployment_id": "2", "skip_pin": False} validate_resp = client.apps.validate_rollback("1", validate_req)' security: - bearer_auth: - app:update /v2/apps/{app_id}/rollback/commit: post: operationId: apps_commit_rollback summary: Commit App Rollback description: 'Commit an app rollback. This action permanently applies the rollback and unpins the app to resume new deployments. ' tags: - Apps parameters: - $ref: '#/components/parameters/app_id' responses: '200': $ref: '#/components/responses/no_content' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X POST \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/apps/{app_id}/rollback/commit\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) commit_resp = client.apps.commit_rollback("1")' security: - bearer_auth: - app:update /v2/apps/{app_id}/rollback/revert: post: operationId: apps_revert_rollback summary: Revert App Rollback description: '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. ' tags: - Apps parameters: - $ref: '#/components/parameters/app_id' responses: '200': $ref: '#/components/responses/new_app_deployment' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X POST \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/apps/{app_id}/rollback/revert\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) revert_resp = client.apps.revert_rollback("1")' security: - bearer_auth: - app:update /v2/apps/{app_id}/metrics/bandwidth_daily: get: operationId: apps_get_metrics_bandwidth_daily summary: Retrieve App Daily Bandwidth Metrics description: Retrieve daily bandwidth usage metrics for a single app. tags: - Apps parameters: - $ref: '#/components/parameters/app_id' - name: date description: 'Optional day to query. Only the date component of the timestamp will be considered. Default: yesterday.' in: query schema: type: string format: date-time example: '2023-01-17T00:00:00Z' responses: '200': $ref: '#/components/responses/get_metrics_bandwidth_usage' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X GET \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/apps/{id}/metrics/bandwidth_daily\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) get_resp = client.apps.get_metrics_bandwidth_daily(app_id="4f6c71e2")' security: - bearer_auth: - app:read /v2/apps/metrics/bandwidth_daily: post: operationId: apps_list_metrics_bandwidth_daily summary: Retrieve Multiple Apps' Daily Bandwidth Metrics description: Retrieve daily bandwidth usage metrics for multiple apps. tags: - Apps requestBody: content: application/json: schema: $ref: '#/components/schemas/app_metrics_bandwidth_usage_request' example: app_ids: - 4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf - c2a93513-8d9b-4223-9d61-5e7272c81cf5 date: '2023-01-17T00:00:00Z' required: true responses: '200': $ref: '#/components/responses/list_metrics_bandwidth_usage' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found' '429': $ref: '#/components/responses/too_many_requests' '500': $ref: '#/components/responses/server_error' default: $ref: '#/components/responses/unexpected_error' x-codeSamples: - lang: cURL source: "curl -X POST \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/apps/metrics/bandwidth_daily\" \\\n -d '{ \"app_ids\": [\"4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf\"] }'" - lang: Python source: "import os\nfrom pydo import Client\n\nclient = Client(token=os.environ.get(\"DIGITALOCEAN_TOKEN\"))\n\nreq = {\n \"app_ids\": [\n \"4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf\",\n \"c2a93513-8d9b-4223-9d61-5e7272c81cf5\",\n ],\n \"date\": \"2023-01-17T00:00:00Z\",\n}\n\nget_resp = client.apps.list_metrics_bandwidth_daily(body=req)" security: - bearer_auth: - app:read components: schemas: app_static_site_spec: allOf: - $ref: '#/components/schemas/app_component_base' - type: object properties: index_document: type: string description: 'The name of the index document to use when serving this static site. Default: index.html' default: index.html example: main.html error_document: type: string description: '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.' default: 404.html example: error.html catchall_document: type: string description: 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. example: index.html output_dir: type: string description: '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`.' example: dist/ cors: allOf: - $ref: '#/components/schemas/apps_cors_policy' - description: (Deprecated - Use Ingress Rules instead). - deprecated: true routes: type: array items: $ref: '#/components/schemas/app_route_spec' description: (Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component. deprecated: true required: - name app_log_destination_papertrail_spec: type: object properties: endpoint: type: string description: Papertrail syslog endpoint. example: https://mypapertrailendpoint.com description: Papertrail configuration. required: - endpoint link_to_prev_page: type: object properties: prev: description: URI of the previous page of the results. type: string example: https://api.digitalocean.com/v2/images?page=1 app_alert: properties: id: readOnly: true title: The ID of the alert type: string example: 4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf component_name: title: Name of component the alert belongs to type: string example: backend spec: $ref: '#/components/schemas/app_alert_spec' emails: title: Emails for alerts to go to type: array items: $ref: '#/components/schemas/app_alert_email' example: - sammy@digitalocean.com slack_webhooks: title: Slack Webhooks to send alerts to type: array items: $ref: '#/components/schemas/app_alert_slack_webhook' phase: $ref: '#/components/schemas/app_alert_phase' progress: $ref: '#/components/schemas/app_alert_progress' type: object app_alert_slack_webhook: properties: url: title: URL of the Slack webhook type: string example: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX channel: title: Name of the Slack Webhook Channel type: string example: Channel Name type: object apps_instance_size: properties: bandwidth_allowance_gib: format: int64 title: The bandwidth allowance in GiB for the instance size type: string example: '1' cpu_type: $ref: '#/components/schemas/instance_size_cpu_type' cpus: format: int64 title: The number of allotted vCPU cores type: string example: '3' deprecation_intent: title: Indicates if the instance size is intended for deprecation type: boolean example: true memory_bytes: format: int64 title: The allotted memory in bytes type: string example: '1048' name: title: A human-readable name of the instance size type: string example: name scalable: title: Indicates if the instance size can enable autoscaling type: boolean example: false single_instance_only: title: Indicates if the instance size allows more than one instance type: boolean example: true slug: title: The slug of the instance size type: string example: apps-s-1vcpu-1gb tier_downgrade_to: title: The slug of the corresponding downgradable instance size on the lower tier type: string example: basic deprecated: true tier_slug: title: The slug of the tier to which this instance size belongs type: string example: basic tier_upgrade_to: title: The slug of the corresponding upgradable instance size on the higher tier type: string example: basic deprecated: true usd_per_month: title: The cost of this instance size in USD per month type: string example: '23' usd_per_second: title: The cost of this instance size in USD per second type: string example: '0.00000001232' type: object app_alert_progress_step: properties: name: title: The name of this step type: string example: example_step status: $ref: '#/components/schemas/app_alert_progress_step_status' started_at: format: date-time title: The start time of this step type: string example: '2020-11-19T20:27:18Z' ended_at: format: date-time title: The start time of this step type: string example: '2020-11-19T20:27:18Z' reason: $ref: '#/components/schemas/app_alert_progress_step_reason' type: object app_spec: title: AppSpec type: object description: The desired configuration of an application. properties: name: description: The name of the app. Must be unique across all apps in the same account. maxLength: 32 minLength: 2 pattern: ^[a-z][a-z0-9-]{0,30}[a-z0-9]$ type: string example: web-app-01 region: description: 'The slug form of the geographical origin of the app. Default: `nearest available`' type: string enum: - ams - nyc - fra - sfo - sgp - blr - tor - lon - syd example: nyc domains: description: A set of hostnames where the application will be available. type: array items: $ref: '#/components/schemas/app_domain_spec' services: description: Workloads which expose publicly-accessible HTTP services. type: array items: $ref: '#/components/schemas/app_service_spec' static_sites: description: Content which can be rendered to static web assets. type: array items: $ref: '#/components/schemas/app_static_site_spec' jobs: description: Pre and post deployment workloads which do not expose publicly-accessible HTTP routes. type: array items: $ref: '#/components/schemas/app_job_spec' workers: description: Workloads which do not expose publicly-accessible HTTP services. items: $ref: '#/components/schemas/app_worker_spec' type: array functions: description: Workloads which expose publicly-accessible HTTP services via Functions Components. items: $ref: '#/components/schemas/app_functions_spec' type: array databases: description: 'Database instances which can provide persistence to workloads within the application.' type: array items: $ref: '#/components/schemas/app_database_spec' ingress: $ref: '#/components/schemas/app_ingress_spec' egress: $ref: '#/components/schemas/app_egress_spec' maintenance: $ref: '#/components/schemas/app_maintenance_spec' required: - name apps_deployment_response: properties: deployment: $ref: '#/components/schemas/apps_deployment' type: object app_ingress_spec_rule: type: object properties: match: $ref: '#/components/schemas/app_ingress_spec_rule_match' cors: $ref: '#/components/schemas/apps_cors_policy' component: $ref: '#/components/schemas/app_ingress_spec_rule_routing_component' redirect: $ref: '#/components/schemas/app_ingress_spec_rule_routing_redirect' apps_deployments_response: allOf: - type: object properties: deployments: title: A list of deployments type: array items: $ref: '#/components/schemas/apps_deployment' - $ref: '#/components/schemas/pagination' - $ref: '#/components/schemas/meta' apps_git_source_spec: type: object properties: branch: type: string description: The name of the branch to use example: main repo_clone_url: type: string description: 'The clone URL of the repo. Example: `https://github.com/digitalocean/sample-golang.git`' example: https://github.com/digitalocean/sample-golang.git app_service_spec_termination: type: object properties: drain_seconds: type: integer format: int32 description: The number of seconds to wait between selecting a container instance for termination and issuing the TERM signal. Selecting a container instance for termination begins an asynchronous drain of new requests on upstream load-balancers. (Default 15) example: 15 maximum: 110 minimum: 1 grace_period_seconds: type: integer format: int32 description: The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. (Default 120) example: 120 maximum: 600 minimum: 1 pagination: type: object properties: links: $ref: '#/components/schemas/page_links' apps_deployment_progress_step_reason: properties: code: title: The error code type: string example: Title of Error message: title: The error message type: string example: This is an error type: object app_maintenance_spec: type: object description: Specification to configure maintenance settings for the app, such as maintenance mode and archiving the app. properties: enabled: type: boolean description: Indicates whether maintenance mode should be enabled for the app. example: true archive: type: boolean description: Indicates whether the app should be archived. Setting this to true implies that enabled is set to true. Note that this feature is currently in closed beta. example: true app_log_destination_datadog_spec: type: object properties: endpoint: type: string description: Datadog HTTP log intake endpoint. example: https://mydatadogendpoint.com api_key: type: string description: Datadog API key. example: abcdefghijklmnopqrstuvwxyz0123456789 description: DataDog configuration. required: - api_key app_ingress_spec_rule_string_match: type: object properties: prefix: type: string description: Prefix-based match. For example, `/api` will match `/api`, `/api/`, and any nested paths such as `/api/v1/endpoint`. maxLength: 256 example: /api description: The path to match on. required: - prefix app_worker_spec_termination: type: object properties: grace_period_seconds: type: integer format: int32 description: The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. (Default 120) example: 120 maximum: 600 minimum: 1 backward_links: allOf: - $ref: '#/components/schemas/link_to_first_page' - $ref: '#/components/schemas/link_to_prev_page' apps_create_deployment_request: type: object properties: force_build: title: Indicates whether to force a build of app from source even if an existing cached build is suitable for re-use type: boolean example: true app_log_destination_logtail_spec: type: object properties: token: type: string description: Logtail token. example: abcdefghijklmnopqrstuvwxyz0123456789 description: Logtail configuration. required: - endpoint apps_gitlab_source_spec: type: object properties: branch: type: string description: The name of the branch to use example: main deploy_on_push: type: boolean description: Whether to automatically deploy new commits made to the repo example: true repo: type: string description: 'The name of the repo in the format owner/repo. Example: `digitalocean/sample-golang`' example: digitalocean/sample-golang app_log_destination_open_search_spec_basic_auth: type: object properties: user: type: string description: 'Username to authenticate with. Only required when `endpoint` is set. Defaults to `doadmin` when `cluster_name` is set.' example: apps_user password: description: 'Password for user defined in User. Is required when `endpoint` is set. Cannot be set if using a DigitalOcean DBaaS OpenSearch cluster.' example: password1 description: Configure Username and/or Password for Basic authentication. app_ingress_spec: type: object properties: rules: description: Rules for configuring HTTP ingress for component routes, CORS, rewrites, and redirects. type: array items: $ref: '#/components/schemas/app_ingress_spec_rule' description: Specification for app ingress configurations. app_propose: type: object properties: spec: $ref: '#/components/schemas/app_spec' app_id: type: string description: An optional ID of an existing app. If set, the spec will be treated as a proposed update to the specified app. The existing app is not modified using this method. example: b6bdf840-2854-4f87-a36c-5f231c617c84 required: - spec app_variable_definition: type: object properties: key: type: string pattern: ^[_A-Za-z][_A-Za-z0-9]*$ description: The variable name example: BASE_URL scope: type: string enum: - UNSET - RUN_TIME - BUILD_TIME - RUN_AND_BUILD_TIME description: '- RUN_TIME: Made available only at run-time - BUILD_TIME: Made available only at build-time - RUN_AND_BUILD_TIME: Made available at both build and run-time' default: RUN_AND_BUILD_TIME example: BUILD_TIME type: type: string enum: - GENERAL - SECRET description: '- GENERAL: A plain-text environment variable - SECRET: A secret encrypted environment variable' default: GENERAL example: GENERAL value: description: The value. If the type is `SECRET`, the value will be encrypted on first submission. On following submissions, the encrypted value should be used. type: string example: http://example.com required: - key apps_domain: properties: id: title: The ID of the domain type: string example: 4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf phase: $ref: '#/components/schemas/apps_domain_phase' progress: $ref: '#/components/schemas/apps_domain_progress' spec: $ref: '#/components/schemas/app_domain_spec' validations: title: List of TXT validation records type: array items: $ref: '#/components/schemas/app_domain_validation' rotate_validation_records: title: Validation values have changed and require manual intervention type: boolean readOnly: true certificate_expires_at: title: Current SSL certificate expiration time type: string format: date-time readOnly: true example: '2024-01-29T23:59:59Z' type: object apps_get_instance_size_response: properties: instance_size: $ref: '#/components/schemas/apps_instance_size' type: object app_alert_spec: properties: rule: $ref: '#/components/schemas/app_alert_spec_rule' disabled: description: Is the alert disabled? type: boolean example: false operator: $ref: '#/components/schemas/app_alert_spec_operator' value: description: Threshold value for alert format: float type: number example: 2.32 window: $ref: '#/components/schemas/app_alert_spec_window' type: object app_job_spec: allOf: - $ref: '#/components/schemas/app_component_base' - $ref: '#/components/schemas/app_component_instance_base' - type: object properties: kind: type: string enum: - UNSPECIFIED - PRE_DEPLOY - POST_DEPLOY - FAILED_DEPLOY description: '- UNSPECIFIED: Default job type, will auto-complete to POST_DEPLOY kind. - PRE_DEPLOY: Indicates a job that runs before an app deployment. - POST_DEPLOY: Indicates a job that runs after an app deployment. - FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy.' default: UNSPECIFIED example: PRE_DEPLOY termination: $ref: '#/components/schemas/app_job_spec_termination' required: - name apps_list_regions_response: properties: regions: items: $ref: '#/components/schemas/apps_region' type: array type: object app_alert_spec_rule: default: UNSPECIFIED_RULE enum: - 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 - FUNCTIONS_GB_RATE_PER_SECOND type: string example: CPU_UTILIZATION app_log_destination_definition: type: object properties: name: type: string maxLength: 42 minLength: 2 pattern: ^[A-Za-z0-9()\[\]'"][-A-Za-z0-9_. \/()\[\]]{0,40}[A-Za-z0-9()\[\]'"]$ example: my_log_destination papertrail: $ref: '#/components/schemas/app_log_destination_papertrail_spec' datadog: $ref: '#/components/schemas/app_log_destination_datadog_spec' logtail: $ref: '#/components/schemas/app_log_destination_logtail_spec' open_search: $ref: '#/components/schemas/app_log_destination_open_search_spec' title: Configurations for external logging. required: - name apps_domain_progress: properties: steps: items: type: object title: The steps of the domain's progress type: array type: object apps_delete_app_response: properties: id: title: The ID of the app that was deleted type: string example: 4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf type: object apps_restart_request: type: object properties: components: title: Optional list of components to restart. If not provided, all components will be restarted. type: array items: type: string example: - component1 - component2 apps_get_exec_response: properties: url: description: A websocket URL that allows sending/receiving console input and receiving console output. type: string example: wss://exec/?token=xxx type: object apps_deployment_progress_step_status: default: UNKNOWN enum: - UNKNOWN - PENDING - RUNNING - ERROR - SUCCESS type: string example: SUCCESS apps_list_instance_sizes_response: properties: discount_percent: format: float type: number example: 2.32 instance_sizes: items: $ref: '#/components/schemas/apps_instance_size' type: array type: object apps_create_app_request: properties: spec: $ref: '#/components/schemas/app_spec' project_id: type: string description: The ID of the project the app should be assigned to. If omitted, it will be assigned to your default project. required: - spec type: object apps_dedicated_egress_ip: type: object readOnly: true properties: ip: title: The IP address of the dedicated egress IP. type: string example: 192.168.1.1 id: title: The ID of the dedicated egress IP. type: string example: 9e7bc2ac-205a-45d6-919c-e1ac5e73f962 status: $ref: '#/components/schemas/apps_dedicated_egress_ip_status' app_rollback_validation_condition: type: object properties: code: type: string enum: - incompatible_phase - incompatible_result - exceeded_revision_limit - app_pinned - database_config_conflict - region_conflict - static_site_requires_rebuild - image_source_missing_digest example: exceeded_revision_limit description: "A code identifier that represents the failing condition.\n\nFailing conditions:\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 - `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.\n" message: type: string description: A human-readable message describing the failing condition. example: the deployment is past the maximum historical revision limit of 0 for the "starter" app tier components: type: array items: type: string description: If applicable, a list of components that are failing the condition. example: - www error: type: object properties: id: description: 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." type: string example: not_found message: description: A message providing additional information about the error, including details to help resolve it when possible. type: string example: The resource you were accessing could not be found. request_id: description: Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue. type: string example: 4d9d8375-3c56-4925-a3e7-eb137fed17e9 required: - id - message app_response: properties: app: $ref: '#/components/schemas/app' type: object app_alert_progress_step_status: default: UNKNOWN enum: - UNKNOWN - PENDING - RUNNING - ERROR - SUCCESS type: string example: SUCCESS apps_deployment_phase: default: UNKNOWN enum: - UNKNOWN - PENDING_BUILD - BUILDING - PENDING_DEPLOY - DEPLOYING - ACTIVE - SUPERSEDED - ERROR - CANCELED type: string example: ACTIVE app_alert_spec_window: default: UNSPECIFIED_WINDOW enum: - UNSPECIFIED_WINDOW - FIVE_MINUTES - TEN_MINUTES - THIRTY_MINUTES - ONE_HOUR type: string example: FIVE_MINUTES apps_deployment_worker: properties: name: title: The name of this worker type: string example: queue-runner source_commit_hash: title: The commit hash of the repository that was used to build this worker type: string example: 54d4a727f457231062439895000d45437c7bb405 type: object app_job_spec_termination: type: object properties: grace_period_seconds: type: integer format: int32 description: The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. (Default 120) example: 120 maximum: 600 minimum: 1 apps_alert_response: properties: alert: $ref: '#/components/schemas/app_alert' type: object app_component_base: type: object properties: name: type: string maxLength: 32 minLength: 2 pattern: ^[a-z][a-z0-9-]{0,30}[a-z0-9]$ description: The name. Must be unique across all components within the same app. example: api git: $ref: '#/components/schemas/apps_git_source_spec' github: $ref: '#/components/schemas/apps_github_source_spec' gitlab: $ref: '#/components/schemas/apps_gitlab_source_spec' bitbucket: $ref: '#/components/schemas/apps_bitbucket_source_spec' image: $ref: '#/components/schemas/apps_image_source_spec' dockerfile_path: type: string description: 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. example: path/to/Dockerfile build_command: type: string description: An optional build command to run while building this component from source. example: npm run build run_command: type: string description: An optional run command to override the component's default. example: bin/api source_dir: type: string description: 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. example: path/to/dir envs: type: array items: $ref: '#/components/schemas/app_variable_definition' description: A list of environment variables made available to the component. environment_slug: type: string description: An environment slug describing the type of this app. For a full list, please refer to [the product documentation](https://docs.digitalocean.com/products/app-platform/). example: node-js log_destinations: type: array items: $ref: '#/components/schemas/app_log_destination_definition' description: A list of configured log forwarding destinations. app_database_spec: type: object properties: cluster_name: description: 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. type: string example: cluster_name db_name: description: The name of the MySQL or PostgreSQL database to configure. type: string example: my_db db_user: description: The name of the MySQL or PostgreSQL user to configure. type: string example: superuser engine: type: string default: UNSET enum: - UNSET - MYSQL - PG - REDIS - MONGODB - KAFKA - OPENSEARCH description: '- MYSQL: MySQL - PG: PostgreSQL - REDIS: Redis - MONGODB: MongoDB - KAFKA: Kafka - OPENSEARCH: OpenSearch' example: PG name: description: The database's name. The name must be unique across all components within the same app and cannot use capital letters. maxLength: 32 minLength: 2 pattern: ^[a-z][a-z0-9-]{0,30}[a-z0-9]$ type: string example: prod-db production: description: Whether this is a production or dev database. type: boolean example: true version: description: The version of the database engine type: string example: '12' required: - name app_egress_spec: type: object description: Specification for app egress configurations. properties: type: $ref: '#/components/schemas/app_egress_type_spec' app_functions_spec: type: object properties: cors: allOf: - $ref: '#/components/schemas/apps_cors_policy' - description: (Deprecated - Use Ingress Rules instead). - deprecated: true routes: type: array description: (Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component. deprecated: true items: $ref: '#/components/schemas/app_route_spec' name: type: string maxLength: 32 minLength: 2 pattern: ^[a-z][a-z0-9-]{0,30}[a-z0-9]$ description: The name. Must be unique across all components within the same app. example: api source_dir: type: string description: 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. example: path/to/dir alerts: type: array items: $ref: '#/components/schemas/app_alert_spec' envs: type: array items: $ref: '#/components/schemas/app_variable_definition' description: A list of environment variables made available to the component. git: $ref: '#/components/schemas/apps_git_source_spec' github: $ref: '#/components/schemas/apps_github_source_spec' gitlab: $ref: '#/components/schemas/apps_gitlab_source_spec' bitbucket: $ref: '#/components/schemas/apps_bitbucket_source_spec' log_destinations: type: array items: $ref: '#/components/schemas/app_log_destination_definition' description: A list of configured log forwarding destinations. required: - name app: description: An application's configuration and status. properties: active_deployment: $ref: '#/components/schemas/apps_deployment' created_at: format: date-time readOnly: true title: The creation time of the app type: string example: '2020-11-19T20:27:18Z' default_ingress: readOnly: true title: The default hostname on which the app is accessible type: string example: digitalocean.com domains: items: $ref: '#/components/schemas/apps_domain' readOnly: true title: Contains all domains for the app type: array id: readOnly: true title: The ID of the application type: string example: 4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf in_progress_deployment: $ref: '#/components/schemas/apps_deployment' last_deployment_created_at: format: date-time readOnly: true title: The creation time of the last deployment type: string example: '2020-11-19T20:27:18Z' live_domain: readOnly: true title: The live domain of the app type: string example: live_domain live_url: readOnly: true title: The live URL of the app type: string example: google.com live_url_base: readOnly: true title: The live URL base of the app, the URL excluding the path type: string example: digitalocean.com owner_uuid: readOnly: true title: The ID of the account to which the application belongs type: string example: 4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf pending_deployment: allOf: - description: The most recent pending deployment. For CreateApp and UpdateApp transactions this is guaranteed to reflect the associated deployment. - $ref: '#/components/schemas/apps_deployment' project_id: readOnly: true type: string example: 88b72d1a-b78a-4d9f-9090-b53c4399073f title: The ID of the project the app is assigned to. This will be empty if there is a lookup failure. region: $ref: '#/components/schemas/apps_region' spec: $ref: '#/components/schemas/app_spec' tier_slug: readOnly: true title: The current pricing tier slug of the app type: string example: basic updated_at: format: date-time readOnly: true title: Time of the app's last configuration update type: string example: '2020-12-01T00:42:16Z' pinned_deployment: allOf: - description: The deployment that the app is pinned to. - $ref: '#/components/schemas/apps_deployment' dedicated_ips: readOnly: true title: The dedicated egress IP addresses associated with the app. type: array items: $ref: '#/components/schemas/apps_dedicated_egress_ip' required: - spec type: object apps_dedicated_egress_ip_status: title: The status of the dedicated egress IP. type: string readOnly: true default: UNKNOWN enum: - UNKNOWN - ASSIGNING - ASSIGNED - REMOVED example: ASSIGNED app_worker_spec: allOf: - $ref: '#/components/schemas/app_component_base' - $ref: '#/components/schemas/app_component_instance_base' - type: object properties: termination: $ref: '#/components/schemas/app_worker_spec_termination' required: - name apps_string_match: type: object properties: exact: type: string description: Exact string match. Only 1 of `exact`, `prefix`, or `regex` must be set. maxLength: 256 minLength: 1 example: https://www.example.com prefix: type: string description: Prefix-based match. Only 1 of `exact`, `prefix`, or `regex` must be set. maxLength: 256 minLength: 1 example: https://www.example.com deprecated: true regex: type: string maxLength: 256 minLength: 1 description: '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' example: ^.*example.com apps_deployment_job: properties: name: title: The name of this job type: string example: migrate-db source_commit_hash: title: The commit hash of the repository that was used to build this job type: string example: 54d4a727f457231062439895000d45437c7bb405 type: object app_ingress_spec_rule_routing_redirect: type: object properties: uri: description: '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.' type: string example: /about authority: description: 'The authority/host to redirect to. This can be a hostname or IP address. Note: use `port` to set the port.' type: string example: example.com port: description: The port to redirect to. type: integer format: int64 example: 443 scheme: description: 'The scheme to redirect to. Supported values are `http` or `https`. Default: `https`.' type: string example: https redirect_code: description: The redirect code to use. Defaults to `302`. Supported values are 300, 301, 302, 303, 304, 307, 308. type: integer format: int64 example: 302 description: The redirect configuration for the rule. Only one of `component` or `redirect` may be set. app_alert_progress: properties: steps: title: Steps of an alert's progress. type: array items: $ref: '#/components/schemas/app_alert_progress_step' type: object apps_deployment_service: properties: name: title: The name of this service type: string example: web source_commit_hash: title: The commit hash of the repository that was used to build this service type: string example: 54d4a727f457231062439895000d45437c7bb405 type: object meta_properties: type: object description: Information about the response itself. properties: total: description: Number of objects returned by the request. type: integer example: 1 app_metrics_bandwidth_usage: type: object properties: app_bandwidth_usage: type: array items: $ref: '#/components/schemas/app_metrics_bandwidth_usage_details' description: A list of bandwidth usage details by app. date: type: string format: date-time description: The date for the metrics data. example: '2023-01-17T00:00:00Z' app_alert_progress_step_reason: properties: code: title: The error code type: string example: Title of Error message: title: The error message type: string example: This is an error type: object apps_cors_policy: type: object properties: allow_origins: type: array description: The set of allowed CORS origins. items: $ref: '#/components/schemas/apps_string_match' example: - exact: https://www.example.com - regex: ^.*example.com allow_methods: type: array items: type: string description: The set of allowed HTTP methods. This configures the `Access-Control-Allow-Methods` header. example: - GET - OPTIONS - POST - PUT - PATCH - DELETE allow_headers: type: array items: type: string description: The set of allowed HTTP request headers. This configures the `Access-Control-Allow-Headers` header. example: - Content-Type - X-Custom-Header expose_headers: type: array items: type: string description: The set of HTTP response headers that browsers are allowed to access. This configures the `Access-Control-Expose-Headers` header. example: - Content-Encoding - X-Custom-Header max_age: type: string description: An optional duration specifying how long browsers can cache the results of a preflight request. This configures the `Access-Control-Max-Age` header. example: 5h30m allow_credentials: type: boolean description: Whether browsers should expose the response to the client-side JavaScript code when the requests credentials mode is include. This configures the `Access-Control-Allow-Credentials` header. example: false apps_bitbucket_source_spec: type: object properties: branch: type: string description: The name of the branch to use example: main deploy_on_push: type: boolean description: Whether to automatically deploy new commits made to the repo example: true repo: type: string description: 'The name of the repo in the format owner/repo. Example: `digitalocean/sample-golang`' example: digitalocean/sample-golang apps_update_app_request: type: object properties: spec: $ref: '#/components/schemas/app_spec' update_all_source_versions: type: boolean description: Whether or not to update the source versions (for example fetching a new commit or image digest) of all components. By default (when this is false) only newly added sources will be updated to avoid changes like updating the scale of a component from also updating the respective code. example: true default: false required: - spec link_to_next_page: type: object properties: next: description: URI of the next page of the results. type: string example: https://api.digitalocean.com/v2/images?page=2 app_propose_response: type: object properties: app_is_static: type: boolean description: Indicates whether the app is a static app. example: true app_name_available: type: boolean description: Indicates whether the app name is available. example: true app_name_suggestion: type: string description: The suggested name if the proposed app name is unavailable. example: newName existing_static_apps: type: string description: The maximum number of free static apps the account can have. We will charge you for any additional static apps. example: '2' spec: $ref: '#/components/schemas/app_spec' app_cost: type: integer format: int32 description: The monthly cost of the proposed app in USD. example: 5 app_tier_downgrade_cost: type: integer format: int32 description: 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. example: 17 deprecated: true apps_deployment: properties: cause: title: What caused this deployment to be created type: string example: commit 9a4df0b pushed to github/digitalocean/sample-golang cloned_from: title: The ID of a previous deployment that this deployment was cloned from type: string example: 3aa4d20e-5527-4c00-b496-601fbd22520a created_at: format: date-time title: The creation time of the deployment type: string example: '2020-07-28T18:00:00Z' id: title: The ID of the deployment type: string example: b6bdf840-2854-4f87-a36c-5f231c617c84 jobs: items: $ref: '#/components/schemas/apps_deployment_job' title: Job components that are part of this deployment type: array functions: type: array items: $ref: '#/components/schemas/apps_deployment_functions' title: Functions components that are part of this deployment phase: $ref: '#/components/schemas/apps_deployment_phase' phase_last_updated_at: format: date-time title: When the deployment phase was last updated type: string example: '0001-01-01T00:00:00Z' progress: $ref: '#/components/schemas/apps_deployment_progress' services: items: $ref: '#/components/schemas/apps_deployment_service' title: Service components that are part of this deployment type: array spec: $ref: '#/components/schemas/app_spec' static_sites: items: $ref: '#/components/schemas/apps_deployment_static_site' title: Static Site components that are part of this deployment type: array tier_slug: readOnly: true title: The current pricing tier slug of the deployment type: string example: basic updated_at: format: date-time title: When the deployment was last updated type: string example: '2020-07-28T18:00:00Z' workers: items: $ref: '#/components/schemas/apps_deployment_worker' title: Worker components that are part of this deployment type: array title: An app deployment type: object app_alert_email: default: '' type: string example: sammy@digitalocean.com app_domain_validation: properties: txt_name: title: TXT record name type: string readOnly: true example: _acme-challenge.app.example.com txt_value: title: TXT record value type: string readOnly: true example: lXLOcN6cPv0nproViNcUHcahD9TrIPlNgdwesj0pYpk app_component_instance_base: type: object properties: instance_count: type: integer format: int64 minimum: 1 description: 'The amount of instances that this component should be scaled to. Default: 1. Must not be set if autoscaling is used.' default: 1 example: 2 instance_size_slug: description: 'The instance size to use for this component. Default: `apps-s-1vcpu-0.5gb`' oneOf: - title: Size slug type: string enum: - apps-s-1vcpu-0.5gb - apps-s-1vcpu-1gb-fixed - apps-s-1vcpu-1gb - apps-s-1vcpu-2gb - apps-s-2vcpu-4gb - apps-d-1vcpu-0.5gb - apps-d-1vcpu-1gb - apps-d-1vcpu-2gb - apps-d-1vcpu-4gb - apps-d-2vcpu-4gb - apps-d-2vcpu-8gb - apps-d-4vcpu-8gb - apps-d-4vcpu-16gb - apps-d-8vcpu-32gb default: apps-s-1vcpu-0.5gb example: apps-s-1vcpu-0.5gb - title: Deprecated description: 'Deprecated size slugs for legacy plans. We strongly encourage customers to use the new plans when creating or upgrading apps. ' type: string enum: - basic-xxs - basic-xs - basic-s - basic-m - professional-xs - professional-s - professional-m - professional-1l - professional-l - professional-xl example: basic-xxs deprecated: true example: apps-s-1vcpu-0.5gb autoscaling: description: Configuration for automatically scaling this component based on metrics. type: object properties: min_instance_count: description: The minimum amount of instances for this component. Must be less than max_instance_count. type: integer format: uint32 minimum: 1 example: 2 max_instance_count: description: The maximum amount of instances for this component. Must be more than min_instance_count. type: integer format: uint32 minimum: 1 example: 3 metrics: description: The metrics that the component is scaled on. type: object properties: cpu: description: Settings for scaling the component based on CPU utilization. type: object properties: percent: description: The average target CPU utilization for the component. type: integer format: uint32 minimum: 1 maximum: 100 default: 80 example: 75 app_service_spec: allOf: - $ref: '#/components/schemas/app_component_base' - $ref: '#/components/schemas/app_component_instance_base' - type: object properties: cors: allOf: - $ref: '#/components/schemas/apps_cors_policy' - description: (Deprecated - Use Ingress Rules instead). - deprecated: true health_check: $ref: '#/components/schemas/app_service_spec_health_check' protocol: type: string description: 'The protocol which the service uses to serve traffic on the http_port. - `HTTP`: The app is serving the HTTP protocol. Default. - `HTTP2`: The app is serving the HTTP/2 protocol. Currently, this needs to be implemented in the service by serving HTTP/2 cleartext (h2c). ' enum: - HTTP - HTTP2 example: HTTP http_port: type: integer description: 'The internal port on which this service''s run command will listen. Default: 8080 If 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.' format: int64 maximum: 65535 minimum: 1 example: 3000 internal_ports: type: array description: The ports on which this service will listen for internal traffic. items: format: int64 type: integer example: - 80 - 443 routes: type: array description: (Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component. deprecated: true items: $ref: '#/components/schemas/app_route_spec' termination: $ref: '#/components/schemas/app_service_spec_termination' required: - name link_to_last_page: type: object properties: last: description: URI of the last page of the results. type: string example: https://api.digitalocean.com/v2/images?page=2 page_links: type: object properties: pages: anyOf: - $ref: '#/components/schemas/forward_links' - $ref: '#/components/schemas/backward_links' - {} example: pages: first: https://api.digitalocean.com/v2/account/keys?page=1 prev: https://api.digitalocean.com/v2/account/keys?page=2 apps_deployment_static_site: properties: name: title: The name of this static site type: string example: web source_commit_hash: title: The commit hash of the repository that was used to build this static site type: string example: 54d4a727f457231062439895000d45437c7bb405 type: object apps_deployment_functions: type: object properties: name: type: string title: The name of this functions component example: my-functions-component source_commit_hash: type: string description: The commit hash of the repository that was used to build this functions component. example: 54d4a727f457231062439895000d45437c7bb405 namespace: type: string description: The namespace where the functions are deployed. example: ap-b2a93513-8d9b-4223-9d61-5e7272c81c32 app_metrics_bandwidth_usage_request: type: object properties: app_ids: type: array items: type: string description: A list of app IDs to query bandwidth metrics for. maxItems: 100 example: - 4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf - c2a93513-8d9b-4223-9d61-5e7272c81cf5 date: type: string format: date-time description: 'Optional day to query. Only the date component of the timestamp will be considered. Default: yesterday.' example: '2023-01-17T00:00:00Z' required: - app_ids apps_region: properties: continent: readOnly: true title: The continent that this region is in type: string example: europe data_centers: items: type: string example: ams readOnly: true title: Data centers that are in this region type: array example: - ams default: description: Whether or not the region is presented as the default. readOnly: true type: boolean example: true disabled: readOnly: true title: Whether or not the region is open for new apps type: boolean example: true flag: readOnly: true title: The flag of this region type: string example: ams label: readOnly: true title: A human-readable name of the region type: string example: ams reason: readOnly: true title: Reason that this region is not available type: string example: to crowded slug: readOnly: true title: The slug form of the region name type: string example: basic title: Geographical information about an app origin type: object apps_image_source_spec: type: object properties: registry: type: string description: The registry name. Must be left empty for the `DOCR` registry type. example: registry.hub.docker.com registry_type: type: string enum: - DOCKER_HUB - DOCR - GHCR description: '- DOCKER_HUB: The DockerHub container registry type. - DOCR: The DigitalOcean container registry type. - GHCR: The Github container registry type.' example: DOCR registry_credentials: type: string description: 'The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value should be used. - "$username:$access_token" for registries of type `DOCKER_HUB`. - "$username:$access_token" for registries of type `GHCR`.' example: my-dockerhub-username:dckr_pat_the_access_token repository: type: string description: The repository name. example: origin/master tag: type: string description: The repository tag. Defaults to `latest` if not provided and no digest is provided. Cannot be specified if digest is provided. example: latest default: latest digest: type: string description: The image digest. Cannot be specified if tag is provided. example: sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041ac deploy_on_push: type: object properties: enabled: type: boolean description: Whether to automatically deploy new images. Can only be used for images hosted in DOCR and can only be used with an image tag, not a specific digest. example: true app_ingress_spec_rule_match: type: object properties: path: $ref: '#/components/schemas/app_ingress_spec_rule_string_match' description: The match configuration for the rule. required: - path apps_rollback_app_request: type: object properties: deployment_id: type: string description: The ID of the deployment to rollback to. example: 3aa4d20e-5527-4c00-b496-601fbd22520a skip_pin: type: boolean description: Whether to skip pinning the rollback deployment. If false, the rollback deployment will be pinned and any new deployments including Auto Deploy on Push hooks will be disabled until the rollback is either manually committed or reverted via the CommitAppRollback or RevertAppRollback endpoints respectively. If true, the rollback will be immediately committed and the app will remain unpinned. example: false forward_links: allOf: - $ref: '#/components/schemas/link_to_last_page' - $ref: '#/components/schemas/link_to_next_page' app_service_spec_health_check: type: object properties: failure_threshold: type: integer format: int32 description: The number of failed health checks before considered unhealthy. example: 2 port: type: integer format: int64 description: 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. example: 80 maximum: 65535 minimum: 1 http_path: type: string description: 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. example: /health initial_delay_seconds: type: integer format: int32 description: The number of seconds to wait before beginning health checks. example: 30 period_seconds: type: integer format: int32 description: The number of seconds to wait between health checks. example: 60 success_threshold: type: integer format: int32 description: The number of successful health checks before considered healthy. example: 3 timeout_seconds: type: integer format: int32 description: The number of seconds after which the check times out. example: 45 app_egress_type_spec: title: The app egress type. type: string default: AUTOASSIGN example: AUTOASSIGN enum: - AUTOASSIGN - DEDICATED_IP apps_deployment_progress: properties: error_steps: format: int32 title: Number of unsuccessful steps type: integer example: 3 pending_steps: format: int32 title: Number of pending steps type: integer example: 2 running_steps: format: int32 title: Number of currently running steps type: integer example: 2 steps: items: $ref: '#/components/schemas/apps_deployment_progress_step' title: The deployment's steps type: array success_steps: format: int32 title: Number of successful steps type: integer example: 4 summary_steps: items: $ref: '#/components/schemas/apps_deployment_progress_step' title: A flattened summary of the steps type: array total_steps: format: int32 title: Total number of steps type: integer example: 5 type: object app_alert_phase: default: UNKNOWN enum: - UNKNOWN - PENDING - CONFIGURING - ACTIVE - ERROR type: string example: ACTIVE instance_size_cpu_type: default: UNSPECIFIED enum: - UNSPECIFIED - SHARED - DEDICATED title: "- SHARED: Shared vCPU cores\n - DEDICATED: Dedicated vCPU cores" type: string example: SHARED link_to_first_page: type: object properties: first: description: URI of the first page of the results. type: string example: https://api.digitalocean.com/v2/images?page=1 app_route_spec: title: A criterion for routing HTTP traffic to a component. type: object properties: path: description: (Deprecated - Use Ingress Rules instead). An HTTP path prefix. Paths must start with / and must be unique across all components within an app. type: string example: /api preserve_path_prefix: description: 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`. type: boolean example: true app_metrics_bandwidth_usage_details: type: object properties: app_id: type: string description: The ID of the app. example: 4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf bandwidth_bytes: type: string format: uint64 description: The used bandwidth amount in bytes. example: '513668' description: Bandwidth usage for an app. apps_get_logs_response: properties: historic_urls: items: type: string example: https://logs/build.log title: A list of URLs to archived log files type: array live_url: description: 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. type: string example: ws://logs/build type: object apps_list_alerts_response: properties: alerts: type: array items: $ref: '#/components/schemas/app_alert' type: object meta: type: object properties: meta: allOf: - $ref: '#/components/schemas/meta_properties' - required: - total required: - meta app_ingress_spec_rule_routing_component: type: object properties: name: description: The name of the component to route to. type: string example: web preserve_path_prefix: description: '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`.' type: string example: 'true' rewrite: description: '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`.' type: string example: /api/v1/ description: The component to route to. Only one of `component` or `redirect` may be set. required: - name apps_deployment_progress_step: properties: component_name: title: The component name that this step is associated with type: string example: component ended_at: format: date-time title: The end time of this step type: string example: '2020-11-19T20:27:18Z' message_base: description: 'The base of a human-readable description of the step intended to be combined with the component name for presentation. For example: `message_base` = "Building service" `component_name` = "api"' type: string example: Building service name: title: The name of this step type: string example: example_step reason: $ref: '#/components/schemas/apps_deployment_progress_step_reason' started_at: format: date-time title: The start time of this step type: string example: '2020-11-19T20:27:18Z' status: $ref: '#/components/schemas/apps_deployment_progress_step_status' steps: items: type: object title: Child steps of this step type: array title: A step that is run as part of the deployment's lifecycle type: object app_log_destination_open_search_spec: type: object properties: endpoint: type: string description: 'OpenSearch API Endpoint. Only HTTPS is supported. Format: https://:. Cannot be specified if `cluster_name` is also specified.' example: https://example.com:9300 basic_auth: $ref: '#/components/schemas/app_log_destination_open_search_spec_basic_auth' index_name: type: string default: logs description: The index name to use for the logs. If not set, the default index name is "logs". example: logs cluster_name: type: string description: 'The name of a DigitalOcean DBaaS OpenSearch cluster to use as a log forwarding destination. Cannot be specified if `endpoint` is also specified.' example: my-opensearch-cluster description: OpenSearch configuration. apps_github_source_spec: type: object properties: branch: type: string description: The name of the branch to use example: main deploy_on_push: type: boolean description: Whether to automatically deploy new commits made to the repo example: true repo: type: string description: 'The name of the repo in the format owner/repo. Example: `digitalocean/sample-golang`' example: digitalocean/sample-golang app_alert_spec_operator: default: UNSPECIFIED_OPERATOR enum: - UNSPECIFIED_OPERATOR - GREATER_THAN - LESS_THAN type: string example: GREATER_THAN apps_response: allOf: - type: object properties: apps: title: A list of apps type: array items: $ref: '#/components/schemas/app' - $ref: '#/components/schemas/pagination' - $ref: '#/components/schemas/meta' app_domain_spec: type: object properties: domain: type: string maxLength: 253 minLength: 4 pattern: ^((xn--)?[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*\.)+[a-zA-Z]{2,}\.?$ description: The hostname for the domain example: app.example.com type: type: string default: UNSPECIFIED enum: - UNSPECIFIED - DEFAULT - PRIMARY - ALIAS description: '- DEFAULT: The default `.ondigitalocean.app` domain assigned to this app - 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. - ALIAS: A non-primary domain' example: DEFAULT wildcard: type: boolean description: Indicates whether the domain includes all sub-domains, in addition to the given domain example: true zone: description: 'Optional. If the domain uses DigitalOcean DNS and you would like App Platform to automatically manage it for you, set this to the name of the domain on your account. For example, If the domain you are adding is `app.domain.com`, the zone could be `domain.com`.' type: string format: hostname example: example.com minimum_tls_version: type: string maxLength: 3 minLength: 3 enum: - '1.2' - '1.3' description: '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"`.' example: '1.3' required: - domain apps_domain_phase: default: UNKNOWN enum: - UNKNOWN - PENDING - CONFIGURING - ACTIVE - ERROR type: string example: ACTIVE apps_assign_app_alert_destinations_request: properties: emails: type: array items: $ref: '#/components/schemas/app_alert_email' example: - sammy@digitalocean.com slack_webhooks: type: array items: $ref: '#/components/schemas/app_alert_slack_webhook' type: object examples: exec: value: url: wss://exec/?token=xxx logs: value: live_url: https://logs-example/build.log url: https://logs/build.log historic_logs: - https://logs-example/archive/build.log app_bandwidth_usage: value: app_bandwidth_usage: - app_id: 4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf bandwidth_bytes: '513668' date: '2023-01-17T00:00:00Z' apps: value: apps: - id: 4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf owner_uuid: ff36cbc6fd350fe12577f5123133bb5ba01a2419 spec: name: sample-php services: - name: sample-php git: repo_clone_url: https://github.com/digitalocean/sample-php.git branch: main run_command: heroku-php-apache2 environment_slug: php instance_size_slug: apps-s-1vcpu-0.5gb instance_count: 1 http_port: 8080 routes: - path: / domains: - domain: sample-php.example.com type: PRIMARY zone: example.com minimum_tls_version: '1.3' default_ingress: https://sample-php-iaj87.ondigitalocean.app created_at: '2020-11-19T20:27:18Z' updated_at: '2020-12-01T00:42:16Z' active_deployment: id: 3aa4d20e-5527-4c00-b496-601fbd22520a spec: name: sample-php services: - name: sample-php git: repo_clone_url: https://github.com/digitalocean/sample-php.git branch: main run_command: heroku-php-apache2 environment_slug: php instance_size_slug: apps-s-1vcpu-0.5gb instance_count: 1 http_port: 8080 routes: - path: / region: fra domains: - domain: sample-php.example.com type: PRIMARY zone: example.com minimum_tls_version: '1.3' services: - name: sample-php source_commit_hash: 54d4a727f457231062439895000d45437c7bb405 phase_last_updated_at: '2020-12-01T00:42:12Z' created_at: '2020-12-01T00:40:05Z' updated_at: '2020-12-01T00:42:12Z' cause: app spec updated pending_deployment: id: 3aa4d20e-5527-4c00-b496-601fbd22520a spec: name: sample-php services: - name: sample-php git: repo_clone_url: https://github.com/digitalocean/sample-php.git branch: main run_command: heroku-php-apache2 environment_slug: php instance_size_slug: apps-s-1vcpu-0.5gb instance_count: 1 http_port: 8080 routes: - path: / region: fra domains: - domain: sample-php.example.com type: PRIMARY zone: example.com minimum_tls_version: '1.3' services: - name: sample-php source_commit_hash: 54d4a727f457231062439895000d45437c7bb405 phase_last_updated_at: '2020-12-01T00:42:12Z' created_at: '2020-12-01T00:40:05Z' updated_at: '2020-12-01T00:42:12Z' progress: success_steps: 6 total_steps: 6 steps: - name: build status: SUCCESS steps: - name: initialize status: SUCCESS started_at: '2020-12-01T00:40:11.979305214Z' ended_at: '2020-12-01T00:40:12.470972033Z' - name: components status: SUCCESS steps: - name: sample-php status: SUCCESS started_at: '0001-01-01T00:00:00Z' ended_at: '0001-01-01T00:00:00Z' component_name: sample-php message_base: Building service started_at: '2020-12-01T00:40:12.470996857Z' ended_at: '2020-12-01T00:41:26.180360487Z' started_at: '2020-12-01T00:40:11.979257919Z' ended_at: '2020-12-01T00:41:26.653989756Z' phase: ACTIVE tier_slug: basic last_deployment_created_at: '2020-12-01T00:40:05Z' live_url: https://sample-php.example.com region: slug: fra label: Frankfurt flag: germany continent: Europe data_centers: - fra1 tier_slug: basic live_url_base: https://sample-php.example.com live_domain: sample-php.example.com domains: - id: 0831f444-a1a7-11ed-828c-ef59494480b5 phase: ACTIVE spec: domain: sample-php.example.com type: PRIMARY zone: example.com minimum_tls_version: '1.3' rotate_validation_records: false certificate_expires_at: '2024-01-29T23:59:59Z' progress: steps: - ended_at: '0001-01-01T00:00:00Z' name: default-ingress-ready started_at: '2023-01-30T22:15:45.021896292Z' status: SUCCESS - ended_at: '0001-01-01T00:00:00Z' name: ensure-zone started_at: '2023-01-30T22:15:45.022017004Z' status: SUCCESS - ended_at: '2023-01-30T15:42:28.50752065Z' name: ensure-ns-records started_at: '2023-01-30T22:15:45.025567874Z' status: SUCCESS - ended_at: '0001-01-01T00:00:00Z' name: verify-nameservers started_at: '2023-01-30T22:15:45.033591906Z' status: SUCCESS - ended_at: '0001-01-01T00:00:00Z' name: ensure-record started_at: '2023-01-30T22:15:45.156750604Z' status: SUCCESS - ended_at: '2023-01-30T15:43:30.258626422Z' name: ensure-alias-record started_at: '2023-01-30T22:15:45.165933869Z' status: SUCCESS - ended_at: '2023-01-30T15:43:30.258808279Z' name: ensure-wildcard-record started_at: '2023-01-30T22:15:45.166093422Z' status: SUCCESS - ended_at: '0001-01-01T00:00:00Z' name: verify-cname started_at: '2023-01-30T22:15:45.166205559Z' status: SUCCESS - ended_at: '2023-01-30T15:43:30.475903785Z' name: ensure-ssl-txt-record-saved started_at: '2023-01-30T22:15:45.295237186Z' status: SUCCESS - ended_at: '2023-01-30T15:43:30.476017236Z' name: ensure-ssl-txt-record started_at: '2023-01-30T22:15:45.295315291Z' status: SUCCESS - ended_at: '2023-01-30T15:43:30.476094058Z' name: ensure-renewal-email started_at: '2023-01-30T22:15:45.295374087Z' status: SUCCESS - ended_at: '0001-01-01T00:00:00Z' name: ensure-CA-authorization started_at: '2023-01-30T22:15:45.295428101Z' status: SUCCESS - ended_at: '0001-01-01T00:00:00Z' name: ensure-certificate started_at: '2023-01-30T22:15:45.978756406Z' status: SUCCESS - ended_at: '2023-01-30T15:43:52.570612857Z' name: create-deployment started_at: '0001-01-01T00:00:00Z' status: SUCCESS - ended_at: '2023-01-30T15:43:31.333582377Z' name: configuration-alert started_at: '2023-01-30T22:15:46.278987808Z' status: SUCCESS dedicated_ips: - ip: 192.168.1.1 id: c24d8f48-3bc4-49f5-8ca0-58e8164427ac status: ASSIGNED - ip: 192.168.1.2 id: 4768fb15-2837-4dda-9be5-3951df4bc3d0 status: ASSIGNED links: pages: {} meta: total: 1 instance_size: value: instance_size: name: Shared 1VCPU 0.5GB slug: apps-s-1vcpu-0.5gb cpu_type: SHARED cpus: '1' memory_bytes: '536870912' usd_per_month: '5.00' usd_per_second: '0.000002066799' tier_slug: basic single_instance_only: true bandwidth_allowance_gib: '50' deployments: value: deployments: - id: b6bdf840-2854-4f87-a36c-5f231c617c84 spec: name: sample-golang services: - name: web github: repo: digitalocean/sample-golang branch: branch run_command: bin/sample-golang environment_slug: go instance_size_slug: apps-s-1vcpu-0.5gb instance_count: 2 routes: - path: / region: ams services: - name: web source_commit_hash: 9a4df0b8e161e323bc3cdf1dc71878080fe144fa phase_last_updated_at: '0001-01-01T00:00:00Z' created_at: '2020-07-28T18:00:00Z' updated_at: '2020-07-28T18:00:00Z' cause: commit 9a4df0b pushed to github/digitalocean/sample-golang progress: pending_steps: 6 total_steps: 6 steps: - name: build status: PENDING steps: - name: initialize status: PENDING - name: components status: PENDING steps: - name: web status: PENDING component_name: web message_base: Building service - name: deploy status: PENDING steps: - name: initialize status: PENDING - name: components status: PENDING steps: - name: web status: PENDING steps: - name: deploy status: PENDING component_name: web message_base: Deploying service - name: wait status: PENDING component_name: web message_base: Waiting for service component_name: web - name: finalize status: PENDING phase: PENDING_BUILD tier_slug: basic links: pages: {} meta: total: 1 deployment: value: deployment: id: b6bdf840-2854-4f87-a36c-5f231c617c84 spec: name: sample-golang services: - name: web github: repo: digitalocean/sample-golang branch: branch run_command: bin/sample-golang environment_slug: go instance_size_slug: apps-s-1vcpu-0.5gb instance_count: 2 routes: - path: / region: ams services: - name: web source_commit_hash: 9a4df0b8e161e323bc3cdf1dc71878080fe144fa phase_last_updated_at: '0001-01-01T00:00:00Z' created_at: '2020-07-28T18:00:00Z' updated_at: '2020-07-28T18:00:00Z' cause: commit 9a4df0b pushed to github/digitalocean/sample-golang progress: pending_steps: 6 total_steps: 6 steps: - name: build status: PENDING steps: - name: initialize status: PENDING - name: components status: PENDING steps: - name: web status: PENDING component_name: web message_base: Building service - name: deploy status: PENDING steps: - name: initialize status: PENDING - name: components status: PENDING steps: - name: web status: PENDING steps: - name: deploy status: PENDING component_name: web message_base: Deploying service - name: wait status: PENDING component_name: web message_base: Waiting for service component_name: web - name: finalize status: PENDING phase: PENDING_BUILD tier_slug: basic app: value: app: id: c2a93513-8d9b-4223-9d61-5e7272c81cf5 owner_uuid: a4e16f25-cdd1-4483-b246-d77f283c9209 spec: name: sample-golang services: - name: web github: repo: ChiefMateStarbuck/sample-golang branch: main run_command: bin/sample-golang environment_slug: go instance_size_slug: apps-s-1vcpu-0.5gb instance_count: 1 http_port: 8080 routes: - path: / region: ams domains: - domain: sample-golang.example.com zone: example.com minimum_tls_version: '1.3' default_ingress: https://sample-golang-zyhgn.ondigitalocean.app created_at: '2021-02-10T16:45:14Z' updated_at: '2021-02-10T17:06:56Z' active_deployment: id: 991dfa59-6a23-459f-86d6-67dfa2c6f1e3 spec: name: sample-golang services: - name: web github: repo: ChiefMateStarbuck/sample-golang branch: main run_command: bin/sample-golang environment_slug: go instance_size_slug: apps-s-1vcpu-0.5gb instance_count: 1 http_port: 8080 routes: - path: / region: ams domains: - domain: sample-golang.example.com zone: example.com minimum_tls_version: '1.3' services: - name: web source_commit_hash: db6936cb46047c576962962eed81ad52c21f35d7 phase_last_updated_at: '2021-02-10T17:06:53Z' created_at: '2021-02-10T17:05:30Z' updated_at: '2021-02-10T17:06:53Z' cause: manual progress: success_steps: 6 total_steps: 6 steps: - name: build status: SUCCESS steps: - name: initialize status: SUCCESS started_at: '2021-02-10T17:05:35.572347485Z' ended_at: '2021-02-10T17:05:36.093995229Z' - name: components status: SUCCESS steps: - name: web status: SUCCESS component_name: web message_base: Building service started_at: '2021-02-10T17:05:36.094015928Z' ended_at: '2021-02-10T17:06:19.461737040Z' started_at: '2021-02-10T17:05:35.572287990Z' ended_at: '2021-02-10T17:06:19.807834070Z' - name: deploy status: SUCCESS steps: - name: initialize status: SUCCESS started_at: '2021-02-10T17:06:25.143957508Z' ended_at: '2021-02-10T17:06:26.120343872Z' - name: components status: SUCCESS steps: - name: web status: SUCCESS steps: - name: deploy status: SUCCESS component_name: web message_base: Deploying service - name: wait status: SUCCESS component_name: web message_base: Waiting for service component_name: web started_at: '2021-02-10T17:06:26.120385561Z' ended_at: '2021-02-10T17:06:50.029695913Z' - name: finalize status: SUCCESS started_at: '2021-02-10T17:06:50.348459495Z' ended_at: '2021-02-10T17:06:53.404065961Z' started_at: '2021-02-10T17:06:25.143932418Z' ended_at: '2021-02-10T17:06:53.404104185Z' phase: ACTIVE tier_slug: basic last_deployment_created_at: '2021-02-10T17:05:30Z' live_url: https://sample-golang-zyhgn.ondigitalocean.app pending_deployment: id: 3aa4d20e-5527-4c00-b496-601fbd22520a spec: name: sample-php services: - name: sample-php git: repo_clone_url: https://github.com/digitalocean/sample-php.git branch: main run_command: heroku-php-apache2 environment_slug: php instance_size_slug: apps-s-1vcpu-0.5gb instance_count: 1 http_port: 8080 routes: - path: / region: fra domains: - domain: sample-php.example.com type: PRIMARY zone: example.com minimum_tls_version: '1.3' region: slug: ams label: Amsterdam flag: netherlands continent: Europe data_centers: - ams3 tier_slug: basic live_url_base: https://sample-golang-zyhgn.ondigitalocean.app live_domain: sample-golang-zyhgn.ondigitalocean.app project_id: 88b72d1a-b78a-4d9f-9090-b53c4399073f domains: - id: e206c64e-a1a3-11ed-9e6e-9b7b6dc9a52b phase: CONFIGURING spec: domain: sample-golang.example.com type: PRIMARY zone: example.com minimum_tls_version: '1.3' rotate_validation_records: false certificate_expires_at: '2024-01-29T23:59:59Z' progress: steps: - ended_at: '0001-01-01T00:00:00Z' name: default-ingress-ready started_at: '2023-01-30T22:15:45.021896292Z' status: SUCCESS - ended_at: '0001-01-01T00:00:00Z' name: ensure-zone started_at: '2023-01-30T22:15:45.022017004Z' status: SUCCESS - ended_at: '2023-01-30T15:42:28.50752065Z' name: ensure-ns-records started_at: '2023-01-30T22:15:45.025567874Z' status: SUCCESS - ended_at: '0001-01-01T00:00:00Z' name: verify-nameservers started_at: '2023-01-30T22:15:45.033591906Z' status: SUCCESS - ended_at: '0001-01-01T00:00:00Z' name: ensure-record started_at: '2023-01-30T22:15:45.156750604Z' status: SUCCESS - ended_at: '2023-01-30T15:43:30.258626422Z' name: ensure-alias-record started_at: '2023-01-30T22:15:45.165933869Z' status: SUCCESS - ended_at: '2023-01-30T15:43:30.258808279Z' name: ensure-wildcard-record started_at: '2023-01-30T22:15:45.166093422Z' status: SUCCESS - ended_at: '0001-01-01T00:00:00Z' name: verify-cname started_at: '2023-01-30T22:15:45.166205559Z' status: SUCCESS - ended_at: '2023-01-30T15:43:30.475903785Z' name: ensure-ssl-txt-record-saved started_at: '2023-01-30T22:15:45.295237186Z' status: SUCCESS - ended_at: '2023-01-30T15:43:30.476017236Z' name: ensure-ssl-txt-record started_at: '2023-01-30T22:15:45.295315291Z' status: SUCCESS - ended_at: '2023-01-30T15:43:30.476094058Z' name: ensure-renewal-email started_at: '2023-01-30T22:15:45.295374087Z' status: SUCCESS - ended_at: '0001-01-01T00:00:00Z' name: ensure-CA-authorization started_at: '2023-01-30T22:15:45.295428101Z' status: SUCCESS - ended_at: '0001-01-01T00:00:00Z' name: ensure-certificate started_at: '2023-01-30T22:15:45.978756406Z' status: RUNNING - ended_at: '0001-01-01T00:00:00' name: create-deployment started_at: '0001-01-01T00:00:00Z' status: PENDING - ended_at: '0001-01-01T00:00:00' name: configuration-alert started_at: '0001-01-01T00:00:00' status: PENDING dedicated_ips: - ip: 192.168.1.1 id: c24d8f48-3bc4-49f5-8ca0-58e8164427ac status: ASSIGNED - ip: 192.168.1.2 id: 4768fb15-2837-4dda-9be5-3951df4bc3d0 status: ASSIGNED alert: value: alert: id: e552e1f9-c1b0-4e6d-8777-ad6f27767306 spec: rule: DEPLOYMENT_FAILED emails: - sammy@digitalocean.com phase: ACTIVE progress: steps: - name: alert-configure-insight-alert status: SUCCESS started_at: '2020-07-28T18:00:00Z' ended_at: '2020-07-28T18:00:00Z' regions: value: regions: - slug: ams label: Amsterdam flag: netherlands continent: Europe data_centers: - ams3 - slug: nyc label: New York flag: usa continent: North America data_centers: - nyc1 - nyc3 default: true - slug: fra label: Frankfurt flag: germany continent: Europe data_centers: - fra1 - slug: sfo label: San Francisco flag: usa continent: North America data_centers: - sfo3 - slug: sgp label: Singapore flag: singapore continent: Asia data_centers: - sgp1 - slug: blr label: Bangalore flag: india continent: Asia data_centers: - blr1 - slug: tor label: Toronto flag: canada continent: North America data_centers: - tor1 - slug: lon label: London flag: uk continent: Europe data_centers: - lon1 propose: value: app_name_available: true existing_static_apps: '2' max_free_static_apps: '3' spec: name: sample-golang services: - name: web github: repo: digitalocean/sample-golang branch: branch run_command: bin/sample-golang environment_slug: go instance_size_slug: apps-s-1vcpu-0.5gb instance_count: 1 http_port: 8080 routes: - path: / region: ams app_cost: 5 app_bandwidth_usage_multiple: value: app_bandwidth_usage: - app_id: 4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf bandwidth_bytes: '513668' - app_id: c2a93513-8d9b-4223-9d61-5e7272c81cf5 bandwidth_bytes: '254847' date: '2023-01-17T00:00:00Z' instance_sizes: value: instance_sizes: - name: Shared 1VCPU 0.5GB slug: apps-s-1vcpu-0.5gb cpu_type: SHARED cpus: '1' memory_bytes: '536870912' usd_per_month: '5.00' usd_per_second: '0.000002066799' tier_slug: basic single_instance_only: true bandwidth_allowance_gib: '50' - name: Shared 1VCPU 1GB Fixed slug: apps-s-1vcpu-1gb-fixed cpu_type: SHARED cpus: '1' memory_bytes: '1073741824' usd_per_month: '10.00' usd_per_second: '0.000004133598' tier_slug: basic single_instance_only: true bandwidth_allowance_gib: '100' - name: Shared 1VCPU 1GB slug: apps-s-1vcpu-1gb cpu_type: SHARED cpus: '1' memory_bytes: '1073741824' usd_per_month: '12.00' usd_per_second: '0.000004960317' tier_slug: professional bandwidth_allowance_gib: '150' - name: Shared 1VCPU 2GB slug: apps-s-1vcpu-2gb cpu_type: SHARED cpus: '1' memory_bytes: '2147483648' usd_per_month: '25.00' usd_per_second: '0.000010333995' tier_slug: professional bandwidth_allowance_gib: '200' - name: Shared 2VCPU 4GB slug: apps-s-2vcpu-4gb cpu_type: SHARED cpus: '2' memory_bytes: '4294967296' usd_per_month: '50.00' usd_per_second: '0.000020667989' tier_slug: professional bandwidth_allowance_gib: '250' - name: Dedicated 1VCPU 0.5GB slug: apps-d-1vcpu-0.5gb cpu_type: DEDICATED cpus: '1' memory_bytes: '536870912' usd_per_month: '29.00' usd_per_second: '0.000011987434' tier_slug: professional scalable: true bandwidth_allowance_gib: '100' - name: Dedicated 1VCPU 1GB slug: apps-d-1vcpu-1gb cpu_type: DEDICATED cpus: '1' memory_bytes: '1073741824' usd_per_month: '34.00' usd_per_second: '0.000014054233' tier_slug: professional scalable: true bandwidth_allowance_gib: '200' - name: Dedicated 1VCPU 2GB slug: apps-d-1vcpu-2gb cpu_type: DEDICATED cpus: '1' memory_bytes: '2147483648' usd_per_month: '39.00' usd_per_second: '0.000016121032' tier_slug: professional scalable: true bandwidth_allowance_gib: '300' - name: Dedicated 1VCPU 4GB slug: apps-d-1vcpu-4gb cpu_type: DEDICATED cpus: '1' memory_bytes: '4294967296' usd_per_month: '49.00' usd_per_second: '0.000020254630' tier_slug: professional scalable: true bandwidth_allowance_gib: '400' - name: Dedicated 2VCPU 4GB slug: apps-d-2vcpu-4gb cpu_type: DEDICATED cpus: '2' memory_bytes: '4294967296' usd_per_month: '78.00' usd_per_second: '0.000032242063' tier_slug: professional scalable: true bandwidth_allowance_gib: '500' - name: Dedicated 2VCPU 8GB slug: apps-d-2vcpu-8gb cpu_type: DEDICATED cpus: '2' memory_bytes: '8589934592' usd_per_month: '98.00' usd_per_second: '0.000040509259' tier_slug: professional scalable: true bandwidth_allowance_gib: '600' - name: Dedicated 4VCPU 8GB slug: apps-d-4vcpu-8gb cpu_type: DEDICATED cpus: '4' memory_bytes: '8589934592' usd_per_month: '156.00' usd_per_second: '0.000064484127' tier_slug: professional scalable: true bandwidth_allowance_gib: '700' - name: Dedicated 4VCPU 16GB slug: apps-d-4vcpu-16gb cpu_type: DEDICATED cpus: '4' memory_bytes: '17179869184' usd_per_month: '196.00' usd_per_second: '0.000081018519' tier_slug: professional scalable: true bandwidth_allowance_gib: '800' - name: Dedicated 8VCPU 32GB slug: apps-d-8vcpu-32gb cpu_type: DEDICATED cpus: '8' memory_bytes: '34359738368' usd_per_month: '392.00' usd_per_second: '0.000162037037' tier_slug: professional scalable: true bandwidth_allowance_gib: '900' alerts: value: alerts: - id: e552e1f9-c1b0-4e6d-8777-ad6f27767306 spec: rule: DEPLOYMENT_FAILED emails: - sammy@digitalocean.com phase: ACTIVE progress: steps: - name: alert-configure-insight-alert status: SUCCESS started_at: '2020-07-28T18:00:00Z' ended_at: '2020-07-28T18:00:00Z' - id: b58cc9d4-0702-4ffd-ab45-4c2a8d979527 spec: rule: CPU_UTILIZATION operator: GREATER_THAN value: 85 window: FIVE_MINUTES emails: - sammy@digitalocean.com phase: ACTIVE progress: steps: - name: alert-configure-insight-alert status: SUCCESS started_at: '2020-07-28T18:00:00Z' ended_at: '2020-07-28T18:00:00Z' parameters: accept: description: The content-type that should be used by the response. By default, the response will be `application/json`. `application/yaml` is also supported. in: header name: Accept schema: type: string enum: - application/json - application/yaml example: application/json app_name: description: The name of the app to retrieve. in: query name: name schema: type: string example: myApp per_page: in: query name: per_page required: false description: Number of items returned per page schema: type: integer minimum: 1 default: 20 maximum: 200 example: 2 app_id: description: The app ID in: path name: app_id required: true schema: type: string example: 4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf component: description: An optional component name. If set, logs will be limited to this component only. in: path name: component_name required: true schema: type: string example: component alert_id: description: The alert ID in: path name: alert_id required: true schema: type: string example: 5a624ab5-dd58-4b39-b7dd-8b7c36e8a91d slug_size: description: The slug of the instance size in: path name: slug required: true schema: type: string example: apps-s-1vcpu-0.5gb log_type: description: 'The type of logs to retrieve - BUILD: Build-time logs - DEPLOY: Deploy-time logs - RUN: Live run-time logs - RUN_RESTARTED: Logs of crashed/restarted instances during runtime' in: query name: type required: true schema: default: UNSPECIFIED enum: - UNSPECIFIED - BUILD - DEPLOY - RUN - RUN_RESTARTED type: string example: BUILD content-type: description: The content-type used for the request. By default, the requests are assumed to use `application/json`. `application/yaml` is also supported. in: header name: Content-Type schema: type: string enum: - application/json - application/yaml example: application/json page: in: query name: page required: false description: Which 'page' of paginated results to return. schema: type: integer minimum: 1 default: 1 example: 1 with_projects: description: Whether the project_id of listed apps should be fetched and included. in: query name: with_projects schema: type: boolean example: true live_updates: description: Whether the logs should follow live updates. in: query name: follow schema: type: boolean example: true deployment_id: description: The deployment ID in: path name: deployment_id required: true schema: type: string example: 3aa4d20e-5527-4c00-b496-601fbd22520a time_wait: description: 'An optional time duration to wait if the underlying component instance is not immediately available. Default: `3m`.' in: query name: pod_connection_timeout schema: type: string example: 3m id_app: description: The ID of the app in: path name: id required: true schema: type: string example: 4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf responses: apps_validate_rollback: description: A JSON object with the validation results. content: application/json: schema: type: object properties: valid: type: boolean description: Indicates whether the app can be rolled back to the specified deployment. error: allOf: - description: Contains the failing condition that is causing the rollback to be invalid. - $ref: '#/components/schemas/app_rollback_validation_condition' warnings: type: array description: Contains a list of warnings that may cause the rollback to run under unideal circumstances. items: $ref: '#/components/schemas/app_rollback_validation_condition' examples: Valid rollback: value: valid: true Valid rollback with warnings: value: valid: true warnings: - code: image_source_missing_digest components: - docker-worker message: one or more components are missing an image digest and are not guaranteed rollback to the old version Invalid rollback: value: valid: false error: code: incompatible_result message: deployment result "failed" is unsuitable for rollback headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' new_app_deployment: description: A JSON object with a `deployment` key. content: application/json: schema: $ref: '#/components/schemas/apps_deployment_response' examples: deployment: $ref: '#/components/examples/deployment' headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' unauthorized: description: Unauthorized headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' content: application/json: schema: $ref: '#/components/schemas/error' example: id: unauthorized message: Unable to authenticate you. cancel_deployment: description: A JSON the `deployment` that was just cancelled. content: application/json: schema: $ref: '#/components/schemas/apps_deployment_response' examples: deployment: $ref: '#/components/examples/deployment' headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' list_apps: description: A JSON object with a `apps` key. This is list of object `apps`. content: application/json: schema: $ref: '#/components/schemas/apps_response' examples: apps: $ref: '#/components/examples/apps' headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' list_instance: description: A JSON with key `instance_sizes` content: application/json: schema: $ref: '#/components/schemas/apps_list_instance_sizes_response' examples: instance_sizes: $ref: '#/components/examples/instance_sizes' headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' list_deployment: description: A JSON of the requested deployment content: application/json: schema: $ref: '#/components/schemas/apps_deployment_response' examples: deployment: $ref: '#/components/examples/deployment' headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' propose_app: description: A JSON object. content: application/json: schema: $ref: '#/components/schemas/app_propose_response' examples: propose: $ref: '#/components/examples/propose' headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' existing_deployments: description: A JSON object with a `deployments` key. This will be a list of all app deployments content: application/json: schema: $ref: '#/components/schemas/apps_deployments_response' examples: deployments: $ref: '#/components/examples/deployments' headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' apps_get: description: A JSON with key `app` content: application/json: schema: $ref: '#/components/schemas/app_response' examples: app: $ref: '#/components/examples/app' headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' update_app: description: A JSON object of the updated `app` content: application/json: schema: $ref: '#/components/schemas/app_response' examples: app: $ref: '#/components/examples/app' headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' no_content: description: The action was successful and the response body is empty. headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' delete_app: description: the ID of the app deleted. content: application/json: schema: $ref: '#/components/schemas/apps_delete_app_response' example: id: b7d64052-3706-4cb7-b21a-c5a2f44e63b3 headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' list_logs: description: A JSON object with urls that point to archived logs content: application/json: schema: $ref: '#/components/schemas/apps_get_logs_response' examples: logs: $ref: '#/components/examples/logs' headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' new_app: description: A JSON or YAML of a `spec` object. content: application/json: schema: $ref: '#/components/schemas/app_response' examples: app: $ref: '#/components/examples/app' headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' too_many_requests: description: API Rate limit exceeded headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' content: application/json: schema: $ref: '#/components/schemas/error' example: id: too_many_requests message: API Rate limit exceeded. unexpected_error: description: Unexpected error headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' content: application/json: schema: $ref: '#/components/schemas/error' example: id: example_error message: some error message server_error: description: Server error. headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' content: application/json: schema: $ref: '#/components/schemas/error' example: id: server_error message: Unexpected server-side error get_exec: description: A JSON object with a websocket URL that allows sending/receiving console input and output. content: application/json: schema: $ref: '#/components/schemas/apps_get_exec_response' examples: exec: $ref: '#/components/examples/exec' headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' assign_alert_destinations: description: A JSON object with an `alert` key. This is an object of type `alert`. content: application/json: schema: $ref: '#/components/schemas/apps_alert_response' examples: apps: $ref: '#/components/examples/alert' headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' get_instance: description: A JSON with key `instance_size` content: application/json: schema: $ref: '#/components/schemas/apps_get_instance_size_response' examples: instance_size: $ref: '#/components/examples/instance_size' headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' list_regions: description: A JSON object with key `regions` content: application/json: schema: $ref: '#/components/schemas/apps_list_regions_response' examples: regions: $ref: '#/components/examples/regions' headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' list_alerts: description: A JSON object with a `alerts` key. This is list of object `alerts`. content: application/json: schema: $ref: '#/components/schemas/apps_list_alerts_response' examples: apps: $ref: '#/components/examples/alerts' headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' list_metrics_bandwidth_usage: description: A JSON object with a `app_bandwidth_usage` key content: application/json: schema: $ref: '#/components/schemas/app_metrics_bandwidth_usage' examples: app_bandwidth_usage: $ref: '#/components/examples/app_bandwidth_usage_multiple' headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' get_metrics_bandwidth_usage: description: A JSON object with a `app_bandwidth_usage` key content: application/json: schema: $ref: '#/components/schemas/app_metrics_bandwidth_usage' examples: app_bandwidth_usage: $ref: '#/components/examples/app_bandwidth_usage' headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' not_found: description: The resource was not found. headers: ratelimit-limit: $ref: '#/components/headers/ratelimit-limit' ratelimit-remaining: $ref: '#/components/headers/ratelimit-remaining' ratelimit-reset: $ref: '#/components/headers/ratelimit-reset' content: application/json: schema: $ref: '#/components/schemas/error' example: id: not_found message: The resource you requested could not be found. headers: ratelimit-reset: schema: type: integer example: 1444931833 description: The time when the oldest request will expire. The value is given in Unix epoch time. See https://developers.digitalocean.com/documentation/v2/#rate-limit for information about how requests expire. ratelimit-remaining: schema: type: integer example: 4816 description: The number of requests in your hourly quota that remain before you hit your request limit. See https://developers.digitalocean.com/documentation/v2/#rate-limit for information about how requests expire. ratelimit-limit: schema: type: integer example: 5000 description: The default limit on number of requests that can be made per hour and per minute. Current rate limits are 5000 requests per hour and 250 requests per minute. securitySchemes: bearer_auth: type: http scheme: bearer description: '## OAuth Authentication In order to interact with the DigitalOcean API, you or your application must authenticate. The DigitalOcean API handles this through OAuth, an open standard for authorization. OAuth allows you to delegate access to your account. Scopes can be used to grant full access, read-only access, or access to a specific set of endpoints. You can generate an OAuth token by visiting the [Apps & API](https://cloud.digitalocean.com/account/api/tokens) section of the DigitalOcean control panel for your account. An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair. Because of this, it is absolutely **essential** that you keep your OAuth tokens secure. In fact, upon generation, the web interface will only display each token a single time in order to prevent the token from being compromised. DigitalOcean access tokens begin with an identifiable prefix in order to distinguish them from other similar tokens. - `dop_v1_` for personal access tokens generated in the control panel - `doo_v1_` for tokens generated by applications using [the OAuth flow](https://docs.digitalocean.com/reference/api/oauth-api/) - `dor_v1_` for OAuth refresh tokens ### Scopes Scopes act like permissions assigned to an API token. These permissions determine what actions the token can perform. You can create API tokens that grant read-only access, full access, or limited access to specific endpoints by using custom scopes. Generally, scopes are designed to match HTTP verbs and common CRUD operations (Create, Read, Update, Delete). | HTTP Verb | CRUD Operation | Scope | |---|---|---| | GET | Read | `:read` | | POST | Create | `:create` | | PUT/PATCH | Update | `:update` | | DELETE | Delete | `:delete` | For example, creating a new Droplet by making a `POST` request to the `/v2/droplets` endpoint requires the `droplet:create` scope while listing Droplets by making a `GET` request to the `/v2/droplets` endpoint requires the `droplet:read` scope. Each endpoint below specifies which scope is required to access it when using custom scopes. ### How to Authenticate with OAuth In order to make an authenticated request, include a bearer-type `Authorization` header containing your OAuth token. All requests must be made over HTTPS. ### Authenticate with a Bearer Authorization Header ``` curl -X $HTTP_METHOD -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" "https://api.digitalocean.com/v2/$OBJECT" ``` '