async def basic_sample(self):

        from azure.containerregistry.aio import ContainerRegistryClient
        from azure.identity.aio import DefaultAzureCredential
        account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"]

        # Instantiate the client
        client = ContainerRegistryClient(account_url, DefaultAzureCredential())
        async with client:
            # Iterate through all the repositories
            async for repository_name in client.list_repository_names():
                if repository_name == "hello-world":
                    # Create a repository object from the registry client
                    container_repository = client.get_repository(repository_name)

                    async with container_repository:
                        # Show all tags
                        async for manifest in container_repository.list_manifests():
                            print(manifest.tags)
Пример #2
0
    async def basic_sample(self):

        from azure.containerregistry.aio import ContainerRegistryClient
        from azure.identity.aio import DefaultAzureCredential

        # Instantiate the client
        client = ContainerRegistryClient(self.account_url, DefaultAzureCredential())
        async with client:
            # Iterate through all the repositories
            async for repository_name in client.list_repository_names():
                if repository_name == "hello-world":
                    # Create a repository client from the registry client
                    repository_client = client.get_repository(repository_name)

                    async with repository_client:
                        # Show all tags
                        async for tag in repository_client.list_tags():
                            print(tag.digest)

                    # [START delete_repository]
                    await client.delete_repository("hello-world")