public final class RegistryArtifact extends Object
Instantiating Registry Artifact
RegistryArtifact
registryArtifact = newContainerRegistryClientBuilder
() .endpoint(endpoint) .credential(credential) .buildClient().getArtifact(repository, digest);
Modifier and Type | Method and Description |
---|---|
void |
delete()
Deletes the registry artifact with the digest and repository associated with the instance.
|
void |
deleteTag(String tag)
Deletes the tag with the matching tag name for the given
repository . |
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 given
repository . |
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.
|
String |
getFullyQualifiedReference()
Gets the fully qualified reference for the current instance.
|
ArtifactManifestProperties |
getManifestProperties()
Gets the
properties associated with an artifact in given repository . |
com.azure.core.http.rest.Response<ArtifactManifestProperties> |
getManifestPropertiesWithResponse(com.azure.core.util.Context context)
Gets the
properties associated with an artifact in given repository . |
String |
getRegistryEndpoint()
Gets the Azure Container Registry service endpoint for the current instance.
|
String |
getRepositoryName()
Gets the repository name for the current instance.
|
ArtifactTagProperties |
getTagProperties(String tag)
Gets the tag properties associated with a given tag in the
repository . |
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 the
repository . |
com.azure.core.http.rest.PagedIterable<ArtifactTagProperties> |
listTagProperties()
Fetches all the tags associated with the given
repository . |
com.azure.core.http.rest.PagedIterable<ArtifactTagProperties> |
listTagProperties(ArtifactTagOrderBy orderBy)
Fetches all the tags associated with the given
repository . |
com.azure.core.http.rest.PagedIterable<ArtifactTagProperties> |
listTagProperties(ArtifactTagOrderBy orderBy,
com.azure.core.util.Context context)
Fetches all the tags associated with the given
repository . |
ArtifactManifestProperties |
updateManifestProperties(ArtifactManifestProperties manifestProperties)
Update the writeable properties
ArtifactTagProperties of the artifact with the given digest . |
com.azure.core.http.rest.Response<ArtifactManifestProperties> |
updateManifestPropertiesWithResponse(ArtifactManifestProperties manifestProperties,
com.azure.core.util.Context context)
Update the properties
ArtifactTagProperties of the artifact with the given digest . |
ArtifactTagProperties |
updateTagProperties(String tag,
ArtifactTagProperties tagProperties)
Update the properties
ArtifactTagProperties of the given tag . |
com.azure.core.http.rest.Response<ArtifactTagProperties> |
updateTagPropertiesWithResponse(String tag,
ArtifactTagProperties tagProperties,
com.azure.core.util.Context context)
Update the properties
ArtifactTagProperties of the given tag in repository . |
public String getRegistryEndpoint()
public String getRepositoryName()
public String getFullyQualifiedReference()
public com.azure.core.http.rest.Response<Void> deleteWithResponse(com.azure.core.util.Context context)
Code Samples
Delete the registry artifact.
client.deleteWithResponse(Context
.NONE);
context
- Additional context that is passed through the Http pipeline during the service call.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.public void delete()
Code Samples
Delete the registry artifact.
client.delete();
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.public com.azure.core.http.rest.Response<Void> deleteTagWithResponse(String tag, com.azure.core.util.Context context)
repository
.
Code Samples
Delete the tag for the given repository.
String
tag = getTag(); client.deleteTagWithResponse(tag,Context
.NONE);
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.com.azure.core.exception.ClientAuthenticationException
- thrown if the client does not have access to modify the namespace.NullPointerException
- thrown if tag
is null.IllegalArgumentException
- thrown if tag
is empty.com.azure.core.exception.HttpResponseException
- thrown if any other unexpected exception is returned by the service.public void deleteTag(String tag)
repository
.
Code Samples
Delete the tag for the given repository.
String
tag = getTag();
client.deleteTag(tag);
tag
- The name of the tag that needs to be deleted.com.azure.core.exception.ClientAuthenticationException
- thrown if the client does not have access to modify the namespace.NullPointerException
- thrown if tag
is null.IllegalArgumentException
- throws if tag
is empty.com.azure.core.exception.HttpResponseException
- thrown if any other unexpected exception is returned by the service.public com.azure.core.http.rest.Response<ArtifactManifestProperties> getManifestPropertiesWithResponse(com.azure.core.util.Context context)
properties
associated with an artifact in given repository
.
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); finalArtifactManifestProperties
properties = response.getValue();System
.out.printf("Digest:%s,", properties.getDigest());
context
- Additional context that is passed through the Http pipeline during the service call.properties
associated with the given Digest
.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.public ArtifactManifestProperties getManifestProperties()
properties
associated with an artifact in given repository
.
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());
properties
associated with the given Digest
.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.public com.azure.core.http.rest.Response<ArtifactTagProperties> getTagPropertiesWithResponse(String tag, com.azure.core.util.Context context)
repository
.
Code Samples
Retrieve the properties associated with the given tag.
.String
tag = getTag();Response
<ArtifactTagProperties
> response = client.getTagPropertiesWithResponse(tag,Context
.NONE); finalArtifactTagProperties
properties = response.getValue();System
.out.printf("Digest:%s,", properties.getDigest());
tag
- name of the tag.context
- Additional context that is passed through the Http pipeline during the service call.properties
associated with the given tag.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 if tag
is null.IllegalArgumentException
- throws if tag
is empty.com.azure.core.exception.HttpResponseException
- thrown if any other unexpected exception is returned by the service.public ArtifactTagProperties getTagProperties(String tag)
repository
.
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());
tag
- name of the tag.properties
associated with the given tag.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 if tag
is null.IllegalArgumentException
- throws if tag
is empty.com.azure.core.exception.HttpResponseException
- thrown if any other unexpected exception is returned by the service.public com.azure.core.http.rest.PagedIterable<ArtifactTagProperties> listTagProperties()
repository
.
If you would like to specify the order in which the tags are returned please
use the overload that takes in the options parameter RegistryArtifact.listTagProperties(ArtifactTagOrderBy, 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 from the most recently updated to the last.
client.listTagProperties(.ArtifactTagOrderBy
.LAST_UPDATED_ON_DESCENDING,Context
.NONE) .iterableByPage(10) .forEach(pagedResponse -> { pagedResponse.getValue() .stream() .forEach(tagProperties ->System
.out.println(tagProperties.getDigest())); });
PagedIterable
of the artifacts for the given repository in the order specified by the options.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.public com.azure.core.http.rest.PagedIterable<ArtifactTagProperties> listTagProperties(ArtifactTagOrderBy orderBy)
repository
.
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(.ArtifactTagOrderBy
.LAST_UPDATED_ON_DESCENDING) .iterableByPage(10) .forEach(pagedResponse -> { pagedResponse.getValue() .stream() .forEach(tagProperties ->System
.out.println(tagProperties.getDigest())); });
orderBy
- The order in which the tags should be returned by the service.PagedIterable
of the artifacts for the given repository in the order specified by the options.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.public com.azure.core.http.rest.PagedIterable<ArtifactTagProperties> listTagProperties(ArtifactTagOrderBy orderBy, com.azure.core.util.Context context)
repository
.
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(.ArtifactTagOrderBy
.LAST_UPDATED_ON_DESCENDING,Context
.NONE) .iterableByPage(10) .forEach(pagedResponse -> { pagedResponse.getValue() .stream() .forEach(tagProperties ->System
.out.println(tagProperties.getDigest())); });
orderBy
- 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.PagedIterable
of the artifacts for the given repository in the order specified by the options.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.public com.azure.core.http.rest.Response<ArtifactTagProperties> updateTagPropertiesWithResponse(String tag, ArtifactTagProperties tagProperties, com.azure.core.util.Context context)
ArtifactTagProperties
of the given tag in repository
.
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);
tag
- Name of the tag.tagProperties
- tagProperties
to be set.context
- Additional context that is passed through the Http pipeline during the service call.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.NullPointerException
- thrown if tag
or tagProperties
is null.IllegalArgumentException
- thrown if tag
or tagProperties
is empty.com.azure.core.exception.HttpResponseException
- thrown if any other unexpected exception is returned by the service.public ArtifactTagProperties updateTagProperties(String tag, ArtifactTagProperties tagProperties)
ArtifactTagProperties
of the given tag
.
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);
tag
- Name of the tag.tagProperties
- tagProperties
to be set.properties
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.NullPointerException
- thrown if tag
or tagProperties
is null.IllegalArgumentException
- thrown if tag
or tagProperties
is empty.com.azure.core.exception.HttpResponseException
- thrown if any other unexpected exception is returned by the service.public com.azure.core.http.rest.Response<ArtifactManifestProperties> updateManifestPropertiesWithResponse(ArtifactManifestProperties manifestProperties, com.azure.core.util.Context context)
ArtifactTagProperties
of the artifact with the given digest
.
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);
manifestProperties
- tagProperties
to be set.context
- Additional context that is passed through the Http pipeline during the service call.com.azure.core.exception.ClientAuthenticationException
- thrown if the client does not have access to repository.NullPointerException
- thrown if the manifestProperties
is null.com.azure.core.exception.ResourceNotFoundException
- thrown if the given digest
was not found.public ArtifactManifestProperties updateManifestProperties(ArtifactManifestProperties manifestProperties)
ArtifactTagProperties
of the artifact with the given digest
.
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);
.manifestProperties
- manifestProperties
to be set.properties
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.NullPointerException
- thrown if the manifestProperties
is null.Copyright © 2021 Microsoft Corporation. All rights reserved.