Class ContainerRepositoryAsync
Instantiating an asynchronous Container Repository Helper class
ContainerRepositoryAsync repositoryAsyncClient = new ContainerRegistryClientBuilder() .endpoint(endpoint) .credential(credential) .audience(ContainerRegistryAudience.AZURE_RESOURCE_MANAGER_PUBLIC_CLOUD) .buildAsyncClient() .getRepository(repository);
-
Method Summary
Modifier and TypeMethodDescriptiondelete()
Delete the repository in the Azure Container Registry for the givenrepository
.Delete the repository in the Azure Container Registry for the givenrepository
.getArtifact
(String tagOrDigest) Creates a new instance ofRegistryArtifactAsync
object for the specified artifact.getName()
Gets the Azure Container Registry service endpoint for the current instance.Gets theproperties
associated with the givenrepository
.Gets theproperties
associated with the givenrepository
.Gets the Azure Container Registry name for the current instance.Fetches all the artifacts associated with the givenrepository
.Fetches all the artifacts associated with the givenrepository
.updateProperties
(ContainerRepositoryProperties repositoryProperties) Update the repository propertiesContainerRepositoryProperties
of the givenrepository
.updatePropertiesWithResponse
(ContainerRepositoryProperties repositoryProperties) Update the repository propertiesContainerRepositoryProperties
of the givenrepository
.
-
Method Details
-
getName
Gets the Azure Container Registry service endpoint for the current instance.- Returns:
- The service endpoint for the current instance.
-
getRegistryEndpoint
Gets the Azure Container Registry name for the current instance.- Returns:
- Return the registry name.
-
deleteWithResponse
Delete the repository in the Azure Container Registry for the givenrepository
.Code Samples
Delete the repository.
client.deleteWithResponse().subscribe(response -> { System.out.printf("Successfully initiated delete of the repository."); }, error -> { System.out.println("Failed to initiate a delete of the repository."); });
- Returns:
- A REST response containing the result of the repository delete operation. It returns the count of the tags and artifacts that are deleted as part of the repository delete.
- Throws:
ClientAuthenticationException
- thrown if the client does not have access to the repository.HttpResponseException
- thrown if any other unexpected exception is returned by the service.
-
delete
Delete the repository in the Azure Container Registry for the givenrepository
.Code Samples
Delete the repository.
client.delete().subscribe(response -> { System.out.printf("Successfully initiated delete of the repository."); }, error -> { System.out.println("Failed to initiate a delete of the repository."); });
- Returns:
- It returns the count of the tags and artifacts that are deleted as part of the repository delete.
- Throws:
ClientAuthenticationException
- thrown if the client does not have access to the repository.HttpResponseException
- thrown if any other unexpected exception is returned by the service.
-
getArtifact
Creates a new instance ofRegistryArtifactAsync
object for the specified artifact.- Parameters:
tagOrDigest
- Either a tag or digest that uniquely identifies the artifact.- Returns:
- A new
RegistryArtifactAsync
object for the desired repository. - Throws:
NullPointerException
- iftagOrDigest
is null.IllegalArgumentException
- iftagOrDigest
is empty.
-
listManifestProperties
Fetches all the artifacts associated with the givenrepository
.If you would like to specify the order in which the tags are returned please use the overload that takes in the options parameter
listManifestProperties(ArtifactManifestOrder)
listManifestProperties} No assumptions on the order can be made if no options are provided to the service.Code Samples
Retrieve all artifacts associated with the given repository.
client.listManifestProperties().byPage(10) .subscribe(ManifestPropertiesPagedResponse -> { ManifestPropertiesPagedResponse.getValue().stream().forEach( ManifestProperties -> System.out.println(ManifestProperties.getDigest())); });
- Returns:
PagedFlux
of ManifestProperties for all the artifacts in the given repository.- Throws:
ClientAuthenticationException
- thrown if the client does not have access to the repository.HttpResponseException
- thrown if any other unexpected exception is returned by the service.
-
listManifestProperties
Fetches all the artifacts associated with the givenrepository
.The method supports options to select the order in which the artifacts are returned by the service. Currently the service supports an ascending or descending order based on the last updated time for the artifacts. No assumptions on the order can be made if no options are provided to the service.
Code Samples
Retrieve all artifacts associated with the given repository from the most recently updated to the last.
client.listManifestProperties(ArtifactManifestOrder.LAST_UPDATED_ON_DESCENDING).byPage(10) .subscribe(ManifestPropertiesPagedResponse -> { ManifestPropertiesPagedResponse.getValue().stream().forEach( ManifestProperties -> System.out.println(ManifestProperties.getDigest())); });
- Parameters:
order
- The order in which the artifacts are returned by the service.- Returns:
PagedFlux
of the artifacts for the given repository in the order specified by the options.- Throws:
ClientAuthenticationException
- thrown if the client does not have access to the repository.HttpResponseException
- thrown if any other unexpected exception is returned by the service.
-
getPropertiesWithResponse
Gets theproperties
associated with the givenrepository
.Code Samples
Get the properties for the given repository.
client.getPropertiesWithResponse().subscribe(response -> { final ContainerRepositoryProperties properties = response.getValue(); System.out.printf("Name:%s,", properties.getName()); });
- Returns:
- A REST response with the
properties
associated with the givenrepository
. - Throws:
ClientAuthenticationException
- thrown if the client have access to the repository.ResourceNotFoundException
- thrown if the repository with the given name was not found.HttpResponseException
- thrown if any other unexpected exception is returned by the service.
-
getProperties
Gets theproperties
associated with the givenrepository
.Code Samples
Get the properties for the given repository.
client.getProperties().subscribe(response -> { System.out.printf("Name:%s,", response.getName()); });
- Returns:
- The
properties
associated with the givenrepository
. - Throws:
ClientAuthenticationException
- thrown if the client does not have access to the repository.ResourceNotFoundException
- thrown if the repository with the given name was not found.HttpResponseException
- thrown if any other unexpected exception is returned by the service.
-
updatePropertiesWithResponse
public Mono<Response<ContainerRepositoryProperties>> updatePropertiesWithResponse(ContainerRepositoryProperties repositoryProperties) Update the repository propertiesContainerRepositoryProperties
of the givenrepository
. These properties set the update, delete and retrieve options of the repository.Code Samples
Update the writeable properties for the given repository.
ContainerRepositoryProperties properties = getRepositoryProperties(); client.updatePropertiesWithResponse(properties).subscribe();
- Parameters:
repositoryProperties
-repository properties
that need to be updated for the repository.- Returns:
- The updated
repository properties
. - Throws:
ClientAuthenticationException
- thrown if the client does not have access to the repository.ResourceNotFoundException
- thrown if the repository with the given name was not found.HttpResponseException
- thrown if any other unexpected exception is returned by the service.NullPointerException
- thrown ifrepositoryProperties
is null.
-
updateProperties
public Mono<ContainerRepositoryProperties> updateProperties(ContainerRepositoryProperties repositoryProperties) Update the repository propertiesContainerRepositoryProperties
of the givenrepository
. These properties set the update, delete and retrieve options of the repository.Code Samples
Update the writeable properties for the given repository.
ContainerRepositoryProperties properties = getRepositoryProperties(); client.updateProperties(properties).subscribe();
- Parameters:
repositoryProperties
-writeable properties
that need to be updated for the repository.- Returns:
- The completion.
- Throws:
ClientAuthenticationException
- thrown if the client does not have access to the repository.ResourceNotFoundException
- thrown if the repository with the given name was not found.HttpResponseException
- thrown if any other unexpected exception is returned by the service.NullPointerException
- thrown if therepositoryProperties
is null.
-