openapi: 3.0.0 info: title: DigitalOcean Container Registry 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: Container Registry description: 'DigitalOcean offers the ability for you to create a [private container registry](https://docs.digitalocean.com/products/container-registry/) to store your Docker images for use with your Kubernetes clusters. This container registry runs inside the same datacenters as your cluster, ensuring reliable and performant rollout of image deployments. You can only create one registry per DigitalOcean account, but you can use that registry to create as many repositories as you wish.' paths: /v2/registry: get: operationId: registry_get summary: Get Container Registry Information description: To get information about your container registry, send a GET request to `/v2/registry`. tags: - Container Registry responses: '200': $ref: '#/components/responses/registry_info' '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/registry\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) resp = client.registry.get()' security: - bearer_auth: - registry:read post: operationId: registry_create summary: Create Container Registry description: 'To create your container registry, send a POST request to `/v2/registry`. The `name` becomes part of the URL for images stored in the registry. For example, if your registry is called `example`, an image in it will have the URL `registry.digitalocean.com/example/image:tag`. ' tags: - Container Registry requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/registry_create' responses: '201': $ref: '#/components/responses/registry_info' '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 -d '{\"name\": \"example\", \"subscription_tier_slug\": \"basic\", \"region\": \"fra1\"}' \\\n \"https://api.digitalocean.com/v2/registry\"" - lang: Python source: "import os\nfrom pydo import Client\n\nclient = Client(token=os.environ.get(\"DIGITALOCEAN_TOKEN\"))\n\nreq = {\n \"name\": \"example\",\n \"subscription_tier_slug\": \"basic\",\n \"region\": \"fra1\"\n}\n\nresp = client.registry.create(body=req)" security: - bearer_auth: - registry:create delete: operationId: registry_delete summary: Delete Container Registry description: To delete your container registry, destroying all container image data stored in it, send a DELETE request to `/v2/registry`. tags: - Container Registry responses: '204': $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 DELETE \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/registry\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) resp = client.registry.delete()' security: - bearer_auth: - registry:delete /v2/registry/subscription: get: operationId: registry_get_subscription summary: Get Subscription Information description: A subscription is automatically created when you configure your container registry. To get information about your subscription, send a GET request to `/v2/registry/subscription`. tags: - Container Registry responses: '200': $ref: '#/components/responses/subscription_response' '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/registry/subscription\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) resp = client.registry.get_subscription()' security: - bearer_auth: - registry:read post: operationId: registry_update_subscription summary: Update Subscription Tier description: After creating your registry, you can switch to a different subscription tier to better suit your needs. To do this, send a POST request to `/v2/registry/subscription`. tags: - Container Registry requestBody: content: application/json: schema: type: object properties: tier_slug: type: string enum: - starter - basic - professional example: basic description: The slug of the subscription tier to sign up for. responses: '200': $ref: '#/components/responses/subscription_response' '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 -d '{\"tier_slug\": \"professional\"}' \\\n \"https://api.digitalocean.com/v2/registry/subscription\"" - lang: Python source: "import os\nfrom pydo import Client\n\nclient = Client(token=os.environ.get(\"DIGITALOCEAN_TOKEN\"))\n\nreq = {\n \"tier_slug\": \"basic\"\n}\n\nresp = client.registry.update_subscription(body=req)" security: - bearer_auth: - registry:update /v2/registry/docker-credentials: get: operationId: registry_get_dockerCredentials summary: Get Docker Credentials for Container Registry description: "In order to access your container registry with the Docker client or from a\nKubernetes cluster, you will need to configure authentication. The necessary\nJSON configuration can be retrieved by sending a GET request to\n`/v2/registry/docker-credentials`.\n\nThe response will be in the format of a Docker `config.json` file. To use the\nconfig in your Kubernetes cluster, create a Secret with:\n\n kubectl create secret generic docr \\\n --from-file=.dockerconfigjson=config.json \\\n --type=kubernetes.io/dockerconfigjson\n\nBy default, the returned credentials have read-only access to your registry\nand cannot be used to push images. This is appropriate for most Kubernetes\nclusters. To retrieve read/write credentials, suitable for use with the Docker\nclient or in a CI system, read_write may be provided as query parameter. For\nexample: `/v2/registry/docker-credentials?read_write=true`\n\nBy default, the returned credentials will not expire. To retrieve credentials\nwith an expiry set, expiry_seconds may be provided as a query parameter. For\nexample: `/v2/registry/docker-credentials?expiry_seconds=3600` will return\ncredentials that expire after one hour.\n" tags: - Container Registry parameters: - $ref: '#/components/parameters/registry_expiry_seconds' - $ref: '#/components/parameters/registry_read_write' responses: '200': $ref: '#/components/responses/docker_credentials' '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/registry/docker-credentials\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) resp = client.registry.get_docker_credentials()' security: - bearer_auth: - registry:read - registry:update /v2/registry/validate-name: post: operationId: registry_validate_name summary: Validate a Container Registry Name description: 'To validate that a container registry name is available for use, send a POST request to `/v2/registry/validate-name`. If the name is both formatted correctly and available, the response code will be 204 and contain no body. If the name is already in use, the response will be a 409 Conflict. ' tags: - Container Registry requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/validate_registry' responses: '204': $ref: '#/components/responses/no_content' '401': $ref: '#/components/responses/unauthorized' '409': $ref: '#/components/responses/conflict' '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 '{\"name\": \"example\"}' \\\n \"https://api.digitalocean.com/v2/registry/validate-name\"" - lang: Python source: "import os\nfrom pydo import Client\n\nclient = Client(token=os.environ.get(\"DIGITALOCEAN_TOKEN\"))\n\nreq = {\n \"name\": \"example\"\n}\n\nresp = client.registry.validate_name(body=req)" security: - bearer_auth: - registry:create /v2/registry/{registry_name}/repositories: get: operationId: registry_list_repositories deprecated: true summary: List All Container Registry Repositories description: 'This endpoint has been deprecated in favor of the _List All Container Registry Repositories [V2]_ endpoint. To list all repositories in your container registry, send a GET request to `/v2/registry/$REGISTRY_NAME/repositories`. ' tags: - Container Registry parameters: - $ref: '#/components/parameters/per_page' - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/registry_name' responses: '200': $ref: '#/components/responses/all_repositories' '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/registry/example/repositories\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) resp = client.registry.list_repositories(registry_name="example")' security: - bearer_auth: - registry:read /v2/registry/{registry_name}/repositoriesV2: get: operationId: registry_list_repositoriesV2 summary: List All Container Registry Repositories (V2) description: To list all repositories in your container registry, send a GET request to `/v2/registry/$REGISTRY_NAME/repositoriesV2`. tags: - Container Registry parameters: - $ref: '#/components/parameters/per_page' - $ref: '#/components/parameters/token_pagination_page' - $ref: '#/components/parameters/token_pagination_page_token' - $ref: '#/components/parameters/registry_name' responses: '200': $ref: '#/components/responses/all_repositories_v2' '400': $ref: '#/components/responses/bad_request' '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/registry/example/repositoriesV2?page_size=1\"" - lang: cURL (next page) source: "curl -X GET \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/registry/example/repositoriesV2?page=2&page_token=JPZmZzZXQiOjB9&per_page=1\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) resp = client.registry.list_repositories_v2(registry_name="example")' security: - bearer_auth: - registry:read /v2/registry/{registry_name}/repositories/{repository_name}/tags: get: operationId: registry_list_repositoryTags summary: List All Container Registry Repository Tags description: 'To list all tags in your container registry repository, send a GET request to `/v2/registry/$REGISTRY_NAME/repositories/$REPOSITORY_NAME/tags`. Note that if your repository name contains `/` characters, it must be URL-encoded in the request URL. For example, to list tags for `registry.digitalocean.com/example/my/repo`, the path would be `/v2/registry/example/repositories/my%2Frepo/tags`. ' tags: - Container Registry parameters: - $ref: '#/components/parameters/per_page' - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/registry_name' - $ref: '#/components/parameters/registry_repository_name' responses: '200': $ref: '#/components/responses/repository_tags' '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/registry/example/repositories/repo-1/tags\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) resp = client.registry.list_repository_tags(registry_name="example", repository_name="repo01")' security: - bearer_auth: - registry:read /v2/registry/{registry_name}/repositories/{repository_name}/tags/{repository_tag}: delete: operationId: registry_delete_repositoryTag summary: Delete Container Registry Repository Tag description: 'To delete a container repository tag, send a DELETE request to `/v2/registry/$REGISTRY_NAME/repositories/$REPOSITORY_NAME/tags/$TAG`. Note that if your repository name contains `/` characters, it must be URL-encoded in the request URL. For example, to delete `registry.digitalocean.com/example/my/repo:mytag`, the path would be `/v2/registry/example/repositories/my%2Frepo/tags/mytag`. A successful request will receive a 204 status code with no body in response. This indicates that the request was processed successfully. ' tags: - Container Registry parameters: - $ref: '#/components/parameters/registry_name' - $ref: '#/components/parameters/registry_repository_name' - $ref: '#/components/parameters/registry_repository_tag' responses: '204': $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 DELETE \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/registry/example/repositories/repo-1/tags/mytag\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) resp = client.registry.delete_repository_tag(registry_name="example", repository_name="repo-1", repository_tag="06a447a")' security: - bearer_auth: - registry:delete /v2/registry/{registry_name}/repositories/{repository_name}/digests: get: operationId: registry_list_repositoryManifests summary: List All Container Registry Repository Manifests description: 'To list all manifests in your container registry repository, send a GET request to `/v2/registry/$REGISTRY_NAME/repositories/$REPOSITORY_NAME/digests`. Note that if your repository name contains `/` characters, it must be URL-encoded in the request URL. For example, to list manifests for `registry.digitalocean.com/example/my/repo`, the path would be `/v2/registry/example/repositories/my%2Frepo/digests`. ' tags: - Container Registry parameters: - $ref: '#/components/parameters/per_page' - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/registry_name' - $ref: '#/components/parameters/registry_repository_name' responses: '200': $ref: '#/components/responses/repository_manifests' '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/registry/example/repositories/repo-1/digests\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) resp = client.registry.list_repository_manifests(registry_name="example", repository_name="repo01")' security: - bearer_auth: - registry:read /v2/registry/{registry_name}/repositories/{repository_name}/digests/{manifest_digest}: delete: operationId: registry_delete_repositoryManifest summary: Delete Container Registry Repository Manifest description: 'To delete a container repository manifest by digest, send a DELETE request to `/v2/registry/$REGISTRY_NAME/repositories/$REPOSITORY_NAME/digests/$MANIFEST_DIGEST`. Note that if your repository name contains `/` characters, it must be URL-encoded in the request URL. For example, to delete `registry.digitalocean.com/example/my/repo@sha256:abcd`, the path would be `/v2/registry/example/repositories/my%2Frepo/digests/sha256:abcd`. A successful request will receive a 204 status code with no body in response. This indicates that the request was processed successfully. ' tags: - Container Registry parameters: - $ref: '#/components/parameters/registry_name' - $ref: '#/components/parameters/registry_repository_name' - $ref: '#/components/parameters/registry_manifest_digest' responses: '204': $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 DELETE \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \\\n \"https://api.digitalocean.com/v2/registry/example/repositories/repo-1/digests/sha256:cb8a924afdf0229ef7515d9e5b3024e23b3eb03ddbba287f4a19c6ac90b8d221\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) resp = client.registry.delete_repository_manifest(registry_name="example", repository_name="repo-1", manifest_digest="sha256:cb8a924afd")' security: - bearer_auth: - registry:delete /v2/registry/{registry_name}/garbage-collection: post: operationId: registry_run_garbageCollection summary: Start Garbage Collection description: "Garbage collection enables users to clear out unreferenced blobs (layer &\nmanifest data) after deleting one or more manifests from a repository. If\nthere are no unreferenced blobs resulting from the deletion of one or more\nmanifests, garbage collection is effectively a noop.\n[See here for more information](https://docs.digitalocean.com/products/container-registry/how-to/clean-up-container-registry/)\nabout how and why you should clean up your container registry periodically.\n\nTo request a garbage collection run on your registry, send a POST request to\n`/v2/registry/$REGISTRY_NAME/garbage-collection`. This will initiate the\nfollowing sequence of events on your registry.\n\n* Set the registry to read-only mode, meaning no further write-scoped\n JWTs will be issued to registry clients. Existing write-scoped JWTs will\n continue to work until they expire which can take up to 15 minutes.\n* Wait until all existing write-scoped JWTs have expired.\n* Scan all registry manifests to determine which blobs are unreferenced.\n* Delete all unreferenced blobs from the registry.\n* Record the number of blobs deleted and bytes freed, mark the garbage\n collection status as `success`.\n* Remove the read-only mode restriction from the registry, meaning write-scoped\n JWTs will once again be issued to registry clients.\n" tags: - Container Registry parameters: - $ref: '#/components/parameters/registry_name' responses: '201': $ref: '#/components/responses/garbage_collection' '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/registry/example/garbage-collection\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) resp = client.registry.run_garbage_collection(registry_name="example")' security: - bearer_auth: - registry:create get: operationId: registry_get_garbageCollection summary: Get Active Garbage Collection description: To get information about the currently-active garbage collection for a registry, send a GET request to `/v2/registry/$REGISTRY_NAME/garbage-collection`. tags: - Container Registry parameters: - $ref: '#/components/parameters/registry_name' responses: '200': $ref: '#/components/responses/garbage_collection' '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/registry/example/garbage-collection\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) resp = client.registry.get_garbage_collection(registry_name="example")' security: - bearer_auth: - registry:read /v2/registry/{registry_name}/garbage-collections: get: operationId: registry_list_garbageCollections summary: List Garbage Collections description: To get information about past garbage collections for a registry, send a GET request to `/v2/registry/$REGISTRY_NAME/garbage-collections`. tags: - Container Registry parameters: - $ref: '#/components/parameters/registry_name' - $ref: '#/components/parameters/per_page' - $ref: '#/components/parameters/page' responses: '200': $ref: '#/components/responses/garbage_collections' '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/registry/example/garbage-collections\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) resp = client.registry.list_garbage_collections(registry_name="example")' security: - bearer_auth: - registry:read /v2/registry/{registry_name}/garbage-collection/{garbage_collection_uuid}: put: operationId: registry_update_garbageCollection summary: Update Garbage Collection description: To cancel the currently-active garbage collection for a registry, send a PUT request to `/v2/registry/$REGISTRY_NAME/garbage-collection/$GC_UUID` and specify one or more of the attributes below. tags: - Container Registry parameters: - $ref: '#/components/parameters/registry_name' - $ref: '#/components/parameters/garbage_collection_uuid' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/update_registry' responses: '200': $ref: '#/components/responses/garbage_collection' '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/registry/example/garbage-collection/example-gc-uuid\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) resp = client.registry.run_garbage_collection(registry_name="example")' security: - bearer_auth: - registry:update /v2/registry/options: get: operationId: registry_get_options summary: List Registry Options (Subscription Tiers and Available Regions) description: 'This endpoint serves to provide additional information as to which option values are available when creating a container registry. There are multiple subscription tiers available for container registry. Each tier allows a different number of image repositories to be created in your registry, and has a different amount of storage and transfer included. There are multiple regions available for container registry and controls where your data is stored. To list the available options, send a GET request to `/v2/registry/options`.' tags: - Container Registry responses: '200': $ref: '#/components/responses/registry_options_response' '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/registry/options\"" - lang: Python source: 'import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) resp = client.registry.get_options()' security: - bearer_auth: - registry:read components: responses: all_repositories_v2: description: The response body will be a JSON object with a key of `repositories`. This will be set to an array containing objects each representing a repository. 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: allOf: - type: object properties: repositories: type: array items: $ref: '#/components/schemas/repository_v2' - $ref: '#/components/schemas/pagination' - $ref: '#/components/schemas/meta' example: repositories: - registry_name: example name: repo-1 tag_count: 57 manifest_count: 82 latest_manifest: digest: sha256:cb8a924afdf0229ef7515d9e5b3024e23b3eb03ddbba287f4a19c6ac90b8d221 registry_name: example repository: repo-1 compressed_size_bytes: 1972332 size_bytes: 2816445 updated_at: '2021-04-09T23:54:25Z' tags: - v1 - v2 blobs: - digest: sha256:14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab compressed_size_bytes: 1471 - digest: sha256:a0d0a0d46f8b52473982a3c466318f479767577551a53ffc9074c9fa7035982e compressed_size_byte: 2814446 - digest: sha256:69704ef328d05a9f806b6b8502915e6a0a4faa4d72018dc42343f511490daf8a compressed_size_bytes: 528 meta: total: 5 links: pages: next: https://api.digitalocean.com/v2/registry/example/repositoriesV2?page=2&page_token=JPZmZzZXQiOjB9&per_page=1 last: https://api.digitalocean.com/v2/registry/example/repositoriesV2?page=5&per_page=1 repository_manifests: description: The response body will be a JSON object with a key of `manifests`. This will be set to an array containing objects each representing a manifest. 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: allOf: - type: object properties: manifests: type: array items: $ref: '#/components/schemas/repository_manifest' - $ref: '#/components/schemas/pagination' - $ref: '#/components/schemas/meta' example: manifests: - digest: sha256:cb8a924afdf0229ef7515d9e5b3024e23b3eb03ddbba287f4a19c6ac90b8d221 registry_name: example repository: repo-1 compressed_size_bytes: 1972332 size_bytes: 2816445 updated_at: '2021-04-09T23:54:25Z' tags: - v1 - v2 blobs: - digest: sha256:14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab compressed_size_bytes: 1471 - digest: sha256:a0d0a0d46f8b52473982a3c466318f479767577551a53ffc9074c9fa7035982e compressed_size_byte: 2814446 - digest: sha256:69704ef328d05a9f806b6b8502915e6a0a4faa4d72018dc42343f511490daf8a compressed_size_bytes: 528 meta: total: 3 links: pages: first: https://api.digitalocean.com/v2/registry/example/repositories/repo-1/digests?page=1&per_page=1 prev: https://api.digitalocean.com/v2/registry/example/repositories/repo-1/digests?page=1&per_page=1 next: https://api.digitalocean.com/v2/registry/example/repositories/repo-1/digests?page=3&per_page=1 last: https://api.digitalocean.com/v2/registry/example/repositories/repo-1/digests?page=3&per_page=1 all_repositories: description: The response body will be a JSON object with a key of `repositories`. This will be set to an array containing objects each representing a repository. 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: allOf: - type: object properties: repositories: type: array items: $ref: '#/components/schemas/repository' - $ref: '#/components/schemas/pagination' - $ref: '#/components/schemas/meta' example: repositories: - registry_name: example name: repo-1 latest_tag: registry_name: example repository: repo-1 tag: latest manifest_digest: sha256:cb8a924afdf0229ef7515d9e5b3024e23b3eb03ddbba287f4a19c6ac90b8d221 compressed_size_bytes: 2803255 size_bytes: 5861888 updated_at: '2020-04-09T23:54:25Z' tag_count: 1 meta: total: 1 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' 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 bad_request: description: Bad Request 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: bad_request message: error parsing request body request_id: 4851a473-1621-42ea-b2f9-5071c0ea8414 subscription_response: description: The response will be a JSON object with a key called `subscription` containing information about your subscription. 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: properties: subscription: $ref: '#/components/schemas/subscription' 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. docker_credentials: description: A Docker `config.json` file for the container registry. 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/docker_credentials' repository_tags: description: The response body will be a JSON object with a key of `tags`. This will be set to an array containing objects each representing a tag. 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: allOf: - type: object properties: tags: type: array items: $ref: '#/components/schemas/repository_tag' - $ref: '#/components/schemas/pagination' - $ref: '#/components/schemas/meta' example: tags: - registry_name: example repository: repo-1 tag: latest manifest_digest: sha256:cb8a924afdf0229ef7515d9e5b3024e23b3eb03ddbba287f4a19c6ac90b8d221 compressed_size_bytes: 2803255 size_bytes: 5861888 updated_at: '2020-04-09T23:54:25Z' meta: total: 1 conflict: description: Conflict 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: conflict message: The request could not be completed due to a conflict. 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. registry_options_response: description: The response will be a JSON object with a key called `options` which contains a key called `subscription_tiers` listing the available tiers. 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: type: object properties: options: type: object properties: available_regions: type: array items: type: string example: - nyc3 subscription_tiers: type: array items: allOf: - $ref: '#/components/schemas/subscription_tier_base' - $ref: '#/components/schemas/subscription_tier_extended' example: options: available_regions: - nyc3 - sfo3 - ams3 - sgp1 - fra1 subscription_tiers: - name: Starter slug: starter included_repositories: 1 included_storage_bytes: 524288000 allow_storage_overage: false included_bandwidth_bytes: 524288000 monthly_price_in_cents: 0 eligible: false eligibility_reasons: - OverRepositoryLimit - name: Basic slug: basic included_repositories: 5 included_storage_bytes: 5368709120 allow_storage_overage: true included_bandwidth_bytes: 5368709120 monthly_price_in_cents: 500 eligible: true - name: Professional slug: professional included_repositories: 0 included_storage_bytes: 107374182400 allow_storage_overage: true included_bandwidth_bytes: 107374182400 monthly_price_in_cents: 2000 eligible: true registry_info: description: The response will be a JSON object with the key `registry` containing information about your registry. 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: properties: registry: $ref: '#/components/schemas/registry' garbage_collection: description: The response will be a JSON object with a key of `garbage_collection`. This will be a json object with attributes representing the currently-active garbage collection. 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: type: object properties: garbage_collection: $ref: '#/components/schemas/garbage_collection' 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. garbage_collections: description: The response will be a JSON object with a key of `garbage_collections`. This will be set to an array containing objects representing each past garbage collection. Each will contain the standard Garbage Collection attributes. 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: type: object properties: garbage_collections: type: array items: $ref: '#/components/schemas/garbage_collection' example: garbage_collections: - uuid: eff0feee-49c7-4e8f-ba5c-a320c109c8a8 registry_name: example status: requested created_at: '2020-10-30T21:03:24.000Z' updated_at: '2020-10-30T21:03:44.000Z' blobs_deleted: 42 freed_bytes: 667 meta: total: 1 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 schemas: repository_blob: type: object properties: digest: type: string example: sha256:cb8a924afdf0229ef7515d9e5b3024e23b3eb03ddbba287f4a19c6ac90b8d221 description: The digest of the blob compressed_size_bytes: type: integer example: 2803255 description: The compressed size of the blob in bytes. validate_registry: type: object properties: name: type: string maxLength: 63 pattern: ^[a-z0-9-]{1,63}$ example: example description: A globally unique name for the container registry. Must be lowercase and be composed only of numbers, letters and `-`, up to a limit of 63 characters. required: - name 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 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 update_registry: type: object properties: cancel: type: boolean example: true description: A boolean value indicating that the garbage collection should be cancelled. garbage_collection: type: object properties: uuid: type: string example: eff0feee-49c7-4e8f-ba5c-a320c109c8a8 description: A string specifying the UUID of the garbage collection. registry_name: type: string example: example description: The name of the container registry. status: type: string enum: - requested - waiting for write JWTs to expire - scanning manifests - deleting unreferenced blobs - cancelling - failed - succeeded - cancelled example: requested description: The current status of this garbage collection. created_at: type: string format: date-time example: '2020-10-30T21:03:24Z' description: The time the garbage collection was created. updated_at: type: string format: date-time example: '2020-10-30T21:03:44Z' description: The time the garbage collection was last updated. blobs_deleted: type: integer example: 42 description: The number of blobs deleted as a result of this garbage collection. freed_bytes: type: integer example: 667 description: The number of bytes freed as a result of this garbage collection. docker_credentials: type: object properties: auths: type: object properties: registry.digitalocean.com: type: object properties: auth: type: string example: YjdkMDNhNjk0N2IyMTdlZmI2ZjNlYzNiZDM1MDQ1ODI6YjdkMDNhNjk0N2IyMTdlZmI2ZjNlYzNiZDM1MDQ1ODIK description: A base64 encoded string containing credentials for the container registry. subscription_tier_base: type: object properties: name: type: string example: Basic description: The name of the subscription tier. slug: type: string example: basic description: The slug identifier of the subscription tier. included_repositories: type: integer example: 5 description: The number of repositories included in the subscription tier. `0` indicates that the subscription tier includes unlimited repositories. included_storage_bytes: type: integer example: 5368709120 description: The amount of storage included in the subscription tier in bytes. allow_storage_overage: type: boolean example: true description: A boolean indicating whether the subscription tier supports additional storage above what is included in the base plan at an additional cost per GiB used. included_bandwidth_bytes: type: integer example: 5368709120 description: The amount of outbound data transfer included in the subscription tier in bytes. monthly_price_in_cents: type: integer example: 500 description: The monthly cost of the subscription tier in cents. storage_overage_price_in_cents: type: integer example: 2 description: The price paid in cents per GiB for additional storage beyond what is included in the subscription plan. forward_links: allOf: - $ref: '#/components/schemas/link_to_last_page' - $ref: '#/components/schemas/link_to_next_page' subscription: type: object properties: tier: $ref: '#/components/schemas/subscription_tier_base' created_at: type: string format: date-time readOnly: true example: '2020-01-23T21:19:12Z' description: The time at which the subscription was created. updated_at: type: string format: date-time readOnly: true example: '2020-11-05T15:53:24Z' description: The time at which the subscription was last updated. pagination: type: object properties: links: $ref: '#/components/schemas/page_links' 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 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 backward_links: allOf: - $ref: '#/components/schemas/link_to_first_page' - $ref: '#/components/schemas/link_to_prev_page' meta_properties: type: object description: Information about the response itself. properties: total: description: Number of objects returned by the request. type: integer example: 1 meta: type: object properties: meta: allOf: - $ref: '#/components/schemas/meta_properties' - required: - total required: - meta registry: type: object properties: name: type: string maxLength: 63 pattern: ^[a-z0-9-]{1,63}$ example: example description: A globally unique name for the container registry. Must be lowercase and be composed only of numbers, letters and `-`, up to a limit of 63 characters. created_at: type: string format: date-time readOnly: true example: '2020-03-21T16:02:37Z' description: A time value given in ISO8601 combined date and time format that represents when the registry was created. region: type: string example: fra1 description: Slug of the region where registry data is stored storage_usage_bytes: type: integer readOnly: true example: 29393920 description: The amount of storage used in the registry in bytes. storage_usage_bytes_updated_at: type: string format: date-time readOnly: true example: '2020-11-04T21:39:49.530562231Z' description: The time at which the storage usage was updated. Storage usage is calculated asynchronously, and may not immediately reflect pushes to the registry. subscription: allOf: - readOnly: true - $ref: '#/components/schemas/subscription' registry_create: type: object properties: name: type: string maxLength: 63 pattern: ^[a-z0-9-]{1,63}$ example: example description: A globally unique name for the container registry. Must be lowercase and be composed only of numbers, letters and `-`, up to a limit of 63 characters. subscription_tier_slug: type: string enum: - starter - basic - professional example: basic description: The slug of the subscription tier to sign up for. Valid values can be retrieved using the options endpoint. region: type: string enum: - nyc3 - sfo3 - ams3 - sgp1 - fra1 example: fra1 description: Slug of the region where registry data is stored. When not provided, a region will be selected. required: - name - subscription_tier_slug repository: type: object properties: registry_name: type: string example: example description: The name of the container registry. name: type: string example: repo-1 description: The name of the repository. latest_tag: $ref: '#/components/schemas/repository_tag' tag_count: type: integer example: 1 description: The number of tags in the repository. 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 repository_v2: type: object properties: registry_name: type: string example: example description: The name of the container registry. name: type: string example: repo-1 description: The name of the repository. latest_manifest: $ref: '#/components/schemas/repository_manifest' tag_count: type: integer example: 1 description: The number of tags in the repository. manifest_count: type: integer example: 1 description: The number of manifests in the repository. repository_manifest: type: object properties: registry_name: type: string example: example description: The name of the container registry. repository: type: string example: repo-1 description: The name of the repository. digest: type: string example: sha256:cb8a924afdf0229ef7515d9e5b3024e23b3eb03ddbba287f4a19c6ac90b8d221 description: The manifest digest compressed_size_bytes: type: integer example: 2803255 description: The compressed size of the manifest in bytes. size_bytes: type: integer example: 5861888 description: The uncompressed size of the manifest in bytes (this size is calculated asynchronously so it may not be immediately available). updated_at: type: string format: date-time example: '2020-04-09T23:54:25Z' description: The time the manifest was last updated. tags: type: array items: type: string example: - latest - v1 - v2 description: All tags associated with this manifest blobs: type: array items: $ref: '#/components/schemas/repository_blob' description: All blobs associated with this manifest subscription_tier_extended: type: object properties: eligible: type: boolean example: true description: A boolean indicating whether your account it eligible to use a certain subscription tier. eligibility_reasons: type: array items: type: string enum: - OverRepositoryLimit - OverStorageLimit example: - OverRepositoryLimit description: If your account is not eligible to use a certain subscription tier, this will include a list of reasons that prevent you from using the tier. repository_tag: type: object properties: registry_name: type: string example: example description: The name of the container registry. repository: type: string example: repo-1 description: The name of the repository. tag: type: string example: latest description: The name of the tag. manifest_digest: type: string example: sha256:cb8a924afdf0229ef7515d9e5b3024e23b3eb03ddbba287f4a19c6ac90b8d221 description: The digest of the manifest associated with the tag. compressed_size_bytes: type: integer example: 2803255 description: The compressed size of the tag in bytes. size_bytes: type: integer example: 5861888 description: The uncompressed size of the tag in bytes (this size is calculated asynchronously so it may not be immediately available). updated_at: type: string format: date-time example: '2020-04-09T23:54:25Z' description: The time the tag was last updated. parameters: registry_name: in: path name: registry_name description: The name of a container registry. required: true schema: type: string example: example registry_read_write: in: query name: read_write required: false description: By default, the registry credentials allow for read-only access. Set this query parameter to `true` to obtain read-write credentials. schema: type: boolean default: false example: true registry_expiry_seconds: in: query name: expiry_seconds required: false description: The duration in seconds that the returned registry credentials will be valid. If not set or 0, the credentials will not expire. schema: type: integer minimum: 0 default: 0 example: 3600 garbage_collection_uuid: in: path name: garbage_collection_uuid description: The UUID of a garbage collection run. required: true schema: type: string example: eff0feee-49c7-4e8f-ba5c-a320c109c8a8 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 token_pagination_page_token: in: query name: page_token required: false description: Token to retrieve of the next or previous set of results more quickly than using 'page'. schema: type: string example: eyJUb2tlbiI6IkNnZGpiMjlz registry_repository_tag: in: path name: repository_tag description: The name of a container registry repository tag. required: true schema: type: string example: 06a447a token_pagination_page: in: query name: page required: false description: Which 'page' of paginated results to return. Ignored when 'page_token' is provided. schema: type: integer minimum: 1 default: 1 example: 1 registry_manifest_digest: in: path name: manifest_digest description: The manifest digest of a container registry repository tag. required: true schema: type: string example: sha256:cb8a924afdf0229ef7515d9e5b3024e23b3eb03ddbba287f4a19c6ac90b8d221 registry_repository_name: in: path name: repository_name description: The name of a container registry repository. If the name contains `/` characters, they must be URL-encoded, e.g. `%2F`. required: true schema: type: string example: repo-1 page: in: query name: page required: false description: Which 'page' of paginated results to return. schema: type: integer minimum: 1 default: 1 example: 1 headers: 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. 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. 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" ``` '