public final class ContainerRegistryAsyncClient extends Object
getArtifact
and getRepository
that can be used to perform operations on repository and artifacts directly.
Instantiating an asynchronous Container Registry client
ContainerRegistryAsyncClient
registryAsyncClient = newContainerRegistryClientBuilder
() .endpoint(endpoint) .credential(credential) .buildAsyncClient();
Instantiating an asynchronous Container Registry client using a custom pipeline
HttpPipeline
pipeline = newHttpPipelineBuilder
() .policies(/* add policies */) .build();ContainerRegistryAsyncClient
registryAsyncClient = newContainerRegistryClientBuilder
() .pipeline(pipeline) .endpoint(endpoint) .credential(credential) .buildAsyncClient();
View this
for additional ways to construct the client.
ContainerRegistryClientBuilder
Modifier and Type | Method and Description |
---|---|
Mono<Void> |
deleteRepository(String repositoryName)
Delete the repository identified by
repositoryName . |
Mono<com.azure.core.http.rest.Response<Void>> |
deleteRepositoryWithResponse(String repositoryName)
Delete the repository identified by 'repositoryName'.
|
RegistryArtifactAsync |
getArtifact(String repositoryName,
String digest)
Creates a new instance of
RegistryArtifactAsync object for the specified artifact. |
String |
getEndpoint()
This method returns the complete registry endpoint.
|
ContainerRepositoryAsync |
getRepository(String repositoryName)
Creates a new instance of
ContainerRepositoryAsync object for the specified repository. |
com.azure.core.http.rest.PagedFlux<String> |
listRepositoryNames()
List all the repository names in this registry.
|
public String getEndpoint()
public com.azure.core.http.rest.PagedFlux<String> listRepositoryNames()
List repository names in the registry.
client.listRepositoryNames().subscribe(name -> {
System
.out.printf("Repository Name:%s,", name);
});
com.azure.core.exception.ClientAuthenticationException
- thrown if the client's credentials do not have access to modify the namespace.public Mono<com.azure.core.http.rest.Response<Void>> deleteRepositoryWithResponse(String 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."); });
repositoryName
- Name of the repository (including the namespace).com.azure.core.exception.ClientAuthenticationException
- thrown if the client's credentials do not have access to modify the namespace.NullPointerException
- thrown if the repositoryName
is null.IllegalArgumentException
- thrown if the repositoryName
is null.public Mono<Void> deleteRepository(String repositoryName)
repositoryName
.
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."); });
repositoryName
- Name of the image (including the namespace).com.azure.core.exception.ClientAuthenticationException
- thrown if the client's credentials do not have access to modify the namespace.NullPointerException
- thrown if the repositoryName
is null.IllegalArgumentException
- thrown if repositoryName
is empty.public ContainerRepositoryAsync getRepository(String repositoryName)
ContainerRepositoryAsync
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()); });
repositoryName
- Name of the repository to reference.ContainerRepositoryAsync
for the desired repository.NullPointerException
- if repositoryName
is null.IllegalArgumentException
- if repositoryName
is empty.public RegistryArtifactAsync getArtifact(String repositoryName, String digest)
RegistryArtifactAsync
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()); });
repositoryName
- Name of the repository to reference.digest
- Either a tag or digest that uniquely identifies the artifact.RegistryArtifactAsync
for the desired repository.NullPointerException
- if repositoryName
or digest
is null.IllegalArgumentException
- if repositoryName
or digest
is empty.Copyright © 2021 Microsoft Corporation. All rights reserved.