azure.containerregistry.aio package

class azure.containerregistry.aio.ContainerRegistryClient(endpoint: str, credential: Optional[azure.core.credentials_async.AsyncTokenCredential] = None, *, api_version: Optional[str] = None, audience: str = 'https://management.azure.com', **kwargs)[source]

Create a ContainerRegistryClient from an ACR endpoint and a credential.

Parameters
  • endpoint (str) – An ACR endpoint.

  • credential (AsyncTokenCredential or None) – The credential with which to authenticate. This should be None in anonymous access.

Keyword Arguments
Returns

None

Return type

None

Raises

ValueError – If the provided api_version keyword-only argument isn’t supported.

Example:

async close()None

Close sockets opened by the client. Calling this method is unnecessary when using the client as a context manager.

async delete_manifest(repository: str, tag_or_digest: str, **kwargs)None[source]

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

Parameters
  • repository (str) – Repository the manifest belongs to

  • tag_or_digest (str) – Tag or digest of the manifest to be deleted.

Returns

None

Return type

None

Raises

~azure.core.exceptions.HttpResponseError

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_repository(repository: str, **kwargs)None[source]

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

Parameters

repository (str) – The repository to delete

Returns

None

Return type

None

Raises

~azure.core.exceptions.HttpResponseError

Example:

async delete_tag(repository: str, tag: str, **kwargs)None[source]

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.

Parameters
  • repository (str) – Repository the tag belongs to

  • tag (str) – The tag to be deleted

Returns

None

Return type

None

Raises

~azure.core.exceptions.HttpResponseError

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 get_manifest_properties(repository: str, tag_or_digest: str, **kwargs)azure.containerregistry._models.ArtifactManifestProperties[source]

Get the properties of a registry artifact

Parameters
  • repository (str) – Name of the repository

  • tag_or_digest (str) – The tag or digest of the manifest

Return type

ArtifactManifestProperties

Raises

~azure.core.exceptions.ResourceNotFoundError

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_repository_properties(repository: str, **kwargs)azure.containerregistry._models.RepositoryProperties[source]

Get the properties of a repository

Parameters

repository (str) – Name of the repository

Return type

RepositoryProperties

Raises

~azure.core.exceptions.ResourceNotFoundError

async get_tag_properties(repository: str, tag: str, **kwargs)azure.containerregistry._models.ArtifactTagProperties[source]

Get the properties for a tag

Parameters
  • repository (str) – Repository the tag belongs to

  • tag (str) – The tag to get properties for

Return type

ArtifactTagProperties

Raises

~azure.core.exceptions.ResourceNotFoundError

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(repository: str, **kwargs)azure.core.async_paging.AsyncItemPaged[azure.containerregistry._models.ArtifactManifestProperties][source]

List the manifests of a repository

Parameters

repository (str) – Name of the repository

Keyword Arguments
  • 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

AsyncItemPaged[ArtifactManifestProperties]

Raises

~azure.core.exceptions.HttpResponseError

list_repository_names(**kwargs)azure.core.async_paging.AsyncItemPaged[str][source]

List all repositories

Keyword Arguments

results_per_page (int) – Number of repositories to return per page

Returns

An iterable of strings

Return type

AsyncItemPaged[str]

Raises

~azure.core.exceptions.HttpResponseError

Example:

list_tag_properties(repository: str, **kwargs)azure.core.async_paging.AsyncItemPaged[azure.containerregistry._models.ArtifactTagProperties][source]

List the tags for a repository

Parameters

repository (str) – Name of the repository

Keyword Arguments
  • 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

AsyncItemPaged[ArtifactTagProperties]

Raises

~azure.core.exceptions.ResourceNotFoundError

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)
async update_manifest_properties(repository: str, tag_or_digest: str, properties: ArtifactManifestProperties, **kwargs)ArtifactManifestProperties[source]
async update_manifest_properties(repository: str, tag_or_digest: str, *, can_delete: Optional[bool] = 'None', can_list: Optional[bool] = 'None', can_read: Optional[bool] = 'None', can_write: Optional[bool] = 'None', **kwargs)ArtifactManifestProperties
async update_repository_properties(repository: str, properties: RepositoryProperties, **kwargs)RepositoryProperties[source]
async update_repository_properties(repository: str, *, can_delete: Optional[bool] = 'None', can_list: Optional[bool] = 'None', can_read: Optional[bool] = 'None', can_write: Optional[bool] = 'None', **kwargs)RepositoryProperties
async update_tag_properties(repository: str, tag: str, properties: ArtifactTagProperties, **kwargs)ArtifactTagProperties[source]
async update_tag_properties(repository: str, tag: str, *, can_delete: Optional[bool] = 'None', can_list: Optional[bool] = 'None', can_read: Optional[bool] = 'None', can_write: Optional[bool] = 'None', **kwargs)ArtifactTagProperties