Class ContainerRegistryAsyncClient
- java.lang.Object
-
- com.azure.containers.containerregistry.ContainerRegistryAsyncClient
-
public final class ContainerRegistryAsyncClient extends Object
This class provides a client that exposes operations to managing container images and artifacts. It exposes methods directly performed on the registry like listing the catalog. as well as helper types likegetArtifact
andgetRepository
that can be used to perform operations on repository and artifacts directly.Instantiating an asynchronous Container Registry client
ContainerRegistryAsyncClient registryAsyncClient = new ContainerRegistryClientBuilder() .endpoint(endpoint) .credential(credential) .audience(ContainerRegistryAudience.AZURE_RESOURCE_MANAGER_PUBLIC_CLOUD) .buildAsyncClient();
Instantiating an asynchronous Container Registry client using a custom pipeline
HttpPipeline pipeline = new HttpPipelineBuilder() .policies(/* add policies */) .build(); ContainerRegistryAsyncClient registryAsyncClient = new ContainerRegistryClientBuilder() .pipeline(pipeline) .endpoint(endpoint) .audience(ContainerRegistryAudience.AZURE_RESOURCE_MANAGER_PUBLIC_CLOUD) .credential(credential) .buildAsyncClient();
View
this
for additional ways to construct the client.- See Also:
ContainerRegistryClientBuilder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mono<Void>
deleteRepository(String repositoryName)
Delete the repository identified byrepositoryName
.Mono<com.azure.core.http.rest.Response<Void>>
deleteRepositoryWithResponse(String repositoryName)
Delete the repository identified by 'repositoryName'.RegistryArtifactAsync
getArtifact(String repositoryName, String tagOrDigest)
Creates a new instance ofRegistryArtifactAsync
object for the specified artifact.String
getEndpoint()
This method returns the complete registry endpoint.ContainerRepositoryAsync
getRepository(String repositoryName)
Creates a new instance ofContainerRepositoryAsync
object for the specified repository.com.azure.core.http.rest.PagedFlux<String>
listRepositoryNames()
List all the repository names in this registry.
-
-
-
Method Detail
-
getEndpoint
public String getEndpoint()
This method returns the complete registry endpoint.- Returns:
- The registry endpoint including the authority.
-
listRepositoryNames
public com.azure.core.http.rest.PagedFlux<String> listRepositoryNames()
List all the repository names in this registry.List repository names in the registry.
client.listRepositoryNames().subscribe(name -> { System.out.printf("Repository Name:%s,", name); });
- Returns:
- list of repository names.
- Throws:
com.azure.core.exception.ClientAuthenticationException
- thrown if the client's credentials do not have access to modify the namespace.
-
deleteRepositoryWithResponse
public Mono<com.azure.core.http.rest.Response<Void>> deleteRepositoryWithResponse(String repositoryName)
Delete the repository identified by 'repositoryName'.Delete a repository in the registry.
client.deleteRepositoryWithResponse(repositoryName).subscribe(response -> { System.out.printf("Successfully initiated delete of the repository."); }, error -> { System.out.println("Failed to initiate a delete of the repository."); });
- Parameters:
repositoryName
- Name of the repository (including the namespace).- Returns:
- the completion.
- Throws:
com.azure.core.exception.ClientAuthenticationException
- thrown if the client's credentials do not have access to modify the namespace.NullPointerException
- thrown if therepositoryName
is null.IllegalArgumentException
- thrown if therepositoryName
is null.
-
deleteRepository
public Mono<Void> deleteRepository(String repositoryName)
Delete the repository identified byrepositoryName
.Delete a repository in the registry.
client.deleteRepository(repositoryName).subscribe(response -> { System.out.printf("Successfully initiated delete of the repository."); }, error -> { System.out.println("Failed to initiate a delete of the repository."); });
- Parameters:
repositoryName
- Name of the image (including the namespace).- Returns:
- the completion stream.
- Throws:
com.azure.core.exception.ClientAuthenticationException
- thrown if the client's credentials do not have access to modify the namespace.NullPointerException
- thrown if therepositoryName
is null.IllegalArgumentException
- thrown ifrepositoryName
is empty.
-
getRepository
public ContainerRepositoryAsync getRepository(String repositoryName)
Creates a new instance ofContainerRepositoryAsync
object for the specified repository.Create an instance of ContainerRepositoryAsync helper type
ContainerRepositoryAsync repositoryAsync = client.getRepository(repositoryName); repositoryAsync.getProperties().subscribe(properties -> { System.out.println(properties.getName()); });
- Parameters:
repositoryName
- Name of the repository to reference.- Returns:
- A new
ContainerRepositoryAsync
for the desired repository. - Throws:
NullPointerException
- ifrepositoryName
is null.IllegalArgumentException
- ifrepositoryName
is empty.
-
getArtifact
public RegistryArtifactAsync getArtifact(String repositoryName, String tagOrDigest)
Creates a new instance ofRegistryArtifactAsync
object for the specified artifact.Create an instance of RegistryArtifactAsync helper type
RegistryArtifactAsync registryArtifactAsync = client.getArtifact(repositoryName, tagOrDigest); registryArtifactAsync.getManifestProperties().subscribe(properties -> { System.out.println(properties.getDigest()); });
- Parameters:
repositoryName
- Name of the repository to reference.tagOrDigest
- Either a tag or digest that uniquely identifies the artifact.- Returns:
- A new
RegistryArtifactAsync
for the desired repository. - Throws:
NullPointerException
- ifrepositoryName
ortagOrDigest
is null.IllegalArgumentException
- ifrepositoryName
ortagOrDigest
is empty.
-
-