Class ContainerRepositoryAsync
Instantiating an asynchronous Container Repository Helper class
ContainerRepositoryAsync repositoryAsyncClient = new ContainerRegistryClientBuilder()
.endpoint(endpoint)
.credential(credential)
.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 ofRegistryArtifactAsyncobject for the specified artifact.getName()Gets the Azure Container Registry service endpoint for the current instance.Gets thepropertiesassociated with the givenrepository.Mono<com.azure.core.http.rest.Response<ContainerRepositoryProperties>>Gets thepropertiesassociated with the givenrepository.Gets the Azure Container Registry name for the current instance.com.azure.core.http.rest.PagedFlux<ArtifactManifestProperties>Fetches all the artifacts associated with the givenrepository.com.azure.core.http.rest.PagedFlux<ArtifactManifestProperties>Fetches all the artifacts associated with the givenrepository.updateProperties(ContainerRepositoryProperties repositoryProperties) Update the repository propertiesContainerRepositoryPropertiesof the givenrepository.Mono<com.azure.core.http.rest.Response<ContainerRepositoryProperties>>updatePropertiesWithResponse(ContainerRepositoryProperties repositoryProperties) Update the repository propertiesContainerRepositoryPropertiesof 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:
com.azure.core.exception.ClientAuthenticationException- thrown if the client does not have access to the repository.com.azure.core.exception.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:
com.azure.core.exception.ClientAuthenticationException- thrown if the client does not have access to the repository.com.azure.core.exception.HttpResponseException- thrown if any other unexpected exception is returned by the service.
-
getArtifact
Creates a new instance ofRegistryArtifactAsyncobject for the specified artifact.- Parameters:
tagOrDigest- Either a tag or digest that uniquely identifies the artifact.- Returns:
- A new
RegistryArtifactAsyncobject for the desired repository. - Throws:
NullPointerException- iftagOrDigestis null.IllegalArgumentException- iftagOrDigestis 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:
PagedFluxof ManifestProperties for all the artifacts in the given repository.- Throws:
com.azure.core.exception.ClientAuthenticationException- thrown if the client does not have access to the repository.com.azure.core.exception.HttpResponseException- thrown if any other unexpected exception is returned by the service.
-
listManifestProperties
public com.azure.core.http.rest.PagedFlux<ArtifactManifestProperties> listManifestProperties(ArtifactManifestOrder order) 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:
PagedFluxof the artifacts for the given repository in the order specified by the options.- Throws:
com.azure.core.exception.ClientAuthenticationException- thrown if the client does not have access to the repository.com.azure.core.exception.HttpResponseException- thrown if any other unexpected exception is returned by the service.
-
getPropertiesWithResponse
public Mono<com.azure.core.http.rest.Response<ContainerRepositoryProperties>> getPropertiesWithResponse()Gets thepropertiesassociated 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
propertiesassociated with the givenrepository. - Throws:
com.azure.core.exception.ClientAuthenticationException- thrown if the client have access to the repository.com.azure.core.exception.ResourceNotFoundException- thrown if the repository with the given name was not found.com.azure.core.exception.HttpResponseException- thrown if any other unexpected exception is returned by the service.
-
getProperties
Gets thepropertiesassociated 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
propertiesassociated with the givenrepository. - Throws:
com.azure.core.exception.ClientAuthenticationException- thrown if the client does not have access to the repository.com.azure.core.exception.ResourceNotFoundException- thrown if the repository with the given name was not found.com.azure.core.exception.HttpResponseException- thrown if any other unexpected exception is returned by the service.
-
updatePropertiesWithResponse
public Mono<com.azure.core.http.rest.Response<ContainerRepositoryProperties>> updatePropertiesWithResponse(ContainerRepositoryProperties repositoryProperties) Update the repository propertiesContainerRepositoryPropertiesof 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 propertiesthat need to be updated for the repository.- Returns:
- The updated
repository properties. - Throws:
com.azure.core.exception.ClientAuthenticationException- thrown if the client does not have access to the repository.com.azure.core.exception.ResourceNotFoundException- thrown if the repository with the given name was not found.com.azure.core.exception.HttpResponseException- thrown if any other unexpected exception is returned by the service.NullPointerException- thrown ifrepositoryPropertiesis null.
-
updateProperties
public Mono<ContainerRepositoryProperties> updateProperties(ContainerRepositoryProperties repositoryProperties) Update the repository propertiesContainerRepositoryPropertiesof 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 propertiesthat need to be updated for the repository.- Returns:
- The completion.
- Throws:
com.azure.core.exception.ClientAuthenticationException- thrown if the client does not have access to the repository.com.azure.core.exception.ResourceNotFoundException- thrown if the repository with the given name was not found.com.azure.core.exception.HttpResponseException- thrown if any other unexpected exception is returned by the service.NullPointerException- thrown if therepositoryPropertiesis null.
-