diff --git a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/__init__.py b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/__init__.py index f58b0efbc9ca..d9f97e737ef0 100644 --- a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/__init__.py +++ b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/__init__.py @@ -7,28 +7,30 @@ # -------------------------------------------------------------------------- from ._container_registry_client import ContainerRegistryClient -from ._container_repository_client import ContainerRepositoryClient +from ._container_repository import ContainerRepository from ._models import ( DeleteRepositoryResult, ContentProperties, - ManifestOrderBy, + ManifestOrder, ArtifactManifestProperties, RepositoryProperties, - TagOrderBy, + TagOrder, ArtifactTagProperties, ) +from ._registry_artifact import RegistryArtifact from ._version import VERSION __version__ = VERSION __all__ = [ "ContainerRegistryClient", - "ContainerRepositoryClient", - "DeleteRepositoryResult", + "ContainerRepository", "ContentProperties", - "ManifestOrderBy", + "DeleteRepositoryResult", + "RegistryArtifact", + "ManifestOrder", "ArtifactManifestProperties", "RepositoryProperties", - "TagOrderBy", + "TagOrder", "ArtifactTagProperties", ] diff --git a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_base_client.py b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_base_client.py index c8fbe64eeb54..9f6aa5554ea0 100644 --- a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_base_client.py +++ b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_base_client.py @@ -23,7 +23,7 @@ class ContainerRegistryApiVersion(str, Enum): class ContainerRegistryBaseClient(object): - """Base class for ContainerRegistryClient and ContainerRepositoryClient + """Base class for ContainerRegistryClient, ContainerRepository, and RegistryArtifact :param str endpoint: Azure Container Registry endpoint :param credential: AAD Token for authenticating requests with Azure diff --git a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_container_registry_client.py b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_container_registry_client.py index 8da2f684fb93..f1caefa5e696 100644 --- a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_container_registry_client.py +++ b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_container_registry_client.py @@ -16,9 +16,10 @@ from azure.core.tracing.decorator import distributed_trace from ._base_client import ContainerRegistryBaseClient, TransportWrapper -from ._container_repository_client import ContainerRepositoryClient +from ._container_repository import ContainerRepository from ._generated.models import AcrErrors from ._helpers import _parse_next_link +from ._registry_artifact import RegistryArtifact from ._models import DeleteRepositoryResult if TYPE_CHECKING: @@ -53,11 +54,11 @@ def __init__(self, endpoint, credential, **kwargs): super(ContainerRegistryClient, self).__init__(endpoint=endpoint, credential=credential, **kwargs) @distributed_trace - def delete_repository(self, repository, **kwargs): + def delete_repository(self, repository_name, **kwargs): # type: (str, Dict[str, Any]) -> DeleteRepositoryResult """Delete a repository - :param str repository: The repository to delete + :param str repository_name: The repository to delete :returns: Object containing information about the deleted repository :rtype: :class:`~azure.containerregistry.DeleteRepositoryResult` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` @@ -72,11 +73,11 @@ def delete_repository(self, repository, **kwargs): :caption: Delete a repository from the `ContainerRegistryClient` """ return DeleteRepositoryResult._from_generated( # pylint: disable=protected-access - self._client.container_registry.delete_repository(repository, **kwargs) + self._client.container_registry.delete_repository(repository_name, **kwargs) ) @distributed_trace - def list_repositories(self, **kwargs): + def list_repository_names(self, **kwargs): # type: (Dict[str, Any]) -> ItemPaged[str] """List all repositories @@ -162,7 +163,7 @@ def extract_data(pipeline_response): deserialized = self._client._deserialize( # pylint: disable=protected-access "Repositories", pipeline_response ) - list_of_elem = deserialized.repositories + list_of_elem = deserialized.repositories or [] if cls: list_of_elem = cls(list_of_elem) link = None @@ -192,12 +193,12 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_repository_client(self, repository, **kwargs): - # type: (str, Dict[str, Any]) -> ContainerRepositoryClient - """Get a repository client + def get_repository(self, repository_name, **kwargs): + # type: (str, Any) -> ContainerRepository + """Get a Container Repository object - :param str repository: The repository to create a client for - :returns: :class:`~azure.containerregistry.ContainerRepositoryClient` + :param str repository_name: The repository to create a client for + :returns: :class:`~azure.containerregistry.ContainerRepository` :raises: None Example @@ -215,6 +216,29 @@ def get_repository_client(self, repository, **kwargs): transport=TransportWrapper(self._client._client._pipeline._transport), # pylint: disable=protected-access policies=self._client._client._pipeline._impl_policies, # pylint: disable=protected-access ) - return ContainerRepositoryClient( - self._endpoint, repository, credential=self._credential, pipeline=_pipeline, **kwargs + return ContainerRepository( + self._endpoint, repository_name, credential=self._credential, pipeline=_pipeline, **kwargs + ) + + @distributed_trace + def get_artifact(self, repository_name, tag_or_digest, **kwargs): + # type: (str, str, Dict[str, Any]) -> RegistryArtifact + """Get a Registry Artifact object + + :param str repository_name: Name of the repository + :param str tag_or_digest: The tag or digest of the artifact + :returns: :class:`~azure.containerregistry.RegistryArtifact` + :raises: None + """ + _pipeline = Pipeline( + transport=TransportWrapper(self._client._client._pipeline._transport), # pylint: disable=protected-access + policies=self._client._client._pipeline._impl_policies, # pylint: disable=protected-access + ) + return RegistryArtifact( + self._endpoint, + repository_name, + tag_or_digest, + self._credential, + pipeline=_pipeline, + **kwargs ) diff --git a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_container_repository.py b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_container_repository.py new file mode 100644 index 000000000000..8f2adfb1d5cd --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_container_repository.py @@ -0,0 +1,229 @@ +# coding=utf-8 +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +from typing import TYPE_CHECKING + +from azure.core.exceptions import ( + ClientAuthenticationError, + ResourceNotFoundError, + ResourceExistsError, + HttpResponseError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import Pipeline +from azure.core.tracing.decorator import distributed_trace + +from ._base_client import ContainerRegistryBaseClient, TransportWrapper +from ._generated.models import AcrErrors +from ._helpers import _parse_next_link +from ._models import ( + DeleteRepositoryResult, + ArtifactManifestProperties, + RepositoryProperties, +) +from ._registry_artifact import RegistryArtifact + +if TYPE_CHECKING: + from typing import Any, Dict + from azure.core.credentials import TokenCredential + from ._models import ContentProperties + + +class ContainerRepository(ContainerRegistryBaseClient): + def __init__(self, endpoint, name, credential, **kwargs): + # type: (str, str, TokenCredential, Dict[str, Any]) -> None + """Create a ContainerRepository from an endpoint, repository name, and credential + + :param str endpoint: An ACR endpoint + :param str name: The name of a repository + :param credential: The credential with which to authenticate + :type credential: :class:`~azure.core.credentials.TokenCredential` + :returns: None + :raises: None + """ + if not endpoint.startswith("https://") and not endpoint.startswith("http://"): + endpoint = "https://" + endpoint + self._endpoint = endpoint + self.name = name + self._credential = credential + self.fully_qualified_name = self._endpoint + self.name + super(ContainerRepository, self).__init__(endpoint=self._endpoint, credential=credential, **kwargs) + + @distributed_trace + def delete(self, **kwargs): + # type: (Dict[str, Any]) -> DeleteRepositoryResult + """Delete a repository + + :returns: Object containing information about the deleted repository + :rtype: :class:`~azure.containerregistry.DeleteRepositoryResult` + :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + """ + return DeleteRepositoryResult._from_generated( # pylint: disable=protected-access + self._client.container_registry.delete_repository(self.name, **kwargs) + ) + + @distributed_trace + def get_properties(self, **kwargs): + # type: (Dict[str, Any]) -> RepositoryProperties + """Get the properties of a repository + + :returns: :class:`~azure.containerregistry.RepositoryProperties` + :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + """ + return RepositoryProperties._from_generated( # pylint: disable=protected-access + self._client.container_registry.get_properties(self.name, **kwargs) + ) + + @distributed_trace + def list_manifests(self, **kwargs): + # type: (Dict[str, Any]) -> ItemPaged[ArtifactManifestProperties] + """List the artifacts for a repository + + :keyword last: Query parameter for the last item in the previous call. Ensuing + call will return values after last lexically + :paramtype last: str + :keyword order_by: Query parameter for ordering by time ascending or descending + :paramtype order_by: :class:`~azure.containerregistry.ManifestOrder` + :keyword results_per_page: Number of repositories to return per page + :paramtype results_per_page: int + :return: ItemPaged[:class:`ArtifactManifestProperties`] + :rtype: :class:`~azure.core.paging.ItemPaged` + :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + """ + name = self.name + last = kwargs.pop("last", None) + n = kwargs.pop("results_per_page", None) + orderby = kwargs.pop("order_by", None) + cls = kwargs.pop( + "cls", + lambda objs: [ + ArtifactManifestProperties._from_generated(x, repository_name=self.name) # pylint: disable=protected-access + for x in objs + ], + ) + + error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop("error_map", {})) + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters["Accept"] = self._client._serialize.header( # pylint: disable=protected-access + "accept", accept, "str" + ) + + if not next_link: + # Construct URL + url = "/acr/v1/{name}/_manifests" + path_format_arguments = { + "url": self._client._serialize.url( # pylint: disable=protected-access + "self._client._config.url", + self._client._config.url, # pylint: disable=protected-access + "str", + skip_quote=True, + ), + "name": self._client._serialize.url("name", name, "str"), # pylint: disable=protected-access + } + url = self._client._client.format_url(url, **path_format_arguments) # pylint: disable=protected-access + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if last is not None: + query_parameters["last"] = self._client._serialize.query( # pylint: disable=protected-access + "last", last, "str" + ) + if n is not None: + query_parameters["n"] = self._client._serialize.query( # pylint: disable=protected-access + "n", n, "int" + ) + if orderby is not None: + query_parameters["orderby"] = self._client._serialize.query( # pylint: disable=protected-access + "orderby", orderby, "str" + ) + + request = self._client._client.get( # pylint: disable=protected-access + url, query_parameters, header_parameters + ) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + path_format_arguments = { + "url": self._client._serialize.url( # pylint: disable=protected-access + "self._client._config.url", + self._client._config.url, # pylint: disable=protected-access + "str", + skip_quote=True, + ), + "name": self._client._serialize.url("name", name, "str"), # pylint: disable=protected-access + } + url = self._client._client.format_url(url, **path_format_arguments) # pylint: disable=protected-access + request = self._client._client.get( # pylint: disable=protected-access + url, query_parameters, header_parameters + ) + return request + + def extract_data(pipeline_response): + deserialized = self._client._deserialize( # pylint: disable=protected-access + "AcrManifests", pipeline_response + ) + list_of_elem = deserialized.manifests + if cls: + list_of_elem = cls(list_of_elem) + link = None + if "Link" in pipeline_response.http_response.headers.keys(): + link = _parse_next_link(pipeline_response.http_response.headers["Link"]) + return link, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._client._deserialize.failsafe_deserialize( # pylint: disable=protected-access + AcrErrors, response + ) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def set_properties(self, properties, **kwargs): + # type: (RepositoryProperties, Dict[str, Any]) -> RepositoryProperties + """Set the properties of a repository + + :returns: :class:`~azure.containerregistry.RepositoryProperties` + :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + """ + return RepositoryProperties._from_generated( # pylint: disable=protected-access + self._client.container_registry.set_properties( + self.name, properties._to_generated(), **kwargs # pylint: disable=protected-access + ) + ) + + @distributed_trace + def get_artifact(self, tag_or_digest, **kwargs): + # type: (str, str, Dict[str, Any]) -> RegistryArtifact + """Get a Registry Artifact object + + :param str repository_name: Name of the repository + :param str tag_or_digest: The tag or digest of the artifact + :returns: :class:`~azure.containerregistry.RegistryArtifact` + :raises: None + """ + _pipeline = Pipeline( + transport=TransportWrapper(self._client._client._pipeline._transport), # pylint: disable=protected-access + policies=self._client._client._pipeline._impl_policies, # pylint: disable=protected-access + ) + return RegistryArtifact( + self._endpoint, self.name, tag_or_digest, self._credential, pipeline=_pipeline, **kwargs + ) diff --git a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_exchange_client.py b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_exchange_client.py index 5d2710c291af..54ae6aff97c3 100644 --- a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_exchange_client.py +++ b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_exchange_client.py @@ -70,7 +70,7 @@ def get_acr_access_token(self, challenge, **kwargs): ) def get_refresh_token(self, service, **kwargs): - # type: (str, **Any) -> str + # type: (str, Dict[str, Any]) -> str if not self._refresh_token or time.time() - self._last_refresh_time > 300: self._refresh_token = self.exchange_aad_token_for_refresh_token(service, **kwargs) self._last_refresh_time = time.time() diff --git a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_models.py b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_models.py index 259c60db2002..61716a694ec1 100644 --- a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_models.py +++ b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_models.py @@ -7,11 +7,11 @@ from enum import Enum from typing import TYPE_CHECKING, Dict, Any from ._generated.models import ContentProperties as GeneratedContentProperties +from ._generated.models import RepositoryProperties as GeneratedRepositoryProperties if TYPE_CHECKING: from ._generated.models import ManifestAttributesBase - from ._generated.models import RepositoryProperties as GeneratedRepositoryProperties - from ._generated.models import ArtifactTagProperties as GeneratedTagProperties + from ._generated.models import ArtifactTagProperties as GeneratedArtifactTagProperties class ContentProperties(object): @@ -107,7 +107,7 @@ def __init__(self, **kwargs): @classmethod def _from_generated(cls, generated, **kwargs): - # type: (ManifestAttributesBase, Any) -> ArtifactManifestProperties + # type: (ManifestAttributesBase, Dict[str, Any]) -> ArtifactManifestProperties return cls( cpu_architecture=generated.architecture, created_on=generated.created_on, @@ -132,7 +132,6 @@ class RepositoryProperties(object): :vartype last_updated_on: :class:`datetime.datetime` :ivar int manifest_count: Number of manifest in the repository :ivar str name: Name of the repository - :ivar str registry: Registry the repository belongs to :ivar int tag_count: Number of tags associated with the repository """ @@ -142,7 +141,6 @@ def __init__(self, **kwargs): self.last_updated_on = kwargs.get("last_updated_on", None) self.manifest_count = kwargs.get("manifest_count", None) self.name = kwargs.get("name", None) - self.registry = kwargs.get("registry", None) self.tag_count = kwargs.get("tag_count", None) if self.writeable_properties: self.writeable_properties = ContentProperties._from_generated(self.writeable_properties) @@ -157,18 +155,28 @@ def _from_generated(cls, generated): manifest_count=generated.manifest_count, tag_count=generated.tag_count, content_permissions=generated.writeable_properties, - registry=generated.additional_properties.get("registry", None), + ) + + def _to_generated(self): + # type: () -> GeneratedRepositoryProperties + return GeneratedRepositoryProperties( + name=self.name, + created_on=self.created_on, + last_updated_on=self.last_updated_on, + manifest_count=self.manifest_count, + tag_count=self.tag_count, + writeable_properties=self.writeable_properties._to_generated(), # pylint: disable=protected-access ) -class ManifestOrderBy(str, Enum): +class ManifestOrder(str, Enum): """Enum for ordering registry artifacts""" LAST_UPDATE_TIME_DESCENDING = "timedesc" LAST_UPDATE_TIME_ASCENDING = "timeasc" -class TagOrderBy(str, Enum): +class TagOrder(str, Enum): """Enum for ordering tags""" LAST_UPDATE_TIME_DESCENDING = "timedesc" @@ -201,7 +209,7 @@ def __init__(self, **kwargs): @classmethod def _from_generated(cls, generated, **kwargs): - # type: (GeneratedTagProperties, Dict[str, Any]) -> ArtifactTagProperties + # type: (GeneratedArtifactTagProperties, Dict[str, Any]) -> ArtifactTagProperties return cls( created_on=generated.created_on, digest=generated.digest, diff --git a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_container_repository_client.py b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_registry_artifact.py similarity index 61% rename from sdk/containerregistry/azure-containerregistry/azure/containerregistry/_container_repository_client.py rename to sdk/containerregistry/azure-containerregistry/azure/containerregistry/_registry_artifact.py index f2aa8acffe4c..e47571b3c33b 100644 --- a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_container_repository_client.py +++ b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_registry_artifact.py @@ -21,7 +21,6 @@ from ._models import ( DeleteRepositoryResult, ArtifactManifestProperties, - RepositoryProperties, ArtifactTagProperties, ) @@ -30,15 +29,17 @@ from ._models import ContentProperties -class ContainerRepositoryClient(ContainerRegistryBaseClient): - def __init__(self, endpoint, repository, credential, **kwargs): - # type: (str, str, TokenCredential, Dict[str, Any]) -> None - """Create a ContainerRepositoryClient from an endpoint, repository name, and credential +class RegistryArtifact(ContainerRegistryBaseClient): + def __init__(self, endpoint, repository, tag_or_digest, credential, **kwargs): + # type: (str, str, str, TokenCredential, Dict[str, Any]) -> None + """Create a RegistryArtifact from an endpoint, repository, a tag or digest, and a credential :param endpoint: An ACR endpoint :type endpoint: str :param repository: The name of a repository :type repository: str + :param tag_or_digest: Tag or digest of the artifact + :type tag_or_digest: str :param credential: The credential with which to authenticate :type credential: :class:`~azure.core.credentials.TokenCredential` :returns: None @@ -56,12 +57,17 @@ def __init__(self, endpoint, repository, credential, **kwargs): if not endpoint.startswith("https://") and not endpoint.startswith("http://"): endpoint = "https://" + endpoint self._endpoint = endpoint + self._credential = credential self.repository = repository - super(ContainerRepositoryClient, self).__init__(endpoint=self._endpoint, credential=credential, **kwargs) + self.tag_or_digest = tag_or_digest + self.fully_qualified_name = self._endpoint + self.repository + self.tag_or_digest + self._digest = None + self._tag = None + super(RegistryArtifact, self).__init__(endpoint=self._endpoint, credential=credential, **kwargs) - def _get_digest_from_tag(self, tag): + def _get_digest_from_tag(self): # type: (str) -> str - tag_props = self.get_tag_properties(tag) + tag_props = self.get_tag_properties(self.tag_or_digest) return tag_props.digest @distributed_trace @@ -88,30 +94,6 @@ def delete(self, **kwargs): self._client.container_registry.delete_repository(self.repository, **kwargs) ) - @distributed_trace - def delete_registry_artifact(self, digest, **kwargs): - # type: (str, Dict[str, Any]) -> None - """Delete a registry artifact - - :param digest: The digest of the artifact to be deleted - :type digest: str - :returns: None - :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` - - Example - - .. code-block:: python - - 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_registry_artifacts(): - client.delete_registry_artifact(artifact.digest) - """ - self._client.container_registry.delete_manifest(self.repository, digest, **kwargs) - @distributed_trace def delete_tag(self, tag, **kwargs): # type: (str, Dict[str, Any]) -> None @@ -136,42 +118,10 @@ def delete_tag(self, tag, **kwargs): self._client.container_registry.delete_tag(self.repository, tag, **kwargs) @distributed_trace - def get_properties(self, **kwargs): - # type: (Dict[str, Any]) -> RepositoryProperties - """Get the properties of a repository - - :returns: :class:`~azure.containerregistry.RepositoryProperties` - :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` - - Example - - .. code-block:: python - - from azure.containerregistry import ContainerRepositoryClient - from azure.identity import DefaultAzureCredential - - account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] - client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) - repository_properties = client.get_properties() - print(repository_properties.name) - print(repository_properties.content_permissions) - print(repository_properties.created_on) - print(repository_properties.last_updated_on) - print(repository_properties.manifest_count) - print(repository_properties.registry) - print(repository_properties.tag_count) - """ - return RepositoryProperties._from_generated( # pylint: disable=protected-access - self._client.container_registry.get_properties(self.repository, **kwargs) - ) - - @distributed_trace - def get_registry_artifact_properties(self, tag_or_digest, **kwargs): + def get_manifest_properties(self, **kwargs): # type: (str, Dict[str, Any]) -> ArtifactManifestProperties """Get the properties of a registry artifact - :param tag_or_digest: The tag/digest of a registry artifact - :type tag_or_digest: str :returns: :class:`~azure.containerregistry.ArtifactManifestProperties` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` @@ -187,12 +137,12 @@ def get_registry_artifact_properties(self, tag_or_digest, **kwargs): for artifact in client.list_registry_artifacts(): properties = client.get_registry_artifact_properties(artifact.digest) """ - if _is_tag(tag_or_digest): - tag_or_digest = self._get_digest_from_tag(tag_or_digest) + if not self._digest: + self._digest = self.tag_or_digest if not _is_tag(self.tag_or_digest) else self._get_digest_from_tag() return ArtifactManifestProperties._from_generated( # pylint: disable=protected-access - self._client.container_registry.get_manifest_properties(self.repository, tag_or_digest, **kwargs), - repository=self.repository + self._client.container_registry.get_manifest_properties(self.repository, self._digest, **kwargs), + repository_name=self.repository, ) @distributed_trace @@ -222,136 +172,6 @@ def get_tag_properties(self, tag, **kwargs): repository=self.repository, ) - @distributed_trace - def list_registry_artifacts(self, **kwargs): - # type: (Dict[str, Any]) -> ItemPaged[ArtifactManifestProperties] - """List the artifacts for a repository - - :keyword last: Query parameter for the last item in the previous call. Ensuing - call will return values after last lexically - :paramtype last: str - :keyword order_by: Query parameter for ordering by time ascending or descending - :paramtype order_by: :class:`~azure.containerregistry.ManifestOrderBy` - :keyword results_per_page: Number of repositories to return per page - :paramtype results_per_page: int - :return: ItemPaged[:class:`ArtifactManifestProperties`] - :rtype: :class:`~azure.core.paging.ItemPaged` - :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` - - Example - - .. code-block:: python - - 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_registry_artifacts(): - print(artifact.digest) - """ - name = self.repository - last = kwargs.pop("last", None) - n = kwargs.pop("results_per_page", None) - orderby = kwargs.pop("order_by", None) - cls = kwargs.pop( - "cls", - lambda objs: [ - ArtifactManifestProperties._from_generated(x, repository=self.repository) for x in objs # pylint: disable=protected-access - ], - ) - - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop("error_map", {})) - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters["Accept"] = self._client._serialize.header( # pylint: disable=protected-access - "accept", accept, "str" - ) - - if not next_link: - # Construct URL - url = "/acr/v1/{name}/_manifests" - path_format_arguments = { - "url": self._client._serialize.url( # pylint: disable=protected-access - "self._client._config.url", - self._client._config.url, # pylint: disable=protected-access - "str", - skip_quote=True, - ), - "name": self._client._serialize.url("name", name, "str"), # pylint: disable=protected-access - } - url = self._client._client.format_url(url, **path_format_arguments) # pylint: disable=protected-access - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if last is not None: - query_parameters["last"] = self._client._serialize.query( # pylint: disable=protected-access - "last", last, "str" - ) - if n is not None: - query_parameters["n"] = self._client._serialize.query( # pylint: disable=protected-access - "n", n, "int" - ) - if orderby is not None: - query_parameters["orderby"] = self._client._serialize.query( # pylint: disable=protected-access - "orderby", orderby, "str" - ) - - request = self._client._client.get( # pylint: disable=protected-access - url, query_parameters, header_parameters - ) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - path_format_arguments = { - "url": self._client._serialize.url( # pylint: disable=protected-access - "self._client._config.url", - self._client._config.url, # pylint: disable=protected-access - "str", - skip_quote=True, - ), - "name": self._client._serialize.url("name", name, "str"), # pylint: disable=protected-access - } - url = self._client._client.format_url(url, **path_format_arguments) # pylint: disable=protected-access - request = self._client._client.get( # pylint: disable=protected-access - url, query_parameters, header_parameters - ) - return request - - def extract_data(pipeline_response): - deserialized = self._client._deserialize( # pylint: disable=protected-access - "AcrManifests", pipeline_response - ) - list_of_elem = deserialized.manifests - if cls: - list_of_elem = cls(list_of_elem) - link = None - if "Link" in pipeline_response.http_response.headers.keys(): - link = _parse_next_link(pipeline_response.http_response.headers["Link"]) - return link, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._client._deserialize.failsafe_deserialize( # pylint: disable=protected-access - AcrErrors, response - ) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - @distributed_trace def list_tags(self, **kwargs): # type: (Dict[str, Any]) -> ItemPaged[ArtifactTagProperties] @@ -361,7 +181,7 @@ def list_tags(self, **kwargs): call will return values after last lexically :paramtype last: str :keyword order_by: Query parameter for ordering by time ascending or descending - :paramtype order_by: :class:`~azure.containerregistry.TagOrderBy` + :paramtype order_by: :class:`~azure.containerregistry.TagOrder` or str :keyword results_per_page: Number of repositories to return per page :paramtype results_per_page: int :return: ItemPaged[:class:`~azure.containerregistry.ArtifactTagProperties`] @@ -487,12 +307,10 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def set_manifest_properties(self, digest, permissions, **kwargs): + def set_manifest_properties(self, permissions, **kwargs): # type: (str, ContentProperties, Dict[str, Any]) -> ArtifactManifestProperties """Set the properties for a manifest - :param digest: Digest of a manifest - :type digest: str :param permissions: The property's values to be set :type permissions: ContentProperties :returns: :class:`~azure.containerregistry.ArtifactManifestProperties` @@ -518,11 +336,17 @@ def set_manifest_properties(self, digest, permissions, **kwargs): ), ) """ + if not self._digest: + self._digest = self.tag_or_digest if _is_tag(self.tag_or_digest) else self._get_digest_from_tag() + return ArtifactManifestProperties._from_generated( # pylint: disable=protected-access self._client.container_registry.update_manifest_properties( - self.repository, digest, value=permissions._to_generated(), **kwargs # pylint: disable=protected-access + self.repository, + self._digest, + value=permissions._to_generated(), # pylint: disable=protected-access + **kwargs ), - repository=self.repository + repository_name=self.repository, ) @distributed_trace diff --git a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/__init__.py b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/__init__.py index 7ea2cd7e2883..5f880b144044 100644 --- a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/__init__.py +++ b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/__init__.py @@ -7,9 +7,7 @@ # -------------------------------------------------------------------------- from ._async_container_registry_client import ContainerRegistryClient -from ._async_container_repository_client import ContainerRepositoryClient +from ._async_container_repository import ContainerRepository +from ._async_registry_artifact import RegistryArtifact -__all__ = [ - "ContainerRegistryClient", - "ContainerRepositoryClient", -] +__all__ = ["ContainerRegistryClient", "ContainerRepository", "RegistryArtifact"] diff --git a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_base_client.py b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_base_client.py index 19377c31105d..94215e38d0e8 100644 --- a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_base_client.py +++ b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_base_client.py @@ -22,7 +22,7 @@ class ContainerRegistryApiVersion(str, Enum): class ContainerRegistryBaseClient(object): - """Base class for ContainerRegistryClient and ContainerRepositoryClient + """Base class for ContainerRegistryClient, ContainerRepository, and RegistryArtifact :param endpoint: Azure Container Registry endpoint :type endpoint: str diff --git a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_container_registry_client.py b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_container_registry_client.py index f9d5f7284462..86cf0ffc6ee4 100644 --- a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_container_registry_client.py +++ b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_container_registry_client.py @@ -18,9 +18,10 @@ from azure.core.tracing.decorator_async import distributed_trace_async from ._async_base_client import ContainerRegistryBaseClient, AsyncTransportWrapper -from ._async_container_repository_client import ContainerRepositoryClient +from ._async_container_repository import ContainerRepository from .._generated.models import AcrErrors from .._helpers import _parse_next_link +from ._async_registry_artifact import RegistryArtifact from .._models import RepositoryProperties, DeleteRepositoryResult if TYPE_CHECKING: @@ -54,11 +55,10 @@ def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: super(ContainerRegistryClient, self).__init__(endpoint=endpoint, credential=credential, **kwargs) @distributed_trace_async - async def delete_repository(self, repository: str, **kwargs: Dict[str, Any]) -> DeleteRepositoryResult: + async def delete_repository(self, repository_name: str, **kwargs: Dict[str, Any]) -> DeleteRepositoryResult: """Delete a repository - :param repository: The repository to delete - :type repository: str + :param str repository_name: The repository to delete :returns: Object containing information about the deleted repository :rtype: :class:`~azure.containerregistry.DeleteRepositoryResult` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` @@ -72,11 +72,11 @@ async def delete_repository(self, repository: str, **kwargs: Dict[str, Any]) -> :dedent: 8 :caption: Delete a repository from the `ContainerRegistryClient` """ - result = await self._client.container_registry.delete_repository(repository, **kwargs) + result = await self._client.container_registry.delete_repository(repository_name, **kwargs) return DeleteRepositoryResult._from_generated(result) # pylint: disable=protected-access @distributed_trace - def list_repositories(self, **kwargs: Dict[str, Any]) -> AsyncItemPaged[str]: + def list_repository_names(self, **kwargs: Dict[str, Any]) -> AsyncItemPaged[str]: """List all repositories :keyword last: Query parameter for the last item in the previous call. Ensuing @@ -161,7 +161,7 @@ async def extract_data(pipeline_response): deserialized = self._client._deserialize( # pylint: disable=protected-access "Repositories", pipeline_response ) - list_of_elem = deserialized.repositories + list_of_elem = deserialized.repositories or [] if cls: list_of_elem = cls(list_of_elem) link = None @@ -189,12 +189,11 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_repository_client(self, repository: str, **kwargs: Dict[str, Any]) -> ContainerRepositoryClient: + def get_repository(self, repository_name: str, **kwargs: Any) -> ContainerRepository: """Get a repository client - :param repository: The repository to create a client for - :type repository: str - :returns: :class:`~azure.containerregistry.aio.ContainerRepositoryClient` + :param str repository_name: The repository to create a client for + :returns: :class:`~azure.containerregistry.aio.ContainerRepository` Example @@ -213,6 +212,28 @@ def get_repository_client(self, repository: str, **kwargs: Dict[str, Any]) -> Co ), policies=self._client._client._pipeline._impl_policies, # pylint: disable=protected-access ) - return ContainerRepositoryClient( - self._endpoint, repository, credential=self._credential, pipeline=_pipeline, **kwargs + return ContainerRepository( + self._endpoint, repository_name, credential=self._credential, pipeline=_pipeline, **kwargs + ) + + @distributed_trace + def get_artifact(self, repository_name: str, tag_or_digest: str, **kwargs: Dict[str, Any]) -> RegistryArtifact: + """Get a Registry Artifact object + + :param str repository_name: Name of the repository + :param str tag_or_digest: The tag or digest of the artifact + :returns: :class:`~azure.containerregistry.RegistryArtifact` + :raises: None + """ + _pipeline = AsyncPipeline( + transport=AsyncTransportWrapper(self._client._client._pipeline._transport), # pylint: disable=protected-access + policies=self._client._client._pipeline._impl_policies, # pylint: disable=protected-access + ) + return RegistryArtifact( + self._endpoint, + repository_name, + tag_or_digest, + self._credential, + pipeline=_pipeline, + **kwargs ) diff --git a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_container_repository.py b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_container_repository.py new file mode 100644 index 000000000000..96a863c92969 --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_container_repository.py @@ -0,0 +1,228 @@ +# coding=utf-8 +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +from typing import TYPE_CHECKING, Dict, Any + +from azure.core.exceptions import ( + ClientAuthenticationError, + ResourceNotFoundError, + ResourceExistsError, + HttpResponseError, + map_error, +) +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.pipeline import AsyncPipeline +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async + +from ._async_base_client import ContainerRegistryBaseClient, AsyncTransportWrapper +from .._generated.models import AcrErrors +from .._helpers import _parse_next_link +from .._models import ( + ContentProperties, + DeleteRepositoryResult, + ArtifactManifestProperties, + RepositoryProperties, + ArtifactTagProperties, +) +from ._async_registry_artifact import RegistryArtifact + +if TYPE_CHECKING: + from azure.core.credentials_async import AsyncTokenCredential + + +class ContainerRepository(ContainerRegistryBaseClient): + def __init__( + self, endpoint: str, name: str, credential: "AsyncTokenCredential", **kwargs: Dict[str, Any] + ) -> None: + """Create a ContainerRepository from an endpoint, repository name, and credential + + :param str endpoint: An ACR endpoint + :param str name: The name of a repository + :param credential: The credential with which to authenticate + :type credential: :class:`~azure.core.credentials_async.AsyncTokenCredential` + :returns: None + :raises: None + """ + if not endpoint.startswith("https://") and not endpoint.startswith("http://"): + endpoint = "https://" + endpoint + self._endpoint = endpoint + self._credential = credential + self.name = name + self.fully_qualified_name = self._endpoint + self.name + super(ContainerRepository, self).__init__(endpoint=self._endpoint, credential=credential, **kwargs) + + @distributed_trace_async + async def delete(self, **kwargs: Dict[str, Any]) -> DeleteRepositoryResult: + """Delete a repository + + :returns: Object containing information about the deleted repository + :rtype: :class:`~azure.containerregistry.DeleteRepositoryResult` + :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + """ + return DeleteRepositoryResult._from_generated( # pylint: disable=protected-access + await self._client.container_registry.delete_repository(self.name, **kwargs) + ) + + @distributed_trace_async + async def get_properties(self, **kwargs: Dict[str, Any]) -> RepositoryProperties: + """Get the properties of a repository + + :returns: :class:`~azure.containerregistry.RepositoryProperties` + :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + """ + return RepositoryProperties._from_generated( # pylint: disable=protected-access + await self._client.container_registry.get_properties(self.name, **kwargs) + ) + + @distributed_trace + def list_manifests(self, **kwargs: Dict[str, Any]) -> AsyncItemPaged[ArtifactManifestProperties]: + """List the artifacts for a repository + + :keyword last: Query parameter for the last item in the previous call. Ensuing + call will return values after last lexically + :paramtype last: str + :keyword order_by: Query parameter for ordering by time ascending or descending + :paramtype order_by: :class:`~azure.containerregistry.ManifestOrder` + :keyword results_per_page: Number of repositories to return per page + :paramtype results_per_page: int + :return: ItemPaged[:class:`~azure.containerregistry.ArtifactManifestProperties`] + :rtype: :class:`~azure.core.async_paging.AsyncItemPaged` + :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + """ + name = self.name + last = kwargs.pop("last", None) + n = kwargs.pop("results_per_page", None) + orderby = kwargs.pop("order_by", None) + cls = kwargs.pop( + "cls", + lambda objs: [ + ArtifactManifestProperties._from_generated(x, repository_name=self.name) # pylint: disable=protected-access + for x in objs + ], + ) + + error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop("error_map", {})) + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters["Accept"] = self._client._serialize.header( # pylint: disable=protected-access + "accept", accept, "str" + ) + + if not next_link: + # Construct URL + url = "/acr/v1/{name}/_manifests" + path_format_arguments = { + "url": self._client._serialize.url( # pylint: disable=protected-access + "self._client._config.url", + self._client._config.url, # pylint: disable=protected-access + "str", + skip_quote=True, + ), + "name": self._client._serialize.url("name", name, "str"), # pylint: disable=protected-access + } + url = self._client._client.format_url(url, **path_format_arguments) # pylint: disable=protected-access + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if last is not None: + query_parameters["last"] = self._client._serialize.query( # pylint: disable=protected-access + "last", last, "str" + ) + if n is not None: + query_parameters["n"] = self._client._serialize.query( # pylint: disable=protected-access + "n", n, "int" + ) + if orderby is not None: + query_parameters["orderby"] = self._client._serialize.query( # pylint: disable=protected-access + "orderby", orderby, "str" + ) + + request = self._client._client.get( # pylint: disable=protected-access + url, query_parameters, header_parameters + ) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + path_format_arguments = { + "url": self._client._serialize.url( # pylint: disable=protected-access + "self._client._config.url", + self._client._config.url, # pylint: disable=protected-access + "str", + skip_quote=True, + ), + "name": self._client._serialize.url("name", name, "str"), # pylint: disable=protected-access + } + url = self._client._client.format_url(url, **path_format_arguments) # pylint: disable=protected-access + request = self._client._client.get( # pylint: disable=protected-access + url, query_parameters, header_parameters + ) + return request + + async def extract_data(pipeline_response): + deserialized = self._client._deserialize( # pylint: disable=protected-access + "AcrManifests", pipeline_response + ) + list_of_elem = deserialized.manifests + if cls: + list_of_elem = cls(list_of_elem) + link = None + if "Link" in pipeline_response.http_response.headers.keys(): + link = _parse_next_link(pipeline_response.http_response.headers["Link"]) + return link, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._client._deserialize.failsafe_deserialize( # pylint: disable=protected-access + AcrErrors, response + ) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def set_properties(self, properties: ContentProperties, **kwargs: Dict[str, Any]) -> RepositoryProperties: + """Set the properties of a repository + + :returns: :class:`~azure.containerregistry.RepositoryProperties` + :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + """ + return RepositoryProperties._from_generated( # pylint: disable=protected-access + await self._client.container_registry.set_properties( + self.name, properties._to_generated(), **kwargs # pylint: disable=protected-access + ) + ) + + @distributed_trace + def get_artifact(self, tag_or_digest: str, **kwargs: Dict[str, Any]) -> RegistryArtifact: + """Get a Registry Artifact object + + :param str repository_name: Name of the repository + :param str tag_or_digest: The tag or digest of the artifact + :returns: :class:`~azure.containerregistry.RegistryArtifact` + :raises: None + """ + _pipeline = AsyncPipeline( + transport=AsyncTransportWrapper( + self._client._client._pipeline._transport # pylint: disable=protected-access + ), + policies=self._client._client._pipeline._impl_policies, # pylint: disable=protected-access + ) + return RegistryArtifact( + self._endpoint, self.name, tag_or_digest, self._credential, pipeline=_pipeline, **kwargs + ) diff --git a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_container_repository_client.py b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_registry_artifact.py similarity index 60% rename from sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_container_repository_client.py rename to sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_registry_artifact.py index 47b50ba0b992..d946628a2571 100644 --- a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_container_repository_client.py +++ b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_registry_artifact.py @@ -23,7 +23,6 @@ DeleteRepositoryResult, ContentProperties, ArtifactManifestProperties, - RepositoryProperties, ArtifactTagProperties, ) @@ -31,18 +30,25 @@ from azure.core.credentials_async import AsyncTokenCredential -class ContainerRepositoryClient(ContainerRegistryBaseClient): +class RegistryArtifact(ContainerRegistryBaseClient): def __init__( - self, endpoint: str, repository: str, credential: "AsyncTokenCredential", **kwargs: Dict[str, Any] + self, + endpoint: str, + repository: str, + tag_or_digest: str, + credential: "AsyncTokenCredential", + **kwargs: Dict[str, Any] ) -> None: - """Create a ContainerRepositoryClient from an endpoint, repository name, and credential + """Create a RegistryArtifact from an endpoint, repository, a tag or digest, and a credential :param endpoint: An ACR endpoint :type endpoint: str :param repository: The name of a repository :type repository: str + :param tag_or_digest: Tag or digest of the artifact + :type tag_or_digest: str :param credential: The credential with which to authenticate - :type credential: :class:`~azure.core.credentials_async.AsyncTokenCredential` + :type credential: :class:`~azure.core.credentials.TokenCredential` :returns: None :raises: None @@ -60,10 +66,14 @@ def __init__( self._endpoint = endpoint self._credential = credential self.repository = repository - super(ContainerRepositoryClient, self).__init__(endpoint=self._endpoint, credential=credential, **kwargs) - - async def _get_digest_from_tag(self, tag: str) -> None: - tag_props = await self.get_tag_properties(tag) + self.tag_or_digest = tag_or_digest + self.fully_qualified_name = self._endpoint + self.repository + self.tag_or_digest + self._digest = None + self._tag = None + super(RegistryArtifact, self).__init__(endpoint=self._endpoint, credential=credential, **kwargs) + + async def _get_digest_from_tag(self) -> str: + tag_props = await self.get_tag_properties(self.tag_or_digest) return tag_props.digest @distributed_trace_async @@ -89,29 +99,6 @@ async def delete(self, **kwargs: Dict[str, Any]) -> DeleteRepositoryResult: await self._client.container_registry.delete_repository(self.repository, **kwargs) ) - @distributed_trace_async - async def delete_registry_artifact(self, digest: str, **kwargs: Dict[str, Any]) -> None: - """Delete a registry artifact - - :param digest: The digest of the artifact to be deleted - :type digest: str - :returns: None - :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` - - Example - - .. code-block:: python - - 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_registry_artifacts(): - await client.delete_registry_artifact(artifact.digest) - """ - await self._client.container_registry.delete_manifest(self.repository, digest, **kwargs) - @distributed_trace_async async def delete_tag(self, tag: str, **kwargs: Dict[str, Any]) -> None: """Delete a tag from a repository @@ -135,42 +122,9 @@ async def delete_tag(self, tag: str, **kwargs: Dict[str, Any]) -> None: await self._client.container_registry.delete_tag(self.repository, tag, **kwargs) @distributed_trace_async - async def get_properties(self, **kwargs: Dict[str, Any]) -> RepositoryProperties: - """Get the properties of a repository - - :returns: :class:`~azure.containerregistry.RepositoryProperties` - :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` - - Example - - .. code-block:: python - - 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()) - repository_properties = await client.get_properties() - print(repository_properties.name) - print(repository_properties.content_permissions) - print(repository_properties.created_on) - print(repository_properties.last_updated_on) - print(repository_properties.manifest_count) - print(repository_properties.registry) - print(repository_properties.tag_count) - """ - return RepositoryProperties._from_generated( # pylint: disable=protected-access - await self._client.container_registry.get_properties(self.repository, **kwargs) - ) - - @distributed_trace_async - async def get_registry_artifact_properties( - self, tag_or_digest: str, **kwargs: Dict[str, Any] - ) -> ArtifactManifestProperties: + async def get_manifest_properties(self, **kwargs: Dict[str, Any]) -> ArtifactManifestProperties: """Get the properties of a registry artifact - :param tag_or_digest: The tag/digest of a registry artifact - :type tag_or_digest: str :returns: :class:`~azure.containerregistry.ArtifactManifestProperties` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` @@ -186,12 +140,12 @@ async def get_registry_artifact_properties( async for artifact in client.list_registry_artifacts(): properties = await client.get_registry_artifact_properties(artifact.digest) """ - if _is_tag(tag_or_digest): - tag_or_digest = self._get_digest_from_tag(tag_or_digest) + if not self._digest: + self._digest = self.tag_or_digest if not _is_tag(self.tag_or_digest) else await self._get_digest_from_tag() return ArtifactManifestProperties._from_generated( # pylint: disable=protected-access - await self._client.container_registry.get_manifest_properties(self.repository, tag_or_digest, **kwargs), - repository=self.repository + await self._client.container_registry.get_manifest_properties(self.repository, self._digest, **kwargs), + repository_name=self.repository, ) @distributed_trace_async @@ -216,139 +170,9 @@ async def get_tag_properties(self, tag: str, **kwargs: Dict[str, Any]) -> Artifa tag_properties = await client.get_tag_properties(tag.name) """ return ArtifactTagProperties._from_generated( # pylint: disable=protected-access - await self._client.container_registry.get_tag_properties(self.repository, tag, **kwargs), - repository=self.repository, - ) - - @distributed_trace - def list_registry_artifacts(self, **kwargs: Dict[str, Any]) -> AsyncItemPaged[ArtifactManifestProperties]: - """List the artifacts for a repository - - :keyword last: Query parameter for the last item in the previous call. Ensuing - call will return values after last lexically - :paramtype last: str - :keyword order_by: Query parameter for ordering by time ascending or descending - :paramtype order_by: :class:`~azure.containerregistry.ManifestOrderBy` - :keyword results_per_page: Number of repositories to return per page - :paramtype results_per_page: int - :return: ItemPaged[:class:`~azure.containerregistry.ArtifactManifestProperties`] - :rtype: :class:`~azure.core.async_paging.AsyncItemPaged` - :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` - - Example - - .. code-block:: python - - 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_registry_artifacts(): - print(artifact.digest) - """ - name = self.repository - last = kwargs.pop("last", None) - n = kwargs.pop("results_per_page", None) - orderby = kwargs.pop("order_by", None) - cls = kwargs.pop( - "cls", - lambda objs: [ - ArtifactManifestProperties._from_generated(x, repository=self.repository) for x in objs # pylint: disable=protected-access - ], + await self._client.container_registry.get_tag_properties(self.repository, tag, **kwargs) ) - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} - error_map.update(kwargs.pop("error_map", {})) - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters["Accept"] = self._client._serialize.header( # pylint: disable=protected-access - "accept", accept, "str" - ) - - if not next_link: - # Construct URL - url = "/acr/v1/{name}/_manifests" - path_format_arguments = { - "url": self._client._serialize.url( # pylint: disable=protected-access - "self._client._config.url", - self._client._config.url, # pylint: disable=protected-access - "str", - skip_quote=True, - ), - "name": self._client._serialize.url("name", name, "str"), # pylint: disable=protected-access - } - url = self._client._client.format_url(url, **path_format_arguments) # pylint: disable=protected-access - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if last is not None: - query_parameters["last"] = self._client._serialize.query( # pylint: disable=protected-access - "last", last, "str" - ) - if n is not None: - query_parameters["n"] = self._client._serialize.query( # pylint: disable=protected-access - "n", n, "int" - ) - if orderby is not None: - query_parameters["orderby"] = self._client._serialize.query( # pylint: disable=protected-access - "orderby", orderby, "str" - ) - - request = self._client._client.get( # pylint: disable=protected-access - url, query_parameters, header_parameters - ) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - path_format_arguments = { - "url": self._client._serialize.url( # pylint: disable=protected-access - "self._client._config.url", - self._client._config.url, # pylint: disable=protected-access - "str", - skip_quote=True, - ), - "name": self._client._serialize.url("name", name, "str"), # pylint: disable=protected-access - } - url = self._client._client.format_url(url, **path_format_arguments) # pylint: disable=protected-access - request = self._client._client.get( # pylint: disable=protected-access - url, query_parameters, header_parameters - ) - return request - - async def extract_data(pipeline_response): - deserialized = self._client._deserialize( # pylint: disable=protected-access - "AcrManifests", pipeline_response - ) - list_of_elem = deserialized.manifests - if cls: - list_of_elem = cls(list_of_elem) - link = None - if "Link" in pipeline_response.http_response.headers.keys(): - link = _parse_next_link(pipeline_response.http_response.headers["Link"]) - return link, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._client._deserialize.failsafe_deserialize( # pylint: disable=protected-access - AcrErrors, response - ) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - @distributed_trace def list_tags(self, **kwargs: Dict[str, Any]) -> AsyncItemPaged[ArtifactTagProperties]: """List the tags for a repository @@ -357,7 +181,7 @@ def list_tags(self, **kwargs: Dict[str, Any]) -> AsyncItemPaged[ArtifactTagPrope call will return values after last lexically :paramtype last: str :keyword order_by: Query parameter for ordering by time ascending or descending - :paramtype order_by: :class:`~azure.containerregistry.TagOrderBy` + :paramtype order_by: :class:`~azure.containerregistry.TagOrder` or str :keyword results_per_page: Number of repositories to return per page :paramtype results_per_page: int :return: ItemPaged[:class:`~azure.containerregistry.ArtifactTagProperties`] @@ -484,12 +308,10 @@ async def get_next(next_link=None): @distributed_trace_async async def set_manifest_properties( - self, digest: str, permissions: ContentProperties, **kwargs: Dict[str, Any] - ) -> None: + self, permissions: ContentProperties, **kwargs: Dict[str, Any] + ) -> ArtifactManifestProperties: """Set the properties for a manifest - :param digest: Digest of a manifest - :type digest: str :param permissions: The property's values to be set :type permissions: ContentProperties :returns: :class:`~azure.containerregistry.ArtifactManifestProperties` @@ -515,11 +337,17 @@ async def set_manifest_properties( ), ) """ + if not self._digest: + self._digest = self.tag_or_digest if _is_tag(self.tag_or_digest) else self._get_digest_from_tag() + return ArtifactManifestProperties._from_generated( # pylint: disable=protected-access await self._client.container_registry.update_manifest_properties( - self.repository, digest, value=permissions._to_generated(), **kwargs # pylint: disable=protected-access + self.repository, + self._digest, + value=permissions._to_generated(), # pylint: disable=protected-access + **kwargs ), - repository=self.repository + repository_name=self.repository, ) @distributed_trace_async diff --git a/sdk/containerregistry/azure-containerregistry/samples/async_samples/sample_create_client_async.py b/sdk/containerregistry/azure-containerregistry/samples/async_samples/sample_create_client_async.py index 21b26d35094b..2d2ea9477eae 100644 --- a/sdk/containerregistry/azure-containerregistry/samples/async_samples/sample_create_client_async.py +++ b/sdk/containerregistry/azure-containerregistry/samples/async_samples/sample_create_client_async.py @@ -10,7 +10,7 @@ FILE: sample_create_client_async.py DESCRIPTION: - These samples demonstrate creating a ContainerRegistryClient and a ContainerRepositoryClient + These samples demonstrate creating a ContainerRegistryClient and a ContainerRepository USAGE: python sample_create_client_async.py @@ -41,10 +41,10 @@ async def create_registry_client(self): async def create_repository_client(self): # Instantiate the ContainerRegistryClient # [START create_repository_client] - from azure.containerregistry.aio import ContainerRepositoryClient + from azure.containerregistry.aio import ContainerRepository from azure.identity.aio import DefaultAzureCredential - client = ContainerRepositoryClient(self.account_url, "my_repository", DefaultAzureCredential()) + client = ContainerRepository(self.account_url, "my_repository", DefaultAzureCredential()) # [END create_repository_client] async def basic_sample(self): @@ -56,10 +56,10 @@ async def basic_sample(self): client = ContainerRegistryClient(self.account_url, DefaultAzureCredential()) async with client: # Iterate through all the repositories - async for repository_name in client.list_repositories(): + async for repository_name in client.list_repository_names(): if repository_name == "hello-world": # Create a repository client from the registry client - repository_client = client.get_repository_client(repository_name) + repository_client = client.get_repository(repository_name) async with repository_client: # Show all tags diff --git a/sdk/containerregistry/azure-containerregistry/samples/async_samples/sample_delete_old_tags_async.py b/sdk/containerregistry/azure-containerregistry/samples/async_samples/sample_delete_old_tags_async.py index 4c6b789f4eec..c3f5a1e0653c 100644 --- a/sdk/containerregistry/azure-containerregistry/samples/async_samples/sample_delete_old_tags_async.py +++ b/sdk/containerregistry/azure-containerregistry/samples/async_samples/sample_delete_old_tags_async.py @@ -30,7 +30,7 @@ def __init__(self): self.account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] async def delete_old_tags(self): - from azure.containerregistry import TagOrderBy + from azure.containerregistry import TagOrder from azure.containerregistry.aio import ( ContainerRegistryClient, ContainerRepositoryClient, @@ -48,7 +48,7 @@ async def delete_old_tags(self): # [START list_tags] tag_count = 0 - async for tag in repository_client.list_tags(order_by=TagOrderBy.LAST_UPDATE_TIME_DESCENDING): + async for tag in repository_client.list_tags(order_by=TagOrder.LAST_UPDATE_TIME_DESCENDING): tag_count += 1 if tag_count > 3: await repository_client.delete_tag(tag.name) diff --git a/sdk/containerregistry/azure-containerregistry/samples/sample_create_client.py b/sdk/containerregistry/azure-containerregistry/samples/sample_create_client.py index 1ce7cf38438d..72a8b9daad8c 100644 --- a/sdk/containerregistry/azure-containerregistry/samples/sample_create_client.py +++ b/sdk/containerregistry/azure-containerregistry/samples/sample_create_client.py @@ -10,7 +10,7 @@ FILE: sample_create_client.py DESCRIPTION: - These samples demonstrate creating a ContainerRegistryClient and a ContainerRepositoryClient + These samples demonstrate creating a ContainerRegistryClient and a ContainerRepository USAGE: python sample_create_client.py @@ -40,10 +40,10 @@ def create_registry_client(self): def create_repository_client(self): # Instantiate the ContainerRegistryClient # [START create_repository_client] - from azure.containerregistry import ContainerRepositoryClient + from azure.containerregistry import ContainerRepository from azure.identity import DefaultAzureCredential - client = ContainerRepositoryClient(self.account_url, "my_repository", DefaultAzureCredential()) + client = ContainerRepository(self.account_url, "my_repository", DefaultAzureCredential()) # [END create_repository_client] def basic_sample(self): @@ -55,10 +55,10 @@ def basic_sample(self): client = ContainerRegistryClient(self.account_url, DefaultAzureCredential()) with client: # Iterate through all the repositories - for repository_name in client.list_repositories(): + for repository_name in client.list_repository_names(): if repository_name == "hello-world": # Create a repository client from the registry client - repository_client = client.get_repository_client(repository_name) + repository_client = client.get_repository(repository_name) with repository_client: # Show all tags diff --git a/sdk/containerregistry/azure-containerregistry/samples/sample_delete_old_tags.py b/sdk/containerregistry/azure-containerregistry/samples/sample_delete_old_tags.py index 521c25fcb4bd..89e141f3a917 100644 --- a/sdk/containerregistry/azure-containerregistry/samples/sample_delete_old_tags.py +++ b/sdk/containerregistry/azure-containerregistry/samples/sample_delete_old_tags.py @@ -32,7 +32,7 @@ def delete_old_tags(self): from azure.containerregistry import ( ContainerRegistryClient, ContainerRepositoryClient, - TagOrderBy + TagOrder ) from azure.identity import DefaultAzureCredential @@ -47,7 +47,7 @@ def delete_old_tags(self): # [START list_tags] tag_count = 0 - for tag in repository_client.list_tags(order_by=TagOrderBy.LAST_UPDATE_TIME_DESCENDING): + for tag in repository_client.list_tags(order_by=TagOrder.LAST_UPDATE_TIME_DESCENDING): tag_count += 1 if tag_count > 3: repository_client.delete_tag(tag.name) diff --git a/sdk/containerregistry/azure-containerregistry/tests/asynctestcase.py b/sdk/containerregistry/azure-containerregistry/tests/asynctestcase.py index a99efe5c66bc..a0c63deb6143 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/asynctestcase.py +++ b/sdk/containerregistry/azure-containerregistry/tests/asynctestcase.py @@ -4,7 +4,7 @@ # Licensed under the MIT License. # ------------------------------------ from azure.containerregistry.aio import ( - ContainerRepositoryClient, + ContainerRepository, ContainerRegistryClient, ) @@ -42,10 +42,10 @@ def create_registry_client(self, endpoint, **kwargs): **kwargs, ) - def create_repository_client(self, endpoint, name, **kwargs): - return ContainerRepositoryClient( + def create_container_repository(self, endpoint, name, **kwargs): + return ContainerRepository( endpoint=endpoint, - repository=name, + name=name, credential=self.get_credential(), **kwargs, ) diff --git a/sdk/containerregistry/azure-containerregistry/tests/conftest.py b/sdk/containerregistry/azure-containerregistry/tests/conftest.py index 242a058af9da..c29ec3831836 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/conftest.py +++ b/sdk/containerregistry/azure-containerregistry/tests/conftest.py @@ -15,7 +15,6 @@ if sys.version_info < (3, 5): collect_ignore_glob.append("*_async.py") + def pytest_configure(config): - config.addinivalue_line( - "usefixtures", "load_registry" - ) + config.addinivalue_line("usefixtures", "load_registry") diff --git a/sdk/containerregistry/azure-containerregistry/tests/preparer.py b/sdk/containerregistry/azure-containerregistry/tests/preparer.py index aeefbdfd6713..3e1252124671 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/preparer.py +++ b/sdk/containerregistry/azure-containerregistry/tests/preparer.py @@ -5,7 +5,7 @@ # ------------------------------------ import functools -from devtools_testutils import AzureTestCase, PowerShellPreparer +from devtools_testutils import PowerShellPreparer acr_preparer = functools.partial( PowerShellPreparer, diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client.test_list_repositories_by_page.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client.test_list_repositories_by_page.yaml index adadddc874f9..0e7e2f6238a7 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client.test_list_repositories_by_page.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client.test_list_repositories_by_page.yaml @@ -1544,7 +1544,7 @@ interactions: uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repoc7611808&n=2&orderby= response: body: - string: '{"repositories": ["repod2be1c42", "repoeb7113db"]}' + string: '{"repositories": ["repo34ab0fa1", "repo3c82158b"]}' headers: access-control-expose-headers: - Docker-Content-Digest diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_list_tags_by_page.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client.test_list_repository_names.yaml similarity index 80% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_list_tags_by_page.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client.test_list_repository_names.yaml index 99cf5d370f1e..b86fcc582b17 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_list_tags_by_page.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client.test_list_repository_names.yaml @@ -11,12 +11,12 @@ interactions: User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: GET - uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_tags?n=2 + uri: https://fake_url.azurecr.io/acr/v1/_catalog response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": - "repository", "Name": "library/busybox", "Action": "metadata_read"}]}]}' + "registry", "Name": "catalog", "Action": "*"}]}]}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -26,11 +26,11 @@ interactions: connection: - keep-alive content-length: - - '218' + - '196' content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:05:54 GMT + - Wed, 28 Apr 2021 21:16:02 GMT docker-distribution-api-version: - registry/2.0 server: @@ -71,7 +71,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:05:55 GMT + - Wed, 28 Apr 2021 21:16:03 GMT server: - openresty strict-transport-security: @@ -79,12 +79,12 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '166.616667' + - '166.3' status: code: 200 message: OK - request: - body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Alibrary%2Fbusybox%3Ametadata_read&refresh_token=REDACTED + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=registry%3Acatalog%3A%2A&refresh_token=REDACTED headers: Accept: - application/json @@ -93,7 +93,7 @@ interactions: Connection: - keep-alive Content-Length: - - '1085' + - '1063' Content-Type: - application/x-www-form-urlencoded User-Agent: @@ -109,7 +109,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:05:55 GMT + - Wed, 28 Apr 2021 21:16:04 GMT server: - openresty strict-transport-security: @@ -117,7 +117,7 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '166.6' + - '166.133333' status: code: 200 message: OK @@ -133,14 +133,14 @@ interactions: User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: GET - uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_tags?n=2 + uri: https://fake_url.azurecr.io/acr/v1/_catalog response: body: - string: '{"registry": "fake_url.azurecr.io", "imageName": "library/busybox", - "tags": [{"name": "latest", "digest": "sha256:ae39a6f5c07297d7ab64dbd4f82c77c874cc6a94cea29fdec309d0992574b4f7", - "createdTime": "2021-04-13T15:11:15.3146514Z", "lastUpdateTime": "2021-04-13T15:11:15.3146514Z", - "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": - true, "readEnabled": true, "listEnabled": true}}]}' + string: '{"repositories": ["library/alpine", "library/busybox", "repo25ce0f5d", + "repo27331535", "repo28471541", "repo2c591564", "repo2e8319c5", "repo308e19dd", + "repo34ab0fa1", "repo3c82158b", "repo3db51597", "repo3e8d15a3", "repo84e316ff", + "repo8b5a11da", "repo9b321760", "repo9cb4121e", "repoaf9517b2", "repob0a917be", + "repob22512e7", "repoc1b5131a", "repoc28d1326", "repoc7611808"]}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -150,11 +150,11 @@ interactions: connection: - keep-alive content-length: - - '387' + - '354' content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:05:55 GMT + - Wed, 28 Apr 2021 21:16:04 GMT docker-distribution-api-version: - registry/2.0 server: diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client.test_list_repository_names_by_page.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client.test_list_repository_names_by_page.yaml new file mode 100644 index 000000000000..7abbeb945f4b --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client.test_list_repository_names_by_page.yaml @@ -0,0 +1,1574 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?n=2 + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '196' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:04 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=access_token&service=fake_url.azurecr.io&access_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1343' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:06 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.633333' + status: + code: 200 + message: OK +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=registry%3Acatalog%3A%2A&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1063' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:06 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.616667' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?n=2 + response: + body: + string: '{"repositories": ["library/alpine", "library/busybox"]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '54' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:06 GMT + docker-distribution-api-version: + - registry/2.0 + link: + - ; rel="next" + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=library%2Fbusybox&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '196' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:06 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=registry%3Acatalog%3A%2A&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1063' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:06 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.6' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=library%2Fbusybox&n=2&orderby= + response: + body: + string: '{"repositories": ["repo25ce0f5d", "repo27331535"]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '49' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:06 GMT + docker-distribution-api-version: + - registry/2.0 + link: + - ; rel="next" + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo27331535&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '196' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:06 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=registry%3Acatalog%3A%2A&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1063' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:07 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.583333' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo27331535&n=2&orderby= + response: + body: + string: '{"repositories": ["repo28471541", "repo2c591564"]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '49' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:07 GMT + docker-distribution-api-version: + - registry/2.0 + link: + - ; rel="next" + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo2c591564&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '196' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:07 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=registry%3Acatalog%3A%2A&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1063' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:07 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.566667' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo2c591564&n=2&orderby= + response: + body: + string: '{"repositories": ["repo2e8319c5", "repo308e19dd"]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '49' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:07 GMT + docker-distribution-api-version: + - registry/2.0 + link: + - ; rel="next" + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo308e19dd&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '196' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:07 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=registry%3Acatalog%3A%2A&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1063' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:07 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.55' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo308e19dd&n=2&orderby= + response: + body: + string: '{"repositories": ["repo34ab0fa1", "repo3c82158b"]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '49' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:08 GMT + docker-distribution-api-version: + - registry/2.0 + link: + - ; rel="next" + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo3c82158b&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '196' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:08 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=registry%3Acatalog%3A%2A&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1063' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:08 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.533333' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo3c82158b&n=2&orderby= + response: + body: + string: '{"repositories": ["repo3db51597", "repo3e8d15a3"]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '49' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:08 GMT + docker-distribution-api-version: + - registry/2.0 + link: + - ; rel="next" + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo3e8d15a3&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '196' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:08 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=registry%3Acatalog%3A%2A&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1063' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:08 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.516667' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo3e8d15a3&n=2&orderby= + response: + body: + string: '{"repositories": ["repo84e316ff", "repo8b5a11da"]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '49' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:09 GMT + docker-distribution-api-version: + - registry/2.0 + link: + - ; rel="next" + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo8b5a11da&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '196' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:09 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=registry%3Acatalog%3A%2A&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1063' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:09 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.5' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo8b5a11da&n=2&orderby= + response: + body: + string: '{"repositories": ["repo9b321760", "repo9cb4121e"]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '49' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:09 GMT + docker-distribution-api-version: + - registry/2.0 + link: + - ; rel="next" + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo9cb4121e&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '196' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:09 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=registry%3Acatalog%3A%2A&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1063' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:09 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.483333' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo9cb4121e&n=2&orderby= + response: + body: + string: '{"repositories": ["repoaf9517b2", "repob0a917be"]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '49' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:10 GMT + docker-distribution-api-version: + - registry/2.0 + link: + - ; rel="next" + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repob0a917be&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '196' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:10 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=registry%3Acatalog%3A%2A&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1063' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:10 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.466667' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repob0a917be&n=2&orderby= + response: + body: + string: '{"repositories": ["repob22512e7", "repoc1b5131a"]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '49' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:10 GMT + docker-distribution-api-version: + - registry/2.0 + link: + - ; rel="next" + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repoc1b5131a&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '196' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:10 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=registry%3Acatalog%3A%2A&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1063' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:10 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.45' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repoc1b5131a&n=2&orderby= + response: + body: + string: '{"repositories": ["repoc28d1326", "repoc7611808"]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '49' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:11 GMT + docker-distribution-api-version: + - registry/2.0 + link: + - ; rel="next" + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repoc7611808&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '196' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:11 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=registry%3Acatalog%3A%2A&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1063' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:11 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.433333' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repoc7611808&n=2&orderby= + response: + body: + string: '{"repositories": null}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:16:11 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client_async.test_delete_repository_does_not_exist.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client_async.test_delete_repository_does_not_exist.yaml index b58c6b8c1037..f48f464865cc 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client_async.test_delete_repository_does_not_exist.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client_async.test_delete_repository_does_not_exist.yaml @@ -18,7 +18,7 @@ interactions: connection: keep-alive content-length: '209' content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:04:09 GMT + date: Thu, 29 Apr 2021 23:24:44 GMT docker-distribution-api-version: registry/2.0 server: openresty strict-transport-security: max-age=31536000; includeSubDomains @@ -46,11 +46,11 @@ interactions: headers: connection: keep-alive content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:04:10 GMT + date: Thu, 29 Apr 2021 23:24:45 GMT server: openresty strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked - x-ms-ratelimit-remaining-calls-per-second: '166.25' + x-ms-ratelimit-remaining-calls-per-second: '166.65' status: code: 200 message: OK @@ -74,11 +74,11 @@ interactions: headers: connection: keep-alive content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:04:10 GMT + date: Thu, 29 Apr 2021 23:24:45 GMT server: openresty strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked - x-ms-ratelimit-remaining-calls-per-second: '166.166667' + x-ms-ratelimit-remaining-calls-per-second: '166.633333' status: code: 200 message: OK @@ -101,7 +101,7 @@ interactions: connection: keep-alive content-length: '121' content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:04:10 GMT + date: Thu, 29 Apr 2021 23:24:45 GMT docker-distribution-api-version: registry/2.0 server: openresty strict-transport-security: max-age=31536000; includeSubDomains diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client_async.test_list_repositories_by_page.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client_async.test_list_repositories_by_page.yaml index eedb8cd16500..f4b100e5bdc9 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client_async.test_list_repositories_by_page.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client_async.test_list_repositories_by_page.yaml @@ -1018,7 +1018,7 @@ interactions: uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repoc7611808&n=2&orderby= response: body: - string: '{"repositories": ["repod2be1c42", "repoeb7113db"]}' + string: '{"repositories": ["repo3db51597", "repo3e8d15a3"]}' headers: access-control-expose-headers: X-Ms-Correlation-Request-Id connection: keep-alive diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client_async.test_list_repository_names.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client_async.test_list_repository_names.yaml new file mode 100644 index 000000000000..f328ef4fbde4 --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client_async.test_list_repository_names.yaml @@ -0,0 +1,116 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '196' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:36 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/_catalog +- request: + body: + access_token: REDACTED + grant_type: access_token + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:37 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.866667' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: registry:catalog:* + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:37 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.85' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog + response: + body: + string: '{"repositories": ["library/alpine", "library/busybox", "repo25ce0f5d", + "repo27331535", "repo28471541", "repo2c591564", "repo2e8319c5", "repo308e19dd", + "repo34ab0fa1", "repo3c82158b", "repo3db51597", "repo3e8d15a3", "repo84e316ff", + "repo8b5a11da", "repo9b321760", "repo9cb4121e", "repoaf9517b2", "repob0a917be", + "repob22512e7", "repoc1b5131a", "repoc28d1326", "repoc7611808"]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '354' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:37 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/_catalog +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client_async.test_list_repository_names_by_page.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client_async.test_list_repository_names_by_page.yaml new file mode 100644 index 000000000000..10a577717d62 --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client_async.test_list_repository_names_by_page.yaml @@ -0,0 +1,1036 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?n=2 + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '196' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:37 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/_catalog?n=2 +- request: + body: + access_token: REDACTED + grant_type: access_token + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:38 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '166.633333' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: registry:catalog:* + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:38 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.816667' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?n=2 + response: + body: + string: '{"repositories": ["library/alpine", "library/busybox"]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '54' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:39 GMT + docker-distribution-api-version: registry/2.0 + link: ; rel="next" + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/_catalog?n=2 +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=library/busybox&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '196' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:39 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/_catalog?last=library/busybox&n=2&orderby= +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: registry:catalog:* + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:39 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.8' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=library/busybox&n=2&orderby= + response: + body: + string: '{"repositories": ["repo25ce0f5d", "repo27331535"]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '49' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:39 GMT + docker-distribution-api-version: registry/2.0 + link: ; rel="next" + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/_catalog?last=library/busybox&n=2&orderby= +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo27331535&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '196' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:39 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo27331535&n=2&orderby= +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: registry:catalog:* + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:39 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.783333' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo27331535&n=2&orderby= + response: + body: + string: '{"repositories": ["repo28471541", "repo2c591564"]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '49' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:39 GMT + docker-distribution-api-version: registry/2.0 + link: ; rel="next" + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo27331535&n=2&orderby= +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo2c591564&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '196' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:40 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo2c591564&n=2&orderby= +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: registry:catalog:* + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:40 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.766667' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo2c591564&n=2&orderby= + response: + body: + string: '{"repositories": ["repo2e8319c5", "repo308e19dd"]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '49' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:40 GMT + docker-distribution-api-version: registry/2.0 + link: ; rel="next" + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo2c591564&n=2&orderby= +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo308e19dd&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '196' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:40 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo308e19dd&n=2&orderby= +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: registry:catalog:* + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:40 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.75' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo308e19dd&n=2&orderby= + response: + body: + string: '{"repositories": ["repo34ab0fa1", "repo3c82158b"]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '49' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:40 GMT + docker-distribution-api-version: registry/2.0 + link: ; rel="next" + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo308e19dd&n=2&orderby= +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo3c82158b&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '196' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:40 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo3c82158b&n=2&orderby= +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: registry:catalog:* + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:40 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.733333' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo3c82158b&n=2&orderby= + response: + body: + string: '{"repositories": ["repo3db51597", "repo3e8d15a3"]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '49' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:41 GMT + docker-distribution-api-version: registry/2.0 + link: ; rel="next" + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo3c82158b&n=2&orderby= +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo3e8d15a3&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '196' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:41 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo3e8d15a3&n=2&orderby= +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: registry:catalog:* + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:41 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.716667' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo3e8d15a3&n=2&orderby= + response: + body: + string: '{"repositories": ["repo84e316ff", "repo8b5a11da"]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '49' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:41 GMT + docker-distribution-api-version: registry/2.0 + link: ; rel="next" + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo3e8d15a3&n=2&orderby= +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo8b5a11da&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '196' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:41 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo8b5a11da&n=2&orderby= +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: registry:catalog:* + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:41 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.7' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo8b5a11da&n=2&orderby= + response: + body: + string: '{"repositories": ["repo9b321760", "repo9cb4121e"]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '49' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:41 GMT + docker-distribution-api-version: registry/2.0 + link: ; rel="next" + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo8b5a11da&n=2&orderby= +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo9cb4121e&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '196' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:42 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo9cb4121e&n=2&orderby= +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: registry:catalog:* + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:42 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.683333' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo9cb4121e&n=2&orderby= + response: + body: + string: '{"repositories": ["repoaf9517b2", "repob0a917be"]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '49' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:42 GMT + docker-distribution-api-version: registry/2.0 + link: ; rel="next" + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/_catalog?last=repo9cb4121e&n=2&orderby= +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repob0a917be&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '196' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:42 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/_catalog?last=repob0a917be&n=2&orderby= +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: registry:catalog:* + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:42 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.666667' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repob0a917be&n=2&orderby= + response: + body: + string: '{"repositories": ["repob22512e7", "repoc1b5131a"]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '49' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:42 GMT + docker-distribution-api-version: registry/2.0 + link: ; rel="next" + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/_catalog?last=repob0a917be&n=2&orderby= +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repoc1b5131a&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '196' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:42 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/_catalog?last=repoc1b5131a&n=2&orderby= +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: registry:catalog:* + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:42 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.65' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repoc1b5131a&n=2&orderby= + response: + body: + string: '{"repositories": ["repoc28d1326", "repoc7611808"]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '49' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:43 GMT + docker-distribution-api-version: registry/2.0 + link: ; rel="next" + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/_catalog?last=repoc1b5131a&n=2&orderby= +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repoc7611808&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "registry", "Name": "catalog", "Action": "*"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '196' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:43 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/_catalog?last=repoc7611808&n=2&orderby= +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: registry:catalog:* + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:43 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.633333' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/_catalog?last=repoc7611808&n=2&orderby= + response: + body: + string: '{"repositories": null}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '22' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:16:43 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/_catalog?last=repoc7611808&n=2&orderby= +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_delete_repository.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_delete_repository.yaml similarity index 100% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_delete_repository.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_delete_repository.yaml diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_delete_repository_doesnt_exist.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_delete_repository_doesnt_exist.yaml similarity index 100% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_delete_repository_doesnt_exist.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_delete_repository_doesnt_exist.yaml diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_get_properties.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_get_properties.yaml similarity index 100% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_get_properties.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_get_properties.yaml diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_list_manifests.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_list_manifests.yaml new file mode 100644 index 000000000000..93d125378fff --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_list_manifests.yaml @@ -0,0 +1,216 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "library/busybox", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '218' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:04:19 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=access_token&service=fake_url.azurecr.io&access_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1343' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:04:20 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.4' + status: + code: 200 + message: OK +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Alibrary%2Fbusybox%3Ametadata_read&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1085' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:04:20 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.183333' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "library/busybox", + "manifests": [{"digest": "sha256:1ccc0a0ca577e5fb5a0bdf2150a1a9f842f47c8865e861fa0062c5d343eb8cac", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.6976923Z", "lastUpdateTime": + "2021-04-13T15:11:15.6976923Z", "architecture": "amd64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:37b77d92a7ca131dd379ab9a637b814dd99dc0cb560ccf59b566bd6448564b7c", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.3563152Z", "lastUpdateTime": + "2021-04-13T15:11:16.3563152Z", "architecture": "s390x", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:6223225a29b199db7ac08bfc70717c0b4fe28b791abbe25a3208025fa86a4b70", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.9220954Z", "lastUpdateTime": + "2021-04-13T15:11:15.9220954Z", "architecture": "386", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:82b4c9f36a6fa022454e78ad5c72a74fd34ca4e20489b36a8a436ca3ce9c34ef", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.9893517Z", "lastUpdateTime": + "2021-04-13T15:11:15.9893517Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:975eefa55fc130df8943cf2f72a8852ed2591db75871e0dcc427b76a0d8c26f8", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.7730283Z", "lastUpdateTime": + "2021-04-13T15:11:15.7730283Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:ae39a6f5c07297d7ab64dbd4f82c77c874cc6a94cea29fdec309d0992574b4f7", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.1951619Z", "lastUpdateTime": + "2021-04-13T15:11:15.1951619Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", + "tags": ["latest"], "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}, {"digest": "sha256:beded925d853f36a55cf1d0d4e92c81e945e0be5ade32df173c2827df2c9b12f", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.8778338Z", "lastUpdateTime": + "2021-04-13T15:11:16.8778338Z", "architecture": "ppc64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e132653a6bb3ea3e3b0c63b608122ee72e03cd1e9849a05818965b695afad399", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.1965873Z", "lastUpdateTime": + "2021-04-13T15:11:16.1965873Z", "architecture": "mips64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:ed9c347e6a72d81a3dec189527b720bd0da021239fe779c9549be501ad083b4e", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.0655061Z", "lastUpdateTime": + "2021-04-13T15:11:16.0655061Z", "architecture": "arm64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:fd659a6f4786d18666586ab4935f8e846d7cf1ff1b2709671f3ff0fcd15519b9", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.6907072Z", "lastUpdateTime": + "2021-04-13T15:11:16.6907072Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:04:21 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_list_registry_artifacts_ascending.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_list_manifests_ascending.yaml similarity index 100% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_list_registry_artifacts_ascending.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_list_manifests_ascending.yaml diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_list_manifests_by_page.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_list_manifests_by_page.yaml new file mode 100644 index 000000000000..293bf9f570ea --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_list_manifests_by_page.yaml @@ -0,0 +1,736 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?n=2 + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "library/busybox", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '218' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:05:06 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=access_token&service=fake_url.azurecr.io&access_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1343' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:05:08 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.533333' + status: + code: 200 + message: OK +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Alibrary%2Fbusybox%3Ametadata_read&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1085' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:05:08 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.516667' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?n=2 + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "library/busybox", + "manifests": [{"digest": "sha256:1ccc0a0ca577e5fb5a0bdf2150a1a9f842f47c8865e861fa0062c5d343eb8cac", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.6976923Z", "lastUpdateTime": + "2021-04-13T15:11:15.6976923Z", "architecture": "amd64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:37b77d92a7ca131dd379ab9a637b814dd99dc0cb560ccf59b566bd6448564b7c", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.3563152Z", "lastUpdateTime": + "2021-04-13T15:11:16.3563152Z", "architecture": "s390x", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '931' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:05:08 GMT + docker-distribution-api-version: + - registry/2.0 + link: + - ; + rel="next" + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?last=sha256%3A37b77d92a7ca131dd379ab9a637b814dd99dc0cb560ccf59b566bd6448564b7c&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "library/busybox", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '218' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:05:08 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Alibrary%2Fbusybox%3Ametadata_read&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1085' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:05:08 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.5' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?last=sha256%3A37b77d92a7ca131dd379ab9a637b814dd99dc0cb560ccf59b566bd6448564b7c&n=2&orderby= + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "library/busybox", + "manifests": [{"digest": "sha256:6223225a29b199db7ac08bfc70717c0b4fe28b791abbe25a3208025fa86a4b70", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.9220954Z", "lastUpdateTime": + "2021-04-13T15:11:15.9220954Z", "architecture": "386", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:82b4c9f36a6fa022454e78ad5c72a74fd34ca4e20489b36a8a436ca3ce9c34ef", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.9893517Z", "lastUpdateTime": + "2021-04-13T15:11:15.9893517Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '927' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:05:08 GMT + docker-distribution-api-version: + - registry/2.0 + link: + - ; + rel="next" + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?last=sha256%3A82b4c9f36a6fa022454e78ad5c72a74fd34ca4e20489b36a8a436ca3ce9c34ef&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "library/busybox", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '218' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:05:09 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Alibrary%2Fbusybox%3Ametadata_read&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1085' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:05:09 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.483333' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?last=sha256%3A82b4c9f36a6fa022454e78ad5c72a74fd34ca4e20489b36a8a436ca3ce9c34ef&n=2&orderby= + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "library/busybox", + "manifests": [{"digest": "sha256:975eefa55fc130df8943cf2f72a8852ed2591db75871e0dcc427b76a0d8c26f8", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.7730283Z", "lastUpdateTime": + "2021-04-13T15:11:15.7730283Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:ae39a6f5c07297d7ab64dbd4f82c77c874cc6a94cea29fdec309d0992574b4f7", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.1951619Z", "lastUpdateTime": + "2021-04-13T15:11:15.1951619Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", + "tags": ["latest"], "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '889' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:05:09 GMT + docker-distribution-api-version: + - registry/2.0 + link: + - ; + rel="next" + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?last=sha256%3Aae39a6f5c07297d7ab64dbd4f82c77c874cc6a94cea29fdec309d0992574b4f7&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "library/busybox", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '218' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:05:09 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Alibrary%2Fbusybox%3Ametadata_read&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1085' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:05:09 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.466667' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?last=sha256%3Aae39a6f5c07297d7ab64dbd4f82c77c874cc6a94cea29fdec309d0992574b4f7&n=2&orderby= + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "library/busybox", + "manifests": [{"digest": "sha256:beded925d853f36a55cf1d0d4e92c81e945e0be5ade32df173c2827df2c9b12f", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.8778338Z", "lastUpdateTime": + "2021-04-13T15:11:16.8778338Z", "architecture": "ppc64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e132653a6bb3ea3e3b0c63b608122ee72e03cd1e9849a05818965b695afad399", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.1965873Z", "lastUpdateTime": + "2021-04-13T15:11:16.1965873Z", "architecture": "mips64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '936' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:05:09 GMT + docker-distribution-api-version: + - registry/2.0 + link: + - ; + rel="next" + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?last=sha256%3Ae132653a6bb3ea3e3b0c63b608122ee72e03cd1e9849a05818965b695afad399&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "library/busybox", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '218' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:05:09 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Alibrary%2Fbusybox%3Ametadata_read&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1085' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:05:10 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.45' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?last=sha256%3Ae132653a6bb3ea3e3b0c63b608122ee72e03cd1e9849a05818965b695afad399&n=2&orderby= + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "library/busybox", + "manifests": [{"digest": "sha256:ed9c347e6a72d81a3dec189527b720bd0da021239fe779c9549be501ad083b4e", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.0655061Z", "lastUpdateTime": + "2021-04-13T15:11:16.0655061Z", "architecture": "arm64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:fd659a6f4786d18666586ab4935f8e846d7cf1ff1b2709671f3ff0fcd15519b9", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.6907072Z", "lastUpdateTime": + "2021-04-13T15:11:16.6907072Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '929' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:05:10 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_list_registry_artifacts_descending.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_list_manifests_descending.yaml similarity index 97% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_list_registry_artifacts_descending.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_list_manifests_descending.yaml index c22f3315d43c..f7c60494fb7e 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_list_registry_artifacts_descending.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_list_manifests_descending.yaml @@ -30,7 +30,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:05:47 GMT + - Wed, 28 Apr 2021 21:17:24 GMT docker-distribution-api-version: - registry/2.0 server: @@ -71,7 +71,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:05:48 GMT + - Wed, 28 Apr 2021 21:17:25 GMT server: - openresty strict-transport-security: @@ -79,7 +79,7 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '166.633333' + - '166.616667' status: code: 200 message: OK @@ -109,7 +109,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:05:48 GMT + - Wed, 28 Apr 2021 21:17:25 GMT server: - openresty strict-transport-security: @@ -117,7 +117,7 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '166.533333' + - '166.466667' status: code: 200 message: OK @@ -198,7 +198,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:05:49 GMT + - Wed, 28 Apr 2021 21:17:26 GMT docker-distribution-api-version: - registry/2.0 server: diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_list_registry_artifacts.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_list_registry_artifacts.yaml similarity index 100% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_list_registry_artifacts.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_list_registry_artifacts.yaml diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_list_registry_artifacts_ascending.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_list_registry_artifacts_ascending.yaml new file mode 100644 index 000000000000..b609c0c21df6 --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_list_registry_artifacts_ascending.yaml @@ -0,0 +1,216 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?orderby=timeasc + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "library/busybox", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '218' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 17:58:25 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=access_token&service=fake_url.azurecr.io&access_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1343' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 17:58:27 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.65' + status: + code: 200 + message: OK +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Alibrary%2Fbusybox%3Ametadata_read&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1085' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 17:58:27 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.633333' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?orderby=timeasc + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "library/busybox", + "manifests": [{"digest": "sha256:ae39a6f5c07297d7ab64dbd4f82c77c874cc6a94cea29fdec309d0992574b4f7", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.1951619Z", "lastUpdateTime": + "2021-04-13T15:11:15.1951619Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", + "tags": ["latest"], "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}, {"digest": "sha256:1ccc0a0ca577e5fb5a0bdf2150a1a9f842f47c8865e861fa0062c5d343eb8cac", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.6976923Z", "lastUpdateTime": + "2021-04-13T15:11:15.6976923Z", "architecture": "amd64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:975eefa55fc130df8943cf2f72a8852ed2591db75871e0dcc427b76a0d8c26f8", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.7730283Z", "lastUpdateTime": + "2021-04-13T15:11:15.7730283Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:6223225a29b199db7ac08bfc70717c0b4fe28b791abbe25a3208025fa86a4b70", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.9220954Z", "lastUpdateTime": + "2021-04-13T15:11:15.9220954Z", "architecture": "386", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:82b4c9f36a6fa022454e78ad5c72a74fd34ca4e20489b36a8a436ca3ce9c34ef", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.9893517Z", "lastUpdateTime": + "2021-04-13T15:11:15.9893517Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:ed9c347e6a72d81a3dec189527b720bd0da021239fe779c9549be501ad083b4e", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.0655061Z", "lastUpdateTime": + "2021-04-13T15:11:16.0655061Z", "architecture": "arm64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e132653a6bb3ea3e3b0c63b608122ee72e03cd1e9849a05818965b695afad399", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.1965873Z", "lastUpdateTime": + "2021-04-13T15:11:16.1965873Z", "architecture": "mips64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:37b77d92a7ca131dd379ab9a637b814dd99dc0cb560ccf59b566bd6448564b7c", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.3563152Z", "lastUpdateTime": + "2021-04-13T15:11:16.3563152Z", "architecture": "s390x", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:fd659a6f4786d18666586ab4935f8e846d7cf1ff1b2709671f3ff0fcd15519b9", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.6907072Z", "lastUpdateTime": + "2021-04-13T15:11:16.6907072Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:beded925d853f36a55cf1d0d4e92c81e945e0be5ade32df173c2827df2c9b12f", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.8778338Z", "lastUpdateTime": + "2021-04-13T15:11:16.8778338Z", "architecture": "ppc64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 17:58:27 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_list_registry_artifacts_by_page.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_list_registry_artifacts_by_page.yaml similarity index 100% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_list_registry_artifacts_by_page.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_list_registry_artifacts_by_page.yaml diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_list_registry_artifacts_descending.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_list_registry_artifacts_descending.yaml new file mode 100644 index 000000000000..0391740c86fd --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_list_registry_artifacts_descending.yaml @@ -0,0 +1,216 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?orderby=timedesc + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "library/busybox", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '218' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 17:58:34 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=access_token&service=fake_url.azurecr.io&access_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1343' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 17:58:35 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '165.866667' + status: + code: 200 + message: OK +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Alibrary%2Fbusybox%3Ametadata_read&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1085' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 17:58:35 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '165.833333' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?orderby=timedesc + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "library/busybox", + "manifests": [{"digest": "sha256:beded925d853f36a55cf1d0d4e92c81e945e0be5ade32df173c2827df2c9b12f", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.8778338Z", "lastUpdateTime": + "2021-04-13T15:11:16.8778338Z", "architecture": "ppc64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:fd659a6f4786d18666586ab4935f8e846d7cf1ff1b2709671f3ff0fcd15519b9", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.6907072Z", "lastUpdateTime": + "2021-04-13T15:11:16.6907072Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:37b77d92a7ca131dd379ab9a637b814dd99dc0cb560ccf59b566bd6448564b7c", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.3563152Z", "lastUpdateTime": + "2021-04-13T15:11:16.3563152Z", "architecture": "s390x", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e132653a6bb3ea3e3b0c63b608122ee72e03cd1e9849a05818965b695afad399", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.1965873Z", "lastUpdateTime": + "2021-04-13T15:11:16.1965873Z", "architecture": "mips64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:ed9c347e6a72d81a3dec189527b720bd0da021239fe779c9549be501ad083b4e", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.0655061Z", "lastUpdateTime": + "2021-04-13T15:11:16.0655061Z", "architecture": "arm64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:82b4c9f36a6fa022454e78ad5c72a74fd34ca4e20489b36a8a436ca3ce9c34ef", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.9893517Z", "lastUpdateTime": + "2021-04-13T15:11:15.9893517Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:6223225a29b199db7ac08bfc70717c0b4fe28b791abbe25a3208025fa86a4b70", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.9220954Z", "lastUpdateTime": + "2021-04-13T15:11:15.9220954Z", "architecture": "386", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:975eefa55fc130df8943cf2f72a8852ed2591db75871e0dcc427b76a0d8c26f8", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.7730283Z", "lastUpdateTime": + "2021-04-13T15:11:15.7730283Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:1ccc0a0ca577e5fb5a0bdf2150a1a9f842f47c8865e861fa0062c5d343eb8cac", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.6976923Z", "lastUpdateTime": + "2021-04-13T15:11:15.6976923Z", "architecture": "amd64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:ae39a6f5c07297d7ab64dbd4f82c77c874cc6a94cea29fdec309d0992574b4f7", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.1951619Z", "lastUpdateTime": + "2021-04-13T15:11:15.1951619Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", + "tags": ["latest"], "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 17:58:36 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_set_tag_properties.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_set_properties.yaml similarity index 81% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_set_tag_properties.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_set_properties.yaml index bc2615ca0608..690957dd134a 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_set_tag_properties.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository.test_set_properties.yaml @@ -11,12 +11,12 @@ interactions: User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: GET - uri: https://fake_url.azurecr.io/acr/v1/repo9b321760/_tags/tag9b321760 + uri: https://fake_url.azurecr.io/acr/v1/repob22512e7 response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": - "repository", "Name": "repo9b321760", "Action": "metadata_read"}]}]}' + "repository", "Name": "repob22512e7", "Action": "metadata_read"}]}]}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -30,7 +30,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:36 GMT + - Mon, 03 May 2021 16:06:45 GMT docker-distribution-api-version: - registry/2.0 server: @@ -71,7 +71,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:37 GMT + - Mon, 03 May 2021 16:06:46 GMT server: - openresty strict-transport-security: @@ -79,12 +79,12 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '166.5' + - '166.65' status: code: 200 message: OK - request: - body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepo9b321760%3Ametadata_read&refresh_token=REDACTED + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepob22512e7%3Ametadata_read&refresh_token=REDACTED headers: Accept: - application/json @@ -109,7 +109,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:37 GMT + - Mon, 03 May 2021 16:06:46 GMT server: - openresty strict-transport-security: @@ -117,7 +117,7 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '165.633333' + - '166.633333' status: code: 200 message: OK @@ -133,14 +133,14 @@ interactions: User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: GET - uri: https://fake_url.azurecr.io/acr/v1/repo9b321760/_tags/tag9b321760 + uri: https://fake_url.azurecr.io/acr/v1/repob22512e7 response: body: - string: '{"registry": "fake_url.azurecr.io", "imageName": "repo9b321760", "tag": - {"name": "tag9b321760", "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", - "createdTime": "2021-04-13T15:25:07.1063989Z", "lastUpdateTime": "2021-04-15T18:52:57.9105866Z", - "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": - true, "readEnabled": true, "listEnabled": true}}}' + string: '{"registry": "fake_url.azurecr.io", "imageName": "repob22512e7", "createdTime": + "2021-04-28T16:00:11.7859645Z", "lastUpdateTime": "2021-04-28T16:00:10.3137046Z", + "manifestCount": 10, "tagCount": 1, "changeableAttributes": {"deleteEnabled": + true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "teleportEnabled": + false}}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -150,11 +150,11 @@ interactions: connection: - keep-alive content-length: - - '386' + - '315' content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:38 GMT + - Mon, 03 May 2021 16:06:46 GMT docker-distribution-api-version: - registry/2.0 server: @@ -184,12 +184,12 @@ interactions: User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: PATCH - uri: https://fake_url.azurecr.io/acr/v1/repo9b321760/_tags/tag9b321760 + uri: https://fake_url.azurecr.io/acr/v1/repob22512e7 response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": - "repository", "Name": "repo9b321760", "Action": "metadata_write"}]}]}' + "repository", "Name": "repob22512e7", "Action": "metadata_write"}]}]}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -203,7 +203,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:38 GMT + - Mon, 03 May 2021 16:06:47 GMT docker-distribution-api-version: - registry/2.0 server: @@ -219,7 +219,7 @@ interactions: code: 401 message: Unauthorized - request: - body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepo9b321760%3Ametadata_write&refresh_token=REDACTED + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepob22512e7%3Ametadata_write&refresh_token=REDACTED headers: Accept: - application/json @@ -244,7 +244,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:38 GMT + - Mon, 03 May 2021 16:06:47 GMT server: - openresty strict-transport-security: @@ -252,7 +252,7 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '165.616667' + - '166.616667' status: code: 200 message: OK @@ -273,14 +273,14 @@ interactions: User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: PATCH - uri: https://fake_url.azurecr.io/acr/v1/repo9b321760/_tags/tag9b321760 + uri: https://fake_url.azurecr.io/acr/v1/repob22512e7 response: body: - string: '{"registry": "fake_url.azurecr.io", "imageName": "repo9b321760", "tag": - {"name": "tag9b321760", "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", - "createdTime": "2021-04-13T15:25:07.1063989Z", "lastUpdateTime": "2021-04-15T18:52:57.9105866Z", - "signed": false, "changeableAttributes": {"deleteEnabled": false, "writeEnabled": - false, "readEnabled": false, "listEnabled": false}}}' + string: '{"registry": "fake_url.azurecr.io", "imageName": "repob22512e7", "createdTime": + "2021-04-28T16:00:11.7859645Z", "lastUpdateTime": "2021-04-28T16:00:10.3137046Z", + "manifestCount": 10, "tagCount": 1, "changeableAttributes": {"deleteEnabled": + false, "writeEnabled": false, "readEnabled": false, "listEnabled": false, + "teleportEnabled": false}}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -290,11 +290,11 @@ interactions: connection: - keep-alive content-length: - - '390' + - '319' content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:38 GMT + - Mon, 03 May 2021 16:06:47 GMT docker-distribution-api-version: - registry/2.0 server: @@ -324,12 +324,12 @@ interactions: User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: PATCH - uri: https://fake_url.azurecr.io/acr/v1/repo9b321760/_tags/tag9b321760 + uri: https://fake_url.azurecr.io/acr/v1/repob22512e7 response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": - "repository", "Name": "repo9b321760", "Action": "metadata_write"}]}]}' + "repository", "Name": "repob22512e7", "Action": "metadata_write"}]}]}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -343,7 +343,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:38 GMT + - Mon, 03 May 2021 16:06:47 GMT docker-distribution-api-version: - registry/2.0 server: @@ -359,7 +359,7 @@ interactions: code: 401 message: Unauthorized - request: - body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepo9b321760%3Ametadata_write&refresh_token=REDACTED + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepob22512e7%3Ametadata_write&refresh_token=REDACTED headers: Accept: - application/json @@ -384,7 +384,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:39 GMT + - Mon, 03 May 2021 16:06:47 GMT server: - openresty strict-transport-security: @@ -392,7 +392,7 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '165.6' + - '166.6' status: code: 200 message: OK @@ -413,14 +413,14 @@ interactions: User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: PATCH - uri: https://fake_url.azurecr.io/acr/v1/repo9b321760/_tags/tag9b321760 + uri: https://fake_url.azurecr.io/acr/v1/repob22512e7 response: body: - string: '{"registry": "fake_url.azurecr.io", "imageName": "repo9b321760", "tag": - {"name": "tag9b321760", "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", - "createdTime": "2021-04-13T15:25:07.1063989Z", "lastUpdateTime": "2021-04-15T18:52:57.9105866Z", - "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": - true, "readEnabled": true, "listEnabled": true}}}' + string: '{"registry": "fake_url.azurecr.io", "imageName": "repob22512e7", "createdTime": + "2021-04-28T16:00:11.7859645Z", "lastUpdateTime": "2021-04-28T16:00:10.3137046Z", + "manifestCount": 10, "tagCount": 1, "changeableAttributes": {"deleteEnabled": + true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "teleportEnabled": + false}}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -430,11 +430,11 @@ interactions: connection: - keep-alive content-length: - - '386' + - '315' content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:39 GMT + - Mon, 03 May 2021 16:06:48 GMT docker-distribution-api-version: - registry/2.0 server: diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_delete_repository.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_delete_repository.yaml similarity index 100% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_delete_repository.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_delete_repository.yaml diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_delete_repository_doesnt_exist.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_delete_repository_doesnt_exist.yaml similarity index 100% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_delete_repository_doesnt_exist.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_delete_repository_doesnt_exist.yaml diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_list_tags_by_page.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_get_properties.yaml similarity index 73% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_list_tags_by_page.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_get_properties.yaml index bd2e0c94375d..137fee8eab59 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_list_tags_by_page.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_get_properties.yaml @@ -7,18 +7,18 @@ interactions: User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: GET - uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_tags?n=2 + uri: https://fake_url.azurecr.io/acr/v1/library%2Fhello-world response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": - "repository", "Name": "library/busybox", "Action": "metadata_read"}]}]}' + "repository", "Name": "library/hello-world", "Action": "metadata_read"}]}]}' headers: access-control-expose-headers: X-Ms-Correlation-Request-Id connection: keep-alive - content-length: '218' + content-length: '222' content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:07:53 GMT + date: Wed, 28 Apr 2021 21:18:07 GMT docker-distribution-api-version: registry/2.0 server: openresty strict-transport-security: max-age=31536000; includeSubDomains @@ -27,7 +27,7 @@ interactions: status: code: 401 message: Unauthorized - url: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_tags?n=2 + url: https://fake_url.azurecr.io/acr/v1/library%2Fhello-world - request: body: access_token: REDACTED @@ -46,11 +46,11 @@ interactions: headers: connection: keep-alive content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:07:54 GMT + date: Wed, 28 Apr 2021 21:18:08 GMT server: openresty strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked - x-ms-ratelimit-remaining-calls-per-second: '166.616667' + x-ms-ratelimit-remaining-calls-per-second: '166.433333' status: code: 200 message: OK @@ -59,7 +59,7 @@ interactions: body: grant_type: refresh_token refresh_token: REDACTED - scope: repository:library/busybox:metadata_read + scope: repository:library/hello-world:metadata_read service: fake_url.azurecr.io headers: Accept: @@ -74,11 +74,11 @@ interactions: headers: connection: keep-alive content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:07:54 GMT + date: Wed, 28 Apr 2021 21:18:08 GMT server: openresty strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked - x-ms-ratelimit-remaining-calls-per-second: '166.6' + x-ms-ratelimit-remaining-calls-per-second: '166.016667' status: code: 200 message: OK @@ -91,20 +91,20 @@ interactions: User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: GET - uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_tags?n=2 + uri: https://fake_url.azurecr.io/acr/v1/library%2Fhello-world response: body: - string: '{"registry": "fake_url.azurecr.io", "imageName": "library/busybox", - "tags": [{"name": "latest", "digest": "sha256:ae39a6f5c07297d7ab64dbd4f82c77c874cc6a94cea29fdec309d0992574b4f7", - "createdTime": "2021-04-13T15:11:15.3146514Z", "lastUpdateTime": "2021-04-13T15:11:15.3146514Z", - "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": - true, "readEnabled": true, "listEnabled": true}}]}' + string: '{"registry": "fake_url.azurecr.io", "imageName": "library/hello-world", + "createdTime": "2021-04-13T15:10:43.6788287Z", "lastUpdateTime": "2021-04-20T12:50:15.1385136Z", + "manifestCount": 12, "tagCount": 5, "changeableAttributes": {"deleteEnabled": + false, "writeEnabled": false, "readEnabled": false, "listEnabled": false, + "teleportEnabled": false}}' headers: access-control-expose-headers: X-Ms-Correlation-Request-Id connection: keep-alive - content-length: '387' + content-length: '326' content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:07:54 GMT + date: Wed, 28 Apr 2021 21:18:08 GMT docker-distribution-api-version: registry/2.0 server: openresty strict-transport-security: max-age=31536000; includeSubDomains @@ -112,5 +112,5 @@ interactions: status: code: 200 message: OK - url: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_tags?n=2 + url: https://fake_url.azurecr.io/acr/v1/library%2Fhello-world version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_list_registry_artifacts.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_list_manifests.yaml similarity index 100% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_list_registry_artifacts.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_list_manifests.yaml diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_list_registry_artifacts_ascending.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_list_manifests_ascending.yaml similarity index 100% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_list_registry_artifacts_ascending.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_list_manifests_ascending.yaml diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_list_manifests_by_page.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_list_manifests_by_page.yaml new file mode 100644 index 000000000000..13d3b7ee318d --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_list_manifests_by_page.yaml @@ -0,0 +1,506 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?n=2 + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "library/busybox", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '218' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:18:13 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?n=2 +- request: + body: + access_token: REDACTED + grant_type: access_token + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:18:14 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.816667' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:library/busybox:metadata_read + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:18:14 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.8' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?n=2 + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "library/busybox", + "manifests": [{"digest": "sha256:1ccc0a0ca577e5fb5a0bdf2150a1a9f842f47c8865e861fa0062c5d343eb8cac", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.6976923Z", "lastUpdateTime": + "2021-04-13T15:11:15.6976923Z", "architecture": "amd64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:37b77d92a7ca131dd379ab9a637b814dd99dc0cb560ccf59b566bd6448564b7c", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.3563152Z", "lastUpdateTime": + "2021-04-13T15:11:16.3563152Z", "architecture": "s390x", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '931' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:18:14 GMT + docker-distribution-api-version: registry/2.0 + link: ; + rel="next" + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?n=2 +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?last=sha256:37b77d92a7ca131dd379ab9a637b814dd99dc0cb560ccf59b566bd6448564b7c&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "library/busybox", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '218' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:18:14 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?last=sha256:37b77d92a7ca131dd379ab9a637b814dd99dc0cb560ccf59b566bd6448564b7c&n=2&orderby= +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:library/busybox:metadata_read + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:18:14 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.783333' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?last=sha256:37b77d92a7ca131dd379ab9a637b814dd99dc0cb560ccf59b566bd6448564b7c&n=2&orderby= + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "library/busybox", + "manifests": [{"digest": "sha256:6223225a29b199db7ac08bfc70717c0b4fe28b791abbe25a3208025fa86a4b70", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.9220954Z", "lastUpdateTime": + "2021-04-13T15:11:15.9220954Z", "architecture": "386", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:82b4c9f36a6fa022454e78ad5c72a74fd34ca4e20489b36a8a436ca3ce9c34ef", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.9893517Z", "lastUpdateTime": + "2021-04-13T15:11:15.9893517Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '927' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:18:15 GMT + docker-distribution-api-version: registry/2.0 + link: ; + rel="next" + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?last=sha256:37b77d92a7ca131dd379ab9a637b814dd99dc0cb560ccf59b566bd6448564b7c&n=2&orderby= +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?last=sha256:82b4c9f36a6fa022454e78ad5c72a74fd34ca4e20489b36a8a436ca3ce9c34ef&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "library/busybox", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '218' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:18:15 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?last=sha256:82b4c9f36a6fa022454e78ad5c72a74fd34ca4e20489b36a8a436ca3ce9c34ef&n=2&orderby= +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:library/busybox:metadata_read + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:18:15 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.9' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?last=sha256:82b4c9f36a6fa022454e78ad5c72a74fd34ca4e20489b36a8a436ca3ce9c34ef&n=2&orderby= + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "library/busybox", + "manifests": [{"digest": "sha256:975eefa55fc130df8943cf2f72a8852ed2591db75871e0dcc427b76a0d8c26f8", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.7730283Z", "lastUpdateTime": + "2021-04-13T15:11:15.7730283Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:ae39a6f5c07297d7ab64dbd4f82c77c874cc6a94cea29fdec309d0992574b4f7", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.1951619Z", "lastUpdateTime": + "2021-04-13T15:11:15.1951619Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", + "tags": ["latest"], "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '889' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:18:15 GMT + docker-distribution-api-version: registry/2.0 + link: ; + rel="next" + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?last=sha256:82b4c9f36a6fa022454e78ad5c72a74fd34ca4e20489b36a8a436ca3ce9c34ef&n=2&orderby= +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?last=sha256:ae39a6f5c07297d7ab64dbd4f82c77c874cc6a94cea29fdec309d0992574b4f7&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "library/busybox", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '218' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:18:15 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?last=sha256:ae39a6f5c07297d7ab64dbd4f82c77c874cc6a94cea29fdec309d0992574b4f7&n=2&orderby= +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:library/busybox:metadata_read + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:18:15 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.883333' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?last=sha256:ae39a6f5c07297d7ab64dbd4f82c77c874cc6a94cea29fdec309d0992574b4f7&n=2&orderby= + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "library/busybox", + "manifests": [{"digest": "sha256:beded925d853f36a55cf1d0d4e92c81e945e0be5ade32df173c2827df2c9b12f", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.8778338Z", "lastUpdateTime": + "2021-04-13T15:11:16.8778338Z", "architecture": "ppc64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e132653a6bb3ea3e3b0c63b608122ee72e03cd1e9849a05818965b695afad399", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.1965873Z", "lastUpdateTime": + "2021-04-13T15:11:16.1965873Z", "architecture": "mips64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '936' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:18:16 GMT + docker-distribution-api-version: registry/2.0 + link: ; + rel="next" + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?last=sha256:ae39a6f5c07297d7ab64dbd4f82c77c874cc6a94cea29fdec309d0992574b4f7&n=2&orderby= +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?last=sha256:e132653a6bb3ea3e3b0c63b608122ee72e03cd1e9849a05818965b695afad399&n=2&orderby= + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "library/busybox", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '218' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:18:16 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?last=sha256:e132653a6bb3ea3e3b0c63b608122ee72e03cd1e9849a05818965b695afad399&n=2&orderby= +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:library/busybox:metadata_read + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:18:16 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.866667' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?last=sha256:e132653a6bb3ea3e3b0c63b608122ee72e03cd1e9849a05818965b695afad399&n=2&orderby= + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "library/busybox", + "manifests": [{"digest": "sha256:ed9c347e6a72d81a3dec189527b720bd0da021239fe779c9549be501ad083b4e", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.0655061Z", "lastUpdateTime": + "2021-04-13T15:11:16.0655061Z", "architecture": "arm64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:fd659a6f4786d18666586ab4935f8e846d7cf1ff1b2709671f3ff0fcd15519b9", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.6907072Z", "lastUpdateTime": + "2021-04-13T15:11:16.6907072Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '929' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:18:16 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?last=sha256:e132653a6bb3ea3e3b0c63b608122ee72e03cd1e9849a05818965b695afad399&n=2&orderby= +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_list_registry_artifacts_descending.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_list_manifests_descending.yaml similarity index 100% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_list_registry_artifacts_descending.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_list_manifests_descending.yaml diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_list_registry_artifacts.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_list_registry_artifacts.yaml new file mode 100644 index 000000000000..7f48f6b3a471 --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_list_registry_artifacts.yaml @@ -0,0 +1,162 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "library/busybox", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '218' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 17:56:14 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests +- request: + body: + access_token: REDACTED + grant_type: access_token + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 17:56:15 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '166.033333' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:library/busybox:metadata_read + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 17:56:15 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.7' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "library/busybox", + "manifests": [{"digest": "sha256:1ccc0a0ca577e5fb5a0bdf2150a1a9f842f47c8865e861fa0062c5d343eb8cac", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.6976923Z", "lastUpdateTime": + "2021-04-13T15:11:15.6976923Z", "architecture": "amd64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:37b77d92a7ca131dd379ab9a637b814dd99dc0cb560ccf59b566bd6448564b7c", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.3563152Z", "lastUpdateTime": + "2021-04-13T15:11:16.3563152Z", "architecture": "s390x", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:6223225a29b199db7ac08bfc70717c0b4fe28b791abbe25a3208025fa86a4b70", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.9220954Z", "lastUpdateTime": + "2021-04-13T15:11:15.9220954Z", "architecture": "386", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:82b4c9f36a6fa022454e78ad5c72a74fd34ca4e20489b36a8a436ca3ce9c34ef", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.9893517Z", "lastUpdateTime": + "2021-04-13T15:11:15.9893517Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:975eefa55fc130df8943cf2f72a8852ed2591db75871e0dcc427b76a0d8c26f8", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.7730283Z", "lastUpdateTime": + "2021-04-13T15:11:15.7730283Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:ae39a6f5c07297d7ab64dbd4f82c77c874cc6a94cea29fdec309d0992574b4f7", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.1951619Z", "lastUpdateTime": + "2021-04-13T15:11:15.1951619Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", + "tags": ["latest"], "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}, {"digest": "sha256:beded925d853f36a55cf1d0d4e92c81e945e0be5ade32df173c2827df2c9b12f", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.8778338Z", "lastUpdateTime": + "2021-04-13T15:11:16.8778338Z", "architecture": "ppc64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e132653a6bb3ea3e3b0c63b608122ee72e03cd1e9849a05818965b695afad399", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.1965873Z", "lastUpdateTime": + "2021-04-13T15:11:16.1965873Z", "architecture": "mips64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:ed9c347e6a72d81a3dec189527b720bd0da021239fe779c9549be501ad083b4e", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.0655061Z", "lastUpdateTime": + "2021-04-13T15:11:16.0655061Z", "architecture": "arm64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:fd659a6f4786d18666586ab4935f8e846d7cf1ff1b2709671f3ff0fcd15519b9", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.6907072Z", "lastUpdateTime": + "2021-04-13T15:11:16.6907072Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 17:56:15 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_list_registry_artifacts_ascending.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_list_registry_artifacts_ascending.yaml new file mode 100644 index 000000000000..c218fcb73239 --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_list_registry_artifacts_ascending.yaml @@ -0,0 +1,162 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?orderby=timeasc + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "library/busybox", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '218' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 17:56:16 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?orderby=timeasc +- request: + body: + access_token: REDACTED + grant_type: access_token + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 17:56:17 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '166.65' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:library/busybox:metadata_read + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 17:56:17 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '166.633333' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?orderby=timeasc + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "library/busybox", + "manifests": [{"digest": "sha256:ae39a6f5c07297d7ab64dbd4f82c77c874cc6a94cea29fdec309d0992574b4f7", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.1951619Z", "lastUpdateTime": + "2021-04-13T15:11:15.1951619Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", + "tags": ["latest"], "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}, {"digest": "sha256:1ccc0a0ca577e5fb5a0bdf2150a1a9f842f47c8865e861fa0062c5d343eb8cac", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.6976923Z", "lastUpdateTime": + "2021-04-13T15:11:15.6976923Z", "architecture": "amd64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:975eefa55fc130df8943cf2f72a8852ed2591db75871e0dcc427b76a0d8c26f8", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.7730283Z", "lastUpdateTime": + "2021-04-13T15:11:15.7730283Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:6223225a29b199db7ac08bfc70717c0b4fe28b791abbe25a3208025fa86a4b70", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.9220954Z", "lastUpdateTime": + "2021-04-13T15:11:15.9220954Z", "architecture": "386", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:82b4c9f36a6fa022454e78ad5c72a74fd34ca4e20489b36a8a436ca3ce9c34ef", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.9893517Z", "lastUpdateTime": + "2021-04-13T15:11:15.9893517Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:ed9c347e6a72d81a3dec189527b720bd0da021239fe779c9549be501ad083b4e", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.0655061Z", "lastUpdateTime": + "2021-04-13T15:11:16.0655061Z", "architecture": "arm64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e132653a6bb3ea3e3b0c63b608122ee72e03cd1e9849a05818965b695afad399", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.1965873Z", "lastUpdateTime": + "2021-04-13T15:11:16.1965873Z", "architecture": "mips64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:37b77d92a7ca131dd379ab9a637b814dd99dc0cb560ccf59b566bd6448564b7c", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.3563152Z", "lastUpdateTime": + "2021-04-13T15:11:16.3563152Z", "architecture": "s390x", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:fd659a6f4786d18666586ab4935f8e846d7cf1ff1b2709671f3ff0fcd15519b9", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.6907072Z", "lastUpdateTime": + "2021-04-13T15:11:16.6907072Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:beded925d853f36a55cf1d0d4e92c81e945e0be5ade32df173c2827df2c9b12f", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.8778338Z", "lastUpdateTime": + "2021-04-13T15:11:16.8778338Z", "architecture": "ppc64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 17:56:18 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?orderby=timeasc +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_list_registry_artifacts_by_page.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_list_registry_artifacts_by_page.yaml similarity index 100% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_list_registry_artifacts_by_page.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_list_registry_artifacts_by_page.yaml diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_list_registry_artifacts_descending.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_list_registry_artifacts_descending.yaml new file mode 100644 index 000000000000..e2c86dab9778 --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_list_registry_artifacts_descending.yaml @@ -0,0 +1,162 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?orderby=timedesc + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "library/busybox", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '218' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 17:56:23 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?orderby=timedesc +- request: + body: + access_token: REDACTED + grant_type: access_token + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 17:56:25 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.1' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:library/busybox:metadata_read + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 17:56:25 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '164.616667' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?orderby=timedesc + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "library/busybox", + "manifests": [{"digest": "sha256:beded925d853f36a55cf1d0d4e92c81e945e0be5ade32df173c2827df2c9b12f", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.8778338Z", "lastUpdateTime": + "2021-04-13T15:11:16.8778338Z", "architecture": "ppc64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:fd659a6f4786d18666586ab4935f8e846d7cf1ff1b2709671f3ff0fcd15519b9", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.6907072Z", "lastUpdateTime": + "2021-04-13T15:11:16.6907072Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:37b77d92a7ca131dd379ab9a637b814dd99dc0cb560ccf59b566bd6448564b7c", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.3563152Z", "lastUpdateTime": + "2021-04-13T15:11:16.3563152Z", "architecture": "s390x", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e132653a6bb3ea3e3b0c63b608122ee72e03cd1e9849a05818965b695afad399", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.1965873Z", "lastUpdateTime": + "2021-04-13T15:11:16.1965873Z", "architecture": "mips64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:ed9c347e6a72d81a3dec189527b720bd0da021239fe779c9549be501ad083b4e", + "imageSize": 0, "createdTime": "2021-04-13T15:11:16.0655061Z", "lastUpdateTime": + "2021-04-13T15:11:16.0655061Z", "architecture": "arm64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:82b4c9f36a6fa022454e78ad5c72a74fd34ca4e20489b36a8a436ca3ce9c34ef", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.9893517Z", "lastUpdateTime": + "2021-04-13T15:11:15.9893517Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:6223225a29b199db7ac08bfc70717c0b4fe28b791abbe25a3208025fa86a4b70", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.9220954Z", "lastUpdateTime": + "2021-04-13T15:11:15.9220954Z", "architecture": "386", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:975eefa55fc130df8943cf2f72a8852ed2591db75871e0dcc427b76a0d8c26f8", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.7730283Z", "lastUpdateTime": + "2021-04-13T15:11:15.7730283Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:1ccc0a0ca577e5fb5a0bdf2150a1a9f842f47c8865e861fa0062c5d343eb8cac", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.6976923Z", "lastUpdateTime": + "2021-04-13T15:11:15.6976923Z", "architecture": "amd64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:ae39a6f5c07297d7ab64dbd4f82c77c874cc6a94cea29fdec309d0992574b4f7", + "imageSize": 0, "createdTime": "2021-04-13T15:11:15.1951619Z", "lastUpdateTime": + "2021-04-13T15:11:15.1951619Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", + "tags": ["latest"], "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 17:56:25 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests?orderby=timedesc +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_set_properties.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_set_properties.yaml new file mode 100644 index 000000000000..fa2ab96cee3c --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_async.test_set_properties.yaml @@ -0,0 +1,310 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo2c591564 + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repo2c591564", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '215' + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 16:09:08 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/repo2c591564 +- request: + body: + access_token: REDACTED + grant_type: access_token + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 16:09:09 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '166.65' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:repo2c591564:metadata_read + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 16:09:09 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '166.633333' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo2c591564 + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "repo2c591564", "createdTime": + "2021-04-27T22:06:04.0103059Z", "lastUpdateTime": "2021-04-27T22:06:02.4505321Z", + "manifestCount": 10, "tagCount": 1, "changeableAttributes": {"deleteEnabled": + true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "teleportEnabled": + false}}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '315' + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 16:09:09 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/repo2c591564 +- request: + body: '{"deleteEnabled": false, "writeEnabled": false, "listEnabled": false, "readEnabled": + false}' + headers: + Accept: + - application/json + Content-Length: + - '91' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: PATCH + uri: https://fake_url.azurecr.io/acr/v1/repo2c591564 + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repo2c591564", "Action": "metadata_write"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '216' + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 16:09:09 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/repo2c591564 +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:repo2c591564:metadata_write + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 16:09:09 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '166.616667' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: '{"deleteEnabled": false, "writeEnabled": false, "listEnabled": false, "readEnabled": + false}' + headers: + Accept: + - application/json + Content-Length: + - '91' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: PATCH + uri: https://fake_url.azurecr.io/acr/v1/repo2c591564 + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "repo2c591564", "createdTime": + "2021-04-27T22:06:04.0103059Z", "lastUpdateTime": "2021-04-27T22:06:02.4505321Z", + "manifestCount": 10, "tagCount": 1, "changeableAttributes": {"deleteEnabled": + false, "writeEnabled": false, "readEnabled": false, "listEnabled": false, + "teleportEnabled": false}}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '319' + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 16:09:09 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/repo2c591564 +- request: + body: '{"deleteEnabled": true, "writeEnabled": true, "listEnabled": true, "readEnabled": + true}' + headers: + Accept: + - application/json + Content-Length: + - '87' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: PATCH + uri: https://fake_url.azurecr.io/acr/v1/repo2c591564 + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repo2c591564", "Action": "metadata_write"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '216' + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 16:09:09 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/repo2c591564 +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:repo2c591564:metadata_write + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 16:09:10 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '166.6' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: '{"deleteEnabled": true, "writeEnabled": true, "listEnabled": true, "readEnabled": + true}' + headers: + Accept: + - application/json + Content-Length: + - '87' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: PATCH + uri: https://fake_url.azurecr.io/acr/v1/repo2c591564 + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "repo2c591564", "createdTime": + "2021-04-27T22:06:04.0103059Z", "lastUpdateTime": "2021-04-27T22:06:02.4505321Z", + "manifestCount": 10, "tagCount": 1, "changeableAttributes": {"deleteEnabled": + true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "teleportEnabled": + false}}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '315' + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 16:09:10 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/repo2c591564 +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_delete_registry_artifact.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_delete_registry_artifact.yaml new file mode 100644 index 000000000000..8add8f00bfa9 --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_delete_registry_artifact.yaml @@ -0,0 +1,522 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b2 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo3c82158b/_manifests + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repo3c82158b", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '215' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 May 2021 20:56:50 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=access_token&service=fake_url.azurecr.io&access_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1343' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b2 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 May 2021 20:56:51 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.633333' + status: + code: 200 + message: OK +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepo3c82158b%3Ametadata_read&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1080' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b2 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 May 2021 20:56:52 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.616667' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b2 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo3c82158b/_manifests + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "repo3c82158b", "manifests": + [{"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", + "imageSize": 525, "createdTime": "2021-05-05T20:56:39.8688881Z", "lastUpdateTime": + "2021-05-05T20:56:39.8688881Z", "architecture": "amd64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1", + "imageSize": 0, "createdTime": "2021-04-28T15:25:27.320821Z", "lastUpdateTime": + "2021-04-28T15:25:27.320821Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:88b2e00179bd6c4064612403c8d42a13de7ca809d61fee966ce9e129860a8a90", + "imageSize": 0, "createdTime": "2021-04-28T15:25:27.6536514Z", "lastUpdateTime": + "2021-04-28T15:25:27.6536514Z", "architecture": "mips64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:963612c5503f3f1674f315c67089dee577d8cc6afc18565e0b4183ae355fb343", + "imageSize": 0, "createdTime": "2021-04-28T15:25:29.223197Z", "lastUpdateTime": + "2021-04-28T15:25:29.223197Z", "architecture": "arm64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:bb7ab0fa94fdd78aca84b27a1bd46c4b811051f9b69905d81f5f267fc6546a9d", + "imageSize": 0, "createdTime": "2021-04-28T15:25:27.8694422Z", "lastUpdateTime": + "2021-04-28T15:25:27.8694422Z", "architecture": "ppc64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:cb55d8f7347376e1ba38ca740904b43c9a52f66c7d2ae1ef1a0de1bc9f40df98", + "imageSize": 0, "createdTime": "2021-04-28T15:25:27.2462505Z", "lastUpdateTime": + "2021-04-28T15:25:27.2462505Z", "architecture": "386", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e49abad529e5d9bd6787f3abeab94e09ba274fe34731349556a850b9aebbf7bf", + "imageSize": 0, "createdTime": "2021-04-28T15:25:26.8210861Z", "lastUpdateTime": + "2021-04-28T15:25:26.8210861Z", "architecture": "s390x", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e5785cb0c62cebbed4965129bae371f0589cadd6d84798fb58c2c5f9e237efd9", + "imageSize": 0, "createdTime": "2021-04-28T15:25:27.1316373Z", "lastUpdateTime": + "2021-04-28T15:25:27.1316373Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:ea0cfb27fd41ea0405d3095880c1efa45710f5bcdddb7d7d5a7317ad4825ae14", + "imageSize": 0, "createdTime": "2021-04-28T15:25:26.9759284Z", "lastUpdateTime": + "2021-04-28T15:25:26.9759284Z", "architecture": "amd64", "os": "windows", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "imageSize": 0, "createdTime": "2021-04-28T15:25:27.0302186Z", "lastUpdateTime": + "2021-04-28T15:25:27.0302186Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", + "tags": ["tag3c82158b"], "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 May 2021 20:56:52 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b2 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/repo3c82158b + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repo3c82158b", "Action": "delete"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '208' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 May 2021 20:56:53 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=access_token&service=fake_url.azurecr.io&access_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1343' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b2 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 May 2021 20:56:54 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.166667' + status: + code: 200 + message: OK +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepo3c82158b%3Adelete&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1073' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b2 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 May 2021 20:56:54 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '165.466667' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b2 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/repo3c82158b + response: + body: + string: '{"manifestsDeleted": ["sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", + "sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1", + "sha256:88b2e00179bd6c4064612403c8d42a13de7ca809d61fee966ce9e129860a8a90", + "sha256:963612c5503f3f1674f315c67089dee577d8cc6afc18565e0b4183ae355fb343", + "sha256:bb7ab0fa94fdd78aca84b27a1bd46c4b811051f9b69905d81f5f267fc6546a9d", + "sha256:cb55d8f7347376e1ba38ca740904b43c9a52f66c7d2ae1ef1a0de1bc9f40df98", + "sha256:e49abad529e5d9bd6787f3abeab94e09ba274fe34731349556a850b9aebbf7bf", + "sha256:e5785cb0c62cebbed4965129bae371f0589cadd6d84798fb58c2c5f9e237efd9", + "sha256:ea0cfb27fd41ea0405d3095880c1efa45710f5bcdddb7d7d5a7317ad4825ae14", + "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519"], + "tagsDeleted": ["tag3c82158b"]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '793' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 May 2021 20:56:56 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-calls-per-second: + - '8.000000' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b2 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo3c82158b/_manifests/sha256%3A1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repo3c82158b", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '215' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 May 2021 20:57:06 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepo3c82158b%3Ametadata_read&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1080' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b2 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 May 2021 20:57:06 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '165.45' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b2 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo3c82158b/_manifests/sha256%3A1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 + response: + body: + string: '{"errors": [{"code": "MANIFEST_UNKNOWN", "message": "manifest unknown"}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '70' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 May 2021 20:57:06 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 404 + message: Not Found +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_delete_registry_artifact_does_not_exist.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_delete_registry_artifact_does_not_exist.yaml new file mode 100644 index 000000000000..07f15783ad13 --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_delete_registry_artifact_does_not_exist.yaml @@ -0,0 +1,173 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b2 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/repob0ef1bd1 + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repob0ef1bd1", "Action": "delete"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '208' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 May 2021 20:57:07 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=access_token&service=fake_url.azurecr.io&access_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1343' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b2 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 May 2021 20:57:08 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.116667' + status: + code: 200 + message: OK +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepob0ef1bd1%3Adelete&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1073' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b2 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 May 2021 20:57:08 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.066667' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b2 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/repob0ef1bd1 + response: + body: + string: '{"errors": [{"code": "NAME_UNKNOWN", "message": "repository name not + known to registry", "detail": {"name": "repob0ef1bd1"}}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '120' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 May 2021 20:57:09 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-calls-per-second: + - '8.000000' + status: + code: 404 + message: Not Found +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_get_registry_artifact_properties.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_delete_tag.yaml similarity index 67% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_get_registry_artifact_properties.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_delete_tag.yaml index 44f2e9333186..8bb36829f2d7 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_get_registry_artifact_properties.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_delete_tag.yaml @@ -8,15 +8,17 @@ interactions: - gzip, deflate Connection: - keep-alive + Content-Length: + - '0' User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_tags/latest + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/repo34ab0fa1/_tags/tag34ab0fa10 response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": - "repository", "Name": "library/busybox", "Action": "metadata_read"}]}]}' + "repository", "Name": "repo34ab0fa1", "Action": "delete"}]}]}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -26,11 +28,11 @@ interactions: connection: - keep-alive content-length: - - '218' + - '208' content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:05:33 GMT + - Mon, 03 May 2021 16:11:10 GMT docker-distribution-api-version: - registry/2.0 server: @@ -71,7 +73,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:05:34 GMT + - Mon, 03 May 2021 16:11:11 GMT server: - openresty strict-transport-security: @@ -79,12 +81,12 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '166.633333' + - '166.583333' status: code: 200 message: OK - request: - body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Alibrary%2Fbusybox%3Ametadata_read&refresh_token=REDACTED + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepo34ab0fa1%3Adelete&refresh_token=REDACTED headers: Accept: - application/json @@ -93,7 +95,7 @@ interactions: Connection: - keep-alive Content-Length: - - '1085' + - '1073' Content-Type: - application/x-www-form-urlencoded User-Agent: @@ -109,7 +111,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:05:34 GMT + - Mon, 03 May 2021 16:11:12 GMT server: - openresty strict-transport-security: @@ -117,7 +119,7 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '166.316667' + - '166.1' status: code: 200 message: OK @@ -130,17 +132,15 @@ interactions: - gzip, deflate Connection: - keep-alive + Content-Length: + - '0' User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_tags/latest + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/repo34ab0fa1/_tags/tag34ab0fa10 response: body: - string: '{"registry": "fake_url.azurecr.io", "imageName": "library/busybox", - "tag": {"name": "latest", "digest": "sha256:ae39a6f5c07297d7ab64dbd4f82c77c874cc6a94cea29fdec309d0992574b4f7", - "createdTime": "2021-04-13T15:11:15.3146514Z", "lastUpdateTime": "2021-04-13T15:11:15.3146514Z", - "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": - true, "readEnabled": true, "listEnabled": true}}}' + string: '' headers: access-control-expose-headers: - Docker-Content-Digest @@ -150,11 +150,9 @@ interactions: connection: - keep-alive content-length: - - '384' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Wed, 28 Apr 2021 22:05:34 GMT + - Mon, 03 May 2021 16:11:12 GMT docker-distribution-api-version: - registry/2.0 server: @@ -164,9 +162,13 @@ interactions: - max-age=31536000; includeSubDomains x-content-type-options: - nosniff + x-ms-int-docker-content-digest: + - sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519 + x-ms-ratelimit-remaining-calls-per-second: + - '8.000000' status: - code: 200 - message: OK + code: 202 + message: Accepted - request: body: null headers: @@ -179,12 +181,12 @@ interactions: User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: GET - uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests/sha256%3Aae39a6f5c07297d7ab64dbd4f82c77c874cc6a94cea29fdec309d0992574b4f7 + uri: https://fake_url.azurecr.io/acr/v1/repo34ab0fa1/_tags response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": - "repository", "Name": "library/busybox", "Action": "metadata_read"}]}]}' + "repository", "Name": "repo34ab0fa1", "Action": "metadata_read"}]}]}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -194,11 +196,11 @@ interactions: connection: - keep-alive content-length: - - '218' + - '215' content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:05:34 GMT + - Mon, 03 May 2021 16:11:12 GMT docker-distribution-api-version: - registry/2.0 server: @@ -214,7 +216,7 @@ interactions: code: 401 message: Unauthorized - request: - body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Alibrary%2Fbusybox%3Ametadata_read&refresh_token=REDACTED + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepo34ab0fa1%3Ametadata_read&refresh_token=REDACTED headers: Accept: - application/json @@ -223,7 +225,7 @@ interactions: Connection: - keep-alive Content-Length: - - '1085' + - '1080' Content-Type: - application/x-www-form-urlencoded User-Agent: @@ -239,7 +241,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:05:35 GMT + - Mon, 03 May 2021 16:11:12 GMT server: - openresty strict-transport-security: @@ -247,7 +249,7 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '166.3' + - '166.083333' status: code: 200 message: OK @@ -263,25 +265,22 @@ interactions: User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: GET - uri: https://fake_url.azurecr.io/acr/v1/library%2Fbusybox/_manifests/sha256%3Aae39a6f5c07297d7ab64dbd4f82c77c874cc6a94cea29fdec309d0992574b4f7 + uri: https://fake_url.azurecr.io/acr/v1/repo34ab0fa1/_tags response: body: - string: '{"registry": "fake_url.azurecr.io", "imageName": "library/busybox", - "manifest": {"digest": "sha256:ae39a6f5c07297d7ab64dbd4f82c77c874cc6a94cea29fdec309d0992574b4f7", - "imageSize": 0, "createdTime": "2021-04-13T15:11:15.1951619Z", "lastUpdateTime": - "2021-04-13T15:11:15.1951619Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", - "tags": ["latest"], "changeableAttributes": {"deleteEnabled": true, "writeEnabled": - true, "readEnabled": true, "listEnabled": true}, "references": [{"digest": - "sha256:1ccc0a0ca577e5fb5a0bdf2150a1a9f842f47c8865e861fa0062c5d343eb8cac", - "architecture": "amd64", "os": "linux"}, {"digest": "sha256:82b4c9f36a6fa022454e78ad5c72a74fd34ca4e20489b36a8a436ca3ce9c34ef", - "architecture": "arm", "os": "linux"}, {"digest": "sha256:975eefa55fc130df8943cf2f72a8852ed2591db75871e0dcc427b76a0d8c26f8", - "architecture": "arm", "os": "linux"}, {"digest": "sha256:fd659a6f4786d18666586ab4935f8e846d7cf1ff1b2709671f3ff0fcd15519b9", - "architecture": "arm", "os": "linux"}, {"digest": "sha256:ed9c347e6a72d81a3dec189527b720bd0da021239fe779c9549be501ad083b4e", - "architecture": "arm64", "os": "linux"}, {"digest": "sha256:6223225a29b199db7ac08bfc70717c0b4fe28b791abbe25a3208025fa86a4b70", - "architecture": "386", "os": "linux"}, {"digest": "sha256:e132653a6bb3ea3e3b0c63b608122ee72e03cd1e9849a05818965b695afad399", - "architecture": "mips64le", "os": "linux"}, {"digest": "sha256:beded925d853f36a55cf1d0d4e92c81e945e0be5ade32df173c2827df2c9b12f", - "architecture": "ppc64le", "os": "linux"}, {"digest": "sha256:37b77d92a7ca131dd379ab9a637b814dd99dc0cb560ccf59b566bd6448564b7c", - "architecture": "s390x", "os": "linux"}]}}' + string: '{"registry": "fake_url.azurecr.io", "imageName": "repo34ab0fa1", "tags": + [{"name": "tag34ab0fa11", "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "createdTime": "2021-04-28T15:12:32.4424555Z", "lastUpdateTime": "2021-04-28T15:12:32.4424555Z", + "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}, {"name": "tag34ab0fa12", + "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "createdTime": "2021-04-28T15:12:32.8815612Z", "lastUpdateTime": "2021-04-28T15:12:32.8815612Z", + "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}, {"name": "tag34ab0fa13", + "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "createdTime": "2021-04-28T15:12:32.6269622Z", "lastUpdateTime": "2021-04-28T15:12:32.6269622Z", + "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}]}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -291,11 +290,11 @@ interactions: connection: - keep-alive content-length: - - '1563' + - '1028' content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:05:35 GMT + - Mon, 03 May 2021 16:11:12 GMT docker-distribution-api-version: - registry/2.0 server: diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_set_tag_properties_does_not_exist.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_delete_tag_does_not_exist.yaml similarity index 85% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_set_tag_properties_does_not_exist.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_delete_tag_does_not_exist.yaml index 2fdb44b9a833..4bdba15ba8f6 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_set_tag_properties_does_not_exist.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_delete_tag_does_not_exist.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"deleteEnabled": false}' + body: null headers: Accept: - application/json @@ -9,18 +9,16 @@ interactions: Connection: - keep-alive Content-Length: - - '24' - Content-Type: - - application/json + - '0' User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: PATCH - uri: https://fake_url.azurecr.io/acr/v1/repo2b291da6/_tags/does_not_exist + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/repo506215e7/_tags/does_not_exist response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": - "repository", "Name": "repo2b291da6", "Action": "metadata_write"}]}]}' + "repository", "Name": "repo506215e7", "Action": "delete"}]}]}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -30,11 +28,11 @@ interactions: connection: - keep-alive content-length: - - '216' + - '208' content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:39 GMT + - Mon, 03 May 2021 16:11:51 GMT docker-distribution-api-version: - registry/2.0 server: @@ -75,7 +73,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:41 GMT + - Mon, 03 May 2021 16:11:52 GMT server: - openresty strict-transport-security: @@ -83,12 +81,12 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '166.633333' + - '165.883333' status: code: 200 message: OK - request: - body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepo2b291da6%3Ametadata_write&refresh_token=REDACTED + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepo506215e7%3Adelete&refresh_token=REDACTED headers: Accept: - application/json @@ -97,7 +95,7 @@ interactions: Connection: - keep-alive Content-Length: - - '1081' + - '1073' Content-Type: - application/x-www-form-urlencoded User-Agent: @@ -113,7 +111,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:41 GMT + - Mon, 03 May 2021 16:11:52 GMT server: - openresty strict-transport-security: @@ -121,12 +119,12 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '165.716667' + - '165.866667' status: code: 200 message: OK - request: - body: '{"deleteEnabled": false}' + body: null headers: Accept: - application/json @@ -135,13 +133,11 @@ interactions: Connection: - keep-alive Content-Length: - - '24' - Content-Type: - - application/json + - '0' User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: PATCH - uri: https://fake_url.azurecr.io/acr/v1/repo2b291da6/_tags/does_not_exist + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/repo506215e7/_tags/does_not_exist response: body: string: '{"errors": [{"code": "TAG_UNKNOWN", "message": "the specified tag does @@ -159,7 +155,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:41 GMT + - Mon, 03 May 2021 16:11:53 GMT docker-distribution-api-version: - registry/2.0 server: @@ -169,6 +165,8 @@ interactions: - max-age=31536000; includeSubDomains x-content-type-options: - nosniff + x-ms-ratelimit-remaining-calls-per-second: + - '8.000000' status: code: 404 message: Not Found diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_get_manifest_properties.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_get_manifest_properties.yaml new file mode 100644 index 000000000000..b8e40750a564 --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_get_manifest_properties.yaml @@ -0,0 +1,389 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo27331535/_manifests + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repo27331535", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '215' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:19:42 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=access_token&service=fake_url.azurecr.io&access_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1343' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:19:43 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '165.45' + status: + code: 200 + message: OK +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepo27331535%3Ametadata_read&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1080' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:19:44 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '165.433333' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo27331535/_manifests + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "repo27331535", "manifests": + [{"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", + "imageSize": 0, "createdTime": "2021-04-28T14:19:08.1493156Z", "lastUpdateTime": + "2021-04-28T14:19:08.1493156Z", "architecture": "amd64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1", + "imageSize": 0, "createdTime": "2021-04-28T14:19:08.2257429Z", "lastUpdateTime": + "2021-04-28T14:19:08.2257429Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:88b2e00179bd6c4064612403c8d42a13de7ca809d61fee966ce9e129860a8a90", + "imageSize": 0, "createdTime": "2021-04-28T14:19:08.4130486Z", "lastUpdateTime": + "2021-04-28T14:19:08.4130486Z", "architecture": "mips64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:963612c5503f3f1674f315c67089dee577d8cc6afc18565e0b4183ae355fb343", + "imageSize": 0, "createdTime": "2021-04-28T14:19:08.9755326Z", "lastUpdateTime": + "2021-04-28T14:19:08.9755326Z", "architecture": "arm64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:bb7ab0fa94fdd78aca84b27a1bd46c4b811051f9b69905d81f5f267fc6546a9d", + "imageSize": 0, "createdTime": "2021-04-28T14:19:08.4645969Z", "lastUpdateTime": + "2021-04-28T14:19:08.4645969Z", "architecture": "ppc64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:cb55d8f7347376e1ba38ca740904b43c9a52f66c7d2ae1ef1a0de1bc9f40df98", + "imageSize": 0, "createdTime": "2021-04-28T14:19:10.1957381Z", "lastUpdateTime": + "2021-04-28T14:19:10.1957381Z", "architecture": "386", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e49abad529e5d9bd6787f3abeab94e09ba274fe34731349556a850b9aebbf7bf", + "imageSize": 0, "createdTime": "2021-04-28T14:19:08.5821358Z", "lastUpdateTime": + "2021-04-28T14:19:08.5821358Z", "architecture": "s390x", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e5785cb0c62cebbed4965129bae371f0589cadd6d84798fb58c2c5f9e237efd9", + "imageSize": 0, "createdTime": "2021-04-28T14:19:07.9519043Z", "lastUpdateTime": + "2021-04-28T14:19:07.9519043Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:ea0cfb27fd41ea0405d3095880c1efa45710f5bcdddb7d7d5a7317ad4825ae14", + "imageSize": 0, "createdTime": "2021-04-28T14:19:08.3640124Z", "lastUpdateTime": + "2021-04-28T14:19:08.3640124Z", "architecture": "amd64", "os": "windows", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "imageSize": 0, "createdTime": "2021-04-28T14:19:07.5813228Z", "lastUpdateTime": + "2021-04-28T14:19:07.5813228Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", + "tags": ["tag27331535"], "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:19:44 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo27331535/_manifests/sha256%3A1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repo27331535", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '215' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:19:45 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=access_token&service=fake_url.azurecr.io&access_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1343' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:19:45 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.633333' + status: + code: 200 + message: OK +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepo27331535%3Ametadata_read&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1080' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:19:45 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.616667' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo27331535/_manifests/sha256%3A1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "repo27331535", "manifest": + {"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", + "imageSize": 0, "createdTime": "2021-04-28T14:19:08.1493156Z", "lastUpdateTime": + "2021-04-28T14:19:08.1493156Z", "architecture": "amd64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineDetails": "{\"state\":\"Scan Failed\",\"link\":\"https://aka.ms/test\",\"scanner\":\"Azure + Security Monitoring-Qualys Scanner\",\"result\":{\"version\":\"4/28/2021 9:19:39 + PM\",\"summary\":[{\"severity\":\"High\",\"count\":0},{\"severity\":\"Medium\",\"count\":0},{\"severity\":\"Low\",\"count\":0}]}}", + "quarantineState": "Passed"}}}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '812' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:19:46 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_delete_tag_does_not_exist.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_get_manifest_properties_does_not_exist.yaml similarity index 82% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_delete_tag_does_not_exist.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_get_manifest_properties_does_not_exist.yaml index fb76741509cc..e2cab48c44a5 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_delete_tag_does_not_exist.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_get_manifest_properties_does_not_exist.yaml @@ -8,12 +8,10 @@ interactions: - gzip, deflate Connection: - keep-alive - Content-Length: - - '0' User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: DELETE - uri: https://fake_url.azurecr.io/acr/v1/DOES_NOT_EXIST123/_tags/DOESNOTEXIST123 + method: GET + uri: https://fake_url.azurecr.io/acr/v1/hello-world/_manifests/sha256%3Aabcdefghijkl response: body: string: '404 page not found @@ -27,7 +25,7 @@ interactions: content-type: - text/plain; charset=utf-8 date: - - Wed, 28 Apr 2021 22:13:56 GMT + - Wed, 28 Apr 2021 21:19:46 GMT docker-distribution-api-version: - registry/2.0 server: diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_delete_tag.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_get_tag_properties.yaml similarity index 56% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_delete_tag.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_get_tag_properties.yaml index f1b773fad4e5..e91c8988b6da 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_delete_tag.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_get_tag_properties.yaml @@ -11,12 +11,12 @@ interactions: User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: GET - uri: https://fake_url.azurecr.io/acr/v1/repoeb7113db/_tags/tageb7113db + uri: https://fake_url.azurecr.io/acr/v1/repoc1b5131a/_manifests response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": - "repository", "Name": "repoeb7113db", "Action": "metadata_read"}]}]}' + "repository", "Name": "repoc1b5131a", "Action": "metadata_read"}]}]}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -30,7 +30,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:13:48 GMT + - Wed, 28 Apr 2021 21:20:01 GMT docker-distribution-api-version: - registry/2.0 server: @@ -71,7 +71,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:13:49 GMT + - Wed, 28 Apr 2021 21:20:03 GMT server: - openresty strict-transport-security: @@ -79,12 +79,12 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '166.65' + - '165.85' status: code: 200 message: OK - request: - body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepoeb7113db%3Ametadata_read&refresh_token=REDACTED + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepoc1b5131a%3Ametadata_read&refresh_token=REDACTED headers: Accept: - application/json @@ -109,7 +109,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:13:49 GMT + - Wed, 28 Apr 2021 21:20:03 GMT server: - openresty strict-transport-security: @@ -117,7 +117,7 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '166.633333' + - '165.833333' status: code: 200 message: OK @@ -133,14 +133,60 @@ interactions: User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: GET - uri: https://fake_url.azurecr.io/acr/v1/repoeb7113db/_tags/tageb7113db + uri: https://fake_url.azurecr.io/acr/v1/repoc1b5131a/_manifests response: body: - string: '{"registry": "fake_url.azurecr.io", "imageName": "repoeb7113db", "tag": - {"name": "tageb7113db", "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", - "createdTime": "2021-04-28T22:13:37.9038522Z", "lastUpdateTime": "2021-04-28T22:13:37.9038522Z", - "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": - true, "readEnabled": true, "listEnabled": true}}}' + string: '{"registry": "fake_url.azurecr.io", "imageName": "repoc1b5131a", "manifests": + [{"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", + "imageSize": 0, "createdTime": "2021-04-28T14:54:13.7370801Z", "lastUpdateTime": + "2021-04-28T14:54:13.7370801Z", "architecture": "amd64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1", + "imageSize": 0, "createdTime": "2021-04-28T14:54:14.1322608Z", "lastUpdateTime": + "2021-04-28T14:54:14.1322608Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:88b2e00179bd6c4064612403c8d42a13de7ca809d61fee966ce9e129860a8a90", + "imageSize": 0, "createdTime": "2021-04-28T14:54:14.7528767Z", "lastUpdateTime": + "2021-04-28T14:54:14.7528767Z", "architecture": "mips64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:963612c5503f3f1674f315c67089dee577d8cc6afc18565e0b4183ae355fb343", + "imageSize": 0, "createdTime": "2021-04-28T14:54:14.230217Z", "lastUpdateTime": + "2021-04-28T14:54:14.230217Z", "architecture": "arm64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:bb7ab0fa94fdd78aca84b27a1bd46c4b811051f9b69905d81f5f267fc6546a9d", + "imageSize": 0, "createdTime": "2021-04-28T14:54:14.8303731Z", "lastUpdateTime": + "2021-04-28T14:54:14.8303731Z", "architecture": "ppc64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:cb55d8f7347376e1ba38ca740904b43c9a52f66c7d2ae1ef1a0de1bc9f40df98", + "imageSize": 0, "createdTime": "2021-04-28T14:54:14.3299515Z", "lastUpdateTime": + "2021-04-28T14:54:14.3299515Z", "architecture": "386", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e49abad529e5d9bd6787f3abeab94e09ba274fe34731349556a850b9aebbf7bf", + "imageSize": 0, "createdTime": "2021-04-28T14:54:14.9895208Z", "lastUpdateTime": + "2021-04-28T14:54:14.9895208Z", "architecture": "s390x", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e5785cb0c62cebbed4965129bae371f0589cadd6d84798fb58c2c5f9e237efd9", + "imageSize": 0, "createdTime": "2021-04-28T14:54:13.9473522Z", "lastUpdateTime": + "2021-04-28T14:54:13.9473522Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:ea0cfb27fd41ea0405d3095880c1efa45710f5bcdddb7d7d5a7317ad4825ae14", + "imageSize": 0, "createdTime": "2021-04-28T14:54:15.0966574Z", "lastUpdateTime": + "2021-04-28T14:54:15.0966574Z", "architecture": "amd64", "os": "windows", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "imageSize": 0, "createdTime": "2021-04-28T14:54:13.2881991Z", "lastUpdateTime": + "2021-04-28T14:54:13.2881991Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", + "tags": ["tagc1b5131a"], "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}]}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -149,12 +195,10 @@ interactions: - X-Ms-Correlation-Request-Id connection: - keep-alive - content-length: - - '386' content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:13:50 GMT + - Wed, 28 Apr 2021 21:20:03 GMT docker-distribution-api-version: - registry/2.0 server: @@ -162,6 +206,8 @@ interactions: strict-transport-security: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked x-content-type-options: - nosniff status: @@ -176,17 +222,15 @@ interactions: - gzip, deflate Connection: - keep-alive - Content-Length: - - '0' User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: DELETE - uri: https://fake_url.azurecr.io/acr/v1/repoeb7113db/_tags/tageb7113db + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repoc1b5131a/_tags/tagc1b5131a response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": - "repository", "Name": "repoeb7113db", "Action": "delete"}]}]}' + "repository", "Name": "repoc1b5131a", "Action": "metadata_read"}]}]}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -196,11 +240,11 @@ interactions: connection: - keep-alive content-length: - - '208' + - '215' content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:13:50 GMT + - Wed, 28 Apr 2021 21:20:04 GMT docker-distribution-api-version: - registry/2.0 server: @@ -216,7 +260,7 @@ interactions: code: 401 message: Unauthorized - request: - body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepoeb7113db%3Adelete&refresh_token=REDACTED + body: grant_type=access_token&service=fake_url.azurecr.io&access_token=REDACTED headers: Accept: - application/json @@ -225,23 +269,23 @@ interactions: Connection: - keep-alive Content-Length: - - '1073' + - '1343' Content-Type: - application/x-www-form-urlencoded User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: POST - uri: https://fake_url.azurecr.io/oauth2/token + uri: https://fake_url.azurecr.io/oauth2/exchange response: body: - string: '{"access_token": "REDACTED"}' + string: '{"refresh_token": "REDACTED"}' headers: connection: - keep-alive content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:13:50 GMT + - Wed, 28 Apr 2021 21:20:05 GMT server: - openresty strict-transport-security: @@ -249,104 +293,12 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '166.616667' + - '165.966667' status: code: 200 message: OK - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - User-Agent: - - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: DELETE - uri: https://fake_url.azurecr.io/acr/v1/repoeb7113db/_tags/tageb7113db - response: - body: - string: '' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '0' - date: - - Wed, 28 Apr 2021 22:13:50 GMT - docker-distribution-api-version: - - registry/2.0 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-int-docker-content-digest: - - sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519 - x-ms-ratelimit-remaining-calls-per-second: - - '8.000000' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://fake_url.azurecr.io/acr/v1/repoeb7113db/_tags/tageb7113db - response: - body: - string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, - visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": - "repository", "Name": "repoeb7113db", "Action": "metadata_read"}]}]}' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '215' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 28 Apr 2021 22:13:55 GMT - docker-distribution-api-version: - - registry/2.0 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - www-authenticate: - - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" - x-content-type-options: - - nosniff - status: - code: 401 - message: Unauthorized -- request: - body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepoeb7113db%3Ametadata_read&refresh_token=REDACTED + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepoc1b5131a%3Ametadata_read&refresh_token=REDACTED headers: Accept: - application/json @@ -371,7 +323,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:13:55 GMT + - Wed, 28 Apr 2021 21:20:05 GMT server: - openresty strict-transport-security: @@ -379,7 +331,7 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '166.6' + - '165.75' status: code: 200 message: OK @@ -395,11 +347,14 @@ interactions: User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: GET - uri: https://fake_url.azurecr.io/acr/v1/repoeb7113db/_tags/tageb7113db + uri: https://fake_url.azurecr.io/acr/v1/repoc1b5131a/_tags/tagc1b5131a response: body: - string: '{"errors": [{"code": "TAG_UNKNOWN", "message": "the specified tag does - not exist"}]}' + string: '{"registry": "fake_url.azurecr.io", "imageName": "repoc1b5131a", "tag": + {"name": "tagc1b5131a", "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "createdTime": "2021-04-28T14:54:13.3752616Z", "lastUpdateTime": "2021-04-28T14:54:13.3752616Z", + "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -409,11 +364,11 @@ interactions: connection: - keep-alive content-length: - - '81' + - '386' content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:13:56 GMT + - Wed, 28 Apr 2021 21:20:05 GMT docker-distribution-api-version: - registry/2.0 server: @@ -424,6 +379,6 @@ interactions: x-content-type-options: - nosniff status: - code: 404 - message: Not Found + code: 200 + message: OK version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_set_manifest_properties_does_not_exist.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_get_tag_properties_does_not_exist.yaml similarity index 86% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_set_manifest_properties_does_not_exist.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_get_tag_properties_does_not_exist.yaml index a91b75f0b35d..9e723569c611 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_set_manifest_properties_does_not_exist.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_get_tag_properties_does_not_exist.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"deleteEnabled": false}' + body: null headers: Accept: - application/json @@ -8,14 +8,10 @@ interactions: - gzip, deflate Connection: - keep-alive - Content-Length: - - '24' - Content-Type: - - application/json User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: PATCH - uri: https://fake_url.azurecr.io/acr/v1/repoc58b1fc1/_manifests/sha256%3Aabcdef + method: GET + uri: https://fake_url.azurecr.io/acr/v1/hello-world/_tags/doesnotexist response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -30,7 +26,7 @@ interactions: connection: - keep-alive content-length: - - '216' + - '214' content-type: - application/json; charset=utf-8 date: @@ -88,7 +84,7 @@ interactions: code: 200 message: OK - request: - body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepoc58b1fc1%3Ametadata_write&refresh_token=REDACTED + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Ahello-world%3Ametadata_read&refresh_token=REDACTED headers: Accept: - application/json @@ -97,7 +93,7 @@ interactions: Connection: - keep-alive Content-Length: - - '1081' + - '1079' Content-Type: - application/x-www-form-urlencoded User-Agent: @@ -126,7 +122,7 @@ interactions: code: 200 message: OK - request: - body: '{"deleteEnabled": false}' + body: null headers: Accept: - application/json @@ -134,17 +130,14 @@ interactions: - gzip, deflate Connection: - keep-alive - Content-Length: - - '24' - Content-Type: - - application/json User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: PATCH - uri: https://fake_url.azurecr.io/acr/v1/repoc58b1fc1/_manifests/sha256%3Aabcdef + method: GET + uri: https://fake_url.azurecr.io/acr/v1/hello-world/_tags/doesnotexist response: body: - string: '{"errors": [{"code": "MANIFEST_UNKNOWN", "message": "manifest unknown"}]}' + string: '{"errors": [{"code": "TAG_UNKNOWN", "message": "the specified tag does + not exist"}]}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -154,7 +147,7 @@ interactions: connection: - keep-alive content-length: - - '70' + - '81' content-type: - application/json; charset=utf-8 date: diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_list_tags.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_list_tags.yaml new file mode 100644 index 000000000000..633693787055 --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_list_tags.yaml @@ -0,0 +1,397 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo25ce0f5d/_manifests + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repo25ce0f5d", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '215' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:20:23 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=access_token&service=fake_url.azurecr.io&access_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1343' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:20:24 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.466667' + status: + code: 200 + message: OK +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepo25ce0f5d%3Ametadata_read&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1080' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:20:24 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '165.516667' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo25ce0f5d/_manifests + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "repo25ce0f5d", "manifests": + [{"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", + "imageSize": 0, "createdTime": "2021-04-28T15:08:43.2327437Z", "lastUpdateTime": + "2021-04-28T15:08:43.2327437Z", "architecture": "amd64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1", + "imageSize": 0, "createdTime": "2021-04-28T15:08:43.6358087Z", "lastUpdateTime": + "2021-04-28T15:08:43.6358087Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:88b2e00179bd6c4064612403c8d42a13de7ca809d61fee966ce9e129860a8a90", + "imageSize": 0, "createdTime": "2021-04-28T15:08:43.0261552Z", "lastUpdateTime": + "2021-04-28T15:08:43.0261552Z", "architecture": "mips64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:963612c5503f3f1674f315c67089dee577d8cc6afc18565e0b4183ae355fb343", + "imageSize": 0, "createdTime": "2021-04-28T15:08:42.8222987Z", "lastUpdateTime": + "2021-04-28T15:08:42.8222987Z", "architecture": "arm64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:bb7ab0fa94fdd78aca84b27a1bd46c4b811051f9b69905d81f5f267fc6546a9d", + "imageSize": 0, "createdTime": "2021-04-28T15:08:42.642209Z", "lastUpdateTime": + "2021-04-28T15:08:42.642209Z", "architecture": "ppc64le", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:cb55d8f7347376e1ba38ca740904b43c9a52f66c7d2ae1ef1a0de1bc9f40df98", + "imageSize": 0, "createdTime": "2021-04-28T15:08:42.7421842Z", "lastUpdateTime": + "2021-04-28T15:08:42.7421842Z", "architecture": "386", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e49abad529e5d9bd6787f3abeab94e09ba274fe34731349556a850b9aebbf7bf", + "imageSize": 0, "createdTime": "2021-04-28T15:08:42.8797686Z", "lastUpdateTime": + "2021-04-28T15:08:42.8797686Z", "architecture": "s390x", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e5785cb0c62cebbed4965129bae371f0589cadd6d84798fb58c2c5f9e237efd9", + "imageSize": 0, "createdTime": "2021-04-28T15:08:44.3818273Z", "lastUpdateTime": + "2021-04-28T15:08:44.3818273Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:ea0cfb27fd41ea0405d3095880c1efa45710f5bcdddb7d7d5a7317ad4825ae14", + "imageSize": 0, "createdTime": "2021-04-28T15:08:43.5610254Z", "lastUpdateTime": + "2021-04-28T15:08:43.5610254Z", "architecture": "amd64", "os": "windows", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "imageSize": 0, "createdTime": "2021-04-28T15:08:41.9477971Z", "lastUpdateTime": + "2021-04-28T15:08:41.9477971Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", + "tags": ["tag25ce0f5d0", "tag25ce0f5d1", "tag25ce0f5d2", "tag25ce0f5d3"], + "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": + true, "listEnabled": true}}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:20:25 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo25ce0f5d/_tags + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repo25ce0f5d", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '215' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:20:26 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=access_token&service=fake_url.azurecr.io&access_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1343' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:20:26 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.633333' + status: + code: 200 + message: OK +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepo25ce0f5d%3Ametadata_read&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1080' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:20:26 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '165.666667' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo25ce0f5d/_tags + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "repo25ce0f5d", "tags": + [{"name": "tag25ce0f5d0", "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "createdTime": "2021-04-28T15:08:41.893031Z", "lastUpdateTime": "2021-04-28T15:08:41.893031Z", + "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}, {"name": "tag25ce0f5d1", + "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "createdTime": "2021-04-28T15:08:42.0475975Z", "lastUpdateTime": "2021-04-28T15:08:42.0475975Z", + "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}, {"name": "tag25ce0f5d2", + "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "createdTime": "2021-04-28T15:08:42.3169392Z", "lastUpdateTime": "2021-04-28T15:08:42.3169392Z", + "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}, {"name": "tag25ce0f5d3", + "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "createdTime": "2021-04-28T15:08:42.2239254Z", "lastUpdateTime": "2021-04-28T15:08:42.2239254Z", + "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '1345' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 28 Apr 2021 21:20:27 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_set_manifest_properties.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_set_manifest_properties.yaml similarity index 72% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_set_manifest_properties.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_set_manifest_properties.yaml index 4189c2af5ab3..39698ccefca2 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_set_manifest_properties.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_set_manifest_properties.yaml @@ -11,12 +11,12 @@ interactions: User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: GET - uri: https://fake_url.azurecr.io/acr/v1/reposetmani160e197b/_manifests + uri: https://fake_url.azurecr.io/acr/v1/repo28471541/_manifests response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": - "repository", "Name": "reposetmani160e197b", "Action": "metadata_read"}]}]}' + "repository", "Name": "repo28471541", "Action": "metadata_read"}]}]}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -26,11 +26,11 @@ interactions: connection: - keep-alive content-length: - - '222' + - '215' content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:13 GMT + - Mon, 03 May 2021 16:12:46 GMT docker-distribution-api-version: - registry/2.0 server: @@ -71,7 +71,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:14 GMT + - Mon, 03 May 2021 16:12:47 GMT server: - openresty strict-transport-security: @@ -79,12 +79,12 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '166.35' + - '166.516667' status: code: 200 message: OK - request: - body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Areposetmani160e197b%3Ametadata_read&refresh_token=REDACTED + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepo28471541%3Ametadata_read&refresh_token=REDACTED headers: Accept: - application/json @@ -93,7 +93,7 @@ interactions: Connection: - keep-alive Content-Length: - - '1087' + - '1080' Content-Type: - application/x-www-form-urlencoded User-Agent: @@ -109,7 +109,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:15 GMT + - Mon, 03 May 2021 16:12:47 GMT server: - openresty strict-transport-security: @@ -117,7 +117,7 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '166.333333' + - '166.5' status: code: 200 message: OK @@ -133,59 +133,59 @@ interactions: User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: GET - uri: https://fake_url.azurecr.io/acr/v1/reposetmani160e197b/_manifests + uri: https://fake_url.azurecr.io/acr/v1/repo28471541/_manifests response: body: - string: '{"registry": "fake_url.azurecr.io", "imageName": "reposetmani160e197b", - "manifests": [{"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", - "imageSize": 525, "createdTime": "2021-04-28T22:06:03.4695677Z", "lastUpdateTime": - "2021-04-28T22:06:03.4695677Z", "architecture": "amd64", "os": "linux", "mediaType": + string: '{"registry": "fake_url.azurecr.io", "imageName": "repo28471541", "manifests": + [{"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", + "imageSize": 525, "createdTime": "2021-05-03T16:12:35.394401Z", "lastUpdateTime": + "2021-05-03T16:12:35.394401Z", "architecture": "amd64", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1", - "imageSize": 525, "createdTime": "2021-04-28T22:06:03.5155339Z", "lastUpdateTime": - "2021-04-28T22:06:03.5155339Z", "architecture": "arm", "os": "linux", "mediaType": + "imageSize": 525, "createdTime": "2021-05-03T16:12:35.8925848Z", "lastUpdateTime": + "2021-05-03T16:12:35.8925848Z", "architecture": "arm", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:88b2e00179bd6c4064612403c8d42a13de7ca809d61fee966ce9e129860a8a90", - "imageSize": 525, "createdTime": "2021-04-28T22:06:03.7255222Z", "lastUpdateTime": - "2021-04-28T22:06:03.7255222Z", "architecture": "mips64le", "os": "linux", + "imageSize": 525, "createdTime": "2021-05-03T16:12:36.2337358Z", "lastUpdateTime": + "2021-05-03T16:12:36.2337358Z", "architecture": "mips64le", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:963612c5503f3f1674f315c67089dee577d8cc6afc18565e0b4183ae355fb343", - "imageSize": 525, "createdTime": "2021-04-28T22:06:05.1517704Z", "lastUpdateTime": - "2021-04-28T22:06:05.1517704Z", "architecture": "arm64", "os": "linux", "mediaType": + "imageSize": 525, "createdTime": "2021-05-03T16:12:35.9585906Z", "lastUpdateTime": + "2021-05-03T16:12:35.9585906Z", "architecture": "arm64", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:bb7ab0fa94fdd78aca84b27a1bd46c4b811051f9b69905d81f5f267fc6546a9d", - "imageSize": 525, "createdTime": "2021-04-28T22:06:03.9476604Z", "lastUpdateTime": - "2021-04-28T22:06:03.9476604Z", "architecture": "ppc64le", "os": "linux", + "imageSize": 525, "createdTime": "2021-05-03T16:12:36.1970464Z", "lastUpdateTime": + "2021-05-03T16:12:36.1970464Z", "architecture": "ppc64le", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:cb55d8f7347376e1ba38ca740904b43c9a52f66c7d2ae1ef1a0de1bc9f40df98", - "imageSize": 525, "createdTime": "2021-04-28T22:06:06.2083312Z", "lastUpdateTime": - "2021-04-28T22:06:06.2083312Z", "architecture": "386", "os": "linux", "mediaType": + "imageSize": 525, "createdTime": "2021-05-03T16:12:36.1483051Z", "lastUpdateTime": + "2021-05-03T16:12:36.1483051Z", "architecture": "386", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:e49abad529e5d9bd6787f3abeab94e09ba274fe34731349556a850b9aebbf7bf", - "imageSize": 525, "createdTime": "2021-04-28T22:06:04.1372935Z", "lastUpdateTime": - "2021-04-28T22:06:04.1372935Z", "architecture": "s390x", "os": "linux", "mediaType": + "imageSize": 525, "createdTime": "2021-05-03T16:12:36.3854241Z", "lastUpdateTime": + "2021-05-03T16:12:36.3854241Z", "architecture": "s390x", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:e5785cb0c62cebbed4965129bae371f0589cadd6d84798fb58c2c5f9e237efd9", - "imageSize": 525, "createdTime": "2021-04-28T22:06:03.8332164Z", "lastUpdateTime": - "2021-04-28T22:06:03.8332164Z", "architecture": "arm", "os": "linux", "mediaType": + "imageSize": 525, "createdTime": "2021-05-03T16:12:35.7153543Z", "lastUpdateTime": + "2021-05-03T16:12:35.7153543Z", "architecture": "arm", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:ea0cfb27fd41ea0405d3095880c1efa45710f5bcdddb7d7d5a7317ad4825ae14", - "imageSize": 1125, "createdTime": "2021-04-28T22:06:04.0284064Z", "lastUpdateTime": - "2021-04-28T22:06:04.0284064Z", "architecture": "amd64", "os": "windows", + "imageSize": 1125, "createdTime": "2021-05-03T16:12:36.4691663Z", "lastUpdateTime": + "2021-05-03T16:12:36.4691663Z", "architecture": "amd64", "os": "windows", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", - "imageSize": 5325, "createdTime": "2021-04-28T22:06:02.9323049Z", "lastUpdateTime": - "2021-04-28T22:06:02.9323049Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", - "tags": ["tag160e197b"], "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + "imageSize": 5325, "createdTime": "2021-05-03T16:12:35.2310813Z", "lastUpdateTime": + "2021-05-03T16:12:35.2310813Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", + "tags": ["tag28471541"], "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true}}]}' headers: access-control-expose-headers: @@ -198,7 +198,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:15 GMT + - Mon, 03 May 2021 16:12:48 GMT docker-distribution-api-version: - registry/2.0 server: @@ -214,8 +214,7 @@ interactions: code: 200 message: OK - request: - body: '{"deleteEnabled": false, "writeEnabled": false, "listEnabled": false, "readEnabled": - false}' + body: null headers: Accept: - application/json @@ -223,19 +222,15 @@ interactions: - gzip, deflate Connection: - keep-alive - Content-Length: - - '91' - Content-Type: - - application/json User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: PATCH - uri: https://fake_url.azurecr.io/acr/v1/reposetmani160e197b/_manifests/sha256%3A1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo28471541/_manifests/sha256%3A1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": - "repository", "Name": "reposetmani160e197b", "Action": "metadata_write"}]}]}' + "repository", "Name": "repo28471541", "Action": "metadata_read"}]}]}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -245,11 +240,11 @@ interactions: connection: - keep-alive content-length: - - '223' + - '215' content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:15 GMT + - Mon, 03 May 2021 16:12:48 GMT docker-distribution-api-version: - registry/2.0 server: @@ -265,7 +260,7 @@ interactions: code: 401 message: Unauthorized - request: - body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Areposetmani160e197b%3Ametadata_write&refresh_token=REDACTED + body: grant_type=access_token&service=fake_url.azurecr.io&access_token=REDACTED headers: Accept: - application/json @@ -274,23 +269,23 @@ interactions: Connection: - keep-alive Content-Length: - - '1088' + - '1343' Content-Type: - application/x-www-form-urlencoded User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: POST - uri: https://fake_url.azurecr.io/oauth2/token + uri: https://fake_url.azurecr.io/oauth2/exchange response: body: - string: '{"access_token": "REDACTED"}' + string: '{"refresh_token": "REDACTED"}' headers: connection: - keep-alive content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:15 GMT + - Mon, 03 May 2021 16:12:49 GMT server: - openresty strict-transport-security: @@ -298,13 +293,12 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '166.316667' + - '166.633333' status: code: 200 message: OK - request: - body: '{"deleteEnabled": false, "writeEnabled": false, "listEnabled": false, "readEnabled": - false}' + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepo28471541%3Ametadata_read&refresh_token=REDACTED headers: Accept: - application/json @@ -313,23 +307,57 @@ interactions: Connection: - keep-alive Content-Length: - - '91' + - '1080' Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:12:49 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.416667' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: PATCH - uri: https://fake_url.azurecr.io/acr/v1/reposetmani160e197b/_manifests/sha256%3A1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo28471541/_manifests/sha256%3A1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 response: body: - string: '{"registry": "fake_url.azurecr.io", "imageName": "reposetmani160e197b", - "manifest": {"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", - "imageSize": 525, "createdTime": "2021-04-28T22:06:03.4695677Z", "lastUpdateTime": - "2021-04-28T22:06:03.4695677Z", "architecture": "amd64", "os": "linux", "mediaType": + string: '{"registry": "fake_url.azurecr.io", "imageName": "repo28471541", "manifest": + {"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", + "imageSize": 525, "createdTime": "2021-05-03T16:12:35.394401Z", "lastUpdateTime": + "2021-05-03T16:12:35.394401Z", "architecture": "amd64", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": - {"deleteEnabled": false, "writeEnabled": false, "readEnabled": false, "listEnabled": - false, "quarantineDetails": "{\"state\":\"Scan Failed\",\"link\":\"https://aka.ms/test\",\"scanner\":\"Azure - Security Monitoring-Qualys Scanner\",\"result\":{\"version\":\"4/28/2021 10:06:07 + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineDetails": "{\"state\":\"Scan InProgress\",\"link\":\"https://aka.ms/test\",\"scanner\":\"Azure + Security Monitoring-Qualys Scanner\",\"result\":{\"version\":\"5/3/2021 4:12:36 PM\",\"summary\":[{\"severity\":\"High\",\"count\":0},{\"severity\":\"Medium\",\"count\":0},{\"severity\":\"Low\",\"count\":0}]}}", "quarantineState": "Passed"}}}' headers: @@ -341,11 +369,11 @@ interactions: connection: - keep-alive content-length: - - '826' + - '815' content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:16 GMT + - Mon, 03 May 2021 16:12:49 GMT docker-distribution-api-version: - registry/2.0 server: @@ -359,8 +387,8 @@ interactions: code: 200 message: OK - request: - body: '{"deleteEnabled": true, "writeEnabled": true, "listEnabled": true, "readEnabled": - true}' + body: '{"deleteEnabled": false, "writeEnabled": false, "listEnabled": false, "readEnabled": + false}' headers: Accept: - application/json @@ -369,18 +397,18 @@ interactions: Connection: - keep-alive Content-Length: - - '87' + - '91' Content-Type: - application/json User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: PATCH - uri: https://fake_url.azurecr.io/acr/v1/reposetmani160e197b/_manifests/sha256%3A1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 + uri: https://fake_url.azurecr.io/acr/v1/repo28471541/_manifests/sha256%3A1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": - "repository", "Name": "reposetmani160e197b", "Action": "metadata_write"}]}]}' + "repository", "Name": "repo28471541", "Action": "metadata_write"}]}]}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -390,11 +418,11 @@ interactions: connection: - keep-alive content-length: - - '223' + - '216' content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:16 GMT + - Mon, 03 May 2021 16:12:50 GMT docker-distribution-api-version: - registry/2.0 server: @@ -410,7 +438,7 @@ interactions: code: 401 message: Unauthorized - request: - body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Areposetmani160e197b%3Ametadata_write&refresh_token=REDACTED + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepo28471541%3Ametadata_write&refresh_token=REDACTED headers: Accept: - application/json @@ -419,7 +447,7 @@ interactions: Connection: - keep-alive Content-Length: - - '1088' + - '1081' Content-Type: - application/x-www-form-urlencoded User-Agent: @@ -435,7 +463,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:16 GMT + - Mon, 03 May 2021 16:12:50 GMT server: - openresty strict-transport-security: @@ -443,13 +471,13 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '166.3' + - '166.4' status: code: 200 message: OK - request: - body: '{"deleteEnabled": true, "writeEnabled": true, "listEnabled": true, "readEnabled": - true}' + body: '{"deleteEnabled": false, "writeEnabled": false, "listEnabled": false, "readEnabled": + false}' headers: Accept: - application/json @@ -458,23 +486,23 @@ interactions: Connection: - keep-alive Content-Length: - - '87' + - '91' Content-Type: - application/json User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: PATCH - uri: https://fake_url.azurecr.io/acr/v1/reposetmani160e197b/_manifests/sha256%3A1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 + uri: https://fake_url.azurecr.io/acr/v1/repo28471541/_manifests/sha256%3A1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 response: body: - string: '{"registry": "fake_url.azurecr.io", "imageName": "reposetmani160e197b", - "manifest": {"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", - "imageSize": 525, "createdTime": "2021-04-28T22:06:03.4695677Z", "lastUpdateTime": - "2021-04-28T22:06:03.4695677Z", "architecture": "amd64", "os": "linux", "mediaType": + string: '{"registry": "fake_url.azurecr.io", "imageName": "repo28471541", "manifest": + {"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", + "imageSize": 525, "createdTime": "2021-05-03T16:12:35.394401Z", "lastUpdateTime": + "2021-05-03T16:12:35.394401Z", "architecture": "amd64", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": - {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": - true, "quarantineDetails": "{\"state\":\"Scan Failed\",\"link\":\"https://aka.ms/test\",\"scanner\":\"Azure - Security Monitoring-Qualys Scanner\",\"result\":{\"version\":\"4/28/2021 10:06:07 + {"deleteEnabled": false, "writeEnabled": false, "readEnabled": false, "listEnabled": + false, "quarantineDetails": "{\"state\":\"Scan InProgress\",\"link\":\"https://aka.ms/test\",\"scanner\":\"Azure + Security Monitoring-Qualys Scanner\",\"result\":{\"version\":\"5/3/2021 4:12:36 PM\",\"summary\":[{\"severity\":\"High\",\"count\":0},{\"severity\":\"Medium\",\"count\":0},{\"severity\":\"Low\",\"count\":0}]}}", "quarantineState": "Passed"}}}' headers: @@ -486,11 +514,11 @@ interactions: connection: - keep-alive content-length: - - '822' + - '819' content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:16 GMT + - Mon, 03 May 2021 16:12:50 GMT docker-distribution-api-version: - registry/2.0 server: @@ -504,7 +532,8 @@ interactions: code: 200 message: OK - request: - body: null + body: '{"deleteEnabled": true, "writeEnabled": true, "listEnabled": true, "readEnabled": + true}' headers: Accept: - application/json @@ -513,16 +542,18 @@ interactions: Connection: - keep-alive Content-Length: - - '0' + - '87' + Content-Type: + - application/json User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: DELETE - uri: https://fake_url.azurecr.io/acr/v1/reposetmani160e197b + method: PATCH + uri: https://fake_url.azurecr.io/acr/v1/repo28471541/_manifests/sha256%3A1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": - "repository", "Name": "reposetmani160e197b", "Action": "delete"}]}]}' + "repository", "Name": "repo28471541", "Action": "metadata_write"}]}]}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -532,11 +563,11 @@ interactions: connection: - keep-alive content-length: - - '215' + - '216' content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:16 GMT + - Mon, 03 May 2021 16:12:50 GMT docker-distribution-api-version: - registry/2.0 server: @@ -552,7 +583,7 @@ interactions: code: 401 message: Unauthorized - request: - body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Areposetmani160e197b%3Adelete&refresh_token=REDACTED + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepo28471541%3Ametadata_write&refresh_token=REDACTED headers: Accept: - application/json @@ -561,7 +592,7 @@ interactions: Connection: - keep-alive Content-Length: - - '1080' + - '1081' Content-Type: - application/x-www-form-urlencoded User-Agent: @@ -577,7 +608,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:17 GMT + - Mon, 03 May 2021 16:12:50 GMT server: - openresty strict-transport-security: @@ -585,12 +616,13 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '166.283333' + - '166.383333' status: code: 200 message: OK - request: - body: null + body: '{"deleteEnabled": true, "writeEnabled": true, "listEnabled": true, "readEnabled": + true}' headers: Accept: - application/json @@ -599,24 +631,25 @@ interactions: Connection: - keep-alive Content-Length: - - '0' + - '87' + Content-Type: + - application/json User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: DELETE - uri: https://fake_url.azurecr.io/acr/v1/reposetmani160e197b + method: PATCH + uri: https://fake_url.azurecr.io/acr/v1/repo28471541/_manifests/sha256%3A1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 response: body: - string: '{"manifestsDeleted": ["sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", - "sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1", - "sha256:88b2e00179bd6c4064612403c8d42a13de7ca809d61fee966ce9e129860a8a90", - "sha256:963612c5503f3f1674f315c67089dee577d8cc6afc18565e0b4183ae355fb343", - "sha256:bb7ab0fa94fdd78aca84b27a1bd46c4b811051f9b69905d81f5f267fc6546a9d", - "sha256:cb55d8f7347376e1ba38ca740904b43c9a52f66c7d2ae1ef1a0de1bc9f40df98", - "sha256:e49abad529e5d9bd6787f3abeab94e09ba274fe34731349556a850b9aebbf7bf", - "sha256:e5785cb0c62cebbed4965129bae371f0589cadd6d84798fb58c2c5f9e237efd9", - "sha256:ea0cfb27fd41ea0405d3095880c1efa45710f5bcdddb7d7d5a7317ad4825ae14", - "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519"], - "tagsDeleted": ["tag160e197b"]}' + string: '{"registry": "fake_url.azurecr.io", "imageName": "repo28471541", "manifest": + {"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", + "imageSize": 525, "createdTime": "2021-05-03T16:12:35.394401Z", "lastUpdateTime": + "2021-05-03T16:12:35.394401Z", "architecture": "amd64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineDetails": "{\"state\":\"Scan InProgress\",\"link\":\"https://aka.ms/test\",\"scanner\":\"Azure + Security Monitoring-Qualys Scanner\",\"result\":{\"version\":\"5/3/2021 4:12:36 + PM\",\"summary\":[{\"severity\":\"High\",\"count\":0},{\"severity\":\"Medium\",\"count\":0},{\"severity\":\"Low\",\"count\":0}]}}", + "quarantineState": "Passed"}}}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -626,11 +659,11 @@ interactions: connection: - keep-alive content-length: - - '793' + - '815' content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:06:18 GMT + - Mon, 03 May 2021 16:12:51 GMT docker-distribution-api-version: - registry/2.0 server: @@ -640,9 +673,7 @@ interactions: - max-age=31536000; includeSubDomains x-content-type-options: - nosniff - x-ms-ratelimit-remaining-calls-per-second: - - '8.000000' status: - code: 202 - message: Accepted + code: 200 + message: OK version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_delete_registry_artifact.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_set_tag_properties.yaml similarity index 58% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_delete_registry_artifact.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_set_tag_properties.yaml index 4b604d01278a..c62fdb8311d8 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_delete_registry_artifact.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact.test_set_tag_properties.yaml @@ -11,12 +11,12 @@ interactions: User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: GET - uri: https://fake_url.azurecr.io/acr/v1/repo2e8319c5/_manifests + uri: https://fake_url.azurecr.io/acr/v1/repoc28d1326/_manifests response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": - "repository", "Name": "repo2e8319c5", "Action": "metadata_read"}]}]}' + "repository", "Name": "repoc28d1326", "Action": "metadata_read"}]}]}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -30,7 +30,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:04:36 GMT + - Mon, 03 May 2021 16:13:43 GMT docker-distribution-api-version: - registry/2.0 server: @@ -71,7 +71,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:04:37 GMT + - Mon, 03 May 2021 16:13:45 GMT server: - openresty strict-transport-security: @@ -79,12 +79,12 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '166.633333' + - '166.5' status: code: 200 message: OK - request: - body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepo2e8319c5%3Ametadata_read&refresh_token=REDACTED + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepoc28d1326%3Ametadata_read&refresh_token=REDACTED headers: Accept: - application/json @@ -109,7 +109,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:04:38 GMT + - Mon, 03 May 2021 16:13:45 GMT server: - openresty strict-transport-security: @@ -117,7 +117,7 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '166.433333' + - '166.4' status: code: 200 message: OK @@ -133,68 +133,59 @@ interactions: User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: GET - uri: https://fake_url.azurecr.io/acr/v1/repo2e8319c5/_manifests + uri: https://fake_url.azurecr.io/acr/v1/repoc28d1326/_manifests response: body: - string: '{"registry": "fake_url.azurecr.io", "imageName": "repo2e8319c5", "manifests": + string: '{"registry": "fake_url.azurecr.io", "imageName": "repoc28d1326", "manifests": [{"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", - "imageSize": 525, "createdTime": "2021-04-28T22:04:25.8920478Z", "lastUpdateTime": - "2021-04-28T22:04:25.8920478Z", "architecture": "amd64", "os": "linux", "mediaType": + "imageSize": 0, "createdTime": "2021-04-28T15:02:29.8734878Z", "lastUpdateTime": + "2021-04-28T15:02:29.8734878Z", "architecture": "amd64", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": - true, "quarantineState": "Passed"}}, {"digest": "sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24", - "imageSize": 0, "createdTime": "2021-04-13T15:21:39.6157682Z", "lastUpdateTime": - "2021-04-13T15:21:39.6157682Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", - "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": - true, "listEnabled": true}}, {"digest": "sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1", - "imageSize": 0, "createdTime": "2021-04-13T15:21:40.1170415Z", "lastUpdateTime": - "2021-04-13T15:21:40.1170415Z", "architecture": "arm", "os": "linux", "mediaType": + true, "quarantineState": "Passed"}}, {"digest": "sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1", + "imageSize": 0, "createdTime": "2021-04-28T15:02:29.439862Z", "lastUpdateTime": + "2021-04-28T15:02:29.439862Z", "architecture": "arm", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:88b2e00179bd6c4064612403c8d42a13de7ca809d61fee966ce9e129860a8a90", - "imageSize": 0, "createdTime": "2021-04-13T15:21:40.5270603Z", "lastUpdateTime": - "2021-04-13T15:21:40.5270603Z", "architecture": "mips64le", "os": "linux", + "imageSize": 0, "createdTime": "2021-04-28T15:02:29.196474Z", "lastUpdateTime": + "2021-04-28T15:02:29.196474Z", "architecture": "mips64le", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:963612c5503f3f1674f315c67089dee577d8cc6afc18565e0b4183ae355fb343", - "imageSize": 0, "createdTime": "2021-04-13T15:21:40.454173Z", "lastUpdateTime": - "2021-04-13T15:21:40.454173Z", "architecture": "arm64", "os": "linux", "mediaType": + "imageSize": 0, "createdTime": "2021-04-28T15:02:29.314296Z", "lastUpdateTime": + "2021-04-28T15:02:29.314296Z", "architecture": "arm64", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": - true, "quarantineState": "Passed"}}, {"digest": "sha256:b0408a0f1d74eced127a2658429f336ed8fa48e36d59878f155b19865e5dbd70", - "imageSize": 0, "createdTime": "2021-04-13T15:21:40.7670881Z", "lastUpdateTime": - "2021-04-13T15:21:40.7670881Z", "architecture": "amd64", "os": "windows", - "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": - {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:bb7ab0fa94fdd78aca84b27a1bd46c4b811051f9b69905d81f5f267fc6546a9d", - "imageSize": 0, "createdTime": "2021-04-13T15:21:41.2075665Z", "lastUpdateTime": - "2021-04-13T15:21:41.2075665Z", "architecture": "ppc64le", "os": "linux", - "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + "imageSize": 0, "createdTime": "2021-04-28T15:02:29.247207Z", "lastUpdateTime": + "2021-04-28T15:02:29.247207Z", "architecture": "ppc64le", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:cb55d8f7347376e1ba38ca740904b43c9a52f66c7d2ae1ef1a0de1bc9f40df98", - "imageSize": 0, "createdTime": "2021-04-13T15:21:40.6661892Z", "lastUpdateTime": - "2021-04-13T15:21:40.6661892Z", "architecture": "386", "os": "linux", "mediaType": + "imageSize": 0, "createdTime": "2021-04-28T15:02:29.9524376Z", "lastUpdateTime": + "2021-04-28T15:02:29.9524376Z", "architecture": "386", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:e49abad529e5d9bd6787f3abeab94e09ba274fe34731349556a850b9aebbf7bf", - "imageSize": 0, "createdTime": "2021-04-13T15:21:40.8867036Z", "lastUpdateTime": - "2021-04-13T15:21:40.8867036Z", "architecture": "s390x", "os": "linux", "mediaType": + "imageSize": 0, "createdTime": "2021-04-28T15:02:29.6299853Z", "lastUpdateTime": + "2021-04-28T15:02:29.6299853Z", "architecture": "s390x", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:e5785cb0c62cebbed4965129bae371f0589cadd6d84798fb58c2c5f9e237efd9", - "imageSize": 0, "createdTime": "2021-04-13T15:21:40.2946843Z", "lastUpdateTime": - "2021-04-13T15:21:40.2946843Z", "architecture": "arm", "os": "linux", "mediaType": + "imageSize": 0, "createdTime": "2021-04-28T15:02:29.125237Z", "lastUpdateTime": + "2021-04-28T15:02:29.125237Z", "architecture": "arm", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:ea0cfb27fd41ea0405d3095880c1efa45710f5bcdddb7d7d5a7317ad4825ae14", - "imageSize": 0, "createdTime": "2021-04-15T18:51:48.2255875Z", "lastUpdateTime": - "2021-04-15T18:51:48.2255875Z", "architecture": "amd64", "os": "windows", + "imageSize": 0, "createdTime": "2021-04-28T15:02:30.1569299Z", "lastUpdateTime": + "2021-04-28T15:02:30.1569299Z", "architecture": "amd64", "os": "windows", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", - "imageSize": 0, "createdTime": "2021-04-15T18:51:47.3624329Z", "lastUpdateTime": - "2021-04-15T18:51:47.3624329Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", - "tags": ["latest"], "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + "imageSize": 0, "createdTime": "2021-04-28T15:02:28.6053947Z", "lastUpdateTime": + "2021-04-28T15:02:28.6053947Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", + "tags": ["tagc28d1326"], "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true}}]}' headers: access-control-expose-headers: @@ -207,7 +198,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:04:38 GMT + - Mon, 03 May 2021 16:13:45 GMT docker-distribution-api-version: - registry/2.0 server: @@ -231,17 +222,15 @@ interactions: - gzip, deflate Connection: - keep-alive - Content-Length: - - '0' User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: DELETE - uri: https://fake_url.azurecr.io/v2/repo2e8319c5/manifests/sha256%3A1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repoc28d1326/_tags/tagc28d1326 response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": - "repository", "Name": "repo2e8319c5", "Action": "delete"}]}]}' + "repository", "Name": "repoc28d1326", "Action": "metadata_read"}]}]}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -251,11 +240,11 @@ interactions: connection: - keep-alive content-length: - - '208' + - '215' content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:04:38 GMT + - Mon, 03 May 2021 16:13:46 GMT docker-distribution-api-version: - registry/2.0 server: @@ -271,7 +260,7 @@ interactions: code: 401 message: Unauthorized - request: - body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepo2e8319c5%3Adelete&refresh_token=REDACTED + body: grant_type=access_token&service=fake_url.azurecr.io&access_token=REDACTED headers: Accept: - application/json @@ -280,7 +269,45 @@ interactions: Connection: - keep-alive Content-Length: - - '1073' + - '1343' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:13:46 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.65' + status: + code: 200 + message: OK +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepoc28d1326%3Ametadata_read&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1080' Content-Type: - application/x-www-form-urlencoded User-Agent: @@ -296,7 +323,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:04:38 GMT + - Mon, 03 May 2021 16:13:47 GMT server: - openresty strict-transport-security: @@ -304,7 +331,7 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '166.416667' + - '166.633333' status: code: 200 message: OK @@ -317,15 +344,17 @@ interactions: - gzip, deflate Connection: - keep-alive - Content-Length: - - '0' User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: DELETE - uri: https://fake_url.azurecr.io/v2/repo2e8319c5/manifests/sha256%3A1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repoc28d1326/_tags/tagc28d1326 response: body: - string: '' + string: '{"registry": "fake_url.azurecr.io", "imageName": "repoc28d1326", "tag": + {"name": "tagc28d1326", "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "createdTime": "2021-04-28T15:02:28.711079Z", "lastUpdateTime": "2021-04-28T15:02:28.711079Z", + "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -335,9 +364,11 @@ interactions: connection: - keep-alive content-length: - - '0' + - '384' + content-type: + - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:04:39 GMT + - Mon, 03 May 2021 16:13:47 GMT docker-distribution-api-version: - registry/2.0 server: @@ -347,13 +378,12 @@ interactions: - max-age=31536000; includeSubDomains x-content-type-options: - nosniff - x-ms-ratelimit-remaining-calls-per-second: - - '8.000000' status: - code: 202 - message: Accepted + code: 200 + message: OK - request: - body: null + body: '{"deleteEnabled": false, "writeEnabled": false, "listEnabled": false, "readEnabled": + false}' headers: Accept: - application/json @@ -361,15 +391,19 @@ interactions: - gzip, deflate Connection: - keep-alive + Content-Length: + - '91' + Content-Type: + - application/json User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://fake_url.azurecr.io/acr/v1/repo2e8319c5/_manifests + method: PATCH + uri: https://fake_url.azurecr.io/acr/v1/repoc28d1326/_tags/tagc28d1326 response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": - "repository", "Name": "repo2e8319c5", "Action": "metadata_read"}]}]}' + "repository", "Name": "repoc28d1326", "Action": "metadata_write"}]}]}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -379,11 +413,11 @@ interactions: connection: - keep-alive content-length: - - '215' + - '216' content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:04:39 GMT + - Mon, 03 May 2021 16:13:47 GMT docker-distribution-api-version: - registry/2.0 server: @@ -399,7 +433,7 @@ interactions: code: 401 message: Unauthorized - request: - body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepo2e8319c5%3Ametadata_read&refresh_token=REDACTED + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepoc28d1326%3Ametadata_write&refresh_token=REDACTED headers: Accept: - application/json @@ -408,7 +442,7 @@ interactions: Connection: - keep-alive Content-Length: - - '1080' + - '1081' Content-Type: - application/x-www-form-urlencoded User-Agent: @@ -424,7 +458,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:04:39 GMT + - Mon, 03 May 2021 16:13:47 GMT server: - openresty strict-transport-security: @@ -432,12 +466,13 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '166.4' + - '166.616667' status: code: 200 message: OK - request: - body: null + body: '{"deleteEnabled": false, "writeEnabled": false, "listEnabled": false, "readEnabled": + false}' headers: Accept: - application/json @@ -445,67 +480,21 @@ interactions: - gzip, deflate Connection: - keep-alive + Content-Length: + - '91' + Content-Type: + - application/json User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://fake_url.azurecr.io/acr/v1/repo2e8319c5/_manifests + method: PATCH + uri: https://fake_url.azurecr.io/acr/v1/repoc28d1326/_tags/tagc28d1326 response: body: - string: '{"registry": "fake_url.azurecr.io", "imageName": "repo2e8319c5", "manifests": - [{"digest": "sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24", - "imageSize": 0, "createdTime": "2021-04-13T15:21:39.6157682Z", "lastUpdateTime": - "2021-04-13T15:21:39.6157682Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", - "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": - true, "listEnabled": true}}, {"digest": "sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1", - "imageSize": 0, "createdTime": "2021-04-13T15:21:40.1170415Z", "lastUpdateTime": - "2021-04-13T15:21:40.1170415Z", "architecture": "arm", "os": "linux", "mediaType": - "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": - {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": - true, "quarantineState": "Passed"}}, {"digest": "sha256:88b2e00179bd6c4064612403c8d42a13de7ca809d61fee966ce9e129860a8a90", - "imageSize": 0, "createdTime": "2021-04-13T15:21:40.5270603Z", "lastUpdateTime": - "2021-04-13T15:21:40.5270603Z", "architecture": "mips64le", "os": "linux", - "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": - {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": - true, "quarantineState": "Passed"}}, {"digest": "sha256:963612c5503f3f1674f315c67089dee577d8cc6afc18565e0b4183ae355fb343", - "imageSize": 0, "createdTime": "2021-04-13T15:21:40.454173Z", "lastUpdateTime": - "2021-04-13T15:21:40.454173Z", "architecture": "arm64", "os": "linux", "mediaType": - "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": - {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": - true, "quarantineState": "Passed"}}, {"digest": "sha256:b0408a0f1d74eced127a2658429f336ed8fa48e36d59878f155b19865e5dbd70", - "imageSize": 0, "createdTime": "2021-04-13T15:21:40.7670881Z", "lastUpdateTime": - "2021-04-13T15:21:40.7670881Z", "architecture": "amd64", "os": "windows", - "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": - {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": - true, "quarantineState": "Passed"}}, {"digest": "sha256:bb7ab0fa94fdd78aca84b27a1bd46c4b811051f9b69905d81f5f267fc6546a9d", - "imageSize": 0, "createdTime": "2021-04-13T15:21:41.2075665Z", "lastUpdateTime": - "2021-04-13T15:21:41.2075665Z", "architecture": "ppc64le", "os": "linux", - "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": - {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": - true, "quarantineState": "Passed"}}, {"digest": "sha256:cb55d8f7347376e1ba38ca740904b43c9a52f66c7d2ae1ef1a0de1bc9f40df98", - "imageSize": 0, "createdTime": "2021-04-13T15:21:40.6661892Z", "lastUpdateTime": - "2021-04-13T15:21:40.6661892Z", "architecture": "386", "os": "linux", "mediaType": - "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": - {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": - true, "quarantineState": "Passed"}}, {"digest": "sha256:e49abad529e5d9bd6787f3abeab94e09ba274fe34731349556a850b9aebbf7bf", - "imageSize": 0, "createdTime": "2021-04-13T15:21:40.8867036Z", "lastUpdateTime": - "2021-04-13T15:21:40.8867036Z", "architecture": "s390x", "os": "linux", "mediaType": - "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": - {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": - true, "quarantineState": "Passed"}}, {"digest": "sha256:e5785cb0c62cebbed4965129bae371f0589cadd6d84798fb58c2c5f9e237efd9", - "imageSize": 0, "createdTime": "2021-04-13T15:21:40.2946843Z", "lastUpdateTime": - "2021-04-13T15:21:40.2946843Z", "architecture": "arm", "os": "linux", "mediaType": - "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": - {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": - true, "quarantineState": "Passed"}}, {"digest": "sha256:ea0cfb27fd41ea0405d3095880c1efa45710f5bcdddb7d7d5a7317ad4825ae14", - "imageSize": 0, "createdTime": "2021-04-15T18:51:48.2255875Z", "lastUpdateTime": - "2021-04-15T18:51:48.2255875Z", "architecture": "amd64", "os": "windows", - "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": - {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": - true, "quarantineState": "Passed"}}, {"digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", - "imageSize": 0, "createdTime": "2021-04-15T18:51:47.3624329Z", "lastUpdateTime": - "2021-04-15T18:51:47.3624329Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", - "tags": ["latest"], "changeableAttributes": {"deleteEnabled": true, "writeEnabled": - true, "readEnabled": true, "listEnabled": true}}]}' + string: '{"registry": "fake_url.azurecr.io", "imageName": "repoc28d1326", "tag": + {"name": "tagc28d1326", "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "createdTime": "2021-04-28T15:02:28.711079Z", "lastUpdateTime": "2021-04-28T15:02:28.711079Z", + "signed": false, "changeableAttributes": {"deleteEnabled": false, "writeEnabled": + false, "readEnabled": false, "listEnabled": false}}}' headers: access-control-expose-headers: - Docker-Content-Digest @@ -514,10 +503,12 @@ interactions: - X-Ms-Correlation-Request-Id connection: - keep-alive + content-length: + - '388' content-type: - application/json; charset=utf-8 date: - - Wed, 28 Apr 2021 22:04:40 GMT + - Mon, 03 May 2021 16:13:47 GMT docker-distribution-api-version: - registry/2.0 server: @@ -525,8 +516,146 @@ interactions: strict-transport-security: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"deleteEnabled": true, "writeEnabled": true, "listEnabled": true, "readEnabled": + true}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '87' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: PATCH + uri: https://fake_url.azurecr.io/acr/v1/repoc28d1326/_tags/tagc28d1326 + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repoc28d1326", "Action": "metadata_write"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '216' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:13:47 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepoc28d1326%3Ametadata_write&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1081' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:13:48 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '166.6' + status: + code: 200 + message: OK +- request: + body: '{"deleteEnabled": true, "writeEnabled": true, "listEnabled": true, "readEnabled": + true}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '87' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: PATCH + uri: https://fake_url.azurecr.io/acr/v1/repoc28d1326/_tags/tagc28d1326 + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "repoc28d1326", "tag": + {"name": "tagc28d1326", "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "createdTime": "2021-04-28T15:02:28.711079Z", "lastUpdateTime": "2021-04-28T15:02:28.711079Z", + "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '384' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 03 May 2021 16:13:48 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains x-content-type-options: - nosniff status: diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_delete_registry_artifact.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_delete_registry_artifact.yaml new file mode 100644 index 000000000000..e22642f2a911 --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_delete_registry_artifact.yaml @@ -0,0 +1,366 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repoc7611808/_manifests + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repoc7611808", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '215' + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 20:10:27 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/repoc7611808/_manifests +- request: + body: + access_token: REDACTED + grant_type: access_token + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 20:10:28 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '166.633333' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:repoc7611808:metadata_read + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 20:10:28 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '166.616667' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repoc7611808/_manifests + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "repoc7611808", "manifests": + [{"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", + "imageSize": 525, "createdTime": "2021-05-03T20:10:16.6574215Z", "lastUpdateTime": + "2021-05-03T20:10:16.6574215Z", "architecture": "amd64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1", + "imageSize": 0, "createdTime": "2021-04-28T15:39:48.8335216Z", "lastUpdateTime": + "2021-04-28T15:39:48.8335216Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:88b2e00179bd6c4064612403c8d42a13de7ca809d61fee966ce9e129860a8a90", + "imageSize": 0, "createdTime": "2021-04-28T15:39:48.6753267Z", "lastUpdateTime": + "2021-04-28T15:39:48.6753267Z", "architecture": "mips64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:963612c5503f3f1674f315c67089dee577d8cc6afc18565e0b4183ae355fb343", + "imageSize": 0, "createdTime": "2021-04-28T15:39:49.6695854Z", "lastUpdateTime": + "2021-04-28T15:39:49.6695854Z", "architecture": "arm64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:bb7ab0fa94fdd78aca84b27a1bd46c4b811051f9b69905d81f5f267fc6546a9d", + "imageSize": 0, "createdTime": "2021-04-28T15:39:48.1836957Z", "lastUpdateTime": + "2021-04-28T15:39:48.1836957Z", "architecture": "ppc64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:cb55d8f7347376e1ba38ca740904b43c9a52f66c7d2ae1ef1a0de1bc9f40df98", + "imageSize": 0, "createdTime": "2021-04-28T15:39:48.3248644Z", "lastUpdateTime": + "2021-04-28T15:39:48.3248644Z", "architecture": "386", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e49abad529e5d9bd6787f3abeab94e09ba274fe34731349556a850b9aebbf7bf", + "imageSize": 0, "createdTime": "2021-04-28T15:39:48.5855065Z", "lastUpdateTime": + "2021-04-28T15:39:48.5855065Z", "architecture": "s390x", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e5785cb0c62cebbed4965129bae371f0589cadd6d84798fb58c2c5f9e237efd9", + "imageSize": 0, "createdTime": "2021-04-28T15:39:48.4142388Z", "lastUpdateTime": + "2021-04-28T15:39:48.4142388Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:ea0cfb27fd41ea0405d3095880c1efa45710f5bcdddb7d7d5a7317ad4825ae14", + "imageSize": 0, "createdTime": "2021-04-28T15:39:48.2527522Z", "lastUpdateTime": + "2021-04-28T15:39:48.2527522Z", "architecture": "amd64", "os": "windows", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "imageSize": 0, "createdTime": "2021-04-28T15:39:47.8188629Z", "lastUpdateTime": + "2021-04-28T15:39:47.8188629Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", + "tags": ["tagc7611808"], "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 20:10:29 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/repoc7611808/_manifests +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/repoc7611808 + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repoc7611808", "Action": "delete"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '208' + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 20:10:29 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/repoc7611808 +- request: + body: + access_token: REDACTED + grant_type: access_token + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 20:10:30 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.916667' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:repoc7611808:delete + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 20:10:30 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.75' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/repoc7611808 + response: + body: + string: '{"manifestsDeleted": ["sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", + "sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1", + "sha256:88b2e00179bd6c4064612403c8d42a13de7ca809d61fee966ce9e129860a8a90", + "sha256:963612c5503f3f1674f315c67089dee577d8cc6afc18565e0b4183ae355fb343", + "sha256:bb7ab0fa94fdd78aca84b27a1bd46c4b811051f9b69905d81f5f267fc6546a9d", + "sha256:cb55d8f7347376e1ba38ca740904b43c9a52f66c7d2ae1ef1a0de1bc9f40df98", + "sha256:e49abad529e5d9bd6787f3abeab94e09ba274fe34731349556a850b9aebbf7bf", + "sha256:e5785cb0c62cebbed4965129bae371f0589cadd6d84798fb58c2c5f9e237efd9", + "sha256:ea0cfb27fd41ea0405d3095880c1efa45710f5bcdddb7d7d5a7317ad4825ae14", + "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519"], + "tagsDeleted": ["tagc7611808"]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '793' + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 20:10:32 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + x-ms-ratelimit-remaining-calls-per-second: '8.000000' + status: + code: 202 + message: Accepted + url: https://fake_url.azurecr.io/acr/v1/repoc7611808 +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repoc7611808/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repoc7611808", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '215' + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 20:10:42 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/repoc7611808/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:repoc7611808:metadata_read + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 20:10:42 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.716667' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repoc7611808/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 + response: + body: + string: '{"errors": [{"code": "MANIFEST_UNKNOWN", "message": "manifest unknown"}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '70' + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 20:10:42 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 404 + message: Not Found + url: https://fake_url.azurecr.io/acr/v1/repoc7611808/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_delete_registry_artifact_does_not_exist.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_delete_registry_artifact_does_not_exist.yaml new file mode 100644 index 000000000000..cb89fb770054 --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_delete_registry_artifact_does_not_exist.yaml @@ -0,0 +1,114 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/repo61301e4e + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repo61301e4e", "Action": "delete"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '208' + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 20:11:37 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/repo61301e4e +- request: + body: + access_token: REDACTED + grant_type: access_token + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 20:11:38 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '166.65' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:repo61301e4e:delete + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 20:11:38 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '166.633333' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/repo61301e4e + response: + body: + string: '{"errors": [{"code": "NAME_UNKNOWN", "message": "repository name not + known to registry", "detail": {"name": "repo61301e4e"}}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '120' + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 20:11:38 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + x-ms-ratelimit-remaining-calls-per-second: '8.000000' + status: + code: 404 + message: Not Found + url: https://fake_url.azurecr.io/acr/v1/repo61301e4e +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_delete_tag.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_delete_tag.yaml new file mode 100644 index 000000000000..19496a6dee87 --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_delete_tag.yaml @@ -0,0 +1,208 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/repo9cb4121e/_tags/tag9cb4121e0 + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repo9cb4121e", "Action": "delete"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '208' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:21:52 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/repo9cb4121e/_tags/tag9cb4121e0 +- request: + body: + access_token: REDACTED + grant_type: access_token + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:21:53 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.9' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:repo9cb4121e:delete + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:21:53 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.883333' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/repo9cb4121e/_tags/tag9cb4121e0 + response: + body: + string: '' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '0' + date: Wed, 28 Apr 2021 21:21:53 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + x-ms-int-docker-content-digest: sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519 + x-ms-ratelimit-remaining-calls-per-second: '8.000000' + status: + code: 202 + message: Accepted + url: https://fake_url.azurecr.io/acr/v1/repo9cb4121e/_tags/tag9cb4121e0 +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo9cb4121e/_tags + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repo9cb4121e", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '215' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:21:53 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/repo9cb4121e/_tags +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:repo9cb4121e:metadata_read + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:21:53 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.866667' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo9cb4121e/_tags + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "repo9cb4121e", "tags": + [{"name": "tag9cb4121e1", "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "createdTime": "2021-04-28T15:40:06.2665877Z", "lastUpdateTime": "2021-04-28T15:40:06.2665877Z", + "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}, {"name": "tag9cb4121e2", + "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "createdTime": "2021-04-28T15:40:05.5686367Z", "lastUpdateTime": "2021-04-28T15:40:05.5686367Z", + "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}, {"name": "tag9cb4121e3", + "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "createdTime": "2021-04-28T15:40:05.2533005Z", "lastUpdateTime": "2021-04-28T15:40:05.2533005Z", + "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '1028' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:21:54 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/repo9cb4121e/_tags +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_set_tag_properties_does_not_exist.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_delete_tag_does_not_exist.yaml similarity index 76% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_set_tag_properties_does_not_exist.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_delete_tag_does_not_exist.yaml index a7b005721292..bf90284d86bc 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_set_tag_properties_does_not_exist.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_delete_tag_does_not_exist.yaml @@ -1,28 +1,24 @@ interactions: - request: - body: '{"deleteEnabled": false}' + body: null headers: Accept: - application/json - Content-Length: - - '24' - Content-Type: - - application/json User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: PATCH - uri: https://fake_url.azurecr.io/acr/v1/repoe5c92023/_tags/does_not_exist + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/repoddbe1864/_tags/does_not_exist response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": - "repository", "Name": "repoe5c92023", "Action": "metadata_write"}]}]}' + "repository", "Name": "repoddbe1864", "Action": "delete"}]}]}' headers: access-control-expose-headers: X-Ms-Correlation-Request-Id connection: keep-alive - content-length: '216' + content-length: '208' content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:08:36 GMT + date: Mon, 03 May 2021 16:14:26 GMT docker-distribution-api-version: registry/2.0 server: openresty strict-transport-security: max-age=31536000; includeSubDomains @@ -31,7 +27,7 @@ interactions: status: code: 401 message: Unauthorized - url: https://fake_url.azurecr.io/acr/v1/repoe5c92023/_tags/does_not_exist + url: https://fake_url.azurecr.io/acr/v1/repoddbe1864/_tags/does_not_exist - request: body: access_token: REDACTED @@ -50,11 +46,11 @@ interactions: headers: connection: keep-alive content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:08:37 GMT + date: Mon, 03 May 2021 16:14:27 GMT server: openresty strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked - x-ms-ratelimit-remaining-calls-per-second: '166.183333' + x-ms-ratelimit-remaining-calls-per-second: '165.9' status: code: 200 message: OK @@ -63,7 +59,7 @@ interactions: body: grant_type: refresh_token refresh_token: REDACTED - scope: repository:repoe5c92023:metadata_write + scope: repository:repoddbe1864:delete service: fake_url.azurecr.io headers: Accept: @@ -78,28 +74,24 @@ interactions: headers: connection: keep-alive content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:08:37 GMT + date: Mon, 03 May 2021 16:14:27 GMT server: openresty strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked - x-ms-ratelimit-remaining-calls-per-second: '165.983333' + x-ms-ratelimit-remaining-calls-per-second: '165.883333' status: code: 200 message: OK url: https://fake_url.azurecr.io/oauth2/token - request: - body: '{"deleteEnabled": false}' + body: null headers: Accept: - application/json - Content-Length: - - '24' - Content-Type: - - application/json User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: PATCH - uri: https://fake_url.azurecr.io/acr/v1/repoe5c92023/_tags/does_not_exist + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/repoddbe1864/_tags/does_not_exist response: body: string: '{"errors": [{"code": "TAG_UNKNOWN", "message": "the specified tag does @@ -109,13 +101,14 @@ interactions: connection: keep-alive content-length: '81' content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:08:37 GMT + date: Mon, 03 May 2021 16:14:27 GMT docker-distribution-api-version: registry/2.0 server: openresty strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff + x-ms-ratelimit-remaining-calls-per-second: '8.000000' status: code: 404 message: Not Found - url: https://fake_url.azurecr.io/acr/v1/repoe5c92023/_tags/does_not_exist + url: https://fake_url.azurecr.io/acr/v1/repoddbe1864/_tags/does_not_exist version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_get_manifest_properties.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_get_manifest_properties.yaml new file mode 100644 index 000000000000..c75d839d577f --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_get_manifest_properties.yaml @@ -0,0 +1,281 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repoaf9517b2/_manifests + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repoaf9517b2", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '215' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:22:10 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/repoaf9517b2/_manifests +- request: + body: + access_token: REDACTED + grant_type: access_token + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:22:11 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '166.033333' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:repoaf9517b2:metadata_read + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:22:11 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '166.016667' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repoaf9517b2/_manifests + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "repoaf9517b2", "manifests": + [{"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", + "imageSize": 525, "createdTime": "2021-04-28T15:40:19.4589707Z", "lastUpdateTime": + "2021-04-28T15:40:19.4589707Z", "architecture": "amd64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1", + "imageSize": 525, "createdTime": "2021-04-28T15:40:19.9217986Z", "lastUpdateTime": + "2021-04-28T15:40:19.9217986Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:88b2e00179bd6c4064612403c8d42a13de7ca809d61fee966ce9e129860a8a90", + "imageSize": 525, "createdTime": "2021-04-28T15:40:19.8197257Z", "lastUpdateTime": + "2021-04-28T15:40:19.8197257Z", "architecture": "mips64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:963612c5503f3f1674f315c67089dee577d8cc6afc18565e0b4183ae355fb343", + "imageSize": 525, "createdTime": "2021-04-28T15:40:20.2913747Z", "lastUpdateTime": + "2021-04-28T15:40:20.2913747Z", "architecture": "arm64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:bb7ab0fa94fdd78aca84b27a1bd46c4b811051f9b69905d81f5f267fc6546a9d", + "imageSize": 525, "createdTime": "2021-04-28T15:40:20.1354974Z", "lastUpdateTime": + "2021-04-28T15:40:20.1354974Z", "architecture": "ppc64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:cb55d8f7347376e1ba38ca740904b43c9a52f66c7d2ae1ef1a0de1bc9f40df98", + "imageSize": 525, "createdTime": "2021-04-28T15:40:19.6881079Z", "lastUpdateTime": + "2021-04-28T15:40:19.6881079Z", "architecture": "386", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e49abad529e5d9bd6787f3abeab94e09ba274fe34731349556a850b9aebbf7bf", + "imageSize": 525, "createdTime": "2021-04-28T15:40:19.3981444Z", "lastUpdateTime": + "2021-04-28T15:40:19.3981444Z", "architecture": "s390x", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e5785cb0c62cebbed4965129bae371f0589cadd6d84798fb58c2c5f9e237efd9", + "imageSize": 525, "createdTime": "2021-04-28T15:40:19.5372072Z", "lastUpdateTime": + "2021-04-28T15:40:19.5372072Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:ea0cfb27fd41ea0405d3095880c1efa45710f5bcdddb7d7d5a7317ad4825ae14", + "imageSize": 1125, "createdTime": "2021-04-28T15:40:19.603384Z", "lastUpdateTime": + "2021-04-28T15:40:19.603384Z", "architecture": "amd64", "os": "windows", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "imageSize": 5325, "createdTime": "2021-04-28T15:40:18.9984058Z", "lastUpdateTime": + "2021-04-28T15:40:18.9984058Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", + "tags": ["tagaf9517b2"], "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:22:11 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/repoaf9517b2/_manifests +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repoaf9517b2/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repoaf9517b2", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '215' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:22:12 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/repoaf9517b2/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 +- request: + body: + access_token: REDACTED + grant_type: access_token + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:22:13 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.8' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:repoaf9517b2:metadata_read + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:22:13 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.783333' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repoaf9517b2/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "repoaf9517b2", "manifest": + {"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", + "imageSize": 525, "createdTime": "2021-04-28T15:40:19.4589707Z", "lastUpdateTime": + "2021-04-28T15:40:19.4589707Z", "architecture": "amd64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineDetails": "{\"state\":\"Scan InProgress\",\"link\":\"https://aka.ms/test\",\"scanner\":\"Azure + Security Monitoring-Qualys Scanner\",\"result\":{\"version\":\"4/28/2021 9:22:02 + PM\",\"summary\":[{\"severity\":\"High\",\"count\":0},{\"severity\":\"Medium\",\"count\":0},{\"severity\":\"Low\",\"count\":0}]}}", + "quarantineState": "Passed"}}}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '818' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:22:13 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/repoaf9517b2/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_delete_tag_does_not_exist.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_get_manifest_properties_does_not_exist.yaml similarity index 73% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_delete_tag_does_not_exist.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_get_manifest_properties_does_not_exist.yaml index f84ec8c883a5..994716b9c55d 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_delete_tag_does_not_exist.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_get_manifest_properties_does_not_exist.yaml @@ -6,8 +6,8 @@ interactions: - application/json User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: DELETE - uri: https://fake_url.azurecr.io/acr/v1/DOES_NOT_EXIST123/_tags/DOESNOTEXIST123 + method: GET + uri: https://fake_url.azurecr.io/acr/v1/hello-world/_manifests/sha256:abcdefghijkl response: body: string: '404 page not found @@ -17,7 +17,7 @@ interactions: connection: keep-alive content-length: '19' content-type: text/plain; charset=utf-8 - date: Wed, 28 Apr 2021 22:22:58 GMT + date: Wed, 28 Apr 2021 21:22:14 GMT docker-distribution-api-version: registry/2.0 server: openresty strict-transport-security: max-age=31536000; includeSubDomains @@ -25,5 +25,5 @@ interactions: status: code: 404 message: Not Found - url: https://fake_url.azurecr.io/acr/v1/DOES_NOT_EXIST123/_tags/DOESNOTEXIST123 + url: https://fake_url.azurecr.io/acr/v1/hello-world/_manifests/sha256:abcdefghijkl version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_get_tag_properties.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_get_tag_properties.yaml new file mode 100644 index 000000000000..f1343c164b0f --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_get_tag_properties.yaml @@ -0,0 +1,276 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo3db51597/_manifests + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repo3db51597", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '215' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:22:29 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/repo3db51597/_manifests +- request: + body: + access_token: REDACTED + grant_type: access_token + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:22:30 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.883333' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:repo3db51597:metadata_read + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:22:30 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.866667' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo3db51597/_manifests + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "repo3db51597", "manifests": + [{"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", + "imageSize": 0, "createdTime": "2021-04-28T15:40:36.3129691Z", "lastUpdateTime": + "2021-04-28T15:40:36.3129691Z", "architecture": "amd64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1", + "imageSize": 0, "createdTime": "2021-04-28T15:40:36.0838544Z", "lastUpdateTime": + "2021-04-28T15:40:36.0838544Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:88b2e00179bd6c4064612403c8d42a13de7ca809d61fee966ce9e129860a8a90", + "imageSize": 0, "createdTime": "2021-04-28T15:40:36.573061Z", "lastUpdateTime": + "2021-04-28T15:40:36.573061Z", "architecture": "mips64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:963612c5503f3f1674f315c67089dee577d8cc6afc18565e0b4183ae355fb343", + "imageSize": 0, "createdTime": "2021-04-28T15:40:36.1876799Z", "lastUpdateTime": + "2021-04-28T15:40:36.1876799Z", "architecture": "arm64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:bb7ab0fa94fdd78aca84b27a1bd46c4b811051f9b69905d81f5f267fc6546a9d", + "imageSize": 0, "createdTime": "2021-04-28T15:40:38.7830324Z", "lastUpdateTime": + "2021-04-28T15:40:38.7830324Z", "architecture": "ppc64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:cb55d8f7347376e1ba38ca740904b43c9a52f66c7d2ae1ef1a0de1bc9f40df98", + "imageSize": 0, "createdTime": "2021-04-28T15:40:36.5033879Z", "lastUpdateTime": + "2021-04-28T15:40:36.5033879Z", "architecture": "386", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e49abad529e5d9bd6787f3abeab94e09ba274fe34731349556a850b9aebbf7bf", + "imageSize": 0, "createdTime": "2021-04-28T15:40:36.8915511Z", "lastUpdateTime": + "2021-04-28T15:40:36.8915511Z", "architecture": "s390x", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e5785cb0c62cebbed4965129bae371f0589cadd6d84798fb58c2c5f9e237efd9", + "imageSize": 0, "createdTime": "2021-04-28T15:40:36.3800722Z", "lastUpdateTime": + "2021-04-28T15:40:36.3800722Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:ea0cfb27fd41ea0405d3095880c1efa45710f5bcdddb7d7d5a7317ad4825ae14", + "imageSize": 0, "createdTime": "2021-04-28T15:40:37.4772288Z", "lastUpdateTime": + "2021-04-28T15:40:37.4772288Z", "architecture": "amd64", "os": "windows", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "imageSize": 0, "createdTime": "2021-04-28T15:40:36.0006511Z", "lastUpdateTime": + "2021-04-28T15:40:36.0006511Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", + "tags": ["tag3db51597"], "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:22:30 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/repo3db51597/_manifests +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo3db51597/_tags/tag3db51597 + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repo3db51597", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '215' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:22:31 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/repo3db51597/_tags/tag3db51597 +- request: + body: + access_token: REDACTED + grant_type: access_token + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:22:31 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '166.083333' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:repo3db51597:metadata_read + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:22:31 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.666667' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo3db51597/_tags/tag3db51597 + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "repo3db51597", "tag": + {"name": "tag3db51597", "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "createdTime": "2021-04-28T15:40:36.7019882Z", "lastUpdateTime": "2021-04-28T15:40:36.7019882Z", + "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '386' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:22:32 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/repo3db51597/_tags/tag3db51597 +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_set_manifest_properties_does_not_exist.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_get_tag_properties_does_not_exist.yaml similarity index 81% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_set_manifest_properties_does_not_exist.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_get_tag_properties_does_not_exist.yaml index 4b6259b9f921..70fa9f946c66 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_set_manifest_properties_does_not_exist.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_get_tag_properties_does_not_exist.yaml @@ -1,17 +1,13 @@ interactions: - request: - body: '{"deleteEnabled": false}' + body: null headers: Accept: - application/json - Content-Length: - - '24' - Content-Type: - - application/json User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: PATCH - uri: https://fake_url.azurecr.io/acr/v1/repo8cab223e/_manifests/sha256:abcdef + method: GET + uri: https://fake_url.azurecr.io/acr/v1/hello-world/_tags/doesnotexist response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -20,7 +16,7 @@ interactions: headers: access-control-expose-headers: X-Ms-Correlation-Request-Id connection: keep-alive - content-length: '216' + content-length: '214' content-type: application/json; charset=utf-8 date: Wed, 28 Apr 2021 22:08:17 GMT docker-distribution-api-version: registry/2.0 @@ -31,7 +27,7 @@ interactions: status: code: 401 message: Unauthorized - url: https://fake_url.azurecr.io/acr/v1/repo8cab223e/_manifests/sha256:abcdef + url: https://fake_url.azurecr.io/acr/v1/hello-world/_tags/doesnotexist - request: body: access_token: REDACTED @@ -63,7 +59,7 @@ interactions: body: grant_type: refresh_token refresh_token: REDACTED - scope: repository:repo8cab223e:metadata_write + scope: repository:hello-world:metadata_read service: fake_url.azurecr.io headers: Accept: @@ -88,25 +84,22 @@ interactions: message: OK url: https://fake_url.azurecr.io/oauth2/token - request: - body: '{"deleteEnabled": false}' + body: null headers: Accept: - application/json - Content-Length: - - '24' - Content-Type: - - application/json User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: PATCH - uri: https://fake_url.azurecr.io/acr/v1/repo8cab223e/_manifests/sha256:abcdef + method: GET + uri: https://fake_url.azurecr.io/acr/v1/hello-world/_tags/doesnotexist response: body: - string: '{"errors": [{"code": "MANIFEST_UNKNOWN", "message": "manifest unknown"}]}' + string: '{"errors": [{"code": "TAG_UNKNOWN", "message": "the specified tag does + not exist"}]}' headers: access-control-expose-headers: X-Ms-Correlation-Request-Id connection: keep-alive - content-length: '70' + content-length: '81' content-type: application/json; charset=utf-8 date: Wed, 28 Apr 2021 22:08:18 GMT docker-distribution-api-version: registry/2.0 @@ -116,5 +109,5 @@ interactions: status: code: 404 message: Not Found - url: https://fake_url.azurecr.io/acr/v1/repo8cab223e/_manifests/sha256:abcdef + url: https://fake_url.azurecr.io/acr/v1/hello-world/_tags/doesnotexist version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_list_tags.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_list_tags.yaml new file mode 100644 index 000000000000..455968149e78 --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_list_tags.yaml @@ -0,0 +1,289 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo8b5a11da/_manifests + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repo8b5a11da", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '215' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:22:48 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/repo8b5a11da/_manifests +- request: + body: + access_token: REDACTED + grant_type: access_token + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:22:49 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.85' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:repo8b5a11da:metadata_read + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:22:49 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.283333' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo8b5a11da/_manifests + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "repo8b5a11da", "manifests": + [{"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", + "imageSize": 0, "createdTime": "2021-04-28T15:40:53.2285659Z", "lastUpdateTime": + "2021-04-28T15:40:53.2285659Z", "architecture": "amd64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1", + "imageSize": 0, "createdTime": "2021-04-28T15:40:53.4675747Z", "lastUpdateTime": + "2021-04-28T15:40:53.4675747Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:88b2e00179bd6c4064612403c8d42a13de7ca809d61fee966ce9e129860a8a90", + "imageSize": 0, "createdTime": "2021-04-28T15:40:54.1081971Z", "lastUpdateTime": + "2021-04-28T15:40:54.1081971Z", "architecture": "mips64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:963612c5503f3f1674f315c67089dee577d8cc6afc18565e0b4183ae355fb343", + "imageSize": 0, "createdTime": "2021-04-28T15:40:53.7975951Z", "lastUpdateTime": + "2021-04-28T15:40:53.7975951Z", "architecture": "arm64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:bb7ab0fa94fdd78aca84b27a1bd46c4b811051f9b69905d81f5f267fc6546a9d", + "imageSize": 0, "createdTime": "2021-04-28T15:40:53.6632822Z", "lastUpdateTime": + "2021-04-28T15:40:53.6632822Z", "architecture": "ppc64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:cb55d8f7347376e1ba38ca740904b43c9a52f66c7d2ae1ef1a0de1bc9f40df98", + "imageSize": 0, "createdTime": "2021-04-28T15:40:54.1632809Z", "lastUpdateTime": + "2021-04-28T15:40:54.1632809Z", "architecture": "386", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e49abad529e5d9bd6787f3abeab94e09ba274fe34731349556a850b9aebbf7bf", + "imageSize": 0, "createdTime": "2021-04-28T15:40:54.8239765Z", "lastUpdateTime": + "2021-04-28T15:40:54.8239765Z", "architecture": "s390x", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e5785cb0c62cebbed4965129bae371f0589cadd6d84798fb58c2c5f9e237efd9", + "imageSize": 0, "createdTime": "2021-04-28T15:40:53.5235657Z", "lastUpdateTime": + "2021-04-28T15:40:53.5235657Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:ea0cfb27fd41ea0405d3095880c1efa45710f5bcdddb7d7d5a7317ad4825ae14", + "imageSize": 0, "createdTime": "2021-04-28T15:40:53.7095671Z", "lastUpdateTime": + "2021-04-28T15:40:53.7095671Z", "architecture": "amd64", "os": "windows", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "imageSize": 0, "createdTime": "2021-04-28T15:40:53.858241Z", "lastUpdateTime": + "2021-04-28T15:40:53.858241Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", + "tags": ["tag8b5a11da0", "tag8b5a11da1", "tag8b5a11da2", "tag8b5a11da3"], + "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": + true, "listEnabled": true}}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:22:50 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/repo8b5a11da/_manifests +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo8b5a11da/_tags + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repo8b5a11da", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '215' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:22:50 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/repo8b5a11da/_tags +- request: + body: + access_token: REDACTED + grant_type: access_token + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:22:51 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '166.65' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:repo8b5a11da:metadata_read + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:22:51 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '166.633333' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo8b5a11da/_tags + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "repo8b5a11da", "tags": + [{"name": "tag8b5a11da0", "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "createdTime": "2021-04-28T15:40:55.5579596Z", "lastUpdateTime": "2021-04-28T15:40:55.5579596Z", + "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}, {"name": "tag8b5a11da1", + "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "createdTime": "2021-04-28T15:40:53.3089855Z", "lastUpdateTime": "2021-04-28T15:40:53.3089855Z", + "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}, {"name": "tag8b5a11da2", + "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "createdTime": "2021-04-28T15:40:53.4155166Z", "lastUpdateTime": "2021-04-28T15:40:53.4155166Z", + "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}, {"name": "tag8b5a11da3", + "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "createdTime": "2021-04-28T15:40:53.572585Z", "lastUpdateTime": "2021-04-28T15:40:53.572585Z", + "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '1345' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:22:51 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/repo8b5a11da/_tags +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_set_manifest_properties.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_set_manifest_properties.yaml similarity index 65% rename from sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_set_manifest_properties.yaml rename to sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_set_manifest_properties.yaml index f4476821a798..074c2243baf6 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_set_manifest_properties.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_set_manifest_properties.yaml @@ -7,18 +7,18 @@ interactions: User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: GET - uri: https://fake_url.azurecr.io/acr/v1/reposetb7cc1bf8/_manifests + uri: https://fake_url.azurecr.io/acr/v1/repob0a917be/_manifests response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": - "repository", "Name": "reposetb7cc1bf8", "Action": "metadata_read"}]}]}' + "repository", "Name": "repob0a917be", "Action": "metadata_read"}]}]}' headers: access-control-expose-headers: X-Ms-Correlation-Request-Id connection: keep-alive - content-length: '218' + content-length: '215' content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:08:11 GMT + date: Mon, 03 May 2021 16:15:21 GMT docker-distribution-api-version: registry/2.0 server: openresty strict-transport-security: max-age=31536000; includeSubDomains @@ -27,7 +27,7 @@ interactions: status: code: 401 message: Unauthorized - url: https://fake_url.azurecr.io/acr/v1/reposetb7cc1bf8/_manifests + url: https://fake_url.azurecr.io/acr/v1/repob0a917be/_manifests - request: body: access_token: REDACTED @@ -46,11 +46,11 @@ interactions: headers: connection: keep-alive content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:08:12 GMT + date: Mon, 03 May 2021 16:15:22 GMT server: openresty strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked - x-ms-ratelimit-remaining-calls-per-second: '166.616667' + x-ms-ratelimit-remaining-calls-per-second: '166.65' status: code: 200 message: OK @@ -59,7 +59,7 @@ interactions: body: grant_type: refresh_token refresh_token: REDACTED - scope: repository:reposetb7cc1bf8:metadata_read + scope: repository:repob0a917be:metadata_read service: fake_url.azurecr.io headers: Accept: @@ -74,11 +74,11 @@ interactions: headers: connection: keep-alive content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:08:12 GMT + date: Mon, 03 May 2021 16:15:22 GMT server: openresty strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked - x-ms-ratelimit-remaining-calls-per-second: '166.5' + x-ms-ratelimit-remaining-calls-per-second: '166.633333' status: code: 200 message: OK @@ -91,65 +91,65 @@ interactions: User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: GET - uri: https://fake_url.azurecr.io/acr/v1/reposetb7cc1bf8/_manifests + uri: https://fake_url.azurecr.io/acr/v1/repob0a917be/_manifests response: body: - string: '{"registry": "fake_url.azurecr.io", "imageName": "reposetb7cc1bf8", - "manifests": [{"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", - "imageSize": 525, "createdTime": "2021-04-28T22:08:01.3894846Z", "lastUpdateTime": - "2021-04-28T22:08:01.3894846Z", "architecture": "amd64", "os": "linux", "mediaType": + string: '{"registry": "fake_url.azurecr.io", "imageName": "repob0a917be", "manifests": + [{"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", + "imageSize": 525, "createdTime": "2021-05-03T16:15:12.0093551Z", "lastUpdateTime": + "2021-05-03T16:15:12.0093551Z", "architecture": "amd64", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1", - "imageSize": 525, "createdTime": "2021-04-28T22:08:01.4686287Z", "lastUpdateTime": - "2021-04-28T22:08:01.4686287Z", "architecture": "arm", "os": "linux", "mediaType": + "imageSize": 525, "createdTime": "2021-05-03T16:15:12.1495384Z", "lastUpdateTime": + "2021-05-03T16:15:12.1495384Z", "architecture": "arm", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:88b2e00179bd6c4064612403c8d42a13de7ca809d61fee966ce9e129860a8a90", - "imageSize": 525, "createdTime": "2021-04-28T22:08:01.8692554Z", "lastUpdateTime": - "2021-04-28T22:08:01.8692554Z", "architecture": "mips64le", "os": "linux", + "imageSize": 525, "createdTime": "2021-05-03T16:15:11.854002Z", "lastUpdateTime": + "2021-05-03T16:15:11.854002Z", "architecture": "mips64le", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:963612c5503f3f1674f315c67089dee577d8cc6afc18565e0b4183ae355fb343", - "imageSize": 525, "createdTime": "2021-04-28T22:08:01.7547492Z", "lastUpdateTime": - "2021-04-28T22:08:01.7547492Z", "architecture": "arm64", "os": "linux", "mediaType": + "imageSize": 525, "createdTime": "2021-05-03T16:15:11.3031204Z", "lastUpdateTime": + "2021-05-03T16:15:11.3031204Z", "architecture": "arm64", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:bb7ab0fa94fdd78aca84b27a1bd46c4b811051f9b69905d81f5f267fc6546a9d", - "imageSize": 525, "createdTime": "2021-04-28T22:08:02.2011859Z", "lastUpdateTime": - "2021-04-28T22:08:02.2011859Z", "architecture": "ppc64le", "os": "linux", + "imageSize": 525, "createdTime": "2021-05-03T16:15:11.6004506Z", "lastUpdateTime": + "2021-05-03T16:15:11.6004506Z", "architecture": "ppc64le", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:cb55d8f7347376e1ba38ca740904b43c9a52f66c7d2ae1ef1a0de1bc9f40df98", - "imageSize": 525, "createdTime": "2021-04-28T22:08:01.9216636Z", "lastUpdateTime": - "2021-04-28T22:08:01.9216636Z", "architecture": "386", "os": "linux", "mediaType": + "imageSize": 525, "createdTime": "2021-05-03T16:15:11.3804449Z", "lastUpdateTime": + "2021-05-03T16:15:11.3804449Z", "architecture": "386", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:e49abad529e5d9bd6787f3abeab94e09ba274fe34731349556a850b9aebbf7bf", - "imageSize": 525, "createdTime": "2021-04-28T22:08:02.2643519Z", "lastUpdateTime": - "2021-04-28T22:08:02.2643519Z", "architecture": "s390x", "os": "linux", "mediaType": + "imageSize": 525, "createdTime": "2021-05-03T16:15:11.6434675Z", "lastUpdateTime": + "2021-05-03T16:15:11.6434675Z", "architecture": "s390x", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:e5785cb0c62cebbed4965129bae371f0589cadd6d84798fb58c2c5f9e237efd9", - "imageSize": 525, "createdTime": "2021-04-28T22:08:01.5677874Z", "lastUpdateTime": - "2021-04-28T22:08:01.5677874Z", "architecture": "arm", "os": "linux", "mediaType": + "imageSize": 525, "createdTime": "2021-05-03T16:15:11.8953692Z", "lastUpdateTime": + "2021-05-03T16:15:11.8953692Z", "architecture": "arm", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:ea0cfb27fd41ea0405d3095880c1efa45710f5bcdddb7d7d5a7317ad4825ae14", - "imageSize": 1125, "createdTime": "2021-04-28T22:08:02.7377961Z", "lastUpdateTime": - "2021-04-28T22:08:02.7377961Z", "architecture": "amd64", "os": "windows", + "imageSize": 1125, "createdTime": "2021-05-03T16:15:12.0625408Z", "lastUpdateTime": + "2021-05-03T16:15:12.0625408Z", "architecture": "amd64", "os": "windows", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true, "quarantineState": "Passed"}}, {"digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", - "imageSize": 5325, "createdTime": "2021-04-28T22:08:01.2695721Z", "lastUpdateTime": - "2021-04-28T22:08:01.2695721Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", - "tags": ["tagb7cc1bf8"], "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + "imageSize": 5325, "createdTime": "2021-05-03T16:15:10.5855101Z", "lastUpdateTime": + "2021-05-03T16:15:10.5855101Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", + "tags": ["tagb0a917be"], "changeableAttributes": {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": true}}]}' headers: access-control-expose-headers: X-Ms-Correlation-Request-Id connection: keep-alive content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:08:13 GMT + date: Mon, 03 May 2021 16:15:22 GMT docker-distribution-api-version: registry/2.0 server: openresty strict-transport-security: max-age=31536000; includeSubDomains @@ -158,32 +158,27 @@ interactions: status: code: 200 message: OK - url: https://fake_url.azurecr.io/acr/v1/reposetb7cc1bf8/_manifests + url: https://fake_url.azurecr.io/acr/v1/repob0a917be/_manifests - request: - body: '{"deleteEnabled": false, "writeEnabled": false, "listEnabled": false, "readEnabled": - false}' + body: null headers: Accept: - application/json - Content-Length: - - '91' - Content-Type: - - application/json User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: PATCH - uri: https://fake_url.azurecr.io/acr/v1/reposetb7cc1bf8/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repob0a917be/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": - "repository", "Name": "reposetb7cc1bf8", "Action": "metadata_write"}]}]}' + "repository", "Name": "repob0a917be", "Action": "metadata_read"}]}]}' headers: access-control-expose-headers: X-Ms-Correlation-Request-Id connection: keep-alive - content-length: '219' + content-length: '215' content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:08:13 GMT + date: Mon, 03 May 2021 16:15:23 GMT docker-distribution-api-version: registry/2.0 server: openresty strict-transport-security: max-age=31536000; includeSubDomains @@ -192,12 +187,39 @@ interactions: status: code: 401 message: Unauthorized - url: https://fake_url.azurecr.io/acr/v1/reposetb7cc1bf8/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 + url: https://fake_url.azurecr.io/acr/v1/repob0a917be/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 +- request: + body: + access_token: REDACTED + grant_type: access_token + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Mon, 03 May 2021 16:15:23 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '166.283333' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/exchange - request: body: grant_type: refresh_token refresh_token: REDACTED - scope: repository:reposetb7cc1bf8:metadata_write + scope: repository:repob0a917be:metadata_read service: fake_url.azurecr.io headers: Accept: @@ -212,47 +234,42 @@ interactions: headers: connection: keep-alive content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:08:13 GMT + date: Mon, 03 May 2021 16:15:23 GMT server: openresty strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked - x-ms-ratelimit-remaining-calls-per-second: '166.483333' + x-ms-ratelimit-remaining-calls-per-second: '166.266667' status: code: 200 message: OK url: https://fake_url.azurecr.io/oauth2/token - request: - body: '{"deleteEnabled": false, "writeEnabled": false, "listEnabled": false, "readEnabled": - false}' + body: null headers: Accept: - application/json - Content-Length: - - '91' - Content-Type: - - application/json User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: PATCH - uri: https://fake_url.azurecr.io/acr/v1/reposetb7cc1bf8/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repob0a917be/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 response: body: - string: '{"registry": "fake_url.azurecr.io", "imageName": "reposetb7cc1bf8", - "manifest": {"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", - "imageSize": 525, "createdTime": "2021-04-28T22:08:01.3894846Z", "lastUpdateTime": - "2021-04-28T22:08:01.3894846Z", "architecture": "amd64", "os": "linux", "mediaType": + string: '{"registry": "fake_url.azurecr.io", "imageName": "repob0a917be", "manifest": + {"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", + "imageSize": 525, "createdTime": "2021-05-03T16:15:12.0093551Z", "lastUpdateTime": + "2021-05-03T16:15:12.0093551Z", "architecture": "amd64", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": - {"deleteEnabled": false, "writeEnabled": false, "readEnabled": false, "listEnabled": - false, "quarantineDetails": "{\"state\":\"Scan Failed\",\"link\":\"https://aka.ms/test\",\"scanner\":\"Azure - Security Monitoring-Qualys Scanner\",\"result\":{\"version\":\"4/28/2021 10:08:13 + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineDetails": "{\"state\":\"Scan InProgress\",\"link\":\"https://aka.ms/test\",\"scanner\":\"Azure + Security Monitoring-Qualys Scanner\",\"result\":{\"version\":\"5/3/2021 4:15:13 PM\",\"summary\":[{\"severity\":\"High\",\"count\":0},{\"severity\":\"Medium\",\"count\":0},{\"severity\":\"Low\",\"count\":0}]}}", "quarantineState": "Passed"}}}' headers: access-control-expose-headers: X-Ms-Correlation-Request-Id connection: keep-alive - content-length: '822' + content-length: '817' content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:08:13 GMT + date: Mon, 03 May 2021 16:15:24 GMT docker-distribution-api-version: registry/2.0 server: openresty strict-transport-security: max-age=31536000; includeSubDomains @@ -260,32 +277,32 @@ interactions: status: code: 200 message: OK - url: https://fake_url.azurecr.io/acr/v1/reposetb7cc1bf8/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 + url: https://fake_url.azurecr.io/acr/v1/repob0a917be/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 - request: - body: '{"deleteEnabled": true, "writeEnabled": true, "listEnabled": true, "readEnabled": - true}' + body: '{"deleteEnabled": false, "writeEnabled": false, "listEnabled": false, "readEnabled": + false}' headers: Accept: - application/json Content-Length: - - '87' + - '91' Content-Type: - application/json User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: PATCH - uri: https://fake_url.azurecr.io/acr/v1/reposetb7cc1bf8/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 + uri: https://fake_url.azurecr.io/acr/v1/repob0a917be/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": - "repository", "Name": "reposetb7cc1bf8", "Action": "metadata_write"}]}]}' + "repository", "Name": "repob0a917be", "Action": "metadata_write"}]}]}' headers: access-control-expose-headers: X-Ms-Correlation-Request-Id connection: keep-alive - content-length: '219' + content-length: '216' content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:08:14 GMT + date: Mon, 03 May 2021 16:15:24 GMT docker-distribution-api-version: registry/2.0 server: openresty strict-transport-security: max-age=31536000; includeSubDomains @@ -294,12 +311,12 @@ interactions: status: code: 401 message: Unauthorized - url: https://fake_url.azurecr.io/acr/v1/reposetb7cc1bf8/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 + url: https://fake_url.azurecr.io/acr/v1/repob0a917be/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 - request: body: grant_type: refresh_token refresh_token: REDACTED - scope: repository:reposetb7cc1bf8:metadata_write + scope: repository:repob0a917be:metadata_write service: fake_url.azurecr.io headers: Accept: @@ -314,47 +331,47 @@ interactions: headers: connection: keep-alive content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:08:14 GMT + date: Mon, 03 May 2021 16:15:24 GMT server: openresty strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked - x-ms-ratelimit-remaining-calls-per-second: '166.466667' + x-ms-ratelimit-remaining-calls-per-second: '166.25' status: code: 200 message: OK url: https://fake_url.azurecr.io/oauth2/token - request: - body: '{"deleteEnabled": true, "writeEnabled": true, "listEnabled": true, "readEnabled": - true}' + body: '{"deleteEnabled": false, "writeEnabled": false, "listEnabled": false, "readEnabled": + false}' headers: Accept: - application/json Content-Length: - - '87' + - '91' Content-Type: - application/json User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) method: PATCH - uri: https://fake_url.azurecr.io/acr/v1/reposetb7cc1bf8/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 + uri: https://fake_url.azurecr.io/acr/v1/repob0a917be/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 response: body: - string: '{"registry": "fake_url.azurecr.io", "imageName": "reposetb7cc1bf8", - "manifest": {"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", - "imageSize": 525, "createdTime": "2021-04-28T22:08:01.3894846Z", "lastUpdateTime": - "2021-04-28T22:08:01.3894846Z", "architecture": "amd64", "os": "linux", "mediaType": + string: '{"registry": "fake_url.azurecr.io", "imageName": "repob0a917be", "manifest": + {"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", + "imageSize": 525, "createdTime": "2021-05-03T16:15:12.0093551Z", "lastUpdateTime": + "2021-05-03T16:15:12.0093551Z", "architecture": "amd64", "os": "linux", "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": - {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": - true, "quarantineDetails": "{\"state\":\"Scan Failed\",\"link\":\"https://aka.ms/test\",\"scanner\":\"Azure - Security Monitoring-Qualys Scanner\",\"result\":{\"version\":\"4/28/2021 10:08:13 + {"deleteEnabled": false, "writeEnabled": false, "readEnabled": false, "listEnabled": + false, "quarantineDetails": "{\"state\":\"Scan InProgress\",\"link\":\"https://aka.ms/test\",\"scanner\":\"Azure + Security Monitoring-Qualys Scanner\",\"result\":{\"version\":\"5/3/2021 4:15:13 PM\",\"summary\":[{\"severity\":\"High\",\"count\":0},{\"severity\":\"Medium\",\"count\":0},{\"severity\":\"Low\",\"count\":0}]}}", "quarantineState": "Passed"}}}' headers: access-control-expose-headers: X-Ms-Correlation-Request-Id connection: keep-alive - content-length: '818' + content-length: '821' content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:08:14 GMT + date: Mon, 03 May 2021 16:15:24 GMT docker-distribution-api-version: registry/2.0 server: openresty strict-transport-security: max-age=31536000; includeSubDomains @@ -362,27 +379,32 @@ interactions: status: code: 200 message: OK - url: https://fake_url.azurecr.io/acr/v1/reposetb7cc1bf8/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 + url: https://fake_url.azurecr.io/acr/v1/repob0a917be/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 - request: - body: null + body: '{"deleteEnabled": true, "writeEnabled": true, "listEnabled": true, "readEnabled": + true}' headers: Accept: - application/json + Content-Length: + - '87' + Content-Type: + - application/json User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: DELETE - uri: https://fake_url.azurecr.io/acr/v1/reposetb7cc1bf8 + method: PATCH + uri: https://fake_url.azurecr.io/acr/v1/repob0a917be/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": - "repository", "Name": "reposetb7cc1bf8", "Action": "delete"}]}]}' + "repository", "Name": "repob0a917be", "Action": "metadata_write"}]}]}' headers: access-control-expose-headers: X-Ms-Correlation-Request-Id connection: keep-alive - content-length: '211' + content-length: '216' content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:08:14 GMT + date: Mon, 03 May 2021 16:15:24 GMT docker-distribution-api-version: registry/2.0 server: openresty strict-transport-security: max-age=31536000; includeSubDomains @@ -391,12 +413,12 @@ interactions: status: code: 401 message: Unauthorized - url: https://fake_url.azurecr.io/acr/v1/reposetb7cc1bf8 + url: https://fake_url.azurecr.io/acr/v1/repob0a917be/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 - request: body: grant_type: refresh_token refresh_token: REDACTED - scope: repository:reposetb7cc1bf8:delete + scope: repository:repob0a917be:metadata_write service: fake_url.azurecr.io headers: Accept: @@ -411,50 +433,53 @@ interactions: headers: connection: keep-alive content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:08:14 GMT + date: Mon, 03 May 2021 16:15:24 GMT server: openresty strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked - x-ms-ratelimit-remaining-calls-per-second: '166.45' + x-ms-ratelimit-remaining-calls-per-second: '166.233333' status: code: 200 message: OK url: https://fake_url.azurecr.io/oauth2/token - request: - body: null + body: '{"deleteEnabled": true, "writeEnabled": true, "listEnabled": true, "readEnabled": + true}' headers: Accept: - application/json + Content-Length: + - '87' + Content-Type: + - application/json User-Agent: - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) - method: DELETE - uri: https://fake_url.azurecr.io/acr/v1/reposetb7cc1bf8 + method: PATCH + uri: https://fake_url.azurecr.io/acr/v1/repob0a917be/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 response: body: - string: '{"manifestsDeleted": ["sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", - "sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1", - "sha256:88b2e00179bd6c4064612403c8d42a13de7ca809d61fee966ce9e129860a8a90", - "sha256:963612c5503f3f1674f315c67089dee577d8cc6afc18565e0b4183ae355fb343", - "sha256:bb7ab0fa94fdd78aca84b27a1bd46c4b811051f9b69905d81f5f267fc6546a9d", - "sha256:cb55d8f7347376e1ba38ca740904b43c9a52f66c7d2ae1ef1a0de1bc9f40df98", - "sha256:e49abad529e5d9bd6787f3abeab94e09ba274fe34731349556a850b9aebbf7bf", - "sha256:e5785cb0c62cebbed4965129bae371f0589cadd6d84798fb58c2c5f9e237efd9", - "sha256:ea0cfb27fd41ea0405d3095880c1efa45710f5bcdddb7d7d5a7317ad4825ae14", - "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519"], - "tagsDeleted": ["tagb7cc1bf8"]}' + string: '{"registry": "fake_url.azurecr.io", "imageName": "repob0a917be", "manifest": + {"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", + "imageSize": 525, "createdTime": "2021-05-03T16:15:12.0093551Z", "lastUpdateTime": + "2021-05-03T16:15:12.0093551Z", "architecture": "amd64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineDetails": "{\"state\":\"Scan InProgress\",\"link\":\"https://aka.ms/test\",\"scanner\":\"Azure + Security Monitoring-Qualys Scanner\",\"result\":{\"version\":\"5/3/2021 4:15:13 + PM\",\"summary\":[{\"severity\":\"High\",\"count\":0},{\"severity\":\"Medium\",\"count\":0},{\"severity\":\"Low\",\"count\":0}]}}", + "quarantineState": "Passed"}}}' headers: access-control-expose-headers: X-Ms-Correlation-Request-Id connection: keep-alive - content-length: '793' + content-length: '817' content-type: application/json; charset=utf-8 - date: Wed, 28 Apr 2021 22:08:16 GMT + date: Mon, 03 May 2021 16:15:25 GMT docker-distribution-api-version: registry/2.0 server: openresty strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff - x-ms-ratelimit-remaining-calls-per-second: '8.000000' status: - code: 202 - message: Accepted - url: https://fake_url.azurecr.io/acr/v1/reposetb7cc1bf8 + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/repob0a917be/_manifests/sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_set_tag_properties.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_set_tag_properties.yaml new file mode 100644 index 000000000000..294dbdc0717a --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_registry_artifact_async.test_set_tag_properties.yaml @@ -0,0 +1,470 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo3e8d15a3/_manifests + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repo3e8d15a3", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '215' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:23:26 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/repo3e8d15a3/_manifests +- request: + body: + access_token: REDACTED + grant_type: access_token + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:23:27 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.35' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:repo3e8d15a3:metadata_read + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:23:28 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.333333' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo3e8d15a3/_manifests + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "repo3e8d15a3", "manifests": + [{"digest": "sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792", + "imageSize": 0, "createdTime": "2021-04-28T15:41:28.6034839Z", "lastUpdateTime": + "2021-04-28T15:41:28.6034839Z", "architecture": "amd64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1", + "imageSize": 0, "createdTime": "2021-04-28T15:41:28.9848846Z", "lastUpdateTime": + "2021-04-28T15:41:28.9848846Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:88b2e00179bd6c4064612403c8d42a13de7ca809d61fee966ce9e129860a8a90", + "imageSize": 0, "createdTime": "2021-04-28T15:41:29.797838Z", "lastUpdateTime": + "2021-04-28T15:41:29.797838Z", "architecture": "mips64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:963612c5503f3f1674f315c67089dee577d8cc6afc18565e0b4183ae355fb343", + "imageSize": 0, "createdTime": "2021-04-28T15:41:29.3917939Z", "lastUpdateTime": + "2021-04-28T15:41:29.3917939Z", "architecture": "arm64", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:bb7ab0fa94fdd78aca84b27a1bd46c4b811051f9b69905d81f5f267fc6546a9d", + "imageSize": 0, "createdTime": "2021-04-28T15:41:29.2818942Z", "lastUpdateTime": + "2021-04-28T15:41:29.2818942Z", "architecture": "ppc64le", "os": "linux", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:cb55d8f7347376e1ba38ca740904b43c9a52f66c7d2ae1ef1a0de1bc9f40df98", + "imageSize": 0, "createdTime": "2021-04-28T15:41:28.7869581Z", "lastUpdateTime": + "2021-04-28T15:41:28.7869581Z", "architecture": "386", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e49abad529e5d9bd6787f3abeab94e09ba274fe34731349556a850b9aebbf7bf", + "imageSize": 0, "createdTime": "2021-04-28T15:41:28.6651892Z", "lastUpdateTime": + "2021-04-28T15:41:28.6651892Z", "architecture": "s390x", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:e5785cb0c62cebbed4965129bae371f0589cadd6d84798fb58c2c5f9e237efd9", + "imageSize": 0, "createdTime": "2021-04-28T15:41:28.4309726Z", "lastUpdateTime": + "2021-04-28T15:41:28.4309726Z", "architecture": "arm", "os": "linux", "mediaType": + "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:ea0cfb27fd41ea0405d3095880c1efa45710f5bcdddb7d7d5a7317ad4825ae14", + "imageSize": 0, "createdTime": "2021-04-28T15:41:28.7313899Z", "lastUpdateTime": + "2021-04-28T15:41:28.7313899Z", "architecture": "amd64", "os": "windows", + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "changeableAttributes": + {"deleteEnabled": true, "writeEnabled": true, "readEnabled": true, "listEnabled": + true, "quarantineState": "Passed"}}, {"digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "imageSize": 0, "createdTime": "2021-04-28T15:41:27.5258825Z", "lastUpdateTime": + "2021-04-28T15:41:27.5258825Z", "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", + "tags": ["tag3e8d15a3"], "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:23:28 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/repo3e8d15a3/_manifests +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo3e8d15a3/_tags/tag3e8d15a3 + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repo3e8d15a3", "Action": "metadata_read"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '215' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:23:29 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/repo3e8d15a3/_tags/tag3e8d15a3 +- request: + body: + access_token: REDACTED + grant_type: access_token + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/exchange + response: + body: + string: '{"refresh_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:23:29 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.4' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:repo3e8d15a3:metadata_read + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:23:29 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.033333' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/repo3e8d15a3/_tags/tag3e8d15a3 + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "repo3e8d15a3", "tag": + {"name": "tag3e8d15a3", "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "createdTime": "2021-04-28T15:41:27.4432686Z", "lastUpdateTime": "2021-04-28T15:41:27.4432686Z", + "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '386' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:23:29 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/repo3e8d15a3/_tags/tag3e8d15a3 +- request: + body: '{"deleteEnabled": false, "writeEnabled": false, "listEnabled": false, "readEnabled": + false}' + headers: + Accept: + - application/json + Content-Length: + - '91' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: PATCH + uri: https://fake_url.azurecr.io/acr/v1/repo3e8d15a3/_tags/tag3e8d15a3 + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repo3e8d15a3", "Action": "metadata_write"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '216' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:23:29 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/repo3e8d15a3/_tags/tag3e8d15a3 +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:repo3e8d15a3:metadata_write + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:23:30 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.833333' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: '{"deleteEnabled": false, "writeEnabled": false, "listEnabled": false, "readEnabled": + false}' + headers: + Accept: + - application/json + Content-Length: + - '91' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: PATCH + uri: https://fake_url.azurecr.io/acr/v1/repo3e8d15a3/_tags/tag3e8d15a3 + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "repo3e8d15a3", "tag": + {"name": "tag3e8d15a3", "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "createdTime": "2021-04-28T15:41:27.4432686Z", "lastUpdateTime": "2021-04-28T15:41:27.4432686Z", + "signed": false, "changeableAttributes": {"deleteEnabled": false, "writeEnabled": + false, "readEnabled": false, "listEnabled": false}}}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '390' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:23:30 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/repo3e8d15a3/_tags/tag3e8d15a3 +- request: + body: '{"deleteEnabled": true, "writeEnabled": true, "listEnabled": true, "readEnabled": + true}' + headers: + Accept: + - application/json + Content-Length: + - '87' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: PATCH + uri: https://fake_url.azurecr.io/acr/v1/repo3e8d15a3/_tags/tag3e8d15a3 + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "repo3e8d15a3", "Action": "metadata_write"}]}]}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '216' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:23:30 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + www-authenticate: Bearer realm="https://fake_url.azurecr.io/oauth2/token",service="fake_url.azurecr.io",scope="fake_scope",error="invalid_token" + x-content-type-options: nosniff + status: + code: 401 + message: Unauthorized + url: https://fake_url.azurecr.io/acr/v1/repo3e8d15a3/_tags/tag3e8d15a3 +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:repo3e8d15a3:metadata_write + service: fake_url.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://fake_url.azurecr.io/oauth2/token + response: + body: + string: '{"access_token": "REDACTED"}' + headers: + connection: keep-alive + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:23:30 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '165.816667' + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/oauth2/token +- request: + body: '{"deleteEnabled": true, "writeEnabled": true, "listEnabled": true, "readEnabled": + true}' + headers: + Accept: + - application/json + Content-Length: + - '87' + Content-Type: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: PATCH + uri: https://fake_url.azurecr.io/acr/v1/repo3e8d15a3/_tags/tag3e8d15a3 + response: + body: + string: '{"registry": "fake_url.azurecr.io", "imageName": "repo3e8d15a3", "tag": + {"name": "tag3e8d15a3", "digest": "sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519", + "createdTime": "2021-04-28T15:41:27.4432686Z", "lastUpdateTime": "2021-04-28T15:41:27.4432686Z", + "signed": false, "changeableAttributes": {"deleteEnabled": true, "writeEnabled": + true, "readEnabled": true, "listEnabled": true}}}' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '386' + content-type: application/json; charset=utf-8 + date: Wed, 28 Apr 2021 21:23:30 GMT + docker-distribution-api-version: registry/2.0 + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + x-content-type-options: nosniff + status: + code: 200 + message: OK + url: https://fake_url.azurecr.io/acr/v1/repo3e8d15a3/_tags/tag3e8d15a3 +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/test_container_registry_client.py b/sdk/containerregistry/azure-containerregistry/tests/test_container_registry_client.py index 6932b034eda4..ef0293170c4f 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/test_container_registry_client.py +++ b/sdk/containerregistry/azure-containerregistry/tests/test_container_registry_client.py @@ -6,10 +6,7 @@ import pytest import six -from devtools_testutils import AzureTestCase - from azure.containerregistry import ( - ContainerRegistryClient, DeleteRepositoryResult, ) from azure.core.exceptions import ResourceNotFoundError @@ -23,10 +20,10 @@ class TestContainerRegistryClient(ContainerRegistryTestClass): @acr_preparer() - def test_list_repositories(self, containerregistry_endpoint): + def test_list_repository_names(self, containerregistry_endpoint): client = self.create_registry_client(containerregistry_endpoint) - repositories = client.list_repositories() + repositories = client.list_repository_names() assert isinstance(repositories, ItemPaged) count = 0 @@ -40,12 +37,12 @@ def test_list_repositories(self, containerregistry_endpoint): assert count > 0 @acr_preparer() - def test_list_repositories_by_page(self, containerregistry_endpoint): + def test_list_repository_names_by_page(self, containerregistry_endpoint): client = self.create_registry_client(containerregistry_endpoint) results_per_page = 2 total_pages = 0 - repository_pages = client.list_repositories(results_per_page=results_per_page) + repository_pages = client.list_repository_names(results_per_page=results_per_page) prev = None for page in repository_pages.by_page(): @@ -70,7 +67,7 @@ def test_delete_repository(self, containerregistry_endpoint, containerregistry_r assert result.deleted_manifests is not None assert result.deleted_tags is not None - for repo in client.list_repositories(): + for repo in client.list_repository_names(): if repo == TO_BE_DELETED: raise ValueError("Repository not deleted") @@ -86,13 +83,13 @@ def test_transport_closed_only_once(self, containerregistry_endpoint): transport = RequestsTransport() client = self.create_registry_client(containerregistry_endpoint, transport=transport) with client: - for r in client.list_repositories(): + for r in client.list_repository_names(): pass assert transport.session is not None - with client.get_repository_client(HELLO_WORLD) as repo_client: + with client.get_repository(HELLO_WORLD) as repo_client: assert transport.session is not None - for r in client.list_repositories(): + for r in client.list_repository_names(): pass assert transport.session is not None diff --git a/sdk/containerregistry/azure-containerregistry/tests/test_container_registry_client_async.py b/sdk/containerregistry/azure-containerregistry/tests/test_container_registry_client_async.py index 40366994cbdd..dd71da9270b7 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/test_container_registry_client_async.py +++ b/sdk/containerregistry/azure-containerregistry/tests/test_container_registry_client_async.py @@ -6,15 +6,10 @@ import pytest import six -from devtools_testutils import AzureTestCase - from azure.containerregistry import ( DeleteRepositoryResult, - RepositoryProperties, ) -from azure.containerregistry.aio import ContainerRegistryClient, ContainerRepositoryClient from azure.core.exceptions import ResourceNotFoundError -from azure.core.paging import ItemPaged from azure.core.pipeline.transport import AioHttpTransport from asynctestcase import AsyncContainerRegistryTestClass @@ -24,14 +19,14 @@ class TestContainerRegistryClient(AsyncContainerRegistryTestClass): @acr_preparer() - async def test_list_repositories(self, containerregistry_endpoint): + async def test_list_repository_names(self, containerregistry_endpoint): client = self.create_registry_client(containerregistry_endpoint) - repositories = client.list_repositories() + repositories = client.list_repository_names() count = 0 prev = None - async for repo in client.list_repositories(): + async for repo in client.list_repository_names(): count += 1 assert isinstance(repo, six.string_types) assert prev != repo @@ -40,12 +35,12 @@ async def test_list_repositories(self, containerregistry_endpoint): assert count > 0 @acr_preparer() - async def test_list_repositories_by_page(self, containerregistry_endpoint): + async def test_list_repository_names_by_page(self, containerregistry_endpoint): client = self.create_registry_client(containerregistry_endpoint) results_per_page = 2 total_pages = 0 - repository_pages = client.list_repositories(results_per_page=results_per_page) + repository_pages = client.list_repository_names(results_per_page=results_per_page) prev = None async for page in repository_pages.by_page(): @@ -71,7 +66,7 @@ async def test_delete_repository(self, containerregistry_endpoint, containerregi assert result.deleted_manifests is not None assert result.deleted_tags is not None - async for repo in client.list_repositories(): + async for repo in client.list_repository_names(): if repo == TO_BE_DELETED: raise ValueError("Repository not deleted") @@ -80,21 +75,21 @@ async def test_delete_repository_does_not_exist(self, containerregistry_endpoint client = self.create_registry_client(containerregistry_endpoint) with pytest.raises(ResourceNotFoundError): - deleted_result = await client.delete_repository("not_real_repo") + await client.delete_repository("not_real_repo") @acr_preparer() async def test_transport_closed_only_once(self, containerregistry_endpoint): transport = AioHttpTransport() client = self.create_registry_client(containerregistry_endpoint, transport=transport) async with client: - async for r in client.list_repositories(): + async for r in client.list_repository_names(): pass assert transport.session is not None - repo_client = client.get_repository_client(HELLO_WORLD) + repo_client = client.get_repository(HELLO_WORLD) async with repo_client: assert transport.session is not None - async for r in client.list_repositories(): + async for r in client.list_repository_names(): pass assert transport.session is not None diff --git a/sdk/containerregistry/azure-containerregistry/tests/test_container_repository.py b/sdk/containerregistry/azure-containerregistry/tests/test_container_repository.py new file mode 100644 index 000000000000..6c8da138d7bc --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/test_container_repository.py @@ -0,0 +1,143 @@ +# coding=utf-8 +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +from datetime import datetime +import pytest + +from azure.containerregistry import ( + ContentProperties, + DeleteRepositoryResult, + RepositoryProperties, + ManifestOrder, + ArtifactManifestProperties, +) +from azure.core.exceptions import ResourceNotFoundError + +from testcase import ContainerRegistryTestClass +from constants import TO_BE_DELETED, DOES_NOT_EXIST, HELLO_WORLD +from preparer import acr_preparer + + +class TestContainerRepository(ContainerRegistryTestClass): + @acr_preparer() + def test_get_properties(self, containerregistry_endpoint): + repo_client = self.create_container_repository(containerregistry_endpoint, HELLO_WORLD) + + properties = repo_client.get_properties() + assert isinstance(properties, RepositoryProperties) + assert isinstance(properties.writeable_properties, ContentProperties) + assert properties.name == u"library/hello-world" + + @acr_preparer() + def test_set_properties(self, containerregistry_endpoint): + repository = self.get_resource_name("repo") + tag_identifier = self.get_resource_name("tag") + self.import_image(HELLO_WORLD, ["{}:{}".format(repository, tag_identifier)]) + repo_client = self.create_container_repository(containerregistry_endpoint, repository) + + properties = repo_client.get_properties() + assert isinstance(properties.writeable_properties, ContentProperties) + + c = ContentProperties(can_delete=False, can_read=False, can_list=False, can_write=False) + properties.writeable_properties = c + new_properties = repo_client.set_properties(c) + + assert c.can_delete == new_properties.writeable_properties.can_delete + assert c.can_read == new_properties.writeable_properties.can_read + assert c.can_list == new_properties.writeable_properties.can_list + assert c.can_write == new_properties.writeable_properties.can_write + + c = ContentProperties(can_delete=True, can_read=True, can_list=True, can_write=True) + properties.writeable_properties = c + new_properties = repo_client.set_properties(c) + + assert c.can_delete == new_properties.writeable_properties.can_delete + assert c.can_read == new_properties.writeable_properties.can_read + assert c.can_list == new_properties.writeable_properties.can_list + assert c.can_write == new_properties.writeable_properties.can_write + + @acr_preparer() + def test_list_manifests(self, containerregistry_endpoint): + client = self.create_container_repository(containerregistry_endpoint, "library/busybox") + + count = 0 + for artifact in client.list_manifests(): + assert artifact is not None + assert isinstance(artifact, ArtifactManifestProperties) + assert artifact.created_on is not None + assert isinstance(artifact.created_on, datetime) + assert artifact.last_updated_on is not None + assert isinstance(artifact.last_updated_on, datetime) + assert artifact.repository_name == "library/busybox" + count += 1 + + assert count > 0 + + @acr_preparer() + def test_list_manifests_by_page(self, containerregistry_endpoint): + client = self.create_container_repository(containerregistry_endpoint, "library/busybox") + results_per_page = 2 + + pages = client.list_manifests(results_per_page=results_per_page) + page_count = 0 + for page in pages.by_page(): + reg_count = 0 + for tag in page: + reg_count += 1 + assert reg_count <= results_per_page + page_count += 1 + + assert page_count >= 1 + + @acr_preparer() + def test_list_manifests_descending(self, containerregistry_endpoint): + client = self.create_container_repository(containerregistry_endpoint, "library/busybox") + + prev_last_updated_on = None + count = 0 + for artifact in client.list_manifests(order_by=ManifestOrder.LAST_UPDATE_TIME_DESCENDING): + if prev_last_updated_on: + assert artifact.last_updated_on < prev_last_updated_on + prev_last_updated_on = artifact.last_updated_on + count += 1 + + assert count > 0 + + @acr_preparer() + def test_list_manifests_ascending(self, containerregistry_endpoint): + client = self.create_container_repository(containerregistry_endpoint, "library/busybox") + + prev_last_updated_on = None + count = 0 + for artifact in client.list_manifests(order_by=ManifestOrder.LAST_UPDATE_TIME_ASCENDING): + if prev_last_updated_on: + assert artifact.last_updated_on > prev_last_updated_on + prev_last_updated_on = artifact.last_updated_on + count += 1 + + assert count > 0 + + @acr_preparer() + def test_delete_repository(self, containerregistry_endpoint, containerregistry_resource_group): + self.import_image(HELLO_WORLD, [TO_BE_DELETED]) + + reg_client = self.create_registry_client(containerregistry_endpoint) + existing_repos = list(reg_client.list_repository_names()) + assert TO_BE_DELETED in existing_repos + + repo_client = self.create_container_repository(containerregistry_endpoint, TO_BE_DELETED) + result = repo_client.delete() + assert isinstance(result, DeleteRepositoryResult) + assert result.deleted_manifests is not None + assert result.deleted_tags is not None + + existing_repos = list(reg_client.list_repository_names()) + assert TO_BE_DELETED not in existing_repos + + @acr_preparer() + def test_delete_repository_doesnt_exist(self, containerregistry_endpoint): + repo_client = self.create_container_repository(containerregistry_endpoint, DOES_NOT_EXIST) + with pytest.raises(ResourceNotFoundError): + repo_client.delete() diff --git a/sdk/containerregistry/azure-containerregistry/tests/test_container_repository_async.py b/sdk/containerregistry/azure-containerregistry/tests/test_container_repository_async.py new file mode 100644 index 000000000000..08f76d70b3ad --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/test_container_repository_async.py @@ -0,0 +1,150 @@ +# coding=utf-8 +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +from datetime import datetime +import pytest + +from azure.containerregistry import ( + DeleteRepositoryResult, + RepositoryProperties, + ContentProperties, + ManifestOrder, + ArtifactManifestProperties, + TagOrder, +) +from azure.containerregistry.aio import ContainerRegistryClient, ContainerRepository +from azure.core.exceptions import ResourceNotFoundError +from azure.core.async_paging import AsyncItemPaged + +from asynctestcase import AsyncContainerRegistryTestClass +from preparer import acr_preparer +from constants import TO_BE_DELETED, DOES_NOT_EXIST, HELLO_WORLD + + +class TestContainerRepository(AsyncContainerRegistryTestClass): + @acr_preparer() + async def test_delete_repository(self, containerregistry_endpoint, containerregistry_resource_group): + self.import_image(HELLO_WORLD, [TO_BE_DELETED]) + + reg_client = self.create_registry_client(containerregistry_endpoint) + existing_repos = [] + async for repo in reg_client.list_repository_names(): + existing_repos.append(repo) + assert TO_BE_DELETED in existing_repos + + repo_client = self.create_container_repository(containerregistry_endpoint, TO_BE_DELETED) + result = await repo_client.delete() + assert isinstance(result, DeleteRepositoryResult) + assert result.deleted_manifests is not None + assert result.deleted_tags is not None + + existing_repos = [] + async for repo in reg_client.list_repository_names(): + existing_repos.append(repo) + assert TO_BE_DELETED not in existing_repos + + @acr_preparer() + async def test_delete_repository_doesnt_exist(self, containerregistry_endpoint): + repo_client = self.create_container_repository(containerregistry_endpoint, DOES_NOT_EXIST) + with pytest.raises(ResourceNotFoundError): + await repo_client.delete() + + @acr_preparer() + async def test_list_manifests(self, containerregistry_endpoint): + client = self.create_container_repository(containerregistry_endpoint, "library/busybox") + + count = 0 + async for artifact in client.list_manifests(): + assert artifact is not None + assert isinstance(artifact, ArtifactManifestProperties) + assert artifact.created_on is not None + assert isinstance(artifact.created_on, datetime) + assert artifact.last_updated_on is not None + assert isinstance(artifact.last_updated_on, datetime) + assert artifact.repository_name == "library/busybox" + count += 1 + + assert count > 0 + + @acr_preparer() + async def test_list_manifests_by_page(self, containerregistry_endpoint): + client = self.create_container_repository(containerregistry_endpoint, "library/busybox") + results_per_page = 2 + + pages = client.list_manifests(results_per_page=results_per_page) + page_count = 0 + async for page in pages.by_page(): + reg_count = 0 + async for tag in page: + reg_count += 1 + assert reg_count <= results_per_page + page_count += 1 + + assert page_count >= 1 + + @acr_preparer() + async def test_list_manifests_descending(self, containerregistry_endpoint): + client = self.create_container_repository(containerregistry_endpoint, "library/busybox") + + prev_last_updated_on = None + count = 0 + async for artifact in client.list_manifests(order_by=ManifestOrder.LAST_UPDATE_TIME_DESCENDING): + if prev_last_updated_on: + assert artifact.last_updated_on < prev_last_updated_on + prev_last_updated_on = artifact.last_updated_on + count += 1 + + assert count > 0 + + @acr_preparer() + async def test_list_manifests_ascending(self, containerregistry_endpoint): + client = self.create_container_repository(containerregistry_endpoint, "library/busybox") + + prev_last_updated_on = None + count = 0 + async for artifact in client.list_manifests(order_by=ManifestOrder.LAST_UPDATE_TIME_ASCENDING): + if prev_last_updated_on: + assert artifact.last_updated_on > prev_last_updated_on + prev_last_updated_on = artifact.last_updated_on + count += 1 + + assert count > 0 + + @acr_preparer() + async def test_get_properties(self, containerregistry_endpoint): + repo_client = self.create_container_repository(containerregistry_endpoint, HELLO_WORLD) + + properties = await repo_client.get_properties() + assert isinstance(properties, RepositoryProperties) + assert isinstance(properties.writeable_properties, ContentProperties) + assert properties.name == u"library/hello-world" + + @acr_preparer() + async def test_set_properties(self, containerregistry_endpoint): + repository = self.get_resource_name("repo") + tag_identifier = self.get_resource_name("tag") + self.import_image(HELLO_WORLD, ["{}:{}".format(repository, tag_identifier)]) + repo_client = self.create_container_repository(containerregistry_endpoint, repository) + + properties = await repo_client.get_properties() + assert isinstance(properties.writeable_properties, ContentProperties) + + c = ContentProperties(can_delete=False, can_read=False, can_list=False, can_write=False) + properties.writeable_properties = c + new_properties = await repo_client.set_properties(c) + + assert c.can_delete == new_properties.writeable_properties.can_delete + assert c.can_read == new_properties.writeable_properties.can_read + assert c.can_list == new_properties.writeable_properties.can_list + assert c.can_write == new_properties.writeable_properties.can_write + + c = ContentProperties(can_delete=True, can_read=True, can_list=True, can_write=True) + properties.writeable_properties = c + new_properties = await repo_client.set_properties(c) + + assert c.can_delete == new_properties.writeable_properties.can_delete + assert c.can_read == new_properties.writeable_properties.can_read + assert c.can_list == new_properties.writeable_properties.can_list + assert c.can_write == new_properties.writeable_properties.can_write diff --git a/sdk/containerregistry/azure-containerregistry/tests/test_container_repository_client.py b/sdk/containerregistry/azure-containerregistry/tests/test_container_repository_client.py deleted file mode 100644 index 82b61bc7c029..000000000000 --- a/sdk/containerregistry/azure-containerregistry/tests/test_container_repository_client.py +++ /dev/null @@ -1,324 +0,0 @@ -# coding=utf-8 -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -from datetime import datetime -import pytest - -from azure.containerregistry import ( - DeleteRepositoryResult, - ContentProperties, - ManifestOrderBy, - ArtifactManifestProperties, - ArtifactTagProperties, - TagOrderBy, -) -from azure.core.exceptions import ResourceNotFoundError -from azure.core.paging import ItemPaged - -from testcase import ContainerRegistryTestClass -from constants import TO_BE_DELETED, DOES_NOT_EXIST, HELLO_WORLD -from preparer import acr_preparer - - -class TestContainerRepositoryClient(ContainerRegistryTestClass): - @acr_preparer() - def test_delete_tag(self, containerregistry_endpoint, containerregistry_resource_group): - repo = self.get_resource_name("repo") - tag = self.get_resource_name("tag") - self.import_image(HELLO_WORLD, ["{}:{}".format(repo, tag)]) - - client = self.create_repository_client(containerregistry_endpoint, repo) - - tag_props = client.get_tag_properties(tag) - assert tag_props is not None - - client.delete_tag(tag) - self.sleep(5) - with pytest.raises(ResourceNotFoundError): - client.get_tag_properties(tag) - - @acr_preparer() - def test_delete_tag_does_not_exist(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, "DOES_NOT_EXIST123") - - with pytest.raises(ResourceNotFoundError): - client.delete_tag("DOESNOTEXIST123") - - @acr_preparer() - def test_get_properties(self, containerregistry_endpoint): - repo_client = self.create_repository_client(containerregistry_endpoint, HELLO_WORLD) - - properties = repo_client.get_properties() - assert isinstance(properties.writeable_properties, ContentProperties) - - @acr_preparer() - def test_get_tag(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, self.repository) - - tag = client.get_tag_properties("latest") - - assert tag is not None - assert isinstance(tag, ArtifactTagProperties) - assert tag.repository == client.repository - - @acr_preparer() - def test_list_registry_artifacts(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, self.repository) - - count = 0 - for artifact in client.list_registry_artifacts(): - assert artifact is not None - assert isinstance(artifact, ArtifactManifestProperties) - assert artifact.created_on is not None - assert isinstance(artifact.created_on, datetime) - assert artifact.last_updated_on is not None - assert isinstance(artifact.last_updated_on, datetime) - count += 1 - - assert count > 0 - - @acr_preparer() - def test_list_registry_artifacts_by_page(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, self.repository) - results_per_page = 2 - - pages = client.list_registry_artifacts(results_per_page=results_per_page) - page_count = 0 - for page in pages.by_page(): - reg_count = 0 - for tag in page: - reg_count += 1 - assert reg_count <= results_per_page - page_count += 1 - - assert page_count >= 1 - - @acr_preparer() - def test_list_registry_artifacts_descending(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, self.repository) - - prev_last_updated_on = None - count = 0 - for artifact in client.list_registry_artifacts(order_by=ManifestOrderBy.LAST_UPDATE_TIME_DESCENDING): - if prev_last_updated_on: - assert artifact.last_updated_on < prev_last_updated_on - prev_last_updated_on = artifact.last_updated_on - count += 1 - - assert count > 0 - - @acr_preparer() - def test_list_registry_artifacts_ascending(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, self.repository) - - prev_last_updated_on = None - count = 0 - for artifact in client.list_registry_artifacts(order_by=ManifestOrderBy.LAST_UPDATE_TIME_ASCENDING): - if prev_last_updated_on: - assert artifact.last_updated_on > prev_last_updated_on - prev_last_updated_on = artifact.last_updated_on - count += 1 - - assert count > 0 - - @acr_preparer() - def test_get_registry_artifact_properties(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, self.repository) - - properties = client.get_registry_artifact_properties("latest") - - assert isinstance(properties, ArtifactManifestProperties) - assert isinstance(properties.created_on, datetime) - assert isinstance(properties.last_updated_on, datetime) - - @acr_preparer() - def test_list_tags(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, self.repository) - - tags = client.list_tags() - assert isinstance(tags, ItemPaged) - count = 0 - for tag in tags: - count += 1 - - assert count > 0 - - @acr_preparer() - def test_list_tags_by_page(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, self.repository) - - results_per_page = 2 - - pages = client.list_tags(results_per_page=results_per_page) - page_count = 0 - for page in pages.by_page(): - tag_count = 0 - for tag in page: - tag_count += 1 - assert tag_count <= results_per_page - page_count += 1 - - assert page_count >= 1 - - @acr_preparer() - def test_list_tags_descending(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, self.repository) - - prev_last_updated_on = None - count = 0 - for tag in client.list_tags(order_by=TagOrderBy.LAST_UPDATE_TIME_DESCENDING): - if prev_last_updated_on: - assert tag.last_updated_on < prev_last_updated_on - prev_last_updated_on = tag.last_updated_on - count += 1 - - assert count > 0 - - @acr_preparer() - def test_list_tags_ascending(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, self.repository) - - prev_last_updated_on = None - count = 0 - for tag in client.list_tags(order_by=TagOrderBy.LAST_UPDATE_TIME_ASCENDING): - if prev_last_updated_on: - assert tag.last_updated_on > prev_last_updated_on - prev_last_updated_on = tag.last_updated_on - count += 1 - - assert count > 0 - - @acr_preparer() - def test_set_tag_properties(self, containerregistry_endpoint, containerregistry_resource_group): - repository = self.get_resource_name("repo") - tag_identifier = self.get_resource_name("tag") - self.import_image(HELLO_WORLD, ["{}:{}".format(repository, tag_identifier)]) - - client = self.create_repository_client(containerregistry_endpoint, repository) - - tag_props = client.get_tag_properties(tag_identifier) - permissions = tag_props.writeable_properties - - received = client.set_tag_properties( - tag_identifier, - ContentProperties( - can_delete=False, - can_list=False, - can_read=False, - can_write=False, - ), - ) - - assert not received.writeable_properties.can_write - assert not received.writeable_properties.can_read - assert not received.writeable_properties.can_list - assert not received.writeable_properties.can_delete - - client.set_tag_properties( - tag_identifier, - ContentProperties( - can_delete=True, - can_list=True, - can_read=True, - can_write=True, - ), - ) - - @acr_preparer() - def test_set_tag_properties_does_not_exist(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, self.get_resource_name("repo")) - - with pytest.raises(ResourceNotFoundError): - client.set_tag_properties(DOES_NOT_EXIST, ContentProperties(can_delete=False)) - - @acr_preparer() - def test_set_manifest_properties(self, containerregistry_endpoint, containerregistry_resource_group): - repository = self.get_resource_name("reposetmani") - tag_identifier = self.get_resource_name("tag") - self.import_image(HELLO_WORLD, ["{}:{}".format(repository, tag_identifier)]) - - client = self.create_repository_client(containerregistry_endpoint, repository) - - for artifact in client.list_registry_artifacts(): - permissions = artifact.writeable_properties - - received_permissions = client.set_manifest_properties( - artifact.digest, - ContentProperties( - can_delete=False, - can_list=False, - can_read=False, - can_write=False, - ), - ) - - assert not received_permissions.writeable_properties.can_delete - assert not received_permissions.writeable_properties.can_read - assert not received_permissions.writeable_properties.can_list - assert not received_permissions.writeable_properties.can_write - - # Reset and delete - client.set_manifest_properties( - artifact.digest, - ContentProperties( - can_delete=True, - can_list=True, - can_read=True, - can_write=True, - ), - ) - client.delete() - break - - @acr_preparer() - def test_set_manifest_properties_does_not_exist(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, self.get_resource_name("repo")) - - with pytest.raises(ResourceNotFoundError): - client.set_manifest_properties("sha256:abcdef", ContentProperties(can_delete=False)) - - @acr_preparer() - def test_delete_repository(self, containerregistry_endpoint, containerregistry_resource_group): - self.import_image(HELLO_WORLD, [TO_BE_DELETED]) - - reg_client = self.create_registry_client(containerregistry_endpoint) - existing_repos = list(reg_client.list_repositories()) - assert TO_BE_DELETED in existing_repos - - repo_client = self.create_repository_client(containerregistry_endpoint, TO_BE_DELETED) - result = repo_client.delete() - assert isinstance(result, DeleteRepositoryResult) - assert result.deleted_manifests is not None - assert result.deleted_tags is not None - - existing_repos = list(reg_client.list_repositories()) - assert TO_BE_DELETED not in existing_repos - - @acr_preparer() - def test_delete_repository_doesnt_exist(self, containerregistry_endpoint): - repo_client = self.create_repository_client(containerregistry_endpoint, DOES_NOT_EXIST) - with pytest.raises(ResourceNotFoundError): - repo_client.delete() - - @acr_preparer() - def test_delete_registry_artifact(self, containerregistry_endpoint, containerregistry_resource_group): - repository = self.get_resource_name("repo") - self.import_image(HELLO_WORLD, [repository]) - - repo_client = self.create_repository_client(containerregistry_endpoint, repository) - - count = 0 - for artifact in repo_client.list_registry_artifacts(): - if count == 0: - repo_client.delete_registry_artifact(artifact.digest) - count += 1 - assert count > 0 - - artifacts = [] - for a in repo_client.list_registry_artifacts(): - artifacts.append(a) - - assert len(artifacts) > 0 - assert len(artifacts) == count - 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/test_container_repository_client_async.py b/sdk/containerregistry/azure-containerregistry/tests/test_container_repository_client_async.py deleted file mode 100644 index 02ea7dfef5a3..000000000000 --- a/sdk/containerregistry/azure-containerregistry/tests/test_container_repository_client_async.py +++ /dev/null @@ -1,329 +0,0 @@ -# coding=utf-8 -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -from datetime import datetime -import pytest - -from azure.containerregistry import ( - DeleteRepositoryResult, - ArtifactTagProperties, - ContentProperties, - ManifestOrderBy, - ArtifactManifestProperties, - TagOrderBy, -) -from azure.core.exceptions import ResourceNotFoundError -from azure.core.async_paging import AsyncItemPaged - -from asynctestcase import AsyncContainerRegistryTestClass -from preparer import acr_preparer -from constants import TO_BE_DELETED, DOES_NOT_EXIST, HELLO_WORLD - - -class TestContainerRepositoryClient(AsyncContainerRegistryTestClass): - @acr_preparer() - async def test_list_registry_artifacts(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, self.repository) - - async for artifact in client.list_registry_artifacts(): - assert artifact is not None - assert isinstance(artifact, ArtifactManifestProperties) - assert artifact.created_on is not None - assert isinstance(artifact.created_on, datetime) - assert artifact.last_updated_on is not None - assert isinstance(artifact.last_updated_on, datetime) - - @acr_preparer() - async def test_list_registry_artifacts_by_page(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, self.repository) - results_per_page = 2 - - pages = client.list_registry_artifacts(results_per_page=results_per_page) - page_count = 0 - async for page in pages.by_page(): - reg_count = 0 - async for tag in page: - reg_count += 1 - assert reg_count <= results_per_page - page_count += 1 - - assert page_count >= 1 - - @acr_preparer() - async def test_list_tags(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, self.repository) - - tags = client.list_tags() - assert isinstance(tags, AsyncItemPaged) - count = 0 - async for tag in tags: - count += 1 - - assert count > 0 - - @acr_preparer() - async def test_list_tags_by_page(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, self.repository) - - results_per_page = 2 - - pages = client.list_tags(results_per_page=results_per_page) - page_count = 0 - async for page in pages.by_page(): - tag_count = 0 - async for tag in page: - tag_count += 1 - assert tag_count <= results_per_page - page_count += 1 - - assert page_count >= 1 - - @acr_preparer() - async def test_delete_tag(self, containerregistry_endpoint): - repo = self.get_resource_name("repos") - tag = self.get_resource_name("tag") - self.import_image(HELLO_WORLD, ["{}:{}".format(repo, tag)]) - - client = self.create_repository_client(containerregistry_endpoint, repo) - - tag_props = await client.get_tag_properties(tag) - assert tag_props is not None - - await client.delete_tag(tag) - self.sleep(5) - - with pytest.raises(ResourceNotFoundError): - await client.get_tag_properties(tag) - - @acr_preparer() - async def test_delete_tag_does_not_exist(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, "DOES_NOT_EXIST123") - - with pytest.raises(ResourceNotFoundError): - await client.delete_tag("DOESNOTEXIST123") - - @acr_preparer() - async def test_delete_repository(self, containerregistry_endpoint, containerregistry_resource_group): - self.import_image(HELLO_WORLD, [TO_BE_DELETED]) - - reg_client = self.create_registry_client(containerregistry_endpoint) - existing_repos = [] - async for repo in reg_client.list_repositories(): - existing_repos.append(repo) - assert TO_BE_DELETED in existing_repos - - repo_client = self.create_repository_client(containerregistry_endpoint, TO_BE_DELETED) - result = await repo_client.delete() - assert isinstance(result, DeleteRepositoryResult) - assert result.deleted_manifests is not None - assert result.deleted_tags is not None - - existing_repos = [] - async for repo in reg_client.list_repositories(): - existing_repos.append(repo) - assert TO_BE_DELETED not in existing_repos - - @acr_preparer() - async def test_delete_repository_doesnt_exist(self, containerregistry_endpoint): - repo_client = self.create_repository_client(containerregistry_endpoint, DOES_NOT_EXIST) - with pytest.raises(ResourceNotFoundError): - await repo_client.delete() - - @acr_preparer() - async def test_delete_registry_artifact(self, containerregistry_endpoint, containerregistry_resource_group): - repository = self.get_resource_name("repo") - self.import_image(HELLO_WORLD, [repository]) - - repo_client = self.create_repository_client(containerregistry_endpoint, repository) - - count = 0 - async for artifact in repo_client.list_registry_artifacts(): - if count == 0: - await repo_client.delete_registry_artifact(artifact.digest) - count += 1 - assert count > 0 - - artifacts = [] - async for a in repo_client.list_registry_artifacts(): - artifacts.append(a) - - assert len(artifacts) > 0 - assert len(artifacts) == count - 1 - - @acr_preparer() - async def test_set_tag_properties(self, containerregistry_endpoint, containerregistry_resource_group): - repository = self.get_resource_name("repo") - tag_identifier = self.get_resource_name("tag") - self.import_image(HELLO_WORLD, ["{}:{}".format(repository, tag_identifier)]) - - client = self.create_repository_client(containerregistry_endpoint, repository) - - tag_props = await client.get_tag_properties(tag_identifier) - permissions = tag_props.writeable_properties - - received = await client.set_tag_properties( - tag_identifier, - ContentProperties( - can_delete=False, - can_list=False, - can_read=False, - can_write=False, - ), - ) - - assert not received.writeable_properties.can_write - assert not received.writeable_properties.can_read - assert not received.writeable_properties.can_list - assert not received.writeable_properties.can_delete - - # Reset them - await client.set_tag_properties( - tag_identifier, - ContentProperties( - can_delete=True, - can_list=True, - can_read=True, - can_write=True, - ), - ) - - @acr_preparer() - async def test_set_tag_properties_does_not_exist(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, self.get_resource_name("repo")) - - with pytest.raises(ResourceNotFoundError): - await client.set_tag_properties(DOES_NOT_EXIST, ContentProperties(can_delete=False)) - - @acr_preparer() - async def test_set_manifest_properties(self, containerregistry_endpoint, containerregistry_resource_group): - repository = self.get_resource_name("reposet") - tag_identifier = self.get_resource_name("tag") - self.import_image(HELLO_WORLD, ["{}:{}".format(repository, tag_identifier)]) - - client = self.create_repository_client(containerregistry_endpoint, repository) - - async for artifact in client.list_registry_artifacts(): - permissions = artifact.writeable_properties - - received_permissions = await client.set_manifest_properties( - artifact.digest, - ContentProperties( - can_delete=False, - can_list=False, - can_read=False, - can_write=False, - ), - ) - assert not received_permissions.writeable_properties.can_delete - assert not received_permissions.writeable_properties.can_read - assert not received_permissions.writeable_properties.can_list - assert not received_permissions.writeable_properties.can_write - - # Reset and delete - await client.set_manifest_properties( - artifact.digest, - ContentProperties( - can_delete=True, - can_list=True, - can_read=True, - can_write=True, - ), - ) - await client.delete() - - break - - @acr_preparer() - async def test_set_manifest_properties_does_not_exist(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, self.get_resource_name("repo")) - - with pytest.raises(ResourceNotFoundError): - await client.set_manifest_properties("sha256:abcdef", ContentProperties(can_delete=False)) - - @acr_preparer() - async def test_list_tags_descending(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, self.repository) - - prev_last_updated_on = None - count = 0 - async for tag in client.list_tags(order_by=TagOrderBy.LAST_UPDATE_TIME_DESCENDING): - if prev_last_updated_on: - assert tag.last_updated_on < prev_last_updated_on - prev_last_updated_on = tag.last_updated_on - count += 1 - - assert count > 0 - - @acr_preparer() - async def test_list_tags_ascending(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, self.repository) - - prev_last_updated_on = None - count = 0 - async for tag in client.list_tags(order_by=TagOrderBy.LAST_UPDATE_TIME_ASCENDING): - if prev_last_updated_on: - assert tag.last_updated_on > prev_last_updated_on - prev_last_updated_on = tag.last_updated_on - count += 1 - - assert count > 0 - - @acr_preparer() - async def test_list_registry_artifacts(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, self.repository) - - count = 0 - async for artifact in client.list_registry_artifacts(): - assert artifact is not None - assert isinstance(artifact, ArtifactManifestProperties) - assert artifact.created_on is not None - assert isinstance(artifact.created_on, datetime) - assert artifact.last_updated_on is not None - assert isinstance(artifact.last_updated_on, datetime) - count += 1 - - assert count > 0 - - @acr_preparer() - async def test_list_registry_artifacts_descending(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, self.repository) - - prev_last_updated_on = None - count = 0 - async for artifact in client.list_registry_artifacts( - order_by=ManifestOrderBy.LAST_UPDATE_TIME_DESCENDING - ): - if prev_last_updated_on: - assert artifact.last_updated_on < prev_last_updated_on - prev_last_updated_on = artifact.last_updated_on - count += 1 - - assert count > 0 - - @acr_preparer() - async def test_list_registry_artifacts_ascending(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, self.repository) - - prev_last_updated_on = None - count = 0 - async for artifact in client.list_registry_artifacts( - order_by=ManifestOrderBy.LAST_UPDATE_TIME_ASCENDING - ): - if prev_last_updated_on: - assert artifact.last_updated_on > prev_last_updated_on - prev_last_updated_on = artifact.last_updated_on - count += 1 - - assert count > 0 - - @acr_preparer() - async def test_get_tag(self, containerregistry_endpoint): - client = self.create_repository_client(containerregistry_endpoint, "library/busybox") - - tag = await client.get_tag_properties("latest") - - assert tag is not None - assert isinstance(tag, ArtifactTagProperties) - assert tag.repository == client.repository \ No newline at end of file diff --git a/sdk/containerregistry/azure-containerregistry/tests/test_registry_artifact.py b/sdk/containerregistry/azure-containerregistry/tests/test_registry_artifact.py new file mode 100644 index 000000000000..6e12835b30d8 --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/test_registry_artifact.py @@ -0,0 +1,184 @@ +# coding=utf-8 +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +import pytest + +from azure.containerregistry import ( + ContentProperties, + ArtifactManifestProperties, + ArtifactTagProperties, +) +from azure.core.exceptions import ResourceNotFoundError + +from testcase import ContainerRegistryTestClass +from constants import DOES_NOT_EXIST, HELLO_WORLD +from preparer import acr_preparer + + +class TestContainerRepository(ContainerRegistryTestClass): + def set_up(self, endpoint, name): + repo_client = self.create_container_repository(endpoint, name) + + for artifact in repo_client.list_manifests(): + return repo_client.get_artifact(artifact.digest) + + @acr_preparer() + def test_get_manifest_properties(self, containerregistry_endpoint): + repo = self.get_resource_name("repo") + tag = self.get_resource_name("tag") + self.import_image(HELLO_WORLD, ["{}:{}".format(repo, tag)]) + + reg_artifact = self.set_up(containerregistry_endpoint, repo) + + properties = reg_artifact.get_manifest_properties() + + assert isinstance(properties, ArtifactManifestProperties) + assert isinstance(properties.writeable_properties, ContentProperties) + assert properties.repository_name == repo + + @acr_preparer() + def test_get_manifest_properties_does_not_exist(self, containerregistry_endpoint): + repo_client = self.create_container_repository(containerregistry_endpoint, "hello-world") + + reg_artifact = repo_client.get_artifact("sha256:abcdefghijkl") + + with pytest.raises(ResourceNotFoundError): + reg_artifact.get_manifest_properties() + + @acr_preparer() + def test_set_manifest_properties(self, containerregistry_endpoint): + repo = self.get_resource_name("repo") + tag = self.get_resource_name("tag") + self.import_image(HELLO_WORLD, ["{}:{}".format(repo, tag)]) + + reg_artifact = self.set_up(containerregistry_endpoint, name=repo) + + properties = reg_artifact.get_manifest_properties() + c = ContentProperties(can_delete=False, can_read=False, can_write=False, can_list=False) + + received = reg_artifact.set_manifest_properties(c) + + assert received.writeable_properties.can_delete == c.can_delete + assert received.writeable_properties.can_read == c.can_read + assert received.writeable_properties.can_write == c.can_write + assert received.writeable_properties.can_list == c.can_list + + c = ContentProperties(can_delete=True, can_read=True, can_write=True, can_list=True) + received = reg_artifact.set_manifest_properties(c) + + assert received.writeable_properties.can_delete == c.can_delete + assert received.writeable_properties.can_read == c.can_read + assert received.writeable_properties.can_write == c.can_write + assert received.writeable_properties.can_list == c.can_list + + @acr_preparer() + def test_get_tag_properties(self, containerregistry_endpoint): + repo = self.get_resource_name("repo") + tag = self.get_resource_name("tag") + self.import_image(HELLO_WORLD, ["{}:{}".format(repo, tag)]) + + reg_artifact = self.set_up(containerregistry_endpoint, name=repo) + + properties = reg_artifact.get_tag_properties(tag) + + assert isinstance(properties, ArtifactTagProperties) + assert properties.name == tag + + @acr_preparer() + def test_get_tag_properties_does_not_exist(self, containerregistry_endpoint): + repo_client = self.create_container_repository(containerregistry_endpoint, "hello-world") + + reg_artifact = repo_client.get_artifact("sha256:abcdefghijkl") + + with pytest.raises(ResourceNotFoundError): + reg_artifact.get_tag_properties("doesnotexist") + + @acr_preparer() + def test_set_tag_properties(self, containerregistry_endpoint): + repo = self.get_resource_name("repo") + tag = self.get_resource_name("tag") + self.import_image(HELLO_WORLD, ["{}:{}".format(repo, tag)]) + + reg_artifact = self.set_up(containerregistry_endpoint, name=repo) + + properties = reg_artifact.get_tag_properties(tag) + c = ContentProperties(can_delete=False, can_read=False, can_write=False, can_list=False) + + received = reg_artifact.set_tag_properties(tag, c) + + assert received.writeable_properties.can_delete == c.can_delete + assert received.writeable_properties.can_read == c.can_read + assert received.writeable_properties.can_write == c.can_write + assert received.writeable_properties.can_list == c.can_list + + c = ContentProperties(can_delete=True, can_read=True, can_write=True, can_list=True) + received = reg_artifact.set_tag_properties(tag, c) + + assert received.writeable_properties.can_delete == c.can_delete + assert received.writeable_properties.can_read == c.can_read + assert received.writeable_properties.can_write == c.can_write + assert received.writeable_properties.can_list == c.can_list + + @acr_preparer() + def test_list_tags(self, containerregistry_endpoint): + repo = self.get_resource_name("repo") + tag = self.get_resource_name("tag") + tags = ["{}:{}".format(repo, tag + str(i)) for i in range(4)] + self.import_image(HELLO_WORLD, tags) + reg_artifact = self.set_up(containerregistry_endpoint, name=repo) + + count = 0 + for tag in reg_artifact.list_tags(): + assert "{}:{}".format(repo, tag.name) in tags + count += 1 + assert count == 4 + + @acr_preparer() + def test_delete_tag(self, containerregistry_endpoint): + repo = self.get_resource_name("repo") + tag = self.get_resource_name("tag") + tags = ["{}:{}".format(repo, tag + str(i)) for i in range(4)] + self.import_image(HELLO_WORLD, tags) + container_repo = self.create_container_repository(containerregistry_endpoint, repo) + reg_artifact = container_repo.get_artifact(tag + str(0)) + + reg_artifact.delete_tag(tag + str(0)) + + count = 0 + for tag in reg_artifact.list_tags(): + assert "{}:{}".format(repo, tag.name) in tags[1:] + count += 1 + assert count == 3 + + @acr_preparer() + def test_delete_tag_does_not_exist(self, containerregistry_endpoint): + repo = self.get_resource_name("repo") + container_repo = self.create_container_repository(containerregistry_endpoint, repo) + reg_artifact = container_repo.get_artifact(DOES_NOT_EXIST) + + with pytest.raises(ResourceNotFoundError): + reg_artifact.delete_tag(DOES_NOT_EXIST) + + @acr_preparer() + def test_delete_registry_artifact(self, containerregistry_endpoint): + repo = self.get_resource_name("repo") + tag = self.get_resource_name("tag") + self.import_image(HELLO_WORLD, ["{}:{}".format(repo, tag)]) + reg_artifact = self.set_up(containerregistry_endpoint, name=repo) + + reg_artifact.delete() + self.sleep(10) + + with pytest.raises(ResourceNotFoundError): + reg_artifact.get_manifest_properties() + + @acr_preparer() + def test_delete_registry_artifact_does_not_exist(self, containerregistry_endpoint): + repo = self.get_resource_name("repo") + container_repo = self.create_container_repository(containerregistry_endpoint, repo) + reg_artifact = container_repo.get_artifact(DOES_NOT_EXIST) + + with pytest.raises(ResourceNotFoundError): + reg_artifact.delete() diff --git a/sdk/containerregistry/azure-containerregistry/tests/test_registry_artifact_async.py b/sdk/containerregistry/azure-containerregistry/tests/test_registry_artifact_async.py new file mode 100644 index 000000000000..14d1c49dd71a --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/test_registry_artifact_async.py @@ -0,0 +1,184 @@ +# coding=utf-8 +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +import pytest + +from azure.containerregistry import ( + ContentProperties, + ArtifactManifestProperties, + ArtifactTagProperties, +) +from azure.core.exceptions import ResourceNotFoundError + +from asynctestcase import AsyncContainerRegistryTestClass +from constants import DOES_NOT_EXIST, HELLO_WORLD +from preparer import acr_preparer + + +class TestContainerRepository(AsyncContainerRegistryTestClass): + async def set_up(self, endpoint, name): + repo_client = self.create_container_repository(endpoint, name) + + async for artifact in repo_client.list_manifests(): + return repo_client.get_artifact(artifact.digest) + + @acr_preparer() + async def test_get_manifest_properties(self, containerregistry_endpoint): + repo = self.get_resource_name("repo") + tag = self.get_resource_name("tag") + self.import_image(HELLO_WORLD, ["{}:{}".format(repo, tag)]) + + reg_artifact = await self.set_up(containerregistry_endpoint, name=repo) + + properties = await reg_artifact.get_manifest_properties() + + assert isinstance(properties, ArtifactManifestProperties) + assert isinstance(properties.writeable_properties, ContentProperties) + assert properties.repository_name == repo + + @acr_preparer() + async def test_get_manifest_properties_does_not_exist(self, containerregistry_endpoint): + repo_client = self.create_container_repository(containerregistry_endpoint, "hello-world") + + reg_artifact = repo_client.get_artifact("sha256:abcdefghijkl") + + with pytest.raises(ResourceNotFoundError): + await reg_artifact.get_manifest_properties() + + @acr_preparer() + async def test_set_manifest_properties(self, containerregistry_endpoint): + repo = self.get_resource_name("repo") + tag = self.get_resource_name("tag") + self.import_image(HELLO_WORLD, ["{}:{}".format(repo, tag)]) + + reg_artifact = await self.set_up(containerregistry_endpoint, name=repo) + + properties = await reg_artifact.get_manifest_properties() + c = ContentProperties(can_delete=False, can_read=False, can_write=False, can_list=False) + + received = await reg_artifact.set_manifest_properties(c) + + assert received.writeable_properties.can_delete == c.can_delete + assert received.writeable_properties.can_read == c.can_read + assert received.writeable_properties.can_write == c.can_write + assert received.writeable_properties.can_list == c.can_list + + c = ContentProperties(can_delete=True, can_read=True, can_write=True, can_list=True) + received = await reg_artifact.set_manifest_properties(c) + + assert received.writeable_properties.can_delete == c.can_delete + assert received.writeable_properties.can_read == c.can_read + assert received.writeable_properties.can_write == c.can_write + assert received.writeable_properties.can_list == c.can_list + + @acr_preparer() + async def test_get_tag_properties(self, containerregistry_endpoint): + repo = self.get_resource_name("repo") + tag = self.get_resource_name("tag") + self.import_image(HELLO_WORLD, ["{}:{}".format(repo, tag)]) + + reg_artifact = await self.set_up(containerregistry_endpoint, name=repo) + + properties = await reg_artifact.get_tag_properties(tag) + + assert isinstance(properties, ArtifactTagProperties) + assert properties.name == tag + + @acr_preparer() + async def test_get_tag_properties_does_not_exist(self, containerregistry_endpoint): + repo_client = self.create_container_repository(containerregistry_endpoint, "hello-world") + + reg_artifact = repo_client.get_artifact("sha256:abcdefghijkl") + + with pytest.raises(ResourceNotFoundError): + await reg_artifact.get_tag_properties("doesnotexist") + + @acr_preparer() + async def test_set_tag_properties(self, containerregistry_endpoint): + repo = self.get_resource_name("repo") + tag = self.get_resource_name("tag") + self.import_image(HELLO_WORLD, ["{}:{}".format(repo, tag)]) + + reg_artifact = await self.set_up(containerregistry_endpoint, name=repo) + + properties = await reg_artifact.get_tag_properties(tag) + c = ContentProperties(can_delete=False, can_read=False, can_write=False, can_list=False) + + received = await reg_artifact.set_tag_properties(tag, c) + + assert received.writeable_properties.can_delete == c.can_delete + assert received.writeable_properties.can_read == c.can_read + assert received.writeable_properties.can_write == c.can_write + assert received.writeable_properties.can_list == c.can_list + + c = ContentProperties(can_delete=True, can_read=True, can_write=True, can_list=True) + received = await reg_artifact.set_tag_properties(tag, c) + + assert received.writeable_properties.can_delete == c.can_delete + assert received.writeable_properties.can_read == c.can_read + assert received.writeable_properties.can_write == c.can_write + assert received.writeable_properties.can_list == c.can_list + + @acr_preparer() + async def test_list_tags(self, containerregistry_endpoint): + repo = self.get_resource_name("repo") + tag = self.get_resource_name("tag") + tags = ["{}:{}".format(repo, tag + str(i)) for i in range(4)] + self.import_image(HELLO_WORLD, tags) + reg_artifact = await self.set_up(containerregistry_endpoint, name=repo) + + count = 0 + async for tag in reg_artifact.list_tags(): + assert "{}:{}".format(repo, tag.name) in tags + count += 1 + assert count == 4 + + @acr_preparer() + async def test_delete_tag(self, containerregistry_endpoint): + repo = self.get_resource_name("repo") + tag = self.get_resource_name("tag") + tags = ["{}:{}".format(repo, tag + str(i)) for i in range(4)] + self.import_image(HELLO_WORLD, tags) + container_repo = self.create_container_repository(containerregistry_endpoint, repo) + reg_artifact = container_repo.get_artifact(tag + str(0)) + + await reg_artifact.delete_tag(tag + str(0)) + + count = 0 + async for tag in reg_artifact.list_tags(): + assert "{}:{}".format(repo, tag.name) in tags[1:] + count += 1 + assert count == 3 + + @acr_preparer() + async def test_delete_tag_does_not_exist(self, containerregistry_endpoint): + repo = self.get_resource_name("repo") + container_repo = self.create_container_repository(containerregistry_endpoint, repo) + reg_artifact = container_repo.get_artifact(DOES_NOT_EXIST) + + with pytest.raises(ResourceNotFoundError): + await reg_artifact.delete_tag(DOES_NOT_EXIST) + + @acr_preparer() + async def test_delete_registry_artifact(self, containerregistry_endpoint): + repo = self.get_resource_name("repo") + tag = self.get_resource_name("tag") + self.import_image(HELLO_WORLD, ["{}:{}".format(repo, tag)]) + reg_artifact = await self.set_up(containerregistry_endpoint, name=repo) + + await reg_artifact.delete() + self.sleep(10) + + with pytest.raises(ResourceNotFoundError): + await reg_artifact.get_manifest_properties() + + @acr_preparer() + async def test_delete_registry_artifact_does_not_exist(self, containerregistry_endpoint): + repo = self.get_resource_name("repo") + container_repo = self.create_container_repository(containerregistry_endpoint, repo) + reg_artifact = container_repo.get_artifact(DOES_NOT_EXIST) + + with pytest.raises(ResourceNotFoundError): + await reg_artifact.delete() diff --git a/sdk/containerregistry/azure-containerregistry/tests/testcase.py b/sdk/containerregistry/azure-containerregistry/tests/testcase.py index c5afbd4b7aa6..7c6d685e1f15 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/testcase.py +++ b/sdk/containerregistry/azure-containerregistry/tests/testcase.py @@ -6,14 +6,16 @@ import copy from datetime import datetime import json +import logging import os +from azure_devtools.scenario_tests.recording_processors import SubscriptionRecordingProcessor import pytest import re import six import time from azure.containerregistry import ( - ContainerRepositoryClient, + ContainerRepository, ContainerRegistryClient, ArtifactTagProperties, ContentProperties, @@ -189,7 +191,6 @@ def sleep(self, t): time.sleep(t) def import_image(self, repository, tags): - # type: (str, List[str]) -> None # repository must be a docker hub repository # tags is a List of repository/tag combos in the format : if not self.is_live: @@ -202,9 +203,9 @@ def _clean_up(self, endpoint): return reg_client = self.create_registry_client(endpoint) - for repo in reg_client.list_repositories(): + for repo in reg_client.list_repository_names(): if repo.startswith("repo"): - repo_client = self.create_repository_client(endpoint, repo) + repo_client = self.create_container_repository(endpoint, repo) for tag in repo_client.list_tags(): try: @@ -214,7 +215,7 @@ def _clean_up(self, endpoint): except: pass - for manifest in repo_client.list_registry_artifacts(): + for manifest in repo_client.list_manifests(): try: p = manifest.writeable_properties p.can_delete = True @@ -222,7 +223,7 @@ def _clean_up(self, endpoint): except: pass - for repo in reg_client.list_repositories(): + for repo in reg_client.list_repository_names(): try: reg_client.delete_repository(repo) except: @@ -236,8 +237,8 @@ def get_credential(self): def create_registry_client(self, endpoint, **kwargs): return ContainerRegistryClient(endpoint=endpoint, credential=self.get_credential(), **kwargs) - def create_repository_client(self, endpoint, name, **kwargs): - return ContainerRepositoryClient(endpoint=endpoint, repository=name, credential=self.get_credential(), **kwargs) + def create_container_repository(self, endpoint, name, **kwargs): + return ContainerRepository(endpoint=endpoint, name=name, credential=self.get_credential(), **kwargs) def assert_content_permission(self, content_perm, content_perm2): assert isinstance(content_perm, ContentProperties) @@ -275,10 +276,6 @@ def assert_tag( if repository: assert tag.repository == repository - def assert_registry_artifact(self, tag_or_digest, expected_tag_or_digest): - assert isinstance(tag_or_digest, ArtifactManifestProperties) - assert tag_or_digest == expected_tag_or_digest - # Moving this out of testcase so the fixture and individual tests can use it def import_image(repository, tags):