azure.containerregistry package¶
-
class
azure.containerregistry.
ArtifactArchitecture
[source]¶ An enumeration.
-
AMD64
= 'amd64'¶
-
ARM
= 'arm'¶
-
ARM64
= 'arm64'¶
-
I386
= '386'¶
-
MIPS
= 'mips'¶
-
MIPS64
= 'mips64'¶
-
MIPS64LE
= 'mips64le'¶
-
MIPSLE
= 'mipsle'¶
-
PPC64
= 'ppc64'¶
-
PPC64LE
= 'ppc64le'¶
-
RISCV64
= 'riscv64'¶
-
S390X
= 's390x'¶
-
WASM
= 'wasm'¶
-
-
class
azure.containerregistry.
ArtifactOperatingSystem
[source]¶ An enumeration.
-
AIX
= 'aix'¶
-
ANDROID
= 'android'¶
-
DARWIN
= 'darwin'¶
-
DRAGONFLY
= 'dragonfly'¶
-
FREEBSD
= 'freebsd'¶
-
ILLUMOS
= 'illumos'¶
-
IOS
= 'ios'¶
-
JS
= 'js'¶
-
LINUX
= 'linux'¶
-
NETBSD
= 'netbsd'¶
-
OPENBSD
= 'openbsd'¶
-
PLAN9
= 'plan9'¶
-
SOLARIS
= 'solaris'¶
-
WINDOWS
= 'windows'¶
-
-
class
azure.containerregistry.
ContainerRegistryClient
(endpoint: str, credential: Optional[TokenCredential] = None, **kwargs: Any)[source]¶ Create a ContainerRegistryClient from an ACR endpoint and a credential
- Parameters
endpoint (str) – An ACR endpoint
credential (
TokenCredential
) – 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 import ContainerRegistryClient from azure.identity import DefaultAzureCredential account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] client = ContainerRegistryClient(account_url, DefaultAzureCredential())
-
close
() → None¶ Close sockets opened by the client. Calling this method is unnecessary when using the client as a context manager.
-
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 import ContainerRepositoryClient from azure.identity import DefaultAzureCredential account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] client = ContainerRepositoryClient(account_url, DefaultAzureCredential()) client.delete_manifest("my_repository", "my_tag_or_digest")
-
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:
client.delete_repository(repository_name, tag.name)
-
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 import ContainerRepositoryClient from azure.identity import DefaultAzureCredential account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) for artifact in client.list_tag_properties(): client.delete_tag("my_repository", tag.name)
-
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 import ContainerRepositoryClient from azure.identity import DefaultAzureCredential account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) for artifact in client.list_manifest_properties(): properties = client.get_manifest_properties("my_repository", artifact.digest)
-
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
-
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 import ContainerRepositoryClient from azure.identity import DefaultAzureCredential account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) for tag in client.list_tag_properties(): tag_properties = client.get_tag_properties("my_repository", tag.name)
-
list_manifest_properties
(repository: str, **kwargs: Any) → azure.core.paging.ItemPaged[azure.containerregistry._models.ArtifactManifestProperties][source]¶ List the artifacts for 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.paging.ItemPaged[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) for repository in client.list_repository_names(): print(repository)
-
list_tag_properties
(repository: str, **kwargs: Any) → azure.core.paging.ItemPaged[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
- Return type
- Raises
Example
from azure.containerregistry import ContainerRepositoryClient from azure.identity import DefaultAzureCredential account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) for tag in client.list_tag_properties(): tag_properties = client.get_tag_properties("my_repository", tag.name)
-
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) – Repository the manifest belongs to
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 import ContainerRepositoryClient from azure.identity import DefaultAzureCredential account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) for artifact in client.list_manifest_properties(): received_properties = client.update_manifest_properties( "my_repository", artifact.digest, can_delete=False, can_list=False, can_read=False, can_write=False, )
-
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
-
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 import ContainerRepositoryClient, TagWriteableProperties from azure.identity import DefaultAzureCredential account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) tag_identifier = "latest" received = client.update_tag_properties( "my_repository", tag_identifier, can_delete=False, can_list=False, can_read=False, can_write=False, )
-
class
azure.containerregistry.
ManifestOrder
[source]¶ Enum for ordering registry artifacts
-
LAST_UPDATE_TIME_ASCENDING
= 'timeasc'¶
-
LAST_UPDATE_TIME_DESCENDING
= 'timedesc'¶
-
-
class
azure.containerregistry.
ArtifactManifestProperties
(**kwargs)[source]¶ Represents properties of a registry artifact
- Variables
can_delete (bool) – Delete Permissions for an artifact
can_write (bool) – Delete Permissions for an artifact
can_read (bool) – Delete Permissions for an artifact
can_list (bool) – Delete Permissions for an artifact
architecture (ArtifactArchitecture) – CPU Architecture of an artifact
created_on (datetime) – Time and date an artifact was created
last_updated_on (datetime.datetime) – Time and date an artifact was last updated
operating_system (ArtifactOperatingSystem) – Operating system for the artifact
repository_name (str) – Repository name the artifact belongs to
-
property
architecture
¶
-
property
created_on
¶
-
property
digest
¶
-
property
fully_qualified_reference
¶
-
property
last_updated_on
¶
-
property
operating_system
¶
-
property
repository_name
¶
-
property
size
¶
-
class
azure.containerregistry.
RepositoryProperties
(**kwargs)[source]¶ Model for storing properties of a single repository
- Variables
can_delete (bool) – Delete Permissions for an artifact
can_write (bool) – Delete Permissions for an artifact
can_read (bool) – Delete Permissions for an artifact
can_list (bool) – Delete Permissions for an artifact
teleport_enabled (bool) – Teleport enabled for the repository
created_on (datetime.datetime) – Time the repository was created
last_updated_on (datetime.datetime) – Time the repository was last updated
manifest_count (int) – Number of manifest in the repository
tag_count (int) – Number of tags associated with the repository
-
property
created_on
¶
-
property
last_udpated_on
¶
-
property
manifest_count
¶
-
property
name
¶
-
property
tag_count
¶
-
class
azure.containerregistry.
TagOrder
[source]¶ Enum for ordering tags
-
LAST_UPDATE_TIME_ASCENDING
= 'timeasc'¶
-
LAST_UPDATE_TIME_DESCENDING
= 'timedesc'¶
-
-
class
azure.containerregistry.
ArtifactTagProperties
(**kwargs)[source]¶ Model for storing properties of a single tag
- Variables
can_delete (bool) – Delete Permissions for an artifact
can_write (bool) – Delete Permissions for an artifact
can_read (bool) – Delete Permissions for an artifact
can_list (bool) – Delete Permissions for an artifact
created_on (datetime.datetime) – Time the tag was created
last_updated_on (datetime.datetime) – Time the tag was last updated
repository (str) – Repository the tag belongs to
-
property
created_on
¶
-
property
digest
¶
-
property
last_updated_on
¶
-
property
name
¶
-
property
repository_name
¶