azure.containerregistry.aio package¶
-
class
azure.containerregistry.aio.
ContainerRegistryClient
(endpoint: str, credential: Optional[AsyncTokenCredential] = None, **kwargs: Any)[source]¶ Create a ContainerRegistryClient from an endpoint and a credential
- Parameters
endpoint (str) – An ACR endpoint
credential (
AsyncTokenCredential
) – The credential with which to authenticate
- Keyword Arguments
authentication_scope (str) – URL for credential authentication if different from the default
- Returns
None
- Raises
None
Example:
from azure.containerregistry.aio import ContainerRegistryClient from azure.identity.aio import DefaultAzureCredential account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] client = ContainerRegistryClient(account_url, DefaultAzureCredential())
-
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: Any) → 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
- Returns
None
- Return type
- Raises
Example
from azure.containerregistry.aio import ContainerRepositoryClient from azure.identity.aio import DefaultAzureCredential account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] client = ContainerRepositoryClient(account_url, DefaultAzureCredential()) await client.delete_manifest("my_repository", "my_tag_or_digest")
-
async
delete_repository
(repository: str, **kwargs: Any) → 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
- Raises
Example:
await client.delete_repository(repository_name, "hello-world")
-
async
delete_tag
(repository: str, tag: str, **kwargs: Any) → 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
- Returns
None
- Return type
- Raises
Example
from azure.containerregistry.aio import ContainerRepositoryClient from azure.identity.aio import DefaultAzureCredential account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) async for artifact in client.list_tag_properties(): await client.delete_tag("my_repository", tag.name)
-
async
get_manifest_properties
(repository: str, tag_or_digest: str, **kwargs: Any) → azure.containerregistry._models.ArtifactManifestProperties[source]¶ Get the properties of a registry artifact
- Parameters
- Returns
- Raises
Example
from azure.containerregistry.aio import ContainerRepositoryClient from azure.identity.aio import DefaultAzureCredential account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) async for artifact in client.list_manifest_properties(): properties = await client.get_manifest_properties("my_repository", artifact.digest)
-
async
get_repository_properties
(repository: str, **kwargs: Any) → azure.containerregistry._models.RepositoryProperties[source]¶ Get the properties of a repository
- Parameters
repository (str) – Name of the repository
- Returns
- Raises
-
async
get_tag_properties
(repository: str, tag: str, **kwargs: Any) → azure.containerregistry._models.ArtifactTagProperties[source]¶ Get the properties for a tag
- Parameters
- Returns
- Raises
Example
from azure.containerregistry.aio import ContainerRepositoryClient from azure.identity.aio import DefaultAzureCredential account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) async for tag in client.list_tag_properties(): tag_properties = await client.get_tag_properties("my_repository", tag.name)
-
list_manifest_properties
(repository: str, **kwargs: Any) → 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 (
ManifestOrder
or str) – Query parameter for ordering by time ascending or descendingresults_per_page (int) – Number of repositories to return per page
- Returns
An iterable of
ArtifactManifestProperties
- Return type
- Raises
-
list_repository_names
(**kwargs: Any) → 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
- Raises
Example:
account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] credential = DefaultAzureCredential() client = ContainerRegistryClient(account_url, credential) async with client: async for repository in client.list_repository_names(): print(repository)
-
list_tag_properties
(repository: str, **kwargs: Any) → 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
- Returns
An iterable of
ArtifactTagProperties
- Return type
- Raises
Example
from azure.containerregistry.aio import ContainerRepositoryClient from azure.identity.aio import DefaultAzureCredential account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) async for tag in client.list_tag_properties(): tag_properties = await client.get_tag_properties(tag.name)
-
async
update_manifest_properties
(*args: Union[str, azure.containerregistry._models.ArtifactManifestProperties], **kwargs: Any) → azure.containerregistry._models.ArtifactManifestProperties[source]¶ Set the properties for a manifest
- Parameters
args (Union[str, ArtifactManifestProperties]) –
repository (str) – Name of the repository
tag_or_digest (str) – Tag or digest of the manifest
properties (ArtifactManifestProperties) – The property’s values to be set
- Returns
- Raises
Example
from azure.containerregistry.aio import ContainerRepositoryClient from azure.identity.aio import DefaultAzureCredential account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) async for artifact in client.list_manifest_properties(): 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_repository_properties
(*args: Union[str, azure.containerregistry._models.RepositoryProperties], **kwargs: Any) → azure.containerregistry._models.RepositoryProperties[source]¶ Set the properties of a repository
- Parameters
args (Union[str, RepositoryProperties]) –
repository (str) – Name of the repository
properties (
RepositoryProperties
) – Properties to set for the repository
- Returns
- Raises
-
async
update_tag_properties
(*args: Union[str, azure.containerregistry._models.ArtifactTagProperties], **kwargs: Any) → azure.containerregistry._models.ArtifactTagProperties[source]¶ Set the properties for a tag
- Parameters
args (Union[str, ArtifactTagProperties]) –
repository (str) – Repository the tag belongs to
tag (str) – Tag to set properties for
properties (ArtifactTagProperties) – The property’s values to be set
- Returns
- Raises
Example
from azure.containerregistry.aio import ContainerRepositoryClient from azure.identity.aio import DefaultAzureCredential account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) 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 )