azure.containerregistry package

class azure.containerregistry.ContainerRegistryClient(endpoint: str, credential: TokenCredential, **kwargs: Dict[str, 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

Returns

None

Raises

None

close()None

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

delete_repository(repository: str, **kwargs: Dict[str, Any]) → DeletedRepositoryResult[source]

Delete a repository

Parameters

repository (str) – The repository to delete

Returns

Object containing information about the deleted repository

Return type

DeletedRepositoryResult

Raises

ResourceNotFoundError

get_repository_client(repository: str, **kwargs: Dict[str, Any]) → ContainerRepositoryClient[source]

Get a repository client

Parameters

repository (str) – The repository to create a client for

Returns

ContainerRepositoryClient

Raises

None

list_repositories(**kwargs: Dict[str, Any]) → ItemPaged[str][source]

List all repositories

Keyword Arguments
  • max (int) – Maximum number of repositories to return

  • last (str) – Query parameter for the last item in the previous call. Ensuing call will return values after last lexically

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

Returns

ItemPaged[str]

Return type

ItemPaged

Raises

ResourceNotFoundError

class azure.containerregistry.ContainerRepositoryClient(endpoint: str, repository: str, credential: TokenCredential, **kwargs: Dict[str, Any])[source]

Create a ContainerRepositoryClient from an endpoint, repository name, and credential

Parameters
  • endpoint (str) – An ACR endpoint

  • repository (str) – The name of a repository

  • credential (TokenCredential) – The credential with which to authenticate

Returns

None

Raises

None

close()None

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

delete(**kwargs: Dict[str, Any])None[source]

Delete a repository

Returns

Object containing information about the deleted repository

Return type

DeletedRepositoryResult

Raises

ResourceNotFoundError

delete_registry_artifact(digest: str, **kwargs: Dict[str, Any])None[source]

Delete a registry artifact

Parameters

digest (str) – The digest of the artifact to be deleted

Returns

None

Raises

ResourceNotFoundError

delete_tag(tag: str, **kwargs: Dict[str, Any])None[source]

Delete a tag from a repository

Parameters

tag (str) – The tag to be deleted

Returns

None

Raises

ResourceNotFoundError

get_properties(**kwargs: Dict[str, Any]) → RepositoryProperties[source]

Get the properties of a repository

Returns

RepositoryProperties

Raises

ResourceNotFoundError

get_registry_artifact_properties(tag_or_digest: str, **kwargs: Dict[str, Any]) → RegistryArtifactProperties[source]

Get the properties of a registry artifact

Parameters

tag_or_digest (str) – The tag/digest of a registry artifact

Returns

RegistryArtifactProperties

Raises

ResourceNotFoundError

get_tag_properties(tag: str, **kwargs: Dict[str, Any]) → TagProperties[source]

Get the properties for a tag

Parameters

tag (str) – The tag to get properties for

Returns

TagProperties

Raises

ResourceNotFoundError

list_registry_artifacts(**kwargs: Dict[str, Any]) → ItemPaged[RegistryArtifactProperties][source]

List the artifacts for a repository

Keyword Arguments
  • last (str) – Query parameter for the last item in the previous call. Ensuing call will return values after last lexically

  • order_by (RegistryArtifactOrderBy) – Query parameter for ordering by time ascending or descending

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

Returns

ItemPaged[RegistryArtifactProperties]

Return type

ItemPaged

Raises

ResourceNotFoundError

list_tags(**kwargs: Dict[str, Any]) → ItemPaged[TagProperties][source]

List the tags for a repository

Keyword Arguments
  • last (str) – Query parameter for the last item in the previous call. Ensuing call will return values after last lexically

  • order_by (TagOrderBy) – Query parameter for ordering by time ascending or descending

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

Returns

ItemPaged[TagProperties]

Return type

ItemPaged

Raises

ResourceNotFoundError

set_manifest_properties(digest: str, permissions: ContentPermissions, **kwargs: Dict[str, Any]) → RegistryArtifactProperties[source]

Set the properties for a manifest

Parameters
  • digest (str) – Digest of a manifest

  • permissions (ContentPermissions) – The property’s values to be set

Returns

RegistryArtifactProperties

Raises

ResourceNotFoundError

set_tag_properties(tag: str, permissions: ContentPermissions, **kwargs: Dict[str, Any]) → TagProperties[source]

Set the properties for a tag

Parameters
  • tag (str) – Tag to set properties for

  • permissions (ContentPermissions) – The property’s values to be set

Returns

TagProperties

Raises

ResourceNotFoundError

class azure.containerregistry.ContentPermissions(**kwargs)[source]

Permissions of an artifact or tag

Variables
  • can_delete (bool) – Ability to delete an artifact or tag

  • can_list (bool) – Ability to list an artifact or tag

  • can_read (bool) – Ability to read an artifact or tag

  • can_write (bool) – Ability to write an artifact or tag

class azure.containerregistry.DeletedRepositoryResult(**kwargs)[source]

Represents the digests and tags deleted when a repository is deleted

Variables
  • deleted_registry_artifact_digests (List[str]) – Registry artifact digests that were deleted

  • deleted_tags (List[str]) – Tags that were deleted

class azure.containerregistry.RegistryArtifactOrderBy[source]

Enum for ordering registry artifacts

LAST_UPDATE_TIME_ASCENDING = 'timeasc'
LAST_UPDATE_TIME_DESCENDING = 'timedesc'
class azure.containerregistry.RegistryArtifactProperties(**kwargs)[source]

Represents properties of a registry artifact

Variables
  • cpu_architecture (str) – CPU Architecture of an artifact

  • created_on (datetime) – Time and date an artifact was created

  • digest (str) – Digest for the artifact

  • last_updated_on (datetime) – Time and date an artifact was last updated

  • operating_system (str) – Operating system for the artifact

  • references (List[str]) – References for the artifact

  • size (str) – Size of the artifact

  • tags (List[str]) – Tags associated with a registry artifact

  • content_permissions (ContentPermissions) – Permissions for an artifact

class azure.containerregistry.RepositoryProperties(**kwargs)[source]

Model for storing properties of a single repository

Variables
  • content_permissions (ContentPermissions) – Read/Write/List/Delete permissions 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

  • name (str) – Name of the repository

  • registry (str) – Registry the repository belongs to

  • tag_count (int) – Number of tags associated with the repository

class azure.containerregistry.TagOrderBy[source]

Enum for ordering tags

LAST_UPDATE_TIME_ASCENDING = 'timeasc'
LAST_UPDATE_TIME_DESCENDING = 'timedesc'
class azure.containerregistry.TagProperties(**kwargs)[source]

Model for storing properties of a single tag

Variables
  • content_permissions (ContentPermissions) – Read/Write/List/Delete permissions for the tag

  • created_on (datetime.datetime) – Time the tag was created

  • digest (str) – Digest for the tag

  • last_updated_on (datetime.datetime) – Time the tag was last updated

  • name (str) – Name of the image the tag corresponds to

  • registry (str) – Registry the tag belongs to

Subpackages