Skip to main content

registries

Creates, updates, deletes, gets or lists a registries resource.

Overview

Nameregistries
TypeResource
Iddigitalocean.container_registry.registries

Fields

The following fields are returned by SELECT queries:

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

NameDatatypeDescription
namestringA 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. (pattern: ^[a-z0-9-]{1,63}$, example: example)
created_atstring (date-time)A time value given in ISO8601 combined date and time format that represents when the registry was created. (example: 2020-03-21T16:02:37Z)
regionstringSlug of the region where registry data is stored (example: fra1)
storage_usage_bytesintegerThe amount of storage used in the registry in bytes.
storage_usage_bytes_updated_atstring (date-time)The time at which the storage usage was updated. Storage usage is calculated asynchronously, and may not immediately reflect pushes to the registry. (example: 2020-11-04T21:39:49.530562231Z)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
registries_getselectregistry_nameTo get information about any container registry in your account, send a GET request to /v2/registries/{registry_name}.
registries_listselectTo get information about any container registry in your account, send a GET request to /v2/registries/.
registries_createinsertdata__nameTo create your container registry, send a POST request to /v2/registries.

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.
registries_deletedeleteregistry_nameTo delete your container registry, destroying all container image data stored in it, send a DELETE request to /v2/registries/{registry_name}.
registries_validate_nameexecnameTo validate that a container registry name is available for use, send a POST
request to /v2/registries/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.

It is similar to /v2/registry/validate-name and exists for backward compatibility.
registry_get_legacyexecTo get information about your container registry, send a GET request to /v2/registry.
This operation is not compatible with multiple registries in a DO account. You should use /v2/registries/{registry_name} instead.
registry_create_legacyexecname, subscription_tier_slugTo 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.
registry_delete_legacyexecTo delete your container registry, destroying all container image data stored in it, send a DELETE request to /v2/registry.
This operation is not compatible with multiple registries in a DO account. You should use /v2/registries/{registry_name} instead.
registry_validate_name_legacyexecnameTo validate that a container registry name is available for use, send a POST
request to /v2/registry/validate-name.

If the name is both formatted correctly and available, the response code will
be 204 and contain no body. If the name is already in use, the response will
be a 409 Conflict.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
registry_namestringThe name of a container registry. (example: example)

SELECT examples

To get information about any container registry in your account, send a GET request to /v2/registries/{registry_name}.

SELECT
name,
created_at,
region,
storage_usage_bytes,
storage_usage_bytes_updated_at
FROM digitalocean.container_registry.registries
WHERE registry_name = '{{ registry_name }}' -- required;

INSERT examples

To create your container registry, send a POST request to /v2/registries.

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.

INSERT INTO digitalocean.container_registry.registries (
data__name,
data__subscription_tier_slug,
data__region
)
SELECT
'{{ name }}' --required,
'{{ subscription_tier_slug }}',
'{{ region }}'
RETURNING
registry
;

DELETE examples

To delete your container registry, destroying all container image data stored in it, send a DELETE request to /v2/registries/{registry_name}.

DELETE FROM digitalocean.container_registry.registries
WHERE registry_name = '{{ registry_name }}' --required;

Lifecycle Methods

To validate that a container registry name is available for use, send a POST
request to /v2/registries/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.

It is similar to /v2/registry/validate-name and exists for backward compatibility.

EXEC digitalocean.container_registry.registries.registries_validate_name 
@@json=
'{
"name": "{{ name }}"
}';