@ThreadSafe @Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class AmazonECRClient extends AmazonWebServiceClient implements AmazonECR
Amazon Elastic Container Registry (Amazon ECR) is a managed container image registry service. Customers can use the familiar Docker CLI, or their preferred client, to push, pull, and manage images. Amazon ECR provides a secure, scalable, and reliable registry for your Docker or Open Container Initiative (OCI) images. Amazon ECR supports private repositories with resource-based permissions using IAM so that specific users or Amazon EC2 instances can access repositories and images.
Amazon ECR has service endpoints in each supported Region. For more information, see Amazon ECR endpoints in the Amazon Web Services General Reference.
LOGGING_AWS_REQUEST_METRIC
ENDPOINT_PREFIX
Constructor and Description |
---|
AmazonECRClient()
Deprecated.
|
AmazonECRClient(AWSCredentials awsCredentials)
Deprecated.
use
AwsClientBuilder.withCredentials(AWSCredentialsProvider) for example:
AmazonECRClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(awsCredentials)).build(); |
AmazonECRClient(AWSCredentials awsCredentials,
ClientConfiguration clientConfiguration)
|
AmazonECRClient(AWSCredentialsProvider awsCredentialsProvider)
Deprecated.
|
AmazonECRClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration)
|
AmazonECRClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetricCollector)
|
AmazonECRClient(ClientConfiguration clientConfiguration)
Deprecated.
|
addRequestHandler, addRequestHandler, configureRegion, getClientConfiguration, getEndpointPrefix, getMonitoringListeners, getRequestMetricsCollector, getServiceName, getSignerByURI, getSignerOverride, getSignerRegionOverride, getTimeOffset, makeImmutable, removeRequestHandler, removeRequestHandler, setEndpoint, setEndpoint, setRegion, setServiceNameIntern, setSignerRegionOverride, setTimeOffset, withEndpoint, withRegion, withRegion, withTimeOffset
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setEndpoint, setRegion
@Deprecated public AmazonECRClient()
AmazonECRClientBuilder.defaultClient()
All service calls made using this new client object are blocking, and will not return until the service call completes.
DefaultAWSCredentialsProviderChain
@Deprecated public AmazonECRClient(ClientConfiguration clientConfiguration)
AwsClientBuilder.withClientConfiguration(ClientConfiguration)
All service calls made using this new client object are blocking, and will not return until the service call completes.
clientConfiguration
- The client configuration options controlling how this client connects to Amazon ECR (ex: proxy settings,
retry counts, etc.).DefaultAWSCredentialsProviderChain
@Deprecated public AmazonECRClient(AWSCredentials awsCredentials)
AwsClientBuilder.withCredentials(AWSCredentialsProvider)
for example:
AmazonECRClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(awsCredentials)).build();
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentials
- The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.@Deprecated public AmazonECRClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration)
AwsClientBuilder.withCredentials(AWSCredentialsProvider)
and
AwsClientBuilder.withClientConfiguration(ClientConfiguration)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentials
- The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.clientConfiguration
- The client configuration options controlling how this client connects to Amazon ECR (ex: proxy settings,
retry counts, etc.).@Deprecated public AmazonECRClient(AWSCredentialsProvider awsCredentialsProvider)
AwsClientBuilder.withCredentials(AWSCredentialsProvider)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will provide credentials to authenticate requests with AWS services.@Deprecated public AmazonECRClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration)
AwsClientBuilder.withCredentials(AWSCredentialsProvider)
and
AwsClientBuilder.withClientConfiguration(ClientConfiguration)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will provide credentials to authenticate requests with AWS services.clientConfiguration
- The client configuration options controlling how this client connects to Amazon ECR (ex: proxy settings,
retry counts, etc.).@Deprecated public AmazonECRClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, RequestMetricCollector requestMetricCollector)
AwsClientBuilder.withCredentials(AWSCredentialsProvider)
and
AwsClientBuilder.withClientConfiguration(ClientConfiguration)
and
AwsClientBuilder.withMetricsCollector(RequestMetricCollector)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will provide credentials to authenticate requests with AWS services.clientConfiguration
- The client configuration options controlling how this client connects to Amazon ECR (ex: proxy settings,
retry counts, etc.).requestMetricCollector
- optional request metric collectorpublic static AmazonECRClientBuilder builder()
public BatchCheckLayerAvailabilityResult batchCheckLayerAvailability(BatchCheckLayerAvailabilityRequest request)
Checks the availability of one or more image layers in a repository.
When an image is pushed to a repository, each image layer is checked to verify if it has been uploaded before. If it has been uploaded, then the image layer is skipped.
This operation is used by the Amazon ECR proxy and is not generally used by customers for pulling and pushing
images. In most cases, you should use the docker
CLI to pull, tag, and push images.
batchCheckLayerAvailability
in interface AmazonECR
batchCheckLayerAvailabilityRequest
- RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.ServerException
- These errors are usually caused by a server-side issue.public BatchDeleteImageResult batchDeleteImage(BatchDeleteImageRequest request)
Deletes a list of specified images within a repository. Images are specified with either an imageTag
or imageDigest
.
You can remove a tag from an image by specifying the image's tag in your request. When you remove the last tag from an image, the image is deleted from your repository.
You can completely delete an image (and all of its tags) by specifying the image's digest in your request.
batchDeleteImage
in interface AmazonECR
batchDeleteImageRequest
- Deletes specified images within a specified repository. Images are specified with either the
imageTag
or imageDigest
.ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.AmazonECR client = AmazonECRClientBuilder.standard().build(); BatchDeleteImageRequest request = new BatchDeleteImageRequest().withRepositoryName("ubuntu") .withImageIds(new ImageIdentifier().withImageTag("precise")); BatchDeleteImageResult response = client.batchDeleteImage(request);
public BatchGetImageResult batchGetImage(BatchGetImageRequest request)
Gets detailed information for an image. Images are specified with either an imageTag
or
imageDigest
.
When an image is pulled, the BatchGetImage API is called once to retrieve the image manifest.
batchGetImage
in interface AmazonECR
batchGetImageRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.LimitExceededException
- The operation did not succeed because it would have exceeded a service limit for your account. For more
information, see Amazon ECR service
quotas in the Amazon Elastic Container Registry User Guide.UnableToGetUpstreamImageException
- The image or images were unable to be pulled using the pull through cache rule. This is usually caused
because of an issue with the Secrets Manager secret containing the credentials for the upstream registry.AmazonECR client = AmazonECRClientBuilder.standard().build(); BatchGetImageRequest request = new BatchGetImageRequest().withRepositoryName("ubuntu").withImageIds(new ImageIdentifier().withImageTag("precise")); BatchGetImageResult response = client.batchGetImage(request);
public BatchGetRepositoryScanningConfigurationResult batchGetRepositoryScanningConfiguration(BatchGetRepositoryScanningConfigurationRequest request)
Gets the scanning configuration for one or more repositories.
batchGetRepositoryScanningConfiguration
in interface AmazonECR
batchGetRepositoryScanningConfigurationRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.ValidationException
- There was an exception validating this request.public CompleteLayerUploadResult completeLayerUpload(CompleteLayerUploadRequest request)
Informs Amazon ECR that the image layer upload has completed for a specified registry, repository name, and
upload ID. You can optionally provide a sha256
digest of the image layer for data validation
purposes.
When an image is pushed, the CompleteLayerUpload API is called once per each new image layer to verify that the upload has completed.
This operation is used by the Amazon ECR proxy and is not generally used by customers for pulling and pushing
images. In most cases, you should use the docker
CLI to pull, tag, and push images.
completeLayerUpload
in interface AmazonECR
completeLayerUploadRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.UploadNotFoundException
- The upload could not be found, or the specified upload ID is not valid for this repository.InvalidLayerException
- The layer digest calculation performed by Amazon ECR upon receipt of the image layer does not match the
digest specified.LayerPartTooSmallException
- Layer parts must be at least 5 MiB in size.LayerAlreadyExistsException
- The image layer already exists in the associated repository.EmptyUploadException
- The specified layer upload does not contain any layer parts.KmsException
- The operation failed due to a KMS exception.public CreatePullThroughCacheRuleResult createPullThroughCacheRule(CreatePullThroughCacheRuleRequest request)
Creates a pull through cache rule. A pull through cache rule provides a way to cache images from an upstream registry source in your Amazon ECR private registry. For more information, see Using pull through cache rules in the Amazon Elastic Container Registry User Guide.
createPullThroughCacheRule
in interface AmazonECR
createPullThroughCacheRuleRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.ValidationException
- There was an exception validating this request.PullThroughCacheRuleAlreadyExistsException
- A pull through cache rule with these settings already exists for the private registry.UnsupportedUpstreamRegistryException
- The specified upstream registry isn't supported.LimitExceededException
- The operation did not succeed because it would have exceeded a service limit for your account. For more
information, see Amazon ECR service
quotas in the Amazon Elastic Container Registry User Guide.UnableToAccessSecretException
- The secret is unable to be accessed. Verify the resource permissions for the secret and try again.SecretNotFoundException
- The ARN of the secret specified in the pull through cache rule was not found. Update the pull through
cache rule with a valid secret ARN and try again.UnableToDecryptSecretValueException
- The secret is accessible but is unable to be decrypted. Verify the resource permisisons and try again.public CreateRepositoryResult createRepository(CreateRepositoryRequest request)
Creates a repository. For more information, see Amazon ECR repositories in the Amazon Elastic Container Registry User Guide.
createRepository
in interface AmazonECR
createRepositoryRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.InvalidTagParameterException
- An invalid parameter has been specified. Tag keys can have a maximum character length of 128 characters,
and tag values can have a maximum length of 256 characters.TooManyTagsException
- The list of tags on the repository is over the limit. The maximum number of tags that can be applied to a
repository is 50.RepositoryAlreadyExistsException
- The specified repository already exists in the specified registry.LimitExceededException
- The operation did not succeed because it would have exceeded a service limit for your account. For more
information, see Amazon ECR service
quotas in the Amazon Elastic Container Registry User Guide.KmsException
- The operation failed due to a KMS exception.AmazonECR client = AmazonECRClientBuilder.standard().build(); CreateRepositoryRequest request = new CreateRepositoryRequest().withRepositoryName("project-a/nginx-web-app"); CreateRepositoryResult response = client.createRepository(request);
public CreateRepositoryCreationTemplateResult createRepositoryCreationTemplate(CreateRepositoryCreationTemplateRequest request)
Creates a repository creation template. This template is used to define the settings for repositories created by Amazon ECR on your behalf. For example, repositories created through pull through cache actions. For more information, see Private repository creation templates in the Amazon Elastic Container Registry User Guide.
createRepositoryCreationTemplate
in interface AmazonECR
createRepositoryCreationTemplateRequest
- ServerException
- These errors are usually caused by a server-side issue.ValidationException
- There was an exception validating this request.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.LimitExceededException
- The operation did not succeed because it would have exceeded a service limit for your account. For more
information, see Amazon ECR service
quotas in the Amazon Elastic Container Registry User Guide.TemplateAlreadyExistsException
- The repository creation template already exists. Specify a unique prefix and try again.public DeleteLifecyclePolicyResult deleteLifecyclePolicy(DeleteLifecyclePolicyRequest request)
Deletes the lifecycle policy associated with the specified repository.
deleteLifecyclePolicy
in interface AmazonECR
deleteLifecyclePolicyRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.LifecyclePolicyNotFoundException
- The lifecycle policy could not be found, and no policy is set to the repository.ValidationException
- There was an exception validating this request.public DeletePullThroughCacheRuleResult deletePullThroughCacheRule(DeletePullThroughCacheRuleRequest request)
Deletes a pull through cache rule.
deletePullThroughCacheRule
in interface AmazonECR
deletePullThroughCacheRuleRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.ValidationException
- There was an exception validating this request.PullThroughCacheRuleNotFoundException
- The pull through cache rule was not found. Specify a valid pull through cache rule and try again.public DeleteRegistryPolicyResult deleteRegistryPolicy(DeleteRegistryPolicyRequest request)
Deletes the registry permissions policy.
deleteRegistryPolicy
in interface AmazonECR
deleteRegistryPolicyRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.RegistryPolicyNotFoundException
- The registry doesn't have an associated registry policy.ValidationException
- There was an exception validating this request.public DeleteRepositoryResult deleteRepository(DeleteRepositoryRequest request)
Deletes a repository. If the repository isn't empty, you must either delete the contents of the repository or use
the force
option to delete the repository and have Amazon ECR delete all of its contents on your
behalf.
deleteRepository
in interface AmazonECR
deleteRepositoryRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.RepositoryNotEmptyException
- The specified repository contains images. To delete a repository that contains images, you must force the
deletion with the force
parameter.KmsException
- The operation failed due to a KMS exception.AmazonECR client = AmazonECRClientBuilder.standard().build(); DeleteRepositoryRequest request = new DeleteRepositoryRequest().withRepositoryName("ubuntu").withForce(true); DeleteRepositoryResult response = client.deleteRepository(request);
public DeleteRepositoryCreationTemplateResult deleteRepositoryCreationTemplate(DeleteRepositoryCreationTemplateRequest request)
Deletes a repository creation template.
deleteRepositoryCreationTemplate
in interface AmazonECR
deleteRepositoryCreationTemplateRequest
- ServerException
- These errors are usually caused by a server-side issue.ValidationException
- There was an exception validating this request.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.TemplateNotFoundException
- The specified repository creation template can't be found. Verify the registry ID and prefix and try
again.public DeleteRepositoryPolicyResult deleteRepositoryPolicy(DeleteRepositoryPolicyRequest request)
Deletes the repository policy associated with the specified repository.
deleteRepositoryPolicy
in interface AmazonECR
deleteRepositoryPolicyRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.RepositoryPolicyNotFoundException
- The specified repository and registry combination does not have an associated repository policy.AmazonECR client = AmazonECRClientBuilder.standard().build(); DeleteRepositoryPolicyRequest request = new DeleteRepositoryPolicyRequest().withRepositoryName("ubuntu"); DeleteRepositoryPolicyResult response = client.deleteRepositoryPolicy(request);
public DescribeImageReplicationStatusResult describeImageReplicationStatus(DescribeImageReplicationStatusRequest request)
Returns the replication status for a specified image.
describeImageReplicationStatus
in interface AmazonECR
describeImageReplicationStatusRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.ImageNotFoundException
- The image requested does not exist in the specified repository.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.ValidationException
- There was an exception validating this request.public DescribeImageScanFindingsResult describeImageScanFindings(DescribeImageScanFindingsRequest request)
Returns the scan findings for the specified image.
describeImageScanFindings
in interface AmazonECR
describeImageScanFindingsRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.ImageNotFoundException
- The image requested does not exist in the specified repository.ScanNotFoundException
- The specified image scan could not be found. Ensure that image scanning is enabled on the repository and
try again.ValidationException
- There was an exception validating this request.public DescribeImagesResult describeImages(DescribeImagesRequest request)
Returns metadata about the images in a repository.
Beginning with Docker version 1.9, the Docker client compresses image layers before pushing them to a V2 Docker
registry. The output of the docker images
command shows the uncompressed image size, so it may
return a larger image size than the image sizes returned by DescribeImages.
describeImages
in interface AmazonECR
describeImagesRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.ImageNotFoundException
- The image requested does not exist in the specified repository.public DescribePullThroughCacheRulesResult describePullThroughCacheRules(DescribePullThroughCacheRulesRequest request)
Returns the pull through cache rules for a registry.
describePullThroughCacheRules
in interface AmazonECR
describePullThroughCacheRulesRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.ValidationException
- There was an exception validating this request.PullThroughCacheRuleNotFoundException
- The pull through cache rule was not found. Specify a valid pull through cache rule and try again.public DescribeRegistryResult describeRegistry(DescribeRegistryRequest request)
Describes the settings for a registry. The replication configuration for a repository can be created or updated with the PutReplicationConfiguration API action.
describeRegistry
in interface AmazonECR
describeRegistryRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.ValidationException
- There was an exception validating this request.public DescribeRepositoriesResult describeRepositories(DescribeRepositoriesRequest request)
Describes image repositories in a registry.
describeRepositories
in interface AmazonECR
describeRepositoriesRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.AmazonECR client = AmazonECRClientBuilder.standard().build(); DescribeRepositoriesRequest request = new DescribeRepositoriesRequest(); DescribeRepositoriesResult response = client.describeRepositories(request);
public DescribeRepositoryCreationTemplatesResult describeRepositoryCreationTemplates(DescribeRepositoryCreationTemplatesRequest request)
Returns details about the repository creation templates in a registry. The prefixes
request
parameter can be used to return the details for a specific repository creation template.
describeRepositoryCreationTemplates
in interface AmazonECR
describeRepositoryCreationTemplatesRequest
- ServerException
- These errors are usually caused by a server-side issue.ValidationException
- There was an exception validating this request.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.public GetAuthorizationTokenResult getAuthorizationToken(GetAuthorizationTokenRequest request)
Retrieves an authorization token. An authorization token represents your IAM authentication credentials and can be used to access any Amazon ECR registry that your IAM principal has access to. The authorization token is valid for 12 hours.
The authorizationToken
returned is a base64 encoded string that can be decoded and used in a
docker login
command to authenticate to a registry. The CLI offers an
get-login-password
command that simplifies the login process. For more information, see Registry
authentication in the Amazon Elastic Container Registry User Guide.
getAuthorizationToken
in interface AmazonECR
getAuthorizationTokenRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.AmazonECR client = AmazonECRClientBuilder.standard().build(); GetAuthorizationTokenRequest request = new GetAuthorizationTokenRequest(); GetAuthorizationTokenResult response = client.getAuthorizationToken(request);
public GetDownloadUrlForLayerResult getDownloadUrlForLayer(GetDownloadUrlForLayerRequest request)
Retrieves the pre-signed Amazon S3 download URL corresponding to an image layer. You can only get URLs for image layers that are referenced in an image.
When an image is pulled, the GetDownloadUrlForLayer API is called once per image layer that is not already cached.
This operation is used by the Amazon ECR proxy and is not generally used by customers for pulling and pushing
images. In most cases, you should use the docker
CLI to pull, tag, and push images.
getDownloadUrlForLayer
in interface AmazonECR
getDownloadUrlForLayerRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.LayersNotFoundException
- The specified layers could not be found, or the specified layer is not valid for this repository.LayerInaccessibleException
- The specified layer is not available because it is not associated with an image. Unassociated image
layers may be cleaned up at any time.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.UnableToGetUpstreamLayerException
- There was an issue getting the upstream layer matching the pull through cache rule.public GetLifecyclePolicyResult getLifecyclePolicy(GetLifecyclePolicyRequest request)
Retrieves the lifecycle policy for the specified repository.
getLifecyclePolicy
in interface AmazonECR
getLifecyclePolicyRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.LifecyclePolicyNotFoundException
- The lifecycle policy could not be found, and no policy is set to the repository.ValidationException
- There was an exception validating this request.public GetLifecyclePolicyPreviewResult getLifecyclePolicyPreview(GetLifecyclePolicyPreviewRequest request)
Retrieves the results of the lifecycle policy preview request for the specified repository.
getLifecyclePolicyPreview
in interface AmazonECR
getLifecyclePolicyPreviewRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.LifecyclePolicyPreviewNotFoundException
- There is no dry run for this repository.ValidationException
- There was an exception validating this request.public GetRegistryPolicyResult getRegistryPolicy(GetRegistryPolicyRequest request)
Retrieves the permissions policy for a registry.
getRegistryPolicy
in interface AmazonECR
getRegistryPolicyRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.RegistryPolicyNotFoundException
- The registry doesn't have an associated registry policy.ValidationException
- There was an exception validating this request.public GetRegistryScanningConfigurationResult getRegistryScanningConfiguration(GetRegistryScanningConfigurationRequest request)
Retrieves the scanning configuration for a registry.
getRegistryScanningConfiguration
in interface AmazonECR
getRegistryScanningConfigurationRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.ValidationException
- There was an exception validating this request.public GetRepositoryPolicyResult getRepositoryPolicy(GetRepositoryPolicyRequest request)
Retrieves the repository policy for the specified repository.
getRepositoryPolicy
in interface AmazonECR
getRepositoryPolicyRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.RepositoryPolicyNotFoundException
- The specified repository and registry combination does not have an associated repository policy.AmazonECR client = AmazonECRClientBuilder.standard().build(); GetRepositoryPolicyRequest request = new GetRepositoryPolicyRequest().withRepositoryName("ubuntu"); GetRepositoryPolicyResult response = client.getRepositoryPolicy(request);
public InitiateLayerUploadResult initiateLayerUpload(InitiateLayerUploadRequest request)
Notifies Amazon ECR that you intend to upload an image layer.
When an image is pushed, the InitiateLayerUpload API is called once per image layer that has not already been uploaded. Whether or not an image layer has been uploaded is determined by the BatchCheckLayerAvailability API action.
This operation is used by the Amazon ECR proxy and is not generally used by customers for pulling and pushing
images. In most cases, you should use the docker
CLI to pull, tag, and push images.
initiateLayerUpload
in interface AmazonECR
initiateLayerUploadRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.KmsException
- The operation failed due to a KMS exception.public ListImagesResult listImages(ListImagesRequest request)
Lists all the image IDs for the specified repository.
You can filter images based on whether or not they are tagged by using the tagStatus
filter and
specifying either TAGGED
, UNTAGGED
or ANY
. For example, you can filter
your results to return only UNTAGGED
images and then pipe that result to a BatchDeleteImage
operation to delete them. Or, you can filter your results to return only TAGGED
images to list all
of the tags in your repository.
listImages
in interface AmazonECR
listImagesRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.AmazonECR client = AmazonECRClientBuilder.standard().build(); ListImagesRequest request = new ListImagesRequest().withRepositoryName("ubuntu"); ListImagesResult response = client.listImages(request);
public ListTagsForResourceResult listTagsForResource(ListTagsForResourceRequest request)
List the tags for an Amazon ECR resource.
listTagsForResource
in interface AmazonECR
listTagsForResourceRequest
- InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.ServerException
- These errors are usually caused by a server-side issue.public PutImageResult putImage(PutImageRequest request)
Creates or updates the image manifest and tags associated with an image.
When an image is pushed and all new image layers have been uploaded, the PutImage API is called once to create or update the image manifest and the tags associated with the image.
This operation is used by the Amazon ECR proxy and is not generally used by customers for pulling and pushing
images. In most cases, you should use the docker
CLI to pull, tag, and push images.
putImage
in interface AmazonECR
putImageRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.ImageAlreadyExistsException
- The specified image has already been pushed, and there were no changes to the manifest or image tag after
the last push.LayersNotFoundException
- The specified layers could not be found, or the specified layer is not valid for this repository.ReferencedImagesNotFoundException
- The manifest list is referencing an image that does not exist.LimitExceededException
- The operation did not succeed because it would have exceeded a service limit for your account. For more
information, see Amazon ECR service
quotas in the Amazon Elastic Container Registry User Guide.ImageTagAlreadyExistsException
- The specified image is tagged with a tag that already exists. The repository is configured for tag
immutability.ImageDigestDoesNotMatchException
- The specified image digest does not match the digest that Amazon ECR calculated for the image.KmsException
- The operation failed due to a KMS exception.public PutImageScanningConfigurationResult putImageScanningConfiguration(PutImageScanningConfigurationRequest request)
The PutImageScanningConfiguration
API is being deprecated, in favor of specifying the image scanning
configuration at the registry level. For more information, see PutRegistryScanningConfiguration.
Updates the image scanning configuration for the specified repository.
putImageScanningConfiguration
in interface AmazonECR
putImageScanningConfigurationRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.ValidationException
- There was an exception validating this request.public PutImageTagMutabilityResult putImageTagMutability(PutImageTagMutabilityRequest request)
Updates the image tag mutability settings for the specified repository. For more information, see Image tag mutability in the Amazon Elastic Container Registry User Guide.
putImageTagMutability
in interface AmazonECR
putImageTagMutabilityRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.public PutLifecyclePolicyResult putLifecyclePolicy(PutLifecyclePolicyRequest request)
Creates or updates the lifecycle policy for the specified repository. For more information, see Lifecycle policy template.
putLifecyclePolicy
in interface AmazonECR
putLifecyclePolicyRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.ValidationException
- There was an exception validating this request.public PutRegistryPolicyResult putRegistryPolicy(PutRegistryPolicyRequest request)
Creates or updates the permissions policy for your registry.
A registry policy is used to specify permissions for another Amazon Web Services account and is used when configuring cross-account replication. For more information, see Registry permissions in the Amazon Elastic Container Registry User Guide.
putRegistryPolicy
in interface AmazonECR
putRegistryPolicyRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.ValidationException
- There was an exception validating this request.public PutRegistryScanningConfigurationResult putRegistryScanningConfiguration(PutRegistryScanningConfigurationRequest request)
Creates or updates the scanning configuration for your private registry.
putRegistryScanningConfiguration
in interface AmazonECR
putRegistryScanningConfigurationRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.ValidationException
- There was an exception validating this request.public PutReplicationConfigurationResult putReplicationConfiguration(PutReplicationConfigurationRequest request)
Creates or updates the replication configuration for a registry. The existing replication configuration for a repository can be retrieved with the DescribeRegistry API action. The first time the PutReplicationConfiguration API is called, a service-linked IAM role is created in your account for the replication process. For more information, see Using service-linked roles for Amazon ECR in the Amazon Elastic Container Registry User Guide. For more information on the custom role for replication, see Creating an IAM role for replication.
When configuring cross-account replication, the destination account must grant the source account permission to replicate. This permission is controlled using a registry permissions policy. For more information, see PutRegistryPolicy.
putReplicationConfiguration
in interface AmazonECR
putReplicationConfigurationRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.ValidationException
- There was an exception validating this request.public SetRepositoryPolicyResult setRepositoryPolicy(SetRepositoryPolicyRequest request)
Applies a repository policy to the specified repository to control access permissions. For more information, see Amazon ECR Repository policies in the Amazon Elastic Container Registry User Guide.
setRepositoryPolicy
in interface AmazonECR
setRepositoryPolicyRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.public StartImageScanResult startImageScan(StartImageScanRequest request)
Starts an image vulnerability scan. An image scan can only be started once per 24 hours on an individual image. This limit includes if an image was scanned on initial push. For more information, see Image scanning in the Amazon Elastic Container Registry User Guide.
startImageScan
in interface AmazonECR
startImageScanRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.UnsupportedImageTypeException
- The image is of a type that cannot be scanned.LimitExceededException
- The operation did not succeed because it would have exceeded a service limit for your account. For more
information, see Amazon ECR service
quotas in the Amazon Elastic Container Registry User Guide.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.ImageNotFoundException
- The image requested does not exist in the specified repository.ValidationException
- There was an exception validating this request.public StartLifecyclePolicyPreviewResult startLifecyclePolicyPreview(StartLifecyclePolicyPreviewRequest request)
Starts a preview of a lifecycle policy for the specified repository. This allows you to see the results before associating the lifecycle policy with the repository.
startLifecyclePolicyPreview
in interface AmazonECR
startLifecyclePolicyPreviewRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.LifecyclePolicyNotFoundException
- The lifecycle policy could not be found, and no policy is set to the repository.LifecyclePolicyPreviewInProgressException
- The previous lifecycle policy preview request has not completed. Wait and try again.ValidationException
- There was an exception validating this request.public TagResourceResult tagResource(TagResourceRequest request)
Adds specified tags to a resource with the specified ARN. Existing tags on a resource are not changed if they are not specified in the request parameters.
tagResource
in interface AmazonECR
tagResourceRequest
- InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.InvalidTagParameterException
- An invalid parameter has been specified. Tag keys can have a maximum character length of 128 characters,
and tag values can have a maximum length of 256 characters.TooManyTagsException
- The list of tags on the repository is over the limit. The maximum number of tags that can be applied to a
repository is 50.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.ServerException
- These errors are usually caused by a server-side issue.public UntagResourceResult untagResource(UntagResourceRequest request)
Deletes specified tags from a resource.
untagResource
in interface AmazonECR
untagResourceRequest
- InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.InvalidTagParameterException
- An invalid parameter has been specified. Tag keys can have a maximum character length of 128 characters,
and tag values can have a maximum length of 256 characters.TooManyTagsException
- The list of tags on the repository is over the limit. The maximum number of tags that can be applied to a
repository is 50.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.ServerException
- These errors are usually caused by a server-side issue.public UpdatePullThroughCacheRuleResult updatePullThroughCacheRule(UpdatePullThroughCacheRuleRequest request)
Updates an existing pull through cache rule.
updatePullThroughCacheRule
in interface AmazonECR
updatePullThroughCacheRuleRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.ValidationException
- There was an exception validating this request.UnableToAccessSecretException
- The secret is unable to be accessed. Verify the resource permissions for the secret and try again.PullThroughCacheRuleNotFoundException
- The pull through cache rule was not found. Specify a valid pull through cache rule and try again.SecretNotFoundException
- The ARN of the secret specified in the pull through cache rule was not found. Update the pull through
cache rule with a valid secret ARN and try again.UnableToDecryptSecretValueException
- The secret is accessible but is unable to be decrypted. Verify the resource permisisons and try again.public UpdateRepositoryCreationTemplateResult updateRepositoryCreationTemplate(UpdateRepositoryCreationTemplateRequest request)
Updates an existing repository creation template.
updateRepositoryCreationTemplate
in interface AmazonECR
updateRepositoryCreationTemplateRequest
- ServerException
- These errors are usually caused by a server-side issue.ValidationException
- There was an exception validating this request.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.TemplateNotFoundException
- The specified repository creation template can't be found. Verify the registry ID and prefix and try
again.public UploadLayerPartResult uploadLayerPart(UploadLayerPartRequest request)
Uploads an image layer part to Amazon ECR.
When an image is pushed, each new image layer is uploaded in parts. The maximum size of each image layer part can be 20971520 bytes (or about 20MB). The UploadLayerPart API is called once per each new image layer part.
This operation is used by the Amazon ECR proxy and is not generally used by customers for pulling and pushing
images. In most cases, you should use the docker
CLI to pull, tag, and push images.
uploadLayerPart
in interface AmazonECR
uploadLayerPartRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.InvalidLayerPartException
- The layer part size is not valid, or the first byte specified is not consecutive to the last byte of a
previous layer part upload.RepositoryNotFoundException
- The specified repository could not be found. Check the spelling of the specified repository and ensure
that you are performing operations on the correct registry.UploadNotFoundException
- The upload could not be found, or the specified upload ID is not valid for this repository.LimitExceededException
- The operation did not succeed because it would have exceeded a service limit for your account. For more
information, see Amazon ECR service
quotas in the Amazon Elastic Container Registry User Guide.KmsException
- The operation failed due to a KMS exception.public ValidatePullThroughCacheRuleResult validatePullThroughCacheRule(ValidatePullThroughCacheRuleRequest request)
Validates an existing pull through cache rule for an upstream registry that requires authentication. This will retrieve the contents of the Amazon Web Services Secrets Manager secret, verify the syntax, and then validate that authentication to the upstream registry is successful.
validatePullThroughCacheRule
in interface AmazonECR
validatePullThroughCacheRuleRequest
- ServerException
- These errors are usually caused by a server-side issue.InvalidParameterException
- The specified parameter is invalid. Review the available parameters for the API request.ValidationException
- There was an exception validating this request.PullThroughCacheRuleNotFoundException
- The pull through cache rule was not found. Specify a valid pull through cache rule and try again.public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request)
Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic information for an executed request, you should use this method to retrieve it as soon as possible after executing the request.
getCachedResponseMetadata
in interface AmazonECR
request
- The originally executed requestpublic AmazonECRWaiters waiters()
public void shutdown()
AmazonWebServiceClient
shutdown
in interface AmazonECR
shutdown
in class AmazonWebServiceClient