Class RegistryArtifact
Instantiating Registry Artifact
RegistryArtifact registryArtifact = new ContainerRegistryClientBuilder()
.endpoint(endpoint)
.credential(credential)
.buildClient().getArtifact(repository, digest);
-
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()Deletes the registry artifact with the digest and repository associated with the instance.voidDeletes the tag with the matching tag name for the givenrepository.com.azure.core.http.rest.Response<Void>deleteTagWithResponse(String tag, com.azure.core.util.Context context) Deletes the tag with the matching tag name for the givenrepository.com.azure.core.http.rest.Response<Void>deleteWithResponse(com.azure.core.util.Context context) Deletes the registry artifact with the digest and repository associated with the instance.Gets the fully qualified reference for the current instance.Gets thepropertiesassociated with an artifact in givenrepository.com.azure.core.http.rest.Response<ArtifactManifestProperties>getManifestPropertiesWithResponse(com.azure.core.util.Context context) Gets thepropertiesassociated with an artifact in givenrepository.Gets the Azure Container Registry service endpoint for the current instance.Gets the repository name for the current instance.getTagProperties(String tag) Gets the tag properties associated with a given tag in therepository.com.azure.core.http.rest.Response<ArtifactTagProperties>getTagPropertiesWithResponse(String tag, com.azure.core.util.Context context) Gets the tag properties associated with a given tag in therepository.com.azure.core.http.rest.PagedIterable<ArtifactTagProperties>Fetches all the tags associated with the givenrepository.com.azure.core.http.rest.PagedIterable<ArtifactTagProperties>Fetches all the tags associated with the givenrepository.com.azure.core.http.rest.PagedIterable<ArtifactTagProperties>listTagProperties(ArtifactTagOrder order, com.azure.core.util.Context context) Fetches all the tags associated with the givenrepository.updateManifestProperties(ArtifactManifestProperties manifestProperties) Update the writeable propertiesArtifactTagPropertiesof the artifact with the givendigest.com.azure.core.http.rest.Response<ArtifactManifestProperties>updateManifestPropertiesWithResponse(ArtifactManifestProperties manifestProperties, com.azure.core.util.Context context) Update the propertiesArtifactTagPropertiesof the artifact with the givendigest.updateTagProperties(String tag, ArtifactTagProperties tagProperties) Update the propertiesArtifactTagPropertiesof the giventag.com.azure.core.http.rest.Response<ArtifactTagProperties>updateTagPropertiesWithResponse(String tag, ArtifactTagProperties tagProperties, com.azure.core.util.Context context) Update the propertiesArtifactTagPropertiesof the given tag inrepository.
-
Method Details
-
deleteWithResponse
public com.azure.core.http.rest.Response<Void> deleteWithResponse(com.azure.core.util.Context context) Deletes the registry artifact with the digest and repository associated with the instance.Code Samples
Delete the registry artifact.
client.deleteWithResponse(Context.NONE);
- Parameters:
context- Additional context that is passed through the Http pipeline during the service call.- Returns:
- A REST response containing the result of the service call.
- 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 void delete()Deletes the registry artifact with the digest and repository associated with the instance.Code Samples
Delete the registry artifact.
client.delete();
- Throws:
com.azure.core.exception.ClientAuthenticationException- thrown if the client does not have access to modify the namespace.com.azure.core.exception.HttpResponseException- thrown if any other unexpected exception is returned by the service.
-
deleteTagWithResponse
public com.azure.core.http.rest.Response<Void> deleteTagWithResponse(String tag, com.azure.core.util.Context context) 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, Context.NONE);
- Parameters:
tag- The name of the tag that needs to be deleted.context- Additional context that is passed through the Http pipeline during the service call.- Returns:
- A REST response containing the result of the service call.
- Throws:
com.azure.core.exception.ClientAuthenticationException- thrown if the client does not have access to modify the namespace.NullPointerException- thrown iftagis null.IllegalArgumentException- thrown iftagis empty.com.azure.core.exception.HttpResponseException- thrown if any other unexpected exception is returned by the service.
-
deleteTag
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);
- Parameters:
tag- The name of the tag that needs to be deleted.- Throws:
com.azure.core.exception.ClientAuthenticationException- thrown if the client does not have access to modify the namespace.NullPointerException- thrown iftagis null.IllegalArgumentException- throws iftagis empty.com.azure.core.exception.HttpResponseException- thrown if any other unexpected exception is returned by the service.
-
getManifestPropertiesWithResponse
public com.azure.core.http.rest.Response<ArtifactManifestProperties> getManifestPropertiesWithResponse(com.azure.core.util.Context context) Gets thepropertiesassociated 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.
Response<ArtifactManifestProperties> response = client.getManifestPropertiesWithResponse( Context.NONE); final ArtifactManifestProperties properties = response.getValue(); System.out.printf("Digest:%s,", properties.getDigest());- Parameters:
context- Additional context that is passed through the Http pipeline during the service call.- Returns:
- A REST response containing
propertiesassociated with the givenDigest. - Throws:
com.azure.core.exception.ClientAuthenticationException- thrown if the client's credentials do not have access to modify the namespace.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
Gets thepropertiesassociated 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 registry artifact properties for a given tag or digest.
ArtifactManifestProperties properties = client.getManifestProperties(); System.out.printf("Digest:%s,", properties.getDigest());- Returns:
- The
propertiesassociated with the givenDigest. - Throws:
com.azure.core.exception.ClientAuthenticationException- thrown if the client's credentials do not have access to modify the namespace.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 com.azure.core.http.rest.Response<ArtifactTagProperties> getTagPropertiesWithResponse(String tag, com.azure.core.util.Context context) Gets the tag properties associated with a given tag in therepository.Code Samples
Retrieve the properties associated with the given tag.
String tag = getTag(); Response<ArtifactTagProperties> response = client.getTagPropertiesWithResponse(tag, Context.NONE); final ArtifactTagProperties properties = response.getValue(); System.out.printf("Digest:%s,", properties.getDigest());- Parameters:
tag- name of the tag.context- Additional context that is passed through the Http pipeline during the service call.- Returns:
- A REST response with the
propertiesassociated 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.NullPointerException- thrown iftagis null.IllegalArgumentException- throws iftagis empty.com.azure.core.exception.HttpResponseException- thrown if any other unexpected exception is returned by the service.
-
getTagProperties
Gets the tag properties associated with a given tag in therepository.Code Samples
Retrieve the properties associated with the given tag.
String tag = getTag(); ArtifactTagProperties properties = client.getTagProperties(tag); System.out.printf("Digest:%s,", properties.getDigest());- Parameters:
tag- name of the tag.- Returns:
- The
propertiesassociated 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.NullPointerException- thrown iftagis null.IllegalArgumentException- throws iftagis empty.com.azure.core.exception.HttpResponseException- thrown if any other unexpected exception is returned by the service.
-
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, Context)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().iterableByPage(10).forEach(pagedResponse -> { pagedResponse.getValue().stream().forEach( tagProperties -> System.out.println(tagProperties.getDigest())); });- Returns:
PagedIterableof 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.PagedIterable<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) .iterableByPage(10) .forEach(pagedResponse -> { pagedResponse.getValue() .stream() .forEach(tagProperties -> System.out.println(tagProperties.getDigest())); });- Parameters:
order- The order in which the tags should be returned by the service.- Returns:
PagedIterableof 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.PagedIterable<ArtifactTagProperties> listTagProperties(ArtifactTagOrder order, com.azure.core.util.Context context) 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, Context.NONE) .iterableByPage(10) .forEach(pagedResponse -> { pagedResponse.getValue() .stream() .forEach(tagProperties -> System.out.println(tagProperties.getDigest())); });- Parameters:
order- The order in which the tags should be returned by the service.context- Additional context that is passed through the Http pipeline during the service call.- Returns:
PagedIterableof 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 com.azure.core.http.rest.Response<ArtifactTagProperties> updateTagPropertiesWithResponse(String tag, ArtifactTagProperties tagProperties, com.azure.core.util.Context context) Update the propertiesArtifactTagPropertiesof the given tag inrepository. 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 = getArtifactTagProperties(); String tag = getTag(); client.updateTagPropertiesWithResponse(tag, properties, Context.NONE);
- Parameters:
tag- Name of the tag.tagProperties-tagPropertiesto be set.context- Additional context that is passed through the Http pipeline during the service call.- 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 giventagwas not found.NullPointerException- thrown iftagortagPropertiesis null.IllegalArgumentException- thrown iftagortagPropertiesis empty.com.azure.core.exception.HttpResponseException- thrown if any other unexpected exception is returned by the service.
-
updateTagProperties
Update the propertiesArtifactTagPropertiesof the giventag. 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 = getArtifactTagProperties(); String tag = getTag(); client.updateTagProperties(tag, properties);
- Parameters:
tag- Name of the tag.tagProperties-tagPropertiesto be set.- Returns:
- The updated
properties - Throws:
com.azure.core.exception.ClientAuthenticationException- thrown if the client does not have access to repository.com.azure.core.exception.ResourceNotFoundException- thrown if the giventagwas not found.NullPointerException- thrown iftagortagPropertiesis null.IllegalArgumentException- thrown iftagortagPropertiesis empty.com.azure.core.exception.HttpResponseException- thrown if any other unexpected exception is returned by the service.
-
updateManifestPropertiesWithResponse
public com.azure.core.http.rest.Response<ArtifactManifestProperties> updateManifestPropertiesWithResponse(ArtifactManifestProperties manifestProperties, com.azure.core.util.Context context) Update the propertiesArtifactTagPropertiesof 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 artifact.
ArtifactManifestProperties properties = getArtifactManifestProperties(); client.updateManifestPropertiesWithResponse(properties, Context.NONE);
- Parameters:
manifestProperties-tagPropertiesto be set.context- Additional context that is passed through the Http pipeline during the service call.- Returns:
- A REST response for the completion.
- Throws:
com.azure.core.exception.ClientAuthenticationException- thrown if the client does not have access to repository.NullPointerException- thrown if themanifestPropertiesis null.com.azure.core.exception.ResourceNotFoundException- thrown if the givendigestwas not found.
-
updateManifestProperties
public ArtifactManifestProperties updateManifestProperties(ArtifactManifestProperties manifestProperties) Update the writeable propertiesArtifactTagPropertiesof 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);
- Parameters:
manifestProperties-manifestPropertiesto be set.- Returns:
- The updated
properties - Throws:
com.azure.core.exception.ClientAuthenticationException- thrown if the client does not have access to repository.com.azure.core.exception.ResourceNotFoundException- thrown if the givendigestwas not found.NullPointerException- thrown if themanifestPropertiesis null.
-
getRegistryEndpoint
Gets the Azure Container Registry service endpoint for the current instance.- Returns:
- The service endpoint for the current instance.
-
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
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.
-