ContainerRegistryClient Class

Inheritance
azure.containerregistry.aio._async_base_client.ContainerRegistryBaseClient
ContainerRegistryClient

Constructor

ContainerRegistryClient(endpoint: str, credential: Optional[AsyncTokenCredential] = None, *, audience, **kwargs: Any)

Parameters

endpoint
credential
default value: None

Methods

delete_manifest

Delete a manifest. If the manifest cannot be found or a response status code of 404 is returned an error will not be raised.

Example


   from azure.containerregistry.aio import ContainerRegistryClient
   from azure.identity.aio import DefaultAzureCredential
   endpoint = os.environ["CONTAINERREGISTRY_ENDPOINT"]
   client = ContainerRegistryClient(endpoint, DefaultAzureCredential(), audience="my_audience")
   await client.delete_manifest("my_repository", "my_tag_or_digest")
delete_repository

Delete a repository. If the repository cannot be found or a response status code of 404 is returned an error will not be raised.

delete_tag

Delete a tag from a repository. If the tag cannot be found or a response status code of 404 is returned an error will not be raised.

Example


   from azure.containerregistry.aio import ContainerRegistryClient
   from azure.identity.aio import DefaultAzureCredential
   endpoint = os.environ["CONTAINERREGISTRY_ENDPOINT"]
   client = ContainerRegistryClient(endpoint, DefaultAzureCredential(), audience="my_audience")
   async for tag in client.list_tag_properties("my_repository"):
       await client.delete_tag("my_repository", tag.name)
get_manifest_properties

Get the properties of a registry artifact

Example


   from azure.containerregistry.aio import ContainerRegistryClient
   from azure.identity.aio import DefaultAzureCredential
   endpoint = os.environ["CONTAINERREGISTRY_ENDPOINT"]
   client = ContainerRegistryClient(endpoint, DefaultAzureCredential(), audience="my_audience")
   async for artifact in client.list_manifest_properties("my_repository"):
       properties = await client.get_manifest_properties("my_repository", artifact.digest)
get_repository_properties

Get the properties of a repository

get_tag_properties

Get the properties for a tag

Example


   from azure.containerregistry.aio import ContainerRegistryClient
   from azure.identity.aio import DefaultAzureCredential
   endpoint = os.environ["CONTAINERREGISTRY_ENDPOINT"]
   client = ContainerRegistryClient(endpoint, DefaultAzureCredential(), audience="my_audience")
   async for tag in client.list_tag_properties("my_repository"):
       tag_properties = await client.get_tag_properties("my_repository", tag.name)
list_manifest_properties

List the manifests of a repository

list_repository_names

List all repositories

list_tag_properties

List the tags for a repository

Example


   from azure.containerregistry.aio import ContainerRegistryClient
   from azure.identity.aio import DefaultAzureCredential
   endpoint = os.environ["CONTAINERREGISTRY_ENDPOINT"]
   client = ContainerRegistryClient(endpoint, DefaultAzureCredential(), audience="my_audience")
   async for tag in client.list_tag_properties("my_repository"):
       tag_properties = await client.get_tag_properties(tag.name)
update_manifest_properties

Set the permission properties for a manifest.

The updatable properties include: can_delete, can_list, can_read, and can_write.

Example


   from azure.containerregistry.aio import ContainerRegistryClient
   from azure.identity.aio import DefaultAzureCredential
   endpoint = os.environ["CONTAINERREGISTRY_ENDPOINT"]
   client = ContainerRegistryClient(endpoint, DefaultAzureCredential(), audience="my_audience")
   async for artifact in client.list_manifest_properties("my_repository"):
       received_properties = await client.update_manifest_properties(
           "my_repository",
           artifact.digest,
           can_delete=False,
           can_list=False,
           can_read=False,
           can_write=False,
       )
update_repository_properties

Set the permission properties of a repository.

The updatable properties include: can_delete, can_list, can_read, and can_write.

update_tag_properties

Set the permission properties for a tag.

The updatable properties include: can_delete, can_list, can_read, and can_write.

Example


   from azure.containerregistry.aio import ContainerRegistryClient
   from azure.identity.aio import DefaultAzureCredential
   endpoint = os.environ["CONTAINERREGISTRY_ENDPOINT"]
   client = ContainerRegistryClient(endpoint, DefaultAzureCredential(), audience="my_audience")
   tag_identifier = "latest"
   received = await client.update_tag_properties(
       "my_repository",
       tag_identifier,
       can_delete=False,
       can_list=False,
       can_read=False,
       can_write=False
   )

delete_manifest

Delete a manifest. If the manifest cannot be found or a response status code of 404 is returned an error will not be raised.

Example


   from azure.containerregistry.aio import ContainerRegistryClient
   from azure.identity.aio import DefaultAzureCredential
   endpoint = os.environ["CONTAINERREGISTRY_ENDPOINT"]
   client = ContainerRegistryClient(endpoint, DefaultAzureCredential(), audience="my_audience")
   await client.delete_manifest("my_repository", "my_tag_or_digest")
async delete_manifest(repository: str, tag_or_digest: str, **kwargs: Any) -> None

Parameters

repository
str
Required

Repository the manifest belongs to

tag_or_digest
str
Required

Tag or digest of the manifest to be deleted.

Returns

None

Return type

Exceptions

delete_repository

Delete a repository. If the repository cannot be found or a response status code of 404 is returned an error will not be raised.

async delete_repository(repository: str, **kwargs: Any) -> None

Parameters

repository
str
Required

The repository to delete

Returns

None

Return type

Exceptions

Examples

Delete a repository from the ContainerRegistryClient


               await client.delete_repository(repository_name, "hello-world")

delete_tag

Delete a tag from a repository. If the tag cannot be found or a response status code of 404 is returned an error will not be raised.

Example


   from azure.containerregistry.aio import ContainerRegistryClient
   from azure.identity.aio import DefaultAzureCredential
   endpoint = os.environ["CONTAINERREGISTRY_ENDPOINT"]
   client = ContainerRegistryClient(endpoint, DefaultAzureCredential(), audience="my_audience")
   async for tag in client.list_tag_properties("my_repository"):
       await client.delete_tag("my_repository", tag.name)
async delete_tag(repository: str, tag: str, **kwargs: Any) -> None

Parameters

repository
str
Required

Repository the tag belongs to

tag
str
Required

The tag to be deleted

Returns

None

Return type

Exceptions

get_manifest_properties

Get the properties of a registry artifact

Example


   from azure.containerregistry.aio import ContainerRegistryClient
   from azure.identity.aio import DefaultAzureCredential
   endpoint = os.environ["CONTAINERREGISTRY_ENDPOINT"]
   client = ContainerRegistryClient(endpoint, DefaultAzureCredential(), audience="my_audience")
   async for artifact in client.list_manifest_properties("my_repository"):
       properties = await client.get_manifest_properties("my_repository", artifact.digest)
async get_manifest_properties(repository: str, tag_or_digest: str, **kwargs: Any) -> azure.containerregistry._models.ArtifactManifestProperties

Parameters

repository
str
Required

Name of the repository

tag_or_digest
str
Required

The tag or digest of the manifest

Return type

Exceptions

get_repository_properties

Get the properties of a repository

async get_repository_properties(repository: str, **kwargs: Any) -> azure.containerregistry._models.RepositoryProperties

Parameters

repository
str
Required

Name of the repository

Return type

Exceptions

get_tag_properties

Get the properties for a tag

Example


   from azure.containerregistry.aio import ContainerRegistryClient
   from azure.identity.aio import DefaultAzureCredential
   endpoint = os.environ["CONTAINERREGISTRY_ENDPOINT"]
   client = ContainerRegistryClient(endpoint, DefaultAzureCredential(), audience="my_audience")
   async for tag in client.list_tag_properties("my_repository"):
       tag_properties = await client.get_tag_properties("my_repository", tag.name)
async get_tag_properties(repository: str, tag: str, **kwargs: Any) -> azure.containerregistry._models.ArtifactTagProperties

Parameters

repository
str
Required

Repository the tag belongs to

tag
str
Required

The tag to get properties for

Return type

Exceptions

list_manifest_properties

List the manifests of a repository

list_manifest_properties(repository: str, **kwargs: Any) -> azure.core.async_paging.AsyncItemPaged[azure.containerregistry._models.ArtifactManifestProperties]

Parameters

repository
str
Required

Name of the repository

order_by
ArtifactManifestOrder or str

Query parameter for ordering by time ascending or descending

results_per_page
int

Number of repositories to return per page

Returns

An iterable of ArtifactManifestProperties

Return type

Exceptions

list_repository_names

List all repositories

list_repository_names(**kwargs: Any) -> azure.core.async_paging.AsyncItemPaged[str]

Parameters

results_per_page
int

Number of repositories to return per page

Returns

An iterable of strings

Return type

Exceptions

Examples

List repositories in a container registry account


   audience = "https://management.azure.com"
   endpoint = os.environ["CONTAINERREGISTRY_ENDPOINT"]
   credential = DefaultAzureCredential()
   client = ContainerRegistryClient(endpoint, credential, audience=audience)

   async with client:
       async for repository in client.list_repository_names():
           print(repository)

list_tag_properties

List the tags for a repository

Example


   from azure.containerregistry.aio import ContainerRegistryClient
   from azure.identity.aio import DefaultAzureCredential
   endpoint = os.environ["CONTAINERREGISTRY_ENDPOINT"]
   client = ContainerRegistryClient(endpoint, DefaultAzureCredential(), audience="my_audience")
   async for tag in client.list_tag_properties("my_repository"):
       tag_properties = await client.get_tag_properties(tag.name)
list_tag_properties(repository: str, **kwargs: Any) -> azure.core.async_paging.AsyncItemPaged[azure.containerregistry._models.ArtifactTagProperties]

Parameters

repository
str
Required

Name of the repository

order_by
ArtifactTagOrder or str

Query parameter for ordering by time ascending or descending

results_per_page
int

Number of repositories to return per page

Returns

An iterable of ArtifactTagProperties

Return type

Exceptions

update_manifest_properties

Set the permission properties for a manifest.

The updatable properties include: can_delete, can_list, can_read, and can_write.

Example


   from azure.containerregistry.aio import ContainerRegistryClient
   from azure.identity.aio import DefaultAzureCredential
   endpoint = os.environ["CONTAINERREGISTRY_ENDPOINT"]
   client = ContainerRegistryClient(endpoint, DefaultAzureCredential(), audience="my_audience")
   async for artifact in client.list_manifest_properties("my_repository"):
       received_properties = await client.update_manifest_properties(
           "my_repository",
           artifact.digest,
           can_delete=False,
           can_list=False,
           can_read=False,
           can_write=False,
       )
async update_manifest_properties(repository: str, tag_or_digest: str, properties: ArtifactManifestProperties, **kwargs: Any) -> ArtifactManifestProperties

Parameters

repository
str
Required

Repository the manifest belongs to.

tag_or_digest
str
Required

Tag or digest of the manifest.

properties
ArtifactManifestProperties
Required

The property's values to be set. This is a positional-only parameter. Please provide either this or individual keyword parameters.

can_delete
bool

Delete permissions for a manifest.

can_list
bool

List permissions for a manifest.

can_read
bool

Read permissions for a manifest.

can_write
bool

Write permissions for a manifest.

Return type

Exceptions

update_repository_properties

Set the permission properties of a repository.

The updatable properties include: can_delete, can_list, can_read, and can_write.

async update_repository_properties(repository: str, properties: RepositoryProperties, **kwargs: Any) -> RepositoryProperties

Parameters

repository
str
Required

Name of the repository.

properties
RepositoryProperties
Required

Properties to set for the repository. This is a positional-only parameter. Please provide either this or individual keyword parameters.

can_delete
bool

Delete permissions for a repository.

can_list
bool

List permissions for a repository.

can_read
bool

Read permissions for a repository.

can_write
bool

Write permissions for a repository.

Return type

Exceptions

update_tag_properties

Set the permission properties for a tag.

The updatable properties include: can_delete, can_list, can_read, and can_write.

Example


   from azure.containerregistry.aio import ContainerRegistryClient
   from azure.identity.aio import DefaultAzureCredential
   endpoint = os.environ["CONTAINERREGISTRY_ENDPOINT"]
   client = ContainerRegistryClient(endpoint, DefaultAzureCredential(), audience="my_audience")
   tag_identifier = "latest"
   received = await client.update_tag_properties(
       "my_repository",
       tag_identifier,
       can_delete=False,
       can_list=False,
       can_read=False,
       can_write=False
   )
async update_tag_properties(repository: str, tag: str, properties: ArtifactTagProperties, **kwargs: Any) -> ArtifactTagProperties

Parameters

repository
str
Required

Repository the tag belongs to.

tag
str
Required

Tag to set properties for.

properties
ArtifactTagProperties
Required

The property's values to be set. This is a positional-only parameter. Please provide either this or individual keyword parameters.

can_delete
bool

Delete permissions for a tag.

can_list
bool

List permissions for a tag.

can_read
bool

Read permissions for a tag.

can_write
bool

Write permissions for a tag.

Return type

Exceptions