diff --git a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_base_client.py b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_base_client.py index d5266390424e..8be1306879b5 100644 --- a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_base_client.py +++ b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_base_client.py @@ -31,7 +31,7 @@ class ContainerRegistryBaseClient(object): """ - def __init__(self, endpoint, credential, **kwargs): # pylint:disable=client-method-missing-type-annotations + def __init__(self, endpoint, credential, **kwargs): # type: (str, TokenCredential, Dict[str, Any]) -> None auth_policy = ContainerRegistryChallengePolicy(credential, endpoint) self._client = ContainerRegistry( diff --git a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_container_repository_client.py b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_container_repository_client.py index 38f889f55b04..1c43ac22bcd6 100644 --- a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_container_repository_client.py +++ b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_container_repository_client.py @@ -63,14 +63,14 @@ def delete_registry_artifact(self, digest, **kwargs): def delete_tag(self, tag, **kwargs): # type: (str) -> None - """Delete a tag + """Delete a tag from a repository :param tag: The digest of the artifact to be deleted :type tag: str :returns: None :raises: :class:~azure.core.exceptions.ResourceNotFoundError """ - raise NotImplementedError("Has not been implemented") + self._client.container_registry_repository.delete_tag(self.repository, tag, **kwargs) def get_properties(self, **kwargs): # type: (...) -> RepositoryProperties @@ -93,7 +93,6 @@ def get_registry_artifact_properties(self, tag_or_digest, **kwargs): :returns: :class:~azure.containerregistry.RegistryArtifactProperties :raises: :class:~azure.core.exceptions.ResourceNotFoundError """ - # GET '/acr/v1/{name}/_manifests/{digest}' if _is_tag(tag_or_digest): tag_or_digest = self._get_digest_from_tag(tag_or_digest) @@ -112,7 +111,6 @@ def get_tag_properties(self, tag, **kwargs): :returns: :class:~azure.containerregistry.TagProperties :raises: :class:~azure.core.exceptions.ResourceNotFoundError """ - # GET '/acr/v1/{name}/_tags/{reference}' return TagProperties._from_generated( # pylint: disable=protected-access self._client.container_registry_repository.get_tag_properties(self.repository, tag, **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_container_repository_client.py index 9ab28d7855b4..a819be96dcfb 100644 --- a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_container_repository_client.py +++ b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_container_repository_client.py @@ -3,7 +3,7 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Dict, Any from azure.core.async_paging import AsyncItemPaged @@ -44,8 +44,7 @@ async def _get_digest_from_tag(self, tag: str) -> None: tag_props = await self.get_tag_properties(tag) return tag_props.digest - async def delete(self, **kwargs) -> None: - # type: (...) -> None + async def delete(self, **kwargs: Dict[str, Any]) -> None: """Delete a repository :returns: None @@ -53,7 +52,7 @@ async def delete(self, **kwargs) -> None: """ await self._client.container_registry.delete_repository(self.repository, **kwargs) - def delete_registry_artifact(self, digest: str, **kwargs) -> None: + async def delete_registry_artifact(self, digest: str, **kwargs) -> None: """Delete a registry artifact :param digest: The digest of the artifact to be deleted @@ -63,15 +62,15 @@ def delete_registry_artifact(self, digest: str, **kwargs) -> None: """ raise NotImplementedError("Has not been implemented") - def delete_tag(self, tag: str, **kwargs) -> None: - """Delete a tag + async def delete_tag(self, tag: str, **kwargs) -> None: + """Delete a tag from a repository :param tag: The digest of the artifact to be deleted :type tag: str :returns: None :raises: :class:~azure.core.exceptions.ResourceNotFoundError """ - raise NotImplementedError("Has not been implemented") + await self._client.container_registry_repository.delete_tag(self.repository, tag, **kwargs) async def get_properties(self, **kwargs) -> RepositoryProperties: """Get the properties of a repository diff --git a/sdk/containerregistry/azure-containerregistry/tests/preparer.py b/sdk/containerregistry/azure-containerregistry/tests/preparer.py new file mode 100644 index 000000000000..fce8db64712e --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/preparer.py @@ -0,0 +1,15 @@ +# coding=utf-8 +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +import functools + +from devtools_testutils import AzureTestCase, PowerShellPreparer + +acr_preparer = functools.partial( + PowerShellPreparer, + "containerregistry", + containerregistry_baseurl="fake_url.azurecr.io", + containerregistry_resource_group="fake_rg", +) diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_async.test_delete_repository_does_not_exist.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_async.test_delete_repository_does_not_exist.yaml index 1000bd0da95a..2b678528592b 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_async.test_delete_repository_does_not_exist.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_async.test_delete_repository_does_not_exist.yaml @@ -19,7 +19,7 @@ interactions: connection: keep-alive content-length: '209' content-type: application/json; charset=utf-8 - date: Tue, 30 Mar 2021 12:19:01 GMT + date: Thu, 01 Apr 2021 17:31:42 GMT docker-distribution-api-version: registry/2.0 server: openresty strict-transport-security: max-age=31536000; includeSubDomains @@ -47,10 +47,11 @@ interactions: headers: connection: keep-alive content-type: application/json; charset=utf-8 - date: Tue, 30 Mar 2021 12:19:02 GMT + date: Thu, 01 Apr 2021 17:31:43 GMT server: openresty strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '333.316667' status: code: 200 message: OK @@ -74,10 +75,11 @@ interactions: headers: connection: keep-alive content-type: application/json; charset=utf-8 - date: Tue, 30 Mar 2021 12:19:03 GMT + date: Thu, 01 Apr 2021 17:31:43 GMT server: openresty strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '333.3' status: code: 200 message: OK @@ -102,11 +104,12 @@ interactions: connection: keep-alive content-length: '121' content-type: application/json; charset=utf-8 - date: Tue, 30 Mar 2021 12:19:03 GMT + date: Thu, 01 Apr 2021 17:31:43 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: '32.000000' status: code: 404 message: Not Found diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_async.test_list_repositories.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_async.test_list_repositories.yaml index c18641f18e36..fb0dc7a1d452 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_async.test_list_repositories.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_async.test_list_repositories.yaml @@ -19,7 +19,7 @@ interactions: connection: keep-alive content-length: '196' content-type: application/json; charset=utf-8 - date: Tue, 30 Mar 2021 12:19:03 GMT + date: Thu, 01 Apr 2021 17:31:43 GMT docker-distribution-api-version: registry/2.0 server: openresty strict-transport-security: max-age=31536000; includeSubDomains @@ -47,10 +47,11 @@ interactions: headers: connection: keep-alive content-type: application/json; charset=utf-8 - date: Tue, 30 Mar 2021 12:19:04 GMT + date: Thu, 01 Apr 2021 17:31:44 GMT server: openresty strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '333.316667' status: code: 200 message: OK @@ -74,10 +75,11 @@ interactions: headers: connection: keep-alive content-type: application/json; charset=utf-8 - date: Tue, 30 Mar 2021 12:19:04 GMT + date: Thu, 01 Apr 2021 17:31:45 GMT server: openresty strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '333.3' status: code: 200 message: OK @@ -93,15 +95,15 @@ interactions: uri: https://fake_url.azurecr.io/acr/v1/_catalog response: body: - string: '{"repositories":["alpine/git","debian","hello-world","library/hello-world","ubuntu"]} + string: '{"repositories":["alpine/git","debian","hello-world","library/hello-world","repo160e197b","repo308e19dd","repo9b321760","repob7cc1bf8","ubuntu"]} ' headers: access-control-expose-headers: X-Ms-Correlation-Request-Id connection: keep-alive - content-length: '86' + content-length: '146' content-type: application/json; charset=utf-8 - date: Tue, 30 Mar 2021 12:19:04 GMT + date: Thu, 01 Apr 2021 17:31: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.test_delete_repository.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client.test_delete_repository.yaml new file mode 100644 index 000000000000..06584cf9c502 --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client.test_delete_repository.yaml @@ -0,0 +1,340 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/repo530d1618 + response: + body: + string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, + visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"repo530d1618","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: + - Fri, 02 Apr 2021 12:59:49 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=seankane.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/0.0.1 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: + - Fri, 02 Apr 2021 12:59:50 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.183333' + status: + code: 200 + message: OK +- request: + body: grant_type=refresh_token&service=seankane.azurecr.io&scope=repository%3Arepo530d1618%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/0.0.1 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: + - Fri, 02 Apr 2021 12:59:51 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.166667' + 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/0.0.1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/repo530d1618 + response: + body: + string: '{"manifestsDeleted":["sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792","sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24","sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1","sha256:88b2e00179bd6c4064612403c8d42a13de7ca809d61fee966ce9e129860a8a90","sha256:963612c5503f3f1674f315c67089dee577d8cc6afc18565e0b4183ae355fb343","sha256:b0408a0f1d74eced127a2658429f336ed8fa48e36d59878f155b19865e5dbd70","sha256:bb7ab0fa94fdd78aca84b27a1bd46c4b811051f9b69905d81f5f267fc6546a9d","sha256:cb55d8f7347376e1ba38ca740904b43c9a52f66c7d2ae1ef1a0de1bc9f40df98","sha256:e49abad529e5d9bd6787f3abeab94e09ba274fe34731349556a850b9aebbf7bf","sha256:e5785cb0c62cebbed4965129bae371f0589cadd6d84798fb58c2c5f9e237efd9"],"tagsDeleted":["latest"]} + + ' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '788' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 02 Apr 2021 12:59:52 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: + - '32.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/0.0.1 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: + - 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: + - Fri, 02 Apr 2021 12:59:57 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=seankane.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/0.0.1 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: + - Fri, 02 Apr 2021 12:59:58 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.133333' + status: + code: 200 + message: OK +- request: + body: grant_type=refresh_token&service=seankane.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/0.0.1 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: + - Fri, 02 Apr 2021 12:59:58 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.116667' + 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/0.0.1 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":["alpine/git","debian","hello-world","library/hello-world","repo160e197b","repo308e19dd","repo9b321760","repob7cc1bf8","ubuntu"]} + + ' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '146' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 02 Apr 2021 12:59:58 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.test_delete_repository_does_not_exist.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client.test_delete_repository_does_not_exist.yaml new file mode 100644 index 000000000000..3fd1f7f57777 --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client.test_delete_repository_does_not_exist.yaml @@ -0,0 +1,175 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/not_real_repo + response: + body: + string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, + visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"not_real_repo","Action":"delete"}]}]} + + ' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '209' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 02 Apr 2021 12:59:59 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=seankane.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/0.0.1 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: + - Fri, 02 Apr 2021 13:00:00 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.133333' + status: + code: 200 + message: OK +- request: + body: grant_type=refresh_token&service=seankane.azurecr.io&scope=repository%3Anot_real_repo%3Adelete&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1074' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 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: + - Fri, 02 Apr 2021 13:00:00 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.116667' + 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/0.0.1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/not_real_repo + response: + body: + string: '{"errors":[{"code":"NAME_UNKNOWN","message":"repository name not known + to registry","detail":{"name":"not_real_repo"}}]} + + ' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '121' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 02 Apr 2021 13:00:00 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: + - '32.000000' + status: + code: 404 + message: Not Found +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client.test_list_repositories.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client.test_list_repositories.yaml index 263490833ac6..9ce9d68c08bf 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client.test_list_repositories.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client.test_list_repositories.yaml @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:05 GMT + - Thu, 01 Apr 2021 17:31:45 GMT docker-distribution-api-version: - registry/2.0 server: @@ -71,13 +71,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:06 GMT + - Thu, 01 Apr 2021 17:31:47 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.316667' status: code: 200 message: OK @@ -107,13 +109,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:07 GMT + - Thu, 01 Apr 2021 17:31:47 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.3' status: code: 200 message: OK @@ -132,7 +136,7 @@ interactions: uri: https://fake_url.azurecr.io/acr/v1/_catalog response: body: - string: '{"repositories":["alpine/git","debian","hello-world","library/hello-world","ubuntu"]} + string: '{"repositories":["alpine/git","debian","hello-world","library/hello-world","repo160e197b","repo308e19dd","repo9b321760","repob7cc1bf8","ubuntu"]} ' headers: @@ -144,11 +148,11 @@ interactions: connection: - keep-alive content-length: - - '86' + - '146' content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:07 GMT + - Thu, 01 Apr 2021 17:31:47 GMT docker-distribution-api-version: - registry/2.0 server: diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client_async.test_delete_repository.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client_async.test_delete_repository.yaml new file mode 100644 index 000000000000..6fc629dc62c2 --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client_async.test_delete_repository.yaml @@ -0,0 +1,229 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/repoe0731895 + response: + body: + string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, + visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"repoe0731895","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: Fri, 02 Apr 2021 12:58:04 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://seankane.azurecr.io/acr/v1/repoe0731895 +- request: + body: + access_token: REDACTED + grant_type: access_token + service: seankane.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 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: Fri, 02 Apr 2021 12:58:05 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '333.25' + status: + code: 200 + message: OK + url: https://seankane.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:repoe0731895:delete + service: seankane.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 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: Fri, 02 Apr 2021 12:58:05 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '333.2' + status: + code: 200 + message: OK + url: https://seankane.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/repoe0731895 + response: + body: + string: '{"manifestsDeleted":["sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792","sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24","sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1","sha256:88b2e00179bd6c4064612403c8d42a13de7ca809d61fee966ce9e129860a8a90","sha256:963612c5503f3f1674f315c67089dee577d8cc6afc18565e0b4183ae355fb343","sha256:b0408a0f1d74eced127a2658429f336ed8fa48e36d59878f155b19865e5dbd70","sha256:bb7ab0fa94fdd78aca84b27a1bd46c4b811051f9b69905d81f5f267fc6546a9d","sha256:cb55d8f7347376e1ba38ca740904b43c9a52f66c7d2ae1ef1a0de1bc9f40df98","sha256:e49abad529e5d9bd6787f3abeab94e09ba274fe34731349556a850b9aebbf7bf","sha256:e5785cb0c62cebbed4965129bae371f0589cadd6d84798fb58c2c5f9e237efd9"],"tagsDeleted":["latest"]} + + ' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '788' + content-type: application/json; charset=utf-8 + date: Fri, 02 Apr 2021 12:58:07 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: '32.000000' + status: + code: 202 + message: Accepted + url: https://seankane.azurecr.io/acr/v1/repoe0731895 +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 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: Fri, 02 Apr 2021 12:58: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://seankane.azurecr.io/acr/v1/_catalog +- request: + body: + access_token: REDACTED + grant_type: access_token + service: seankane.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 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: Fri, 02 Apr 2021 12:58:12 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '333.183333' + status: + code: 200 + message: OK + url: https://seankane.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: registry:catalog:* + service: seankane.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 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: Fri, 02 Apr 2021 12:58:12 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '333.166667' + status: + code: 200 + message: OK + url: https://seankane.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 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":["alpine/git","debian","hello-world","library/hello-world","repo160e197b","repo308e19dd","repo9b321760","repob7cc1bf8","ubuntu"]} + + ' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '146' + content-type: application/json; charset=utf-8 + date: Fri, 02 Apr 2021 12:58:12 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://seankane.azurecr.io/acr/v1/_catalog +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 new file mode 100644 index 000000000000..a1c562bae943 --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client_async.test_delete_repository_does_not_exist.yaml @@ -0,0 +1,117 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/not_real_repo + response: + body: + string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, + visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"not_real_repo","Action":"delete"}]}]} + + ' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '209' + content-type: application/json; charset=utf-8 + date: Fri, 02 Apr 2021 12:58: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://seankane.azurecr.io/acr/v1/not_real_repo +- request: + body: + access_token: REDACTED + grant_type: access_token + service: seankane.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 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: Fri, 02 Apr 2021 12:58:14 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '333.066667' + status: + code: 200 + message: OK + url: https://seankane.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:not_real_repo:delete + service: seankane.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 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: Fri, 02 Apr 2021 12:58:14 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '333.05' + status: + code: 200 + message: OK + url: https://seankane.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/not_real_repo + response: + body: + string: '{"errors":[{"code":"NAME_UNKNOWN","message":"repository name not known + to registry","detail":{"name":"not_real_repo"}}]} + + ' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '121' + content-type: application/json; charset=utf-8 + date: Fri, 02 Apr 2021 12:58:14 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: '32.000000' + status: + code: 404 + message: Not Found + url: https://seankane.azurecr.io/acr/v1/not_real_repo +version: 1 diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client_async.test_list_repositories.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client_async.test_list_repositories.yaml new file mode 100644 index 000000000000..7ee77016f031 --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_registry_client_async.test_list_repositories.yaml @@ -0,0 +1,115 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 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: Thu, 01 Apr 2021 17:31:49 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://seankane.azurecr.io/acr/v1/_catalog +- request: + body: + access_token: REDACTED + grant_type: access_token + service: seankane.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 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: Thu, 01 Apr 2021 17:31:50 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '333.316667' + status: + code: 200 + message: OK + url: https://seankane.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: registry:catalog:* + service: seankane.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 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: Thu, 01 Apr 2021 17:31:50 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '333.3' + status: + code: 200 + message: OK + url: https://seankane.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 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":["alpine/git","debian","hello-world","library/hello-world","repo160e197b","repo308e19dd","repo9b321760","repob7cc1bf8","ubuntu"]} + + ' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '146' + content-type: application/json; charset=utf-8 + date: Thu, 01 Apr 2021 17:31: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://seankane.azurecr.io/acr/v1/_catalog +version: 1 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_container_repository_client.test_delete_tag.yaml new file mode 100644 index 000000000000..4b093fedfe87 --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_delete_tag.yaml @@ -0,0 +1,505 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/hello-world/_tags/to_be_deleted + response: + body: + string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, + visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"hello-world","Action":"metadata_read"}]}]} + + ' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '214' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Apr 2021 17:32: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=seankane.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/0.0.1 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: + - Thu, 01 Apr 2021 17:32:07 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.183333' + status: + code: 200 + message: OK +- request: + body: grant_type=refresh_token&service=seankane.azurecr.io&scope=repository%3Ahello-world%3Ametadata_read&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1079' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 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: + - Thu, 01 Apr 2021 17:32:08 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.166667' + 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/0.0.1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/hello-world/_tags/to_be_deleted + response: + body: + string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","tag":{"name":"to_be_deleted","digest":"sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24","createdTime":"2021-04-01T17:31:57.7170116Z","lastUpdateTime":"2021-04-01T17:31:57.7170116Z","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: + - '387' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Apr 2021 17:32:08 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 +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/hello-world/_tags/to_be_deleted + response: + body: + string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, + visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"hello-world","Action":"delete"}]}]} + + ' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '207' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Apr 2021 17:32: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=access_token&service=seankane.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/0.0.1 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: + - Thu, 01 Apr 2021 17:32:08 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.15' + status: + code: 200 + message: OK +- request: + body: grant_type=refresh_token&service=seankane.azurecr.io&scope=repository%3Ahello-world%3Adelete&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1072' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 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: + - Thu, 01 Apr 2021 17:32:08 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.133333' + 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/0.0.1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/hello-world/_tags/to_be_deleted + 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: + - Thu, 01 Apr 2021 17:32: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-int-docker-content-digest: + - sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24 + x-ms-ratelimit-remaining-calls-per-second: + - '32.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/0.0.1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/hello-world/_tags/to_be_deleted + response: + body: + string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, + visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"hello-world","Action":"metadata_read"}]}]} + + ' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '214' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Apr 2021 17:32: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=seankane.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/0.0.1 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: + - Thu, 01 Apr 2021 17:32:19 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.083333' + status: + code: 200 + message: OK +- request: + body: grant_type=refresh_token&service=seankane.azurecr.io&scope=repository%3Ahello-world%3Ametadata_read&refresh_token=REDACTED + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1079' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 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: + - Thu, 01 Apr 2021 17:32:19 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.066667' + 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/0.0.1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/hello-world/_tags/to_be_deleted + response: + body: + string: '{"errors":[{"code":"TAG_UNKNOWN","message":"the specified tag does + not exist"}]} + + ' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '81' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 01 Apr 2021 17:32:19 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_container_repository_client.test_get_attributes.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_get_attributes.yaml index 987e091130d2..aa393d1a31ac 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_get_attributes.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_get_attributes.yaml @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:07 GMT + - Thu, 01 Apr 2021 17:32:20 GMT docker-distribution-api-version: - registry/2.0 server: @@ -71,13 +71,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:09 GMT + - Thu, 01 Apr 2021 17:32:22 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.183333' status: code: 200 message: OK @@ -107,13 +109,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:09 GMT + - Thu, 01 Apr 2021 17:32:22 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '332.866667' status: code: 200 message: OK @@ -132,7 +136,7 @@ interactions: uri: https://fake_url.azurecr.io/acr/v1/hello-world response: body: - string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","createdTime":"2021-03-30T12:18:47.4147491Z","lastUpdateTime":"2021-03-30T12:18:47.1644459Z","manifestCount":10,"tagCount":1,"changeableAttributes":{"deleteEnabled":true,"writeEnabled":true,"readEnabled":true,"listEnabled":true}} + string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","createdTime":"2021-03-30T12:18:47.4147491Z","lastUpdateTime":"2021-04-01T17:32:09.0713887Z","manifestCount":10,"tagCount":1,"changeableAttributes":{"deleteEnabled":true,"writeEnabled":true,"readEnabled":true,"listEnabled":true}} ' headers: @@ -148,7 +152,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:09 GMT + - Thu, 01 Apr 2021 17:32:22 GMT docker-distribution-api-version: - registry/2.0 server: 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_client.test_get_properties.yaml index 241933d524a8..cc59767ab598 100644 --- 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_client.test_get_properties.yaml @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:10 GMT + - Thu, 01 Apr 2021 17:32:22 GMT docker-distribution-api-version: - registry/2.0 server: @@ -71,13 +71,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:11 GMT + - Thu, 01 Apr 2021 17:32:24 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.05' status: code: 200 message: OK @@ -107,13 +109,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:11 GMT + - Thu, 01 Apr 2021 17:32:24 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.033333' status: code: 200 message: OK @@ -132,7 +136,7 @@ interactions: uri: https://fake_url.azurecr.io/acr/v1/hello-world response: body: - string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","createdTime":"2021-03-30T12:18:47.4147491Z","lastUpdateTime":"2021-03-30T12:18:47.1644459Z","manifestCount":10,"tagCount":1,"changeableAttributes":{"deleteEnabled":true,"writeEnabled":true,"readEnabled":true,"listEnabled":true}} + string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","createdTime":"2021-03-30T12:18:47.4147491Z","lastUpdateTime":"2021-04-01T17:32:09.0713887Z","manifestCount":10,"tagCount":1,"changeableAttributes":{"deleteEnabled":true,"writeEnabled":true,"readEnabled":true,"listEnabled":true}} ' headers: @@ -148,7 +152,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:12 GMT + - Thu, 01 Apr 2021 17:32:24 GMT docker-distribution-api-version: - registry/2.0 server: 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_container_repository_client.test_get_registry_artifact_properties.yaml index 843453b71800..827fa274a7c8 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_container_repository_client.test_get_registry_artifact_properties.yaml @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:12 GMT + - Thu, 01 Apr 2021 17:32:25 GMT docker-distribution-api-version: - registry/2.0 server: @@ -71,13 +71,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:14 GMT + - Thu, 01 Apr 2021 17:32:26 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '332.85' status: code: 200 message: OK @@ -107,13 +109,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:15 GMT + - Thu, 01 Apr 2021 17:32:26 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '332.833333' status: code: 200 message: OK @@ -132,7 +136,7 @@ interactions: uri: https://fake_url.azurecr.io/acr/v1/hello-world/_tags/latest response: body: - string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","tag":{"name":"latest","digest":"sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24","createdTime":"2021-03-30T12:18:52.8272444Z","lastUpdateTime":"2021-03-30T12:18:52.8272444Z","signed":false,"changeableAttributes":{"deleteEnabled":true,"writeEnabled":true,"readEnabled":true,"listEnabled":true}}} + string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","tag":{"name":"latest","digest":"sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24","createdTime":"2021-03-30T12:18:52.8272444Z","lastUpdateTime":"2021-03-30T12:18:52.8272444Z","signed":false,"quarantineState":"Passed","changeableAttributes":{"deleteEnabled":true,"writeEnabled":true,"readEnabled":true,"listEnabled":true}}} ' headers: @@ -144,11 +148,11 @@ interactions: connection: - keep-alive content-length: - - '380' + - '407' content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:15 GMT + - Thu, 01 Apr 2021 17:32:26 GMT docker-distribution-api-version: - registry/2.0 server: @@ -193,7 +197,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:15 GMT + - Thu, 01 Apr 2021 17:32:27 GMT docker-distribution-api-version: - registry/2.0 server: @@ -233,13 +237,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:16 GMT + - Thu, 01 Apr 2021 17:32:27 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '332.816667' status: code: 200 message: OK @@ -269,13 +275,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:16 GMT + - Thu, 01 Apr 2021 17:32:27 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '332.8' status: code: 200 message: OK @@ -294,7 +302,9 @@ interactions: uri: https://fake_url.azurecr.io/acr/v1/hello-world/_manifests/sha256%3A308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24 response: body: - string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","manifest":{"digest":"sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24","imageSize":0,"createdTime":"2021-03-30T12:18:47.4863064Z","lastUpdateTime":"2021-03-30T12:18:47.4863064Z","mediaType":"application/vnd.docker.distribution.manifest.list.v2+json","tags":["latest"],"changeableAttributes":{"deleteEnabled":true,"writeEnabled":true,"readEnabled":true,"listEnabled":true},"references":[{"digest":"sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792","architecture":"amd64","os":"linux"},{"digest":"sha256:e5785cb0c62cebbed4965129bae371f0589cadd6d84798fb58c2c5f9e237efd9","architecture":"arm","os":"linux"},{"digest":"sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1","architecture":"arm","os":"linux"},{"digest":"sha256:963612c5503f3f1674f315c67089dee577d8cc6afc18565e0b4183ae355fb343","architecture":"arm64","os":"linux"},{"digest":"sha256:cb55d8f7347376e1ba38ca740904b43c9a52f66c7d2ae1ef1a0de1bc9f40df98","architecture":"386","os":"linux"},{"digest":"sha256:88b2e00179bd6c4064612403c8d42a13de7ca809d61fee966ce9e129860a8a90","architecture":"mips64le","os":"linux"},{"digest":"sha256:bb7ab0fa94fdd78aca84b27a1bd46c4b811051f9b69905d81f5f267fc6546a9d","architecture":"ppc64le","os":"linux"},{"digest":"sha256:e49abad529e5d9bd6787f3abeab94e09ba274fe34731349556a850b9aebbf7bf","architecture":"s390x","os":"linux"},{"digest":"sha256:b0408a0f1d74eced127a2658429f336ed8fa48e36d59878f155b19865e5dbd70","architecture":"amd64","os":"windows"}]}} + string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","manifest":{"digest":"sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24","imageSize":0,"createdTime":"2021-03-30T12:18:47.4863064Z","lastUpdateTime":"2021-03-30T12:18:47.4863064Z","mediaType":"application/vnd.docker.distribution.manifest.list.v2+json","tags":["latest"],"changeableAttributes":{"deleteEnabled":true,"writeEnabled":false,"readEnabled":true,"listEnabled":true,"quarantineDetails":"{\"state\":\"Scan + Failed\",\"link\":\"https://aka.ms/test\",\"scanner\":\"Azure Security Monitoring-Qualys + Scanner\",\"result\":{\"version\":\"3/31/2021 1:55:48 PM\",\"summary\":[{\"severity\":\"High\",\"count\":0},{\"severity\":\"Medium\",\"count\":0},{\"severity\":\"Low\",\"count\":0}]}}","quarantineState":"Passed"},"references":[{"digest":"sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792","architecture":"amd64","os":"linux"},{"digest":"sha256:e5785cb0c62cebbed4965129bae371f0589cadd6d84798fb58c2c5f9e237efd9","architecture":"arm","os":"linux"},{"digest":"sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1","architecture":"arm","os":"linux"},{"digest":"sha256:963612c5503f3f1674f315c67089dee577d8cc6afc18565e0b4183ae355fb343","architecture":"arm64","os":"linux"},{"digest":"sha256:cb55d8f7347376e1ba38ca740904b43c9a52f66c7d2ae1ef1a0de1bc9f40df98","architecture":"386","os":"linux"},{"digest":"sha256:88b2e00179bd6c4064612403c8d42a13de7ca809d61fee966ce9e129860a8a90","architecture":"mips64le","os":"linux"},{"digest":"sha256:bb7ab0fa94fdd78aca84b27a1bd46c4b811051f9b69905d81f5f267fc6546a9d","architecture":"ppc64le","os":"linux"},{"digest":"sha256:e49abad529e5d9bd6787f3abeab94e09ba274fe34731349556a850b9aebbf7bf","architecture":"s390x","os":"linux"},{"digest":"sha256:b0408a0f1d74eced127a2658429f336ed8fa48e36d59878f155b19865e5dbd70","architecture":"amd64","os":"windows"}]}} ' headers: @@ -306,11 +316,11 @@ interactions: connection: - keep-alive content-length: - - '1563' + - '1904' content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:17 GMT + - Thu, 01 Apr 2021 17:32:27 GMT docker-distribution-api-version: - registry/2.0 server: diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_get_tag.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_get_tag.yaml index f423e013f9b2..1627c2894cea 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_get_tag.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_get_tag.yaml @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:18 GMT + - Thu, 01 Apr 2021 17:32:28 GMT docker-distribution-api-version: - registry/2.0 server: @@ -71,13 +71,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:22 GMT + - Thu, 01 Apr 2021 17:32:29 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.316667' status: code: 200 message: OK @@ -107,13 +109,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:22 GMT + - Thu, 01 Apr 2021 17:32:29 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.3' status: code: 200 message: OK @@ -132,7 +136,7 @@ interactions: uri: https://fake_url.azurecr.io/acr/v1/hello-world/_tags/latest response: body: - string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","tag":{"name":"latest","digest":"sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24","createdTime":"2021-03-30T12:18:52.8272444Z","lastUpdateTime":"2021-03-30T12:18:52.8272444Z","signed":false,"changeableAttributes":{"deleteEnabled":true,"writeEnabled":true,"readEnabled":true,"listEnabled":true}}} + string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","tag":{"name":"latest","digest":"sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24","createdTime":"2021-03-30T12:18:52.8272444Z","lastUpdateTime":"2021-03-30T12:18:52.8272444Z","signed":false,"quarantineState":"Passed","changeableAttributes":{"deleteEnabled":true,"writeEnabled":true,"readEnabled":true,"listEnabled":true}}} ' headers: @@ -144,11 +148,11 @@ interactions: connection: - keep-alive content-length: - - '380' + - '407' content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:22 GMT + - Thu, 01 Apr 2021 17:32:30 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_client.test_list_registry_artifacts.yaml index cac8904df3e6..94a6a1570f95 100644 --- 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_client.test_list_registry_artifacts.yaml @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:21:01 GMT + - Thu, 01 Apr 2021 17:32:30 GMT docker-distribution-api-version: - registry/2.0 server: @@ -71,13 +71,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:21:03 GMT + - Thu, 01 Apr 2021 17:32:31 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '332.9' status: code: 200 message: OK @@ -107,13 +109,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:21:03 GMT + - Thu, 01 Apr 2021 17:32:32 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '332.883333' status: code: 200 message: OK @@ -132,7 +136,7 @@ interactions: uri: https://fake_url.azurecr.io/acr/v1/hello-world/_manifests response: body: - string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","manifests":[{"digest":"sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792","imageSize":0,"createdTime":"2021-03-30T12:18:47.6437335Z","lastUpdateTime":"2021-03-30T12:18:47.6437335Z","architecture":"amd64","os":"linux","mediaType":"application/vnd.docker.distribution.manifest.v2+json","changeableAttributes":{"deleteEnabled":false,"writeEnabled":true,"readEnabled":true,"listEnabled":true,"quarantineState":"Passed"}},{"digest":"sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24","imageSize":0,"createdTime":"2021-03-30T12:18:47.4863064Z","lastUpdateTime":"2021-03-30T12:18:47.4863064Z","mediaType":"application/vnd.docker.distribution.manifest.list.v2+json","tags":["latest"],"changeableAttributes":{"deleteEnabled":true,"writeEnabled":false,"readEnabled":true,"listEnabled":true}},{"digest":"sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1","imageSize":0,"createdTime":"2021-03-30T12:18:48.9950981Z","lastUpdateTime":"2021-03-30T12:18:48.9950981Z","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-03-30T12:18:48.0921265Z","lastUpdateTime":"2021-03-30T12:18:48.0921265Z","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-03-30T12:18:47.9641681Z","lastUpdateTime":"2021-03-30T12:18:47.9641681Z","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-03-30T12:18:48.6908523Z","lastUpdateTime":"2021-03-30T12:18:48.6908523Z","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-03-30T12:18:48.2834053Z","lastUpdateTime":"2021-03-30T12:18:48.2834053Z","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-03-30T12:18:48.1605587Z","lastUpdateTime":"2021-03-30T12:18:48.1605587Z","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-03-30T12:18:48.5864242Z","lastUpdateTime":"2021-03-30T12:18:48.5864242Z","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-03-30T12:18:48.4392605Z","lastUpdateTime":"2021-03-30T12:18:48.4392605Z","architecture":"arm","os":"linux","mediaType":"application/vnd.docker.distribution.manifest.v2+json","changeableAttributes":{"deleteEnabled":true,"writeEnabled":true,"readEnabled":true,"listEnabled":true,"quarantineState":"Passed"}}]} + string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","manifests":[{"digest":"sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792","imageSize":0,"createdTime":"2021-03-30T12:18:47.6437335Z","lastUpdateTime":"2021-03-30T12:18:47.6437335Z","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-03-30T12:18:47.4863064Z","lastUpdateTime":"2021-03-30T12:18:47.4863064Z","mediaType":"application/vnd.docker.distribution.manifest.list.v2+json","tags":["latest"],"changeableAttributes":{"deleteEnabled":true,"writeEnabled":false,"readEnabled":true,"listEnabled":true,"quarantineState":"Passed"}},{"digest":"sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1","imageSize":0,"createdTime":"2021-03-30T12:18:48.9950981Z","lastUpdateTime":"2021-03-30T12:18:48.9950981Z","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-03-30T12:18:48.0921265Z","lastUpdateTime":"2021-03-30T12:18:48.0921265Z","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-03-30T12:18:47.9641681Z","lastUpdateTime":"2021-03-30T12:18:47.9641681Z","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-03-30T12:18:48.6908523Z","lastUpdateTime":"2021-03-30T12:18:48.6908523Z","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-03-30T12:18:48.2834053Z","lastUpdateTime":"2021-03-30T12:18:48.2834053Z","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-03-30T12:18:48.1605587Z","lastUpdateTime":"2021-03-30T12:18:48.1605587Z","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-03-30T12:18:48.5864242Z","lastUpdateTime":"2021-03-30T12:18:48.5864242Z","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-03-30T12:18:48.4392605Z","lastUpdateTime":"2021-03-30T12:18:48.4392605Z","architecture":"arm","os":"linux","mediaType":"application/vnd.docker.distribution.manifest.v2+json","changeableAttributes":{"deleteEnabled":true,"writeEnabled":true,"readEnabled":true,"listEnabled":true,"quarantineState":"Passed"}}]} ' headers: @@ -146,7 +150,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:21:04 GMT + - Thu, 01 Apr 2021 17:32:32 GMT docker-distribution-api-version: - registry/2.0 server: diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_list_tags.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_list_tags.yaml index e03d192e00fb..c83158e202e4 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_list_tags.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_list_tags.yaml @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:27 GMT + - Thu, 01 Apr 2021 17:32:33 GMT docker-distribution-api-version: - registry/2.0 server: @@ -71,13 +71,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:30 GMT + - Thu, 01 Apr 2021 17:32:34 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.316667' status: code: 200 message: OK @@ -107,13 +109,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:30 GMT + - Thu, 01 Apr 2021 17:32:34 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.3' status: code: 200 message: OK @@ -132,7 +136,7 @@ interactions: uri: https://fake_url.azurecr.io/acr/v1/hello-world/_tags response: body: - string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","tags":[{"name":"latest","digest":"sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24","createdTime":"2021-03-30T12:18:52.8272444Z","lastUpdateTime":"2021-03-30T12:18:52.8272444Z","signed":false,"changeableAttributes":{"deleteEnabled":true,"writeEnabled":true,"readEnabled":true,"listEnabled":true}}]} + string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","tags":[{"name":"latest","digest":"sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24","createdTime":"2021-03-30T12:18:52.8272444Z","lastUpdateTime":"2021-03-30T12:18:52.8272444Z","signed":false,"quarantineState":"Passed","changeableAttributes":{"deleteEnabled":true,"writeEnabled":true,"readEnabled":true,"listEnabled":true}}]} ' headers: @@ -144,11 +148,11 @@ interactions: connection: - keep-alive content-length: - - '383' + - '410' content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:30 GMT + - Thu, 01 Apr 2021 17:32:35 GMT docker-distribution-api-version: - registry/2.0 server: diff --git a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_list_tags_descending.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_list_tags_descending.yaml index fd202eaf6f2e..80dd32fda56e 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_list_tags_descending.yaml +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_list_tags_descending.yaml @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:31 GMT + - Thu, 01 Apr 2021 17:32:35 GMT docker-distribution-api-version: - registry/2.0 server: @@ -71,13 +71,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:34 GMT + - Thu, 01 Apr 2021 17:32:37 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.283333' status: code: 200 message: OK @@ -107,13 +109,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:34 GMT + - Thu, 01 Apr 2021 17:32:37 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.25' status: code: 200 message: OK @@ -132,7 +136,7 @@ interactions: uri: https://fake_url.azurecr.io/acr/v1/hello-world/_tags?orderby=0 response: body: - string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","tags":[{"name":"latest","digest":"sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24","createdTime":"2021-03-30T12:18:52.8272444Z","lastUpdateTime":"2021-03-30T12:18:52.8272444Z","signed":false,"changeableAttributes":{"deleteEnabled":true,"writeEnabled":true,"readEnabled":true,"listEnabled":true}}]} + string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","tags":[{"name":"latest","digest":"sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24","createdTime":"2021-03-30T12:18:52.8272444Z","lastUpdateTime":"2021-03-30T12:18:52.8272444Z","signed":false,"quarantineState":"Passed","changeableAttributes":{"deleteEnabled":true,"writeEnabled":true,"readEnabled":true,"listEnabled":true}}]} ' headers: @@ -144,11 +148,11 @@ interactions: connection: - keep-alive content-length: - - '383' + - '410' content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:34 GMT + - Thu, 01 Apr 2021 17:32:37 GMT docker-distribution-api-version: - registry/2.0 server: 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_container_repository_client.test_set_manifest_properties.yaml index fdf7b611d2c0..d1dbec5188b5 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_container_repository_client.test_set_manifest_properties.yaml @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:35 GMT + - Thu, 01 Apr 2021 17:32:38 GMT docker-distribution-api-version: - registry/2.0 server: @@ -71,13 +71,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:36 GMT + - Thu, 01 Apr 2021 17:32:39 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '332.866667' status: code: 200 message: OK @@ -107,13 +109,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:36 GMT + - Thu, 01 Apr 2021 17:32:40 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '332.85' status: code: 200 message: OK @@ -132,7 +136,7 @@ interactions: uri: https://fake_url.azurecr.io/acr/v1/hello-world/_manifests response: body: - string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","manifests":[{"digest":"sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792","imageSize":0,"createdTime":"2021-03-30T12:18:47.6437335Z","lastUpdateTime":"2021-03-30T12:18:47.6437335Z","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-03-30T12:18:47.4863064Z","lastUpdateTime":"2021-03-30T12:18:47.4863064Z","mediaType":"application/vnd.docker.distribution.manifest.list.v2+json","tags":["latest"],"changeableAttributes":{"deleteEnabled":true,"writeEnabled":true,"readEnabled":true,"listEnabled":true}},{"digest":"sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1","imageSize":0,"createdTime":"2021-03-30T12:18:48.9950981Z","lastUpdateTime":"2021-03-30T12:18:48.9950981Z","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-03-30T12:18:48.0921265Z","lastUpdateTime":"2021-03-30T12:18:48.0921265Z","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-03-30T12:18:47.9641681Z","lastUpdateTime":"2021-03-30T12:18:47.9641681Z","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-03-30T12:18:48.6908523Z","lastUpdateTime":"2021-03-30T12:18:48.6908523Z","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-03-30T12:18:48.2834053Z","lastUpdateTime":"2021-03-30T12:18:48.2834053Z","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-03-30T12:18:48.1605587Z","lastUpdateTime":"2021-03-30T12:18:48.1605587Z","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-03-30T12:18:48.5864242Z","lastUpdateTime":"2021-03-30T12:18:48.5864242Z","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-03-30T12:18:48.4392605Z","lastUpdateTime":"2021-03-30T12:18:48.4392605Z","architecture":"arm","os":"linux","mediaType":"application/vnd.docker.distribution.manifest.v2+json","changeableAttributes":{"deleteEnabled":true,"writeEnabled":true,"readEnabled":true,"listEnabled":true,"quarantineState":"Passed"}}]} + string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","manifests":[{"digest":"sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792","imageSize":0,"createdTime":"2021-03-30T12:18:47.6437335Z","lastUpdateTime":"2021-03-30T12:18:47.6437335Z","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-03-30T12:18:47.4863064Z","lastUpdateTime":"2021-03-30T12:18:47.4863064Z","mediaType":"application/vnd.docker.distribution.manifest.list.v2+json","tags":["latest"],"changeableAttributes":{"deleteEnabled":true,"writeEnabled":false,"readEnabled":true,"listEnabled":true,"quarantineState":"Passed"}},{"digest":"sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1","imageSize":0,"createdTime":"2021-03-30T12:18:48.9950981Z","lastUpdateTime":"2021-03-30T12:18:48.9950981Z","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-03-30T12:18:48.0921265Z","lastUpdateTime":"2021-03-30T12:18:48.0921265Z","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-03-30T12:18:47.9641681Z","lastUpdateTime":"2021-03-30T12:18:47.9641681Z","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-03-30T12:18:48.6908523Z","lastUpdateTime":"2021-03-30T12:18:48.6908523Z","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-03-30T12:18:48.2834053Z","lastUpdateTime":"2021-03-30T12:18:48.2834053Z","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-03-30T12:18:48.1605587Z","lastUpdateTime":"2021-03-30T12:18:48.1605587Z","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-03-30T12:18:48.5864242Z","lastUpdateTime":"2021-03-30T12:18:48.5864242Z","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-03-30T12:18:48.4392605Z","lastUpdateTime":"2021-03-30T12:18:48.4392605Z","architecture":"arm","os":"linux","mediaType":"application/vnd.docker.distribution.manifest.v2+json","changeableAttributes":{"deleteEnabled":true,"writeEnabled":true,"readEnabled":true,"listEnabled":true,"quarantineState":"Passed"}}]} ' headers: @@ -146,7 +150,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:37 GMT + - Thu, 01 Apr 2021 17:32:40 GMT docker-distribution-api-version: - registry/2.0 server: @@ -198,7 +202,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:38 GMT + - Thu, 01 Apr 2021 17:32:40 GMT docker-distribution-api-version: - registry/2.0 server: @@ -238,13 +242,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:38 GMT + - Thu, 01 Apr 2021 17:32:41 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '332.833333' status: code: 200 message: OK @@ -274,13 +280,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:38 GMT + - Thu, 01 Apr 2021 17:32:41 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '332.816667' status: code: 200 message: OK @@ -306,7 +314,7 @@ interactions: body: string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","manifest":{"digest":"sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792","imageSize":0,"createdTime":"2021-03-30T12:18:47.6437335Z","lastUpdateTime":"2021-03-30T12:18:47.6437335Z","architecture":"amd64","os":"linux","mediaType":"application/vnd.docker.distribution.manifest.v2+json","changeableAttributes":{"deleteEnabled":false,"writeEnabled":true,"readEnabled":true,"listEnabled":true,"quarantineDetails":"{\"state\":\"Scan InProgress\",\"link\":\"https://aka.ms/test\",\"scanner\":\"Azure Security - Monitoring-Qualys Scanner\",\"result\":{\"version\":\"3/30/2021 12:18:49 PM\",\"summary\":[{\"severity\":\"High\",\"count\":0},{\"severity\":\"Medium\",\"count\":0},{\"severity\":\"Low\",\"count\":0}]}}","quarantineState":"Passed"}}} + Monitoring-Qualys Scanner\",\"result\":{\"version\":\"4/1/2021 5:28:41 PM\",\"summary\":[{\"severity\":\"High\",\"count\":0},{\"severity\":\"Medium\",\"count\":0},{\"severity\":\"Low\",\"count\":0}]}}","quarantineState":"Passed"}}} ' headers: @@ -318,11 +326,11 @@ interactions: connection: - keep-alive content-length: - - '817' + - '815' content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:38 GMT + - Thu, 01 Apr 2021 17:32:41 GMT docker-distribution-api-version: - registry/2.0 server: @@ -367,7 +375,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:39 GMT + - Thu, 01 Apr 2021 17:32:41 GMT docker-distribution-api-version: - registry/2.0 server: @@ -407,13 +415,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:39 GMT + - Thu, 01 Apr 2021 17:32:41 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '332.8' status: code: 200 message: OK @@ -443,13 +453,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:39 GMT + - Thu, 01 Apr 2021 17:32:42 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '332.783333' status: code: 200 message: OK @@ -470,7 +482,7 @@ interactions: body: string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","manifest":{"digest":"sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792","imageSize":0,"createdTime":"2021-03-30T12:18:47.6437335Z","lastUpdateTime":"2021-03-30T12:18:47.6437335Z","architecture":"amd64","os":"linux","mediaType":"application/vnd.docker.distribution.manifest.v2+json","changeableAttributes":{"deleteEnabled":false,"writeEnabled":true,"readEnabled":true,"listEnabled":true,"quarantineDetails":"{\"state\":\"Scan InProgress\",\"link\":\"https://aka.ms/test\",\"scanner\":\"Azure Security - Monitoring-Qualys Scanner\",\"result\":{\"version\":\"3/30/2021 12:18:49 PM\",\"summary\":[{\"severity\":\"High\",\"count\":0},{\"severity\":\"Medium\",\"count\":0},{\"severity\":\"Low\",\"count\":0}]}}","quarantineState":"Passed"}}} + Monitoring-Qualys Scanner\",\"result\":{\"version\":\"4/1/2021 5:28:41 PM\",\"summary\":[{\"severity\":\"High\",\"count\":0},{\"severity\":\"Medium\",\"count\":0},{\"severity\":\"Low\",\"count\":0}]}}","quarantineState":"Passed"}}} ' headers: @@ -482,11 +494,11 @@ interactions: connection: - keep-alive content-length: - - '817' + - '815' content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:39 GMT + - Thu, 01 Apr 2021 17:32:42 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.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client.test_set_tag_properties.yaml index 4a17ecaf240e..77843fe99c51 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_client.test_set_tag_properties.yaml @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:40 GMT + - Thu, 01 Apr 2021 17:32:42 GMT docker-distribution-api-version: - registry/2.0 server: @@ -71,13 +71,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:42 GMT + - Thu, 01 Apr 2021 17:32:44 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.283333' status: code: 200 message: OK @@ -107,13 +109,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:42 GMT + - Thu, 01 Apr 2021 17:32:44 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.266667' status: code: 200 message: OK @@ -132,7 +136,7 @@ interactions: uri: https://fake_url.azurecr.io/acr/v1/hello-world/_tags response: body: - string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","tags":[{"name":"latest","digest":"sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24","createdTime":"2021-03-30T12:18:52.8272444Z","lastUpdateTime":"2021-03-30T12:18:52.8272444Z","signed":false,"changeableAttributes":{"deleteEnabled":true,"writeEnabled":true,"readEnabled":true,"listEnabled":true}}]} + string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","tags":[{"name":"latest","digest":"sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24","createdTime":"2021-03-30T12:18:52.8272444Z","lastUpdateTime":"2021-03-30T12:18:52.8272444Z","signed":false,"quarantineState":"Passed","changeableAttributes":{"deleteEnabled":true,"writeEnabled":true,"readEnabled":true,"listEnabled":true}}]} ' headers: @@ -144,11 +148,11 @@ interactions: connection: - keep-alive content-length: - - '383' + - '410' content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:42 GMT + - Thu, 01 Apr 2021 17:32:44 GMT docker-distribution-api-version: - registry/2.0 server: @@ -198,7 +202,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:42 GMT + - Thu, 01 Apr 2021 17:32:44 GMT docker-distribution-api-version: - registry/2.0 server: @@ -238,13 +242,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:42 GMT + - Thu, 01 Apr 2021 17:32:44 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.25' status: code: 200 message: OK @@ -274,13 +280,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:42 GMT + - Thu, 01 Apr 2021 17:32:45 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.233333' status: code: 200 message: OK @@ -304,7 +312,9 @@ interactions: uri: https://fake_url.azurecr.io/acr/v1/hello-world/_manifests/sha256%3A308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24 response: body: - string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","manifest":{"digest":"sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24","imageSize":0,"createdTime":"2021-03-30T12:18:47.4863064Z","lastUpdateTime":"2021-03-30T12:18:47.4863064Z","mediaType":"application/vnd.docker.distribution.manifest.list.v2+json","tags":["latest"],"changeableAttributes":{"deleteEnabled":true,"writeEnabled":false,"readEnabled":true,"listEnabled":true},"references":[{"digest":"sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792","architecture":"amd64","os":"linux"},{"digest":"sha256:e5785cb0c62cebbed4965129bae371f0589cadd6d84798fb58c2c5f9e237efd9","architecture":"arm","os":"linux"},{"digest":"sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1","architecture":"arm","os":"linux"},{"digest":"sha256:963612c5503f3f1674f315c67089dee577d8cc6afc18565e0b4183ae355fb343","architecture":"arm64","os":"linux"},{"digest":"sha256:cb55d8f7347376e1ba38ca740904b43c9a52f66c7d2ae1ef1a0de1bc9f40df98","architecture":"386","os":"linux"},{"digest":"sha256:88b2e00179bd6c4064612403c8d42a13de7ca809d61fee966ce9e129860a8a90","architecture":"mips64le","os":"linux"},{"digest":"sha256:bb7ab0fa94fdd78aca84b27a1bd46c4b811051f9b69905d81f5f267fc6546a9d","architecture":"ppc64le","os":"linux"},{"digest":"sha256:e49abad529e5d9bd6787f3abeab94e09ba274fe34731349556a850b9aebbf7bf","architecture":"s390x","os":"linux"},{"digest":"sha256:b0408a0f1d74eced127a2658429f336ed8fa48e36d59878f155b19865e5dbd70","architecture":"amd64","os":"windows"}]}} + string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","manifest":{"digest":"sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24","imageSize":0,"createdTime":"2021-03-30T12:18:47.4863064Z","lastUpdateTime":"2021-03-30T12:18:47.4863064Z","mediaType":"application/vnd.docker.distribution.manifest.list.v2+json","tags":["latest"],"changeableAttributes":{"deleteEnabled":true,"writeEnabled":false,"readEnabled":true,"listEnabled":true,"quarantineDetails":"{\"state\":\"Scan + Failed\",\"link\":\"https://aka.ms/test\",\"scanner\":\"Azure Security Monitoring-Qualys + Scanner\",\"result\":{\"version\":\"3/31/2021 1:55:48 PM\",\"summary\":[{\"severity\":\"High\",\"count\":0},{\"severity\":\"Medium\",\"count\":0},{\"severity\":\"Low\",\"count\":0}]}}","quarantineState":"Passed"},"references":[{"digest":"sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792","architecture":"amd64","os":"linux"},{"digest":"sha256:e5785cb0c62cebbed4965129bae371f0589cadd6d84798fb58c2c5f9e237efd9","architecture":"arm","os":"linux"},{"digest":"sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1","architecture":"arm","os":"linux"},{"digest":"sha256:963612c5503f3f1674f315c67089dee577d8cc6afc18565e0b4183ae355fb343","architecture":"arm64","os":"linux"},{"digest":"sha256:cb55d8f7347376e1ba38ca740904b43c9a52f66c7d2ae1ef1a0de1bc9f40df98","architecture":"386","os":"linux"},{"digest":"sha256:88b2e00179bd6c4064612403c8d42a13de7ca809d61fee966ce9e129860a8a90","architecture":"mips64le","os":"linux"},{"digest":"sha256:bb7ab0fa94fdd78aca84b27a1bd46c4b811051f9b69905d81f5f267fc6546a9d","architecture":"ppc64le","os":"linux"},{"digest":"sha256:e49abad529e5d9bd6787f3abeab94e09ba274fe34731349556a850b9aebbf7bf","architecture":"s390x","os":"linux"},{"digest":"sha256:b0408a0f1d74eced127a2658429f336ed8fa48e36d59878f155b19865e5dbd70","architecture":"amd64","os":"windows"}]}} ' headers: @@ -316,11 +326,11 @@ interactions: connection: - keep-alive content-length: - - '1564' + - '1904' content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:43 GMT + - Thu, 01 Apr 2021 17:32:45 GMT docker-distribution-api-version: - registry/2.0 server: @@ -365,7 +375,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:43 GMT + - Thu, 01 Apr 2021 17:32:45 GMT docker-distribution-api-version: - registry/2.0 server: @@ -405,13 +415,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:43 GMT + - Thu, 01 Apr 2021 17:32:46 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.216667' status: code: 200 message: OK @@ -441,13 +453,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:43 GMT + - Thu, 01 Apr 2021 17:32:46 GMT server: - openresty strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.2' status: code: 200 message: OK @@ -466,7 +480,7 @@ interactions: uri: https://fake_url.azurecr.io/acr/v1/hello-world/_tags/latest response: body: - string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","tag":{"name":"latest","digest":"sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24","createdTime":"2021-03-30T12:18:52.8272444Z","lastUpdateTime":"2021-03-30T12:18:52.8272444Z","signed":false,"changeableAttributes":{"deleteEnabled":true,"writeEnabled":true,"readEnabled":true,"listEnabled":true}}} + string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","tag":{"name":"latest","digest":"sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24","createdTime":"2021-03-30T12:18:52.8272444Z","lastUpdateTime":"2021-03-30T12:18:52.8272444Z","signed":false,"quarantineState":"Passed","changeableAttributes":{"deleteEnabled":true,"writeEnabled":true,"readEnabled":true,"listEnabled":true}}} ' headers: @@ -478,11 +492,11 @@ interactions: connection: - keep-alive content-length: - - '380' + - '407' content-type: - application/json; charset=utf-8 date: - - Tue, 30 Mar 2021 12:19:44 GMT + - Thu, 01 Apr 2021 17:32:46 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_tag.yaml b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_delete_tag.yaml new file mode 100644 index 000000000000..e7df158103b7 --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/recordings/test_container_repository_client_async.test_delete_tag.yaml @@ -0,0 +1,341 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/hello-world/_tags/to_be_deleted + response: + body: + string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, + visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"hello-world","Action":"metadata_read"}]}]} + + ' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '214' + content-type: application/json; charset=utf-8 + date: Thu, 01 Apr 2021 17:33:01 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://seankane.azurecr.io/acr/v1/hello-world/_tags/to_be_deleted +- request: + body: + access_token: REDACTED + grant_type: access_token + service: seankane.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 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: Thu, 01 Apr 2021 17:33:03 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '333.05' + status: + code: 200 + message: OK + url: https://seankane.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:hello-world:metadata_read + service: seankane.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 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: Thu, 01 Apr 2021 17:33:03 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '333.033333' + status: + code: 200 + message: OK + url: https://seankane.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/hello-world/_tags/to_be_deleted + response: + body: + string: '{"registry":"fake_url.azurecr.io","imageName":"hello-world","tag":{"name":"to_be_deleted","digest":"sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24","createdTime":"2021-04-01T17:32:53.4951935Z","lastUpdateTime":"2021-04-01T17:32:53.4951935Z","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: '387' + content-type: application/json; charset=utf-8 + date: Thu, 01 Apr 2021 17:33:03 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://seankane.azurecr.io/acr/v1/hello-world/_tags/to_be_deleted +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/hello-world/_tags/to_be_deleted + response: + body: + string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, + visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"hello-world","Action":"delete"}]}]} + + ' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '207' + content-type: application/json; charset=utf-8 + date: Thu, 01 Apr 2021 17:33:03 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://seankane.azurecr.io/acr/v1/hello-world/_tags/to_be_deleted +- request: + body: + access_token: REDACTED + grant_type: access_token + service: seankane.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 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: Thu, 01 Apr 2021 17:33:03 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '333.016667' + status: + code: 200 + message: OK + url: https://seankane.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:hello-world:delete + service: seankane.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 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: Thu, 01 Apr 2021 17:33:03 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '333' + status: + code: 200 + message: OK + url: https://seankane.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://fake_url.azurecr.io/acr/v1/hello-world/_tags/to_be_deleted + response: + body: + string: '' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '0' + date: Thu, 01 Apr 2021 17:33:04 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:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24 + x-ms-ratelimit-remaining-calls-per-second: '32.000000' + status: + code: 202 + message: Accepted + url: https://seankane.azurecr.io/acr/v1/hello-world/_tags/to_be_deleted +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/hello-world/_tags/to_be_deleted + response: + body: + string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, + visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"hello-world","Action":"metadata_read"}]}]} + + ' + headers: + access-control-expose-headers: X-Ms-Correlation-Request-Id + connection: keep-alive + content-length: '214' + content-type: application/json; charset=utf-8 + date: Thu, 01 Apr 2021 17:33: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://seankane.azurecr.io/acr/v1/hello-world/_tags/to_be_deleted +- request: + body: + access_token: REDACTED + grant_type: access_token + service: seankane.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 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: Thu, 01 Apr 2021 17:33:14 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '332.983333' + status: + code: 200 + message: OK + url: https://seankane.azurecr.io/oauth2/exchange +- request: + body: + grant_type: refresh_token + refresh_token: REDACTED + scope: repository:hello-world:metadata_read + service: seankane.azurecr.io + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 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: Thu, 01 Apr 2021 17:33:14 GMT + server: openresty + strict-transport-security: max-age=31536000; includeSubDomains + transfer-encoding: chunked + x-ms-ratelimit-remaining-calls-per-second: '332.966667' + status: + code: 200 + message: OK + url: https://seankane.azurecr.io/oauth2/token +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-azure-containerregistry/0.0.1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_url.azurecr.io/acr/v1/hello-world/_tags/to_be_deleted + response: + body: + 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: '81' + content-type: application/json; charset=utf-8 + date: Thu, 01 Apr 2021 17:33:14 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://seankane.azurecr.io/acr/v1/hello-world/_tags/to_be_deleted +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 eddad8a8df7d..d2b86a9850de 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/test_container_registry_client.py +++ b/sdk/containerregistry/azure-containerregistry/tests/test_container_registry_client.py @@ -3,12 +3,10 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ -import functools -import os import pytest import six -from devtools_testutils import AzureTestCase, PowerShellPreparer +from devtools_testutils import AzureTestCase from azure.containerregistry import ( ContainerRegistryClient, @@ -16,16 +14,9 @@ ) from azure.core.exceptions import ResourceNotFoundError from azure.core.paging import ItemPaged -from azure.identity import DefaultAzureCredential from testcase import ContainerRegistryTestClass - - -acr_preparer = functools.partial( - PowerShellPreparer, - "containerregistry", - containerregistry_baseurl="fake_url.azurecr.io", -) +from preparer import acr_preparer class TestContainerRegistryClient(ContainerRegistryTestClass): @@ -47,18 +38,20 @@ def test_list_repositories(self, containerregistry_baseurl): assert count > 0 - @pytest.mark.skip("Don't want to delete for now") @acr_preparer() - def test_delete_repository(self, containerregistry_baseurl): + def test_delete_repository(self, containerregistry_baseurl, containerregistry_resource_group): + repository = self.get_resource_name("repo") + self._import_tag_to_be_deleted( + containerregistry_baseurl, resource_group=containerregistry_resource_group, repository=repository + ) client = self.create_registry_client(containerregistry_baseurl) - deleted_result = client.delete_repository("debian") - - assert isinstance(deleted_result, DeletedRepositoryResult) - assert len(deleted_result.deleted_registry_artifact_digests) == 1 - assert len(deleted_result.deleted_tags) == 1 + client.delete_repository(repository) + self.sleep(5) - @pytest.mark.skip("Don't want to for now") + for repo in client.list_repositories(): + if repo == repository: + raise ValueError("Repository not deleted") @acr_preparer() def test_delete_repository_does_not_exist(self, containerregistry_baseurl): diff --git a/sdk/containerregistry/azure-containerregistry/tests/test_container_registry_async.py b/sdk/containerregistry/azure-containerregistry/tests/test_container_registry_client_async.py similarity index 68% rename from sdk/containerregistry/azure-containerregistry/tests/test_container_registry_async.py rename to sdk/containerregistry/azure-containerregistry/tests/test_container_registry_client_async.py index 4f5b89bdb855..347063153ea4 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/test_container_registry_async.py +++ b/sdk/containerregistry/azure-containerregistry/tests/test_container_registry_client_async.py @@ -3,12 +3,10 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ -import functools -import os import pytest import six -from devtools_testutils import AzureTestCase, PowerShellPreparer +from devtools_testutils import AzureTestCase from azure.containerregistry import ( DeletedRepositoryResult, @@ -17,16 +15,9 @@ from azure.containerregistry.aio import ContainerRegistryClient, ContainerRepositoryClient from azure.core.exceptions import ResourceNotFoundError from azure.core.paging import ItemPaged -from azure.identity.aio import DefaultAzureCredential from asynctestcase import AsyncContainerRegistryTestClass - - -acr_preparer = functools.partial( - PowerShellPreparer, - "containerregistry", - containerregistry_baseurl="fake_url.azurecr.io", -) +from preparer import acr_preparer class TestContainerRegistryClient(AsyncContainerRegistryTestClass): @@ -35,6 +26,8 @@ class TestContainerRegistryClient(AsyncContainerRegistryTestClass): async def test_list_repositories(self, containerregistry_baseurl): client = self.create_registry_client(containerregistry_baseurl) + repositories = client.list_repositories() + count = 0 prev = None async for repo in client.list_repositories(): @@ -45,16 +38,20 @@ async def test_list_repositories(self, containerregistry_baseurl): assert count > 0 - @pytest.mark.skip("Don't want to delete for now") @acr_preparer() - def test_delete_repository(self, containerregistry_baseurl): + async def test_delete_repository(self, containerregistry_baseurl, containerregistry_resource_group): + repository = self.get_resource_name("repo") + self._import_tag_to_be_deleted( + containerregistry_baseurl, resource_group=containerregistry_resource_group, repository=repository + ) client = self.create_registry_client(containerregistry_baseurl) - deleted_result = client.delete_repository("debian") + await client.delete_repository(repository) + self.sleep(5) - assert isinstance(deleted_result, DeletedRepositoryResult) - assert len(deleted_result.deleted_registry_artifact_digests) == 1 - assert len(deleted_result.deleted_tags) == 1 + async for repo in client.list_repositories(): + if repo == repository: + raise ValueError("Repository not deleted") @acr_preparer() async def test_delete_repository_does_not_exist(self, containerregistry_baseurl): diff --git a/sdk/containerregistry/azure-containerregistry/tests/test_container_repository_client.py b/sdk/containerregistry/azure-containerregistry/tests/test_container_repository_client.py index 09d1f10a698b..2b68f6ef8fa8 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/test_container_repository_client.py +++ b/sdk/containerregistry/azure-containerregistry/tests/test_container_repository_client.py @@ -4,11 +4,9 @@ # Licensed under the MIT License. # ------------------------------------ from datetime import datetime -import functools -import os import pytest -from devtools_testutils import AzureTestCase, PowerShellPreparer +from devtools_testutils import AzureTestCase from azure.containerregistry import ( ContainerRepositoryClient, @@ -19,24 +17,28 @@ TagProperties, TagOrderBy, ) +from azure.core.exceptions import ResourceNotFoundError from azure.core.paging import ItemPaged from testcase import ContainerRegistryTestClass, AcrBodyReplacer, FakeTokenCredential - -acr_preparer = functools.partial( - PowerShellPreparer, - "containerregistry", - containerregistry_baseurl="fake_url.azurecr.io", -) +from preparer import acr_preparer class TestContainerRepositoryClient(ContainerRegistryTestClass): + @acr_preparer() + def test_delete_tag(self, containerregistry_baseurl, containerregistry_resource_group): + self._import_tag_to_be_deleted(containerregistry_baseurl, resource_group=containerregistry_resource_group) + + client = self.create_repository_client(containerregistry_baseurl, "hello-world") + + tag = client.get_tag_properties("to_be_deleted") + assert tag is not None - def __init__(self, method_name): - super(TestContainerRepositoryClient, self).__init__(method_name) - self.vcr.match_on = ["path", "method", "query"] - self.recording_processors.append(AcrBodyReplacer()) - self.repository = "hello-world" + client.delete_tag("to_be_deleted") + self.sleep(10) + + with pytest.raises(ResourceNotFoundError): + client.get_tag_properties("to_be_deleted") @acr_preparer() def test_get_attributes(self, containerregistry_baseurl): @@ -67,6 +69,7 @@ def test_get_tag(self, containerregistry_baseurl): def test_list_registry_artifacts(self, containerregistry_baseurl): client = self.create_repository_client(containerregistry_baseurl, self.repository) + count = 0 for artifact in client.list_registry_artifacts(): assert artifact is not None assert isinstance(artifact, RegistryArtifactProperties) @@ -74,6 +77,9 @@ def test_list_registry_artifacts(self, containerregistry_baseurl): 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_get_registry_artifact_properties(self, containerregistry_baseurl): 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 new file mode 100644 index 000000000000..3292e7fe3878 --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/tests/test_container_repository_client_async.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +import pytest + +from devtools_testutils import AzureTestCase + +from azure.containerregistry import ( + DeletedRepositoryResult, + RepositoryProperties, +) +from azure.containerregistry.aio import ContainerRegistryClient, ContainerRepositoryClient +from azure.core.exceptions import ResourceNotFoundError +from azure.core.paging import ItemPaged + +from asynctestcase import AsyncContainerRegistryTestClass +from preparer import acr_preparer + + +class TestContainerRegistryClient(AsyncContainerRegistryTestClass): + @acr_preparer() + async def test_delete_tag(self, containerregistry_baseurl, containerregistry_resource_group): + self._import_tag_to_be_deleted(containerregistry_baseurl, resource_group=containerregistry_resource_group) + + client = self.create_repository_client(containerregistry_baseurl, "hello-world") + + tag = await client.get_tag_properties("to_be_deleted") + assert tag is not None + + await client.delete_tag("to_be_deleted") + self.sleep(10) + + with pytest.raises(ResourceNotFoundError): + await client.get_tag_properties("to_be_deleted") diff --git a/sdk/containerregistry/azure-containerregistry/tests/testcase.py b/sdk/containerregistry/azure-containerregistry/tests/testcase.py index fb3185579a5d..6d131e2c0fef 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/testcase.py +++ b/sdk/containerregistry/azure-containerregistry/tests/testcase.py @@ -9,6 +9,8 @@ import os import re import six +import subprocess +import time from azure.containerregistry import ( ContainerRepositoryClient, @@ -27,6 +29,7 @@ REDACTED = "REDACTED" + class AcrBodyReplacer(RecordingProcessor): """Replace request body for oauth2 exchanges""" def __init__(self, replacement="redacted"): @@ -101,11 +104,43 @@ def get_token(self, *args): class ContainerRegistryTestClass(AzureTestCase): - def __init__(self, method_name): super(ContainerRegistryTestClass, self).__init__(method_name) self.vcr.match_on = ["path", "method", "query"] self.recording_processors.append(AcrBodyReplacer()) + self.repository = "hello-world" + + def sleep(self, t): + if self.is_live: + time.sleep(t) + + def _fake_sleep(self, *args, **kwargs): + pass + + def _import_tag_to_be_deleted( + self, endpoint, repository="hello-world", resource_group="fake_rg" + ): + if not self.is_live: + return + + registry = endpoint.split(".")[0] + command = [ + "powershell.exe", + "Import-AzcontainerRegistryImage", + "-ResourceGroupName", + "'{}'".format(resource_group), + "-RegistryName", + "'{}'".format(registry), + "-SourceImage", + "'library/hello-world'", + "-SourceRegistryUri", + "'registry.hub.docker.com'", + "-TargetTag", + "'{}'".format(repository), + "-Mode", + "'Force'", + ] + subprocess.check_call(command) def get_credential(self): if self.is_live: diff --git a/sdk/containerregistry/ci.yml b/sdk/containerregistry/ci.yml index c38cef937ada..156f6a28741a 100644 --- a/sdk/containerregistry/ci.yml +++ b/sdk/containerregistry/ci.yml @@ -10,7 +10,7 @@ trigger: - restapi* paths: include: - - sdk/tables/ + - sdk/containerregistry/ - sdk/core/ - tools/ - eng/ @@ -26,7 +26,7 @@ pr: - restapi* paths: include: - - sdk/tables/ + - sdk/containerregistry/ - sdk/core/ - tools/ - eng/ diff --git a/sdk/containerregistry/test-resources.json b/sdk/containerregistry/test-resources.json new file mode 100644 index 000000000000..5fe3abd98e38 --- /dev/null +++ b/sdk/containerregistry/test-resources.json @@ -0,0 +1,70 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "baseName": { + "type": "string", + "defaultValue": "[resourceGroup().name]", + "metadata": { + "description": "The base resource name." + } + }, + "tenantId": { + "type": "string", + "metadata": { + "description": "The tenant ID to which the application and resources belong." + } + }, + "testApplicationOid": { + "type": "string", + "metadata": { + "description": "The client OID to grant access to test resources." + } + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "The location of the resource. By default, this is the same as the resource group." + } + } + }, + "variables": { + "apiVersion": "2019-05-01", + "endpointValue": "[format('https://{0}.azurecr.io', parameters('baseName'))]" + }, + "resources": [ + { + "type": "Microsoft.ContainerRegistry/registries", + "apiVersion": "[variables('apiVersion')]", + "name": "[parameters('baseName')]", + "location": "[parameters('location')]", + "properties": { + "endpoint": "[variables('endpointValue')]", + "adminUserEnabled": true + }, + "sku": { + "name": "Basic", + "tier": "Basic" + } + } + ], + "outputs": { + "CONTAINERREGISTRY_REGISTRY_NAME": { + "type": "string", + "value": "[parameters('baseName')]" + }, + "CONTAINERREGISTRY_ENDPOINT": { + "type": "string", + "value": "[variables('endpointValue')]" + }, + "CONTAINERREGISTRY_USERNAME": { + "type": "string", + "value": "[listCredentials(parameters('baseName'), variables('apiVersion')).username]" + }, + "CONTAINERREGISTRY_PASSWORD": { + "type": "string", + "value": "[listCredentials(parameters('baseName'), variables('apiVersion')).passwords[0].value]" + } + } + } \ No newline at end of file