Class ContainerRepository
Instantiating Container Repository helper type.
ContainerRepository repositoryClient = new ContainerRegistryClientBuilder()
.endpoint(endpoint)
.credential(credential)
.buildClient().getRepository(repository);
View this for additional ways to construct the client.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()Delete the repository in the Azure Container Registry for the givenrepository.com.azure.core.http.rest.Response<Void>deleteWithResponse(com.azure.core.util.Context context) Delete the repository in the Azure Container Registry for the givenrepository.getArtifact(String tagOrDigest) Creates a new instance ofRegistryArtifactobject for the specified artifact.getName()Gets the Azure Container Registry service endpoint for the current instance.Gets thepropertiesassociated with the givenrepository.com.azure.core.http.rest.Response<ContainerRepositoryProperties>getPropertiesWithResponse(com.azure.core.util.Context context) Gets thepropertiesassociated with the givenrepository.Gets the Azure Container Registry name for the current instance.com.azure.core.http.rest.PagedIterable<ArtifactManifestProperties>Fetches all the artifacts associated with the givenrepository.com.azure.core.http.rest.PagedIterable<ArtifactManifestProperties>Fetches all the artifacts associated with the givenrepository.com.azure.core.http.rest.PagedIterable<ArtifactManifestProperties>listManifestProperties(ArtifactManifestOrder order, com.azure.core.util.Context context) Fetches all the artifacts associated with the givenrepository.updateProperties(ContainerRepositoryProperties repositoryProperties) Update the repository propertiesContainerRepositoryPropertiesof the givenrepository.com.azure.core.http.rest.Response<ContainerRepositoryProperties>updatePropertiesWithResponse(ContainerRepositoryProperties repositoryProperties, com.azure.core.util.Context context) Update the settable 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
public com.azure.core.http.rest.Response<Void> deleteWithResponse(com.azure.core.util.Context context) Delete the repository in the Azure Container Registry for the givenrepository.Code Samples
Delete the repository.
Response<Void> response = client.deleteWithResponse(Context.NONE); System.out.printf("Successfully initiated delete.");- Parameters:
context- Additional context that is passed through the Http pipeline during the service call. artifacts that are deleted as part of the repository delete.- Returns:
- A void response for 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.
-
delete
public void delete()Delete the repository in the Azure Container Registry for the givenrepository.Code Samples
Delete the repository.
client.delete(); System.out.printf("Successfully initiated 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.
-
getPropertiesWithResponse
public com.azure.core.http.rest.Response<ContainerRepositoryProperties> getPropertiesWithResponse(com.azure.core.util.Context context) Gets thepropertiesassociated with the givenrepository.Code Samples
Get the properties for the given repository.
Response<ContainerRepositoryProperties> response = client.getPropertiesWithResponse(Context.NONE); final ContainerRepositoryProperties properties = response.getValue(); System.out.printf("Name:%s,", properties.getName());- Parameters:
context- Additional context that is passed through the Http pipeline during the service call.- Returns:
- A REST response with the
propertiesassociated with the givenrepository. - Throws:
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.
-
getProperties
Gets thepropertiesassociated with the givenrepository.Code Samples
Get the properties for the given repository.
ContainerRepositoryProperties properties = client.getProperties(); System.out.printf("Name:%s,", properties.getName());- Returns:
- The
propertiesassociated with the givenrepository. - Throws:
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.
-
getArtifact
Creates a new instance ofRegistryArtifactobject for the specified artifact.- Parameters:
tagOrDigest- Either a tag or digest that uniquely identifies the artifact.- Returns:
- A new
RegistryArtifactobject 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, 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())); });- 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'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.
-
listManifestProperties
public com.azure.core.http.rest.PagedIterable<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 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(ArtifactManifestOrder.LAST_UPDATED_ON_DESCENDING).iterableByPage(10) .forEach(pagedResponse -> { pagedResponse.getValue().stream().forEach( ManifestProperties -> System.out.println(ManifestProperties.getDigest())); });- Parameters:
order- the order in which the artifacts are 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'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.
-
listManifestProperties
public com.azure.core.http.rest.PagedIterable<ArtifactManifestProperties> listManifestProperties(ArtifactManifestOrder order, com.azure.core.util.Context context) 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 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(ArtifactManifestOrder.LAST_UPDATED_ON_DESCENDING, Context.NONE).iterableByPage(10) .forEach(pagedResponse -> { pagedResponse.getValue().stream().forEach( ManifestProperties -> System.out.println(ManifestProperties.getDigest())); });- Parameters:
order- 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.- 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'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.
-
updatePropertiesWithResponse
public com.azure.core.http.rest.Response<ContainerRepositoryProperties> updatePropertiesWithResponse(ContainerRepositoryProperties repositoryProperties, com.azure.core.util.Context context) Update the settable 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, Context.NONE);
- Parameters:
repositoryProperties-repository propertiesthat need to be updated for the repository.context- Additional context that is passed through the Http pipeline during the service call.- Returns:
- A REST response with 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.
-
updateProperties
public 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);
- Parameters:
repositoryProperties-repository propertiesthat need to be updated for the repository.- Returns:
- The updated
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 if therepositoryPropertiesis null.
-