Class RegistryArtifactAsync
- java.lang.Object
-
- com.azure.containers.containerregistry.RegistryArtifactAsync
-
public final class RegistryArtifactAsync extends Object
This class provides a helper type that contains all the operations for artifacts in a given repository.Instantiating an asynchronous RegistryArtifact helper.
RegistryArtifactAsync registryArtifactAsync = new ContainerRegistryClientBuilder() .endpoint(endpoint) .credential(credential) .audience(ContainerRegistryAudience.AZURE_RESOURCE_MANAGER_PUBLIC_CLOUD) .buildAsyncClient().getArtifact(repository, digest);
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>
delete()
Deletes the registry artifact with the matching digest in the givenrespository.
Mono<Void>
deleteTag(String tag)
Deletes the tag with the matching tag name for the givenrepository
.Mono<com.azure.core.http.rest.Response<Void>>
deleteTagWithResponse(String tag)
Deletes the tag with the matching tag name for the givenrepository
.Mono<com.azure.core.http.rest.Response<Void>>
deleteWithResponse()
Deletes the registry artifact with the matching digest in the givenrespository.
String
getFullyQualifiedReference()
Gets the fully qualified reference for the current instance.Mono<ArtifactManifestProperties>
getManifestProperties()
Gets theproperties
associated with an artifact in givenrepository
.Mono<com.azure.core.http.rest.Response<ArtifactManifestProperties>>
getManifestPropertiesWithResponse()
Gets theproperties
associated with an artifact in givenrepository
.String
getRegistryEndpoint()
Gets the Azure Container Registry service endpoint for the current instance.String
getRepositoryName()
Gets the repository name for the current instance.Mono<ArtifactTagProperties>
getTagProperties(String tag)
Gets the tag properties associated with a given tag in therepository
.Mono<com.azure.core.http.rest.Response<ArtifactTagProperties>>
getTagPropertiesWithResponse(String tag)
Gets the tag properties associated with a given tag in therepository
.com.azure.core.http.rest.PagedFlux<ArtifactTagProperties>
listTagProperties()
Fetches all the tags associated with the givenrepository
.com.azure.core.http.rest.PagedFlux<ArtifactTagProperties>
listTagProperties(ArtifactTagOrder order)
Fetches all the tags associated with the givenrepository
.Mono<ArtifactManifestProperties>
updateManifestProperties(ArtifactManifestProperties manifestProperties)
Update the propertiesArtifactManifestProperties
of the artifact with the givendigest
.Mono<com.azure.core.http.rest.Response<ArtifactManifestProperties>>
updateManifestPropertiesWithResponse(ArtifactManifestProperties manifestProperties)
Update the propertiesArtifactManifestProperties
of the artifact with the givendigest
.Mono<ArtifactTagProperties>
updateTagProperties(String tag, ArtifactTagProperties tagProperties)
Update the propertiesArtifactTagProperties
of the tag with the given nametag
.Mono<com.azure.core.http.rest.Response<ArtifactTagProperties>>
updateTagPropertiesWithResponse(String tag, ArtifactTagProperties tagProperties)
Update the propertiesArtifactTagProperties
of the tag with the given nametag
..
-
-
-
Method Detail
-
getRegistryEndpoint
public String getRegistryEndpoint()
Gets the Azure Container Registry service endpoint for the current instance.- Returns:
- The service endpoint for the current instance.
-
getFullyQualifiedReference
public String getFullyQualifiedReference()
Gets the fully qualified reference for the current instance. The fully qualifiedName is of the form 'registryName/repositoryName@digest' or 'registryName/repositoryName:tag' based on the docker naming convention and whether tag or digest was supplied to the constructor.- Returns:
- Fully qualified reference of the current instance.
-
getRepositoryName
public String getRepositoryName()
Gets the repository name for the current instance. Gets the repository name for the current instance.- Returns:
- Name of the repository for the current instance.
-
deleteWithResponse
public Mono<com.azure.core.http.rest.Response<Void>> deleteWithResponse()
Deletes the registry artifact with the matching digest in the givenrespository.
Code Samples
Delete the registry artifact.
client.deleteWithResponse().subscribe();
- Returns:
- A REST response with completion signal.
- 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
public Mono<Void> delete()
Deletes the registry artifact with the matching digest in the givenrespository.
Code Samples
Delete the registry artifact.
client.delete().subscribe();
- Returns:
- the completion.
- 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.
-
deleteTagWithResponse
public Mono<com.azure.core.http.rest.Response<Void>> deleteTagWithResponse(String tag)
Deletes the tag with the matching tag name for the givenrepository
.Code Samples
Delete the tag for the given repository.
String tag = getTag(); client.deleteTagWithResponse(tag).subscribe();
- Parameters:
tag
- The name of the 'tag' that uniquely identifies the 'tag' that needs to be deleted.- Returns:
- A REST response with completion signal.
- Throws:
com.azure.core.exception.ClientAuthenticationException
- thrown if the client does not have access to the repository.NullPointerException
- thrown iftag
is null.IllegalArgumentException
- thrown iftag
is empty.com.azure.core.exception.HttpResponseException
- thrown if any other unexpected exception is returned by the service.
-
deleteTag
public Mono<Void> deleteTag(String tag)
Deletes the tag with the matching tag name for the givenrepository
.Code Samples
Delete the tag for the given repository.
String tag = getTag(); client.deleteTag(tag).subscribe();
- Parameters:
tag
- The name of the tag that uniquely identifies the tag that needs to be deleted.- Returns:
- The completion.
- Throws:
com.azure.core.exception.ClientAuthenticationException
- thrown if the client does not have access to the repository.NullPointerException
- thrown iftag
is null.IllegalArgumentException
- thrown if thetag
is empty.com.azure.core.exception.HttpResponseException
- thrown if any other unexpected exception is returned by the service.
-
getManifestPropertiesWithResponse
public Mono<com.azure.core.http.rest.Response<ArtifactManifestProperties>> getManifestPropertiesWithResponse()
Gets theproperties
associated with an artifact in givenrepository
.This method can take in both a digest as well as a tag.
In case a tag is provided it calls the service to get the digest associated with the given tag.Code Samples
Get the properties for the given repository.
client.getManifestPropertiesWithResponse() .subscribe(response -> { final ArtifactManifestProperties properties = response.getValue(); System.out.printf("Digest:%s,", properties.getDigest()); });
- Returns:
- A REST response containing
properties
associated with the givenDigest
. - 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 given digest was not found.com.azure.core.exception.HttpResponseException
- thrown if any other unexpected exception is returned by the service.
-
getManifestProperties
public Mono<ArtifactManifestProperties> getManifestProperties()
Gets theproperties
associated with an artifact in givenrepository
.This method can take in both a digest as well as a tag.
In case a tag is provided it calls the service to get the digest associated with the given tag.Code Samples
Get the properties for the given repository.
client.getManifestProperties() .subscribe(properties -> { System.out.printf("Digest:%s,", properties.getDigest()); });
- Returns:
- The
properties
associated with the givenDigest
. - 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 given digest was not found.com.azure.core.exception.HttpResponseException
- thrown if any other unexpected exception is returned by the service.
-
getTagPropertiesWithResponse
public Mono<com.azure.core.http.rest.Response<ArtifactTagProperties>> getTagPropertiesWithResponse(String tag)
Gets the tag properties associated with a given tag in therepository
.Code Samples
Retrieve the properties associated with the given tag.
String tag = getTag(); client.getTagPropertiesWithResponse(tag).subscribe(response -> { final ArtifactTagProperties properties = response.getValue(); System.out.printf("Digest:%s,", properties.getDigest()); });
- Parameters:
tag
- name of the tag that uniquely identifies a given tag.- Returns:
- A REST response with the
properties
associated with the given tag. - 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 given tag was not found.com.azure.core.exception.HttpResponseException
- thrown if any other unexpected exception is returned by the service.NullPointerException
- thrown if thetag
is null.IllegalArgumentException
- thrown if thetag
is empty.
-
getTagProperties
public Mono<ArtifactTagProperties> getTagProperties(String tag)
Gets the tag properties associated with a given tag in therepository
.Code Samples
Retrieve the properties associated with the given tag.
String tag = getTag(); client.getTagProperties(tag).subscribe(properties -> { System.out.printf("Digest:%s,", properties.getDigest()); });
- Parameters:
tag
- name of the tag that uniquely identifies a given tag.- Returns:
- The
properties
associated with the given tag. - 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 given tag was not found.com.azure.core.exception.HttpResponseException
- thrown if any other unexpected exception is returned by the service.NullPointerException
- thrown if thetag
is null.IllegalArgumentException
- thrown if thetag
is empty.
-
listTagProperties
public com.azure.core.http.rest.PagedFlux<ArtifactTagProperties> listTagProperties()
Fetches all the tags 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
listTagProperties(ArtifactTagOrder)
listTagProperties} No assumptions on the order can be made if no options are provided to the service.Code Samples
Retrieve all the tags associated with the given repository.
client.listTagProperties().byPage(10) .subscribe(tagPropertiesPagedResponse -> { tagPropertiesPagedResponse.getValue().stream().forEach( tagProperties -> System.out.println(tagProperties.getDigest())); });
- Returns:
PagedFlux
of 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.
-
listTagProperties
public com.azure.core.http.rest.PagedFlux<ArtifactTagProperties> listTagProperties(ArtifactTagOrder order)
Fetches all the tags associated with the givenrepository
.The method supports options to select the order in which the tags are returned by the service. Currently the service supports an ascending or descending order based on the last updated time of the tag. No assumptions on the order can be made if no options are provided to the service.
Code Samples
Retrieve all the tags associated with the given repository from the most recently updated to the last.
client.listTagProperties(ArtifactTagOrder.LAST_UPDATED_ON_DESCENDING) .byPage(10) .subscribe(tagPropertiesPagedResponse -> { tagPropertiesPagedResponse.getValue() .stream() .forEach(tagProperties -> System.out.println(tagProperties.getDigest())); });
- Parameters:
order
- The order in which the tags should be returned by the service.- Returns:
PagedFlux
of 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.
-
updateTagPropertiesWithResponse
public Mono<com.azure.core.http.rest.Response<ArtifactTagProperties>> updateTagPropertiesWithResponse(String tag, ArtifactTagProperties tagProperties)
Update the propertiesArtifactTagProperties
of the tag with the given nametag
.. These properties set whether the given tag can be updated, deleted and retrieved.Code Samples
Update the writeable properties of a given tag.
ArtifactTagProperties properties = getTagProperties(); String tag = getTag(); client.updateTagPropertiesWithResponse(tag, properties).subscribe();
- Parameters:
tag
- Name of the tag that uniquely identifies it.tagProperties
-value
to be set.- Returns:
- A REST response for completion.
- Throws:
com.azure.core.exception.ClientAuthenticationException
- thrown if the client does not have access to repository.com.azure.core.exception.ResourceNotFoundException
- thrown if the given tag was not found.com.azure.core.exception.HttpResponseException
- thrown if any other unexpected exception is returned by the service.NullPointerException
- thrown if thetag
is null.IllegalArgumentException
- thrown if thetag
is empty.NullPointerException
- thrown iftagProperties
is null.
-
updateTagProperties
public Mono<ArtifactTagProperties> updateTagProperties(String tag, ArtifactTagProperties tagProperties)
Update the propertiesArtifactTagProperties
of the tag with the given nametag
. These properties set whether the given tag can be updated, deleted and retrieved.Code Samples
Update the writeable properties of a given tag.
ArtifactTagProperties properties = getTagProperties(); String tag = getTag(); client.updateTagPropertiesWithResponse(tag, properties).subscribe();
- Parameters:
tag
- Name of the tag that uniquely identifies it.tagProperties
-tagProperties
to be set.- Returns:
- The completion.
- Throws:
com.azure.core.exception.ClientAuthenticationException
- thrown if the client does not have access to repository.com.azure.core.exception.ResourceNotFoundException
- thrown if the given tag was not found.com.azure.core.exception.HttpResponseException
- thrown if any other unexpected exception is returned by the service.NullPointerException
- thrown if thetag
is null.IllegalArgumentException
- thrown if thetag
is empty.NullPointerException
- thrown iftagProperties
is null.
-
updateManifestPropertiesWithResponse
public Mono<com.azure.core.http.rest.Response<ArtifactManifestProperties>> updateManifestPropertiesWithResponse(ArtifactManifestProperties manifestProperties)
Update the propertiesArtifactManifestProperties
of the artifact with the givendigest
. These properties set whether the given manifest can be updated, deleted and retrieved.Code Samples
Update the writeable properties of a given manifest.
ArtifactManifestProperties properties = getArtifactManifestProperties(); client.updateManifestPropertiesWithResponse(properties).subscribe();
- Parameters:
manifestProperties
-manifestProperties
to be set.- Returns:
- A REST response for the completion.
- Throws:
com.azure.core.exception.ClientAuthenticationException
- thrown if the client does not have access to repository.com.azure.core.exception.ResourceNotFoundException
- thrown if the given digest was not found.com.azure.core.exception.HttpResponseException
- thrown if any other unexpected exception is returned by the service.NullPointerException
- thrown if themanifestProperties
is null.
-
updateManifestProperties
public Mono<ArtifactManifestProperties> updateManifestProperties(ArtifactManifestProperties manifestProperties)
Update the propertiesArtifactManifestProperties
of the artifact with the givendigest
. These properties set whether the given manifest can be updated, deleted and retrieved.Code Samples
Update the writeable properties of a given manifest.
ArtifactManifestProperties properties = getArtifactManifestProperties(); client.updateManifestProperties(properties).subscribe();
- Parameters:
manifestProperties
-manifestProperties
to be set.- Returns:
- The completion.
- Throws:
com.azure.core.exception.ClientAuthenticationException
- thrown if the client does not have access to repository.com.azure.core.exception.ResourceNotFoundException
- thrown if the given digest was not found.com.azure.core.exception.HttpResponseException
- thrown if any other unexpected exception is returned by the service.NullPointerException
- thrown if themanifestProperties
is null.
-
-