pydo.registry.create()

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.

Request Sample

import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

req = {
  "name": "example",
  "subscription_tier_slug": "basic",
  "region": "fra1"
}

resp = client.registry.create(body=req)

Responses

See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.

The response will be a JSON object with the key registry containing information about your registry.

Click to expand an example response.
{
  "registry": {
    "name": "example",
    "created_at": "2020-03-21T16:02:37Z",
    "region": "fra1",
    "storage_usage_bytes": 29393920,
    "storage_usage_bytes_updated_at": "2020-11-04T21:39:49.530562231Z",
    "subscription": {
      "tier": {
        "name": "Basic",
        "slug": "basic",
        "included_repositories": 5,
        "included_storage_bytes": 5368709120,
        "allow_storage_overage": true,
        "included_bandwidth_bytes": 5368709120,
        "monthly_price_in_cents": 500,
        "storage_overage_price_in_cents": 2
      },
      "created_at": "2020-01-23T21:19:12Z",
      "updated_at": "2020-11-05T15:53:24Z"
    }
  }
}

Unauthorized

Click to expand an example response.
{
  "id": "unauthorized",
  "message": "Unable to authenticate you."
}

API Rate limit exceeded

Click to expand an example response.
{
  "id": "too_many_requests",
  "message": "API Rate limit exceeded."
}

Server error.

Click to expand an example response.
{
  "id": "server_error",
  "message": "Unexpected server-side error"
}

Unexpected error

Click to expand an example response.
{
  "id": "example_error",
  "message": "some error message"
}