public final class ContainerRepository extends Object
Instantiating Container Repository helper type.
ContainerRepository
repositoryClient = newContainerRegistryClientBuilder
() .endpoint(endpoint) .credential(credential) .buildClient().getRepository(repository);
View this
for additional ways to construct the client.
ContainerRegistryClientBuilder
Modifier and Type | Method and Description |
---|---|
void |
delete()
Delete the repository in the Azure Container Registry for the given
repository . |
com.azure.core.http.rest.Response<Void> |
deleteWithResponse(com.azure.core.util.Context context)
Delete the repository in the Azure Container Registry for the given
repository . |
RegistryArtifact |
getArtifact(String digest)
Creates a new instance of
RegistryArtifact object for the specified artifact. |
String |
getName()
Gets the Azure Container Registry service endpoint for the current instance.
|
ContainerRepositoryProperties |
getProperties()
Gets the
properties associated with the given repository . |
com.azure.core.http.rest.Response<ContainerRepositoryProperties> |
getPropertiesWithResponse(com.azure.core.util.Context context)
Gets the
properties associated with the given repository . |
String |
getRegistryEndpoint()
Gets the Azure Container Registry name for the current instance.
|
com.azure.core.http.rest.PagedIterable<ArtifactManifestProperties> |
listManifestProperties()
Fetches all the artifacts associated with the given
repository . |
com.azure.core.http.rest.PagedIterable<ArtifactManifestProperties> |
listManifestProperties(ArtifactManifestOrderBy orderBy)
Fetches all the artifacts associated with the given
repository . |
com.azure.core.http.rest.PagedIterable<ArtifactManifestProperties> |
listManifestProperties(ArtifactManifestOrderBy orderBy,
com.azure.core.util.Context context)
Fetches all the artifacts associated with the given
repository . |
ContainerRepositoryProperties |
updateProperties(ContainerRepositoryProperties repositoryProperties)
Update the repository properties
ContainerRepositoryProperties of the given repository . |
com.azure.core.http.rest.Response<ContainerRepositoryProperties> |
updatePropertiesWithResponse(ContainerRepositoryProperties repositoryProperties,
com.azure.core.util.Context context)
Update the settable properties
ContainerRepositoryProperties of the given repository . |
public String getName()
public String getRegistryEndpoint()
public com.azure.core.http.rest.Response<Void> deleteWithResponse(com.azure.core.util.Context context)
repository
.
Code Samples
Delete the repository.
Response
<Void
> response = client.deleteWithResponse(Context
.NONE);System
.out.printf("Successfully initiated delete.");
context
- Additional context that is passed through the Http pipeline during the service call.
artifacts that are deleted as part of the repository delete.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()
repository
.
Code Samples
Delete the repository.
client.delete();
System
.out.printf("Successfully initiated delete.");
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<ContainerRepositoryProperties> getPropertiesWithResponse(com.azure.core.util.Context context)
properties
associated with the given repository
.
Code Samples
Get the properties for the given repository.
Response
<ContainerRepositoryProperties
> response = client.getPropertiesWithResponse(Context
.NONE); finalContainerRepositoryProperties
properties = response.getValue();System
.out.printf("Name:%s,", properties.getName());
context
- Additional context that is passed through the Http pipeline during the service call.properties
associated with the given repository
.com.azure.core.exception.ClientAuthenticationException
- thrown if the client does not have access to modify the namespace.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.public ContainerRepositoryProperties getProperties()
properties
associated with the given repository
.
Code Samples
Get the properties for the given repository.
ContainerRepositoryProperties
properties = client.getProperties();System
.out.printf("Name:%s,", properties.getName());
properties
associated with the given repository
.com.azure.core.exception.ClientAuthenticationException
- thrown if the client does not have access to modify the namespace.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.public RegistryArtifact getArtifact(String digest)
RegistryArtifact
object for the specified artifact.digest
- Either a tag or digest that uniquely identifies the artifact.RegistryArtifact
object for the desired repository.NullPointerException
- if digest
is null.IllegalArgumentException
- if digest
is empty.public com.azure.core.http.rest.PagedIterable<ArtifactManifestProperties> listManifestProperties()
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 ContainerRepository.listManifestProperties(ArtifactManifestOrderBy, Context)
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().iterableByPage(10)
.forEach(pagedResponse -> {
pagedResponse.getValue().stream().forEach(
ManifestProperties -> System
.out.println(ManifestProperties.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's credentials do 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.PagedIterable<ArtifactManifestProperties> listManifestProperties(ArtifactManifestOrderBy orderBy)
repository
.
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 for the last updated time for the artifacts. No assumptions on the order can be made if no options are provided by the service.
Code Samples
Retrieve all artifacts associated with the given repository from the most recently updated to the last.
client.listManifestProperties(.ArtifactManifestOrderBy
.LAST_UPDATED_ON_DESCENDING).iterableByPage(10) .forEach(pagedResponse -> { pagedResponse.getValue().stream().forEach( ManifestProperties ->System
.out.println(ManifestProperties.getDigest())); });
orderBy
- the order in which the artifacts are 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's credentials do 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.PagedIterable<ArtifactManifestProperties> listManifestProperties(ArtifactManifestOrderBy orderBy, com.azure.core.util.Context context)
repository
.
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 for the last updated time for the artifacts. No assumptions on the order can be made if no options are provided by the service.
Code Samples
Retrieve all artifacts associated with the given repository from the most recently updated to the last.
client.listManifestProperties(.ArtifactManifestOrderBy
.LAST_UPDATED_ON_DESCENDING,Context
.NONE).iterableByPage(10) .forEach(pagedResponse -> { pagedResponse.getValue().stream().forEach( ManifestProperties ->System
.out.println(ManifestProperties.getDigest())); });
orderBy
- the order in which the artifacts are 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's credentials do 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<ContainerRepositoryProperties> updatePropertiesWithResponse(ContainerRepositoryProperties repositoryProperties, com.azure.core.util.Context context)
ContainerRepositoryProperties
of the given repository
.
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,Context
.NONE);
repositoryProperties
- repository properties
that need to be updated for the repository.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.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 the repositoryProperties
is null.public ContainerRepositoryProperties updateProperties(ContainerRepositoryProperties repositoryProperties)
ContainerRepositoryProperties
of the given repository
.
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);
.repositoryProperties
- repository properties
that need to be updated for the repository.properties
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 the repositoryProperties
is null.Copyright © 2021 Microsoft Corporation. All rights reserved.