Skip to main content

repositories

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

Overview

Namerepositories
TypeResource
Iddigitalocean.container_registry.repositories

Fields

The following fields are returned by SELECT queries:

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.

NameDatatypeDescription
namestringThe name of the repository. (example: repo-1)
registry_namestringThe name of the container registry. (example: example)
latest_manifestobject
manifest_countintegerThe number of manifests in the repository.
tag_countintegerThe number of tags in the repository.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
registries_list_repositories_v2selectregistry_nameper_page, page, page_tokenTo list all repositories in your container registry, send a GET request to /v2/registries/$REGISTRY_NAME/repositoriesV2. It is similar to GET /v2/registry/$REGISTRY_NAME/repositoriesV2 and exists for backward compatibility.
registries_delete_repositorydeleteregistry_name, repository_nameTo delete a container repository including all of its tags, send a DELETE request to
/v2/registries/$REGISTRY_NAME/repositories/$REPOSITORY_NAME.

A successful request will receive a 204 status code with no body in response.
This indicates that the request was processed successfully.
registry_list_repositories_legacyexecregistry_nameper_page, pageThis 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.
registry_list_repositories_v2_legacyexecregistry_nameper_page, page, page_tokenTo list all repositories in your container registry, send a GET request to /v2/registry/$REGISTRY_NAME/repositoriesV2.

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)
repository_namestringThe name of a container registry repository. If the name contains / characters, they must be URL-encoded, e.g. %2F. (example: repo-1)
pageintegerWhich 'page' of paginated results to return. Ignored when 'page_token' is provided. (example: 1)
page_tokenstringToken to retrieve of the next or previous set of results more quickly than using 'page'. (example: eyJUb2tlbiI6IkNnZGpiMjlz)
per_pageintegerNumber of items returned per page (example: 2)

SELECT examples

To list all repositories in your container registry, send a GET request to /v2/registries/$REGISTRY_NAME/repositoriesV2. It is similar to GET /v2/registry/$REGISTRY_NAME/repositoriesV2 and exists for backward compatibility.

SELECT
name,
registry_name,
latest_manifest,
manifest_count,
tag_count
FROM digitalocean.container_registry.repositories
WHERE registry_name = '{{ registry_name }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
AND page_token = '{{ page_token }}';

DELETE examples

To delete a container repository including all of its tags, send a DELETE request to
/v2/registries/$REGISTRY_NAME/repositories/$REPOSITORY_NAME.

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

DELETE FROM digitalocean.container_registry.repositories
WHERE registry_name = '{{ registry_name }}' --required
AND repository_name = '{{ repository_name }}' --required;

Lifecycle Methods

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.

EXEC digitalocean.container_registry.repositories.registry_list_repositories_legacy 
@registry_name='{{ registry_name }}' --required,
@per_page='{{ per_page }}',
@page='{{ page }}';