2015/12/21 - Amazon EC2 Container Registry - 16 new api methods
Uploads an image layer part to Amazon ECR.
Note
This operation is used by the Amazon ECR proxy, and it is not intended for general use by customers. Use the docker CLI to pull, tag, and push images.
Request Syntax
client.upload_layer_part( registryId='string', repositoryName='string', uploadId='string', partFirstByte=123, partLastByte=123, layerPartBlob=b'bytes' )
string
The AWS account ID associated with the registry that you are uploading layer parts to. If you do not specify a registry, the default registry is assumed.
string
[REQUIRED]
The name of the repository that you are uploading layer parts to.
string
[REQUIRED]
The upload ID from a previous InitiateLayerUpload operation to associate with the layer part upload.
integer
[REQUIRED]
The integer value of the first byte of the layer part.
integer
[REQUIRED]
The integer value of the last byte of the layer part.
bytes
[REQUIRED]
The base64-encoded layer part payload.
dict
Response Syntax
{ 'registryId': 'string', 'repositoryName': 'string', 'uploadId': 'string', 'lastByteReceived': 123 }
Response Structure
(dict) --
registryId (string) --
The registry ID associated with the request.
repositoryName (string) --
The repository name associated with the request.
uploadId (string) --
The upload ID associated with the request.
lastByteReceived (integer) --
The integer value of the last byte received in the request.
Gets detailed information for specified images within a specified repository. Images are specified with either imageTag or imageDigest .
Request Syntax
client.batch_get_image( registryId='string', repositoryName='string', imageIds=[ { 'imageDigest': 'string', 'imageTag': 'string' }, ] )
string
The AWS account ID associated with the registry that contains the images to describe. If you do not specify a registry, the default registry is assumed.
string
[REQUIRED]
The repository that contains the images to describe.
list
[REQUIRED]
A list of image ID references that correspond to images to describe. The format of the imageIds reference is imageTag=tag or imageDigest=digest .
(dict) --
imageDigest (string) --
The sha256 digest of the image manifest.
imageTag (string) --
The tag used for the image.
dict
Response Syntax
{ 'images': [ { 'registryId': 'string', 'repositoryName': 'string', 'imageId': { 'imageDigest': 'string', 'imageTag': 'string' }, 'imageManifest': 'string' }, ], 'failures': [ { 'imageId': { 'imageDigest': 'string', 'imageTag': 'string' }, 'failureCode': 'InvalidImageDigest'|'InvalidImageTag'|'ImageTagDoesNotMatchDigest'|'ImageNotFound'|'MissingDigestAndTag', 'failureReason': 'string' }, ] }
Response Structure
(dict) --
images (list) --
A list of image objects corresponding to the image references in the request.
(dict) --
Object representing an image.
registryId (string) --
The AWS account ID associated with the registry containing the image.
repositoryName (string) --
The name of the repository associated with the image.
imageId (dict) --
An object containing the image tag and image digest associated with an image.
imageDigest (string) --
The sha256 digest of the image manifest.
imageTag (string) --
The tag used for the image.
imageManifest (string) --
The image manifest associated with the image.
failures (list) --
Any failures associated with the call.
(dict) --
imageId (dict) --
The image ID associated with the failure.
imageDigest (string) --
The sha256 digest of the image manifest.
imageTag (string) --
The tag used for the image.
failureCode (string) --
The code associated with the failure.
failureReason (string) --
The reason for the failure.
Creates or updates the image manifest associated with an image.
Note
This operation is used by the Amazon ECR proxy, and it is not intended for general use by customers. Use the docker CLI to pull, tag, and push images.
Request Syntax
client.put_image( registryId='string', repositoryName='string', imageManifest='string' )
string
The AWS account ID associated with the registry that contains the repository in which to put the image. If you do not specify a registry, the default registry is assumed.
string
[REQUIRED]
The name of the repository in which to put the image.
string
[REQUIRED]
The image manifest corresponding to the image to be uploaded.
dict
Response Syntax
{ 'image': { 'registryId': 'string', 'repositoryName': 'string', 'imageId': { 'imageDigest': 'string', 'imageTag': 'string' }, 'imageManifest': 'string' } }
Response Structure
(dict) --
image (dict) --
Details of the image uploaded.
registryId (string) --
The AWS account ID associated with the registry containing the image.
repositoryName (string) --
The name of the repository associated with the image.
imageId (dict) --
An object containing the image tag and image digest associated with an image.
imageDigest (string) --
The sha256 digest of the image manifest.
imageTag (string) --
The tag used for the image.
imageManifest (string) --
The image manifest associated with the image.
Check the availability of multiple image layers in a specified registry and repository.
Note
This operation is used by the Amazon ECR proxy, and it is not intended for general use by customers. Use the docker CLI to pull, tag, and push images.
Request Syntax
client.batch_check_layer_availability( registryId='string', repositoryName='string', layerDigests=[ 'string', ] )
string
The AWS account ID associated with the registry that contains the image layers to check. If you do not specify a registry, the default registry is assumed.
string
[REQUIRED]
The name of the repository that is associated with the image layers to check.
list
[REQUIRED]
The digests of the image layers to check.
(string) --
dict
Response Syntax
{ 'layers': [ { 'layerDigest': 'string', 'layerAvailability': 'AVAILABLE'|'UNAVAILABLE', 'layerSize': 123 }, ], 'failures': [ { 'layerDigest': 'string', 'failureCode': 'InvalidLayerDigest'|'MissingLayerDigest', 'failureReason': 'string' }, ] }
Response Structure
(dict) --
layers (list) --
A list of image layer objects corresponding to the image layer references in the request.
(dict) --
layerDigest (string) --
The sha256 digest of the image layer.
layerAvailability (string) --
The availability status of the image layer. Valid values are AVAILABLE and UNAVAILABLE .
layerSize (integer) --
The size, in bytes, of the image layer.
failures (list) --
Any failures associated with the call.
(dict) --
layerDigest (string) --
The layer digest associated with the failure.
failureCode (string) --
The failure code associated with the failure.
failureReason (string) --
The reason for the failure.
Deletes a list of specified images within a specified repository. Images are specified with either imageTag or imageDigest .
Request Syntax
client.batch_delete_image( registryId='string', repositoryName='string', imageIds=[ { 'imageDigest': 'string', 'imageTag': 'string' }, ] )
string
The AWS account ID associated with the registry that contains the image to delete. If you do not specify a registry, the default registry is assumed.
string
[REQUIRED]
The repository that contains the image to delete.
list
[REQUIRED]
A list of image ID references that correspond to images to delete. The format of the imageIds reference is imageTag=tag or imageDigest=digest .
(dict) --
imageDigest (string) --
The sha256 digest of the image manifest.
imageTag (string) --
The tag used for the image.
dict
Response Syntax
{ 'imageIds': [ { 'imageDigest': 'string', 'imageTag': 'string' }, ], 'failures': [ { 'imageId': { 'imageDigest': 'string', 'imageTag': 'string' }, 'failureCode': 'InvalidImageDigest'|'InvalidImageTag'|'ImageTagDoesNotMatchDigest'|'ImageNotFound'|'MissingDigestAndTag', 'failureReason': 'string' }, ] }
Response Structure
(dict) --
imageIds (list) --
The image IDs of the deleted images.
(dict) --
imageDigest (string) --
The sha256 digest of the image manifest.
imageTag (string) --
The tag used for the image.
failures (list) --
Any failures associated with the call.
(dict) --
imageId (dict) --
The image ID associated with the failure.
imageDigest (string) --
The sha256 digest of the image manifest.
imageTag (string) --
The tag used for the image.
failureCode (string) --
The code associated with the failure.
failureReason (string) --
The reason for the failure.
Deletes the repository policy from a specified repository.
Request Syntax
client.delete_repository_policy( registryId='string', repositoryName='string' )
string
The AWS account ID associated with the registry that contains the repository policy to delete. If you do not specify a registry, the default registry is assumed.
string
[REQUIRED]
The name of the repository that is associated with the repository policy to delete.
dict
Response Syntax
{ 'registryId': 'string', 'repositoryName': 'string', 'policyText': 'string' }
Response Structure
(dict) --
registryId (string) --
The registry ID associated with the request.
repositoryName (string) --
The repository name associated with the request.
policyText (string) --
The JSON repository policy that was deleted from the repository.
Retrieves a token that is valid for a specified registry for 12 hours. This command allows you to use the docker CLI to push and pull images with Amazon ECR. If you do not specify a registry, the default registry is assumed.
The authorizationToken returned for each registry specified is a base64 encoded string that can be decoded and used in a docker login command to authenticate to a registry. The AWS CLI offers an aws ecr get-login command that simplifies the login process.
Request Syntax
client.get_authorization_token( registryIds=[ 'string', ] )
list
A list of AWS account IDs that are associated with the registries for which to get authorization tokens. If you do not specify a registry, the default registry is assumed.
(string) --
dict
Response Syntax
{ 'authorizationData': [ { 'authorizationToken': 'string', 'expiresAt': datetime(2015, 1, 1), 'proxyEndpoint': 'string' }, ] }
Response Structure
(dict) --
authorizationData (list) --
A list of authorization token data objects that correspond to the registryIds values in the request.
(dict) --
An object representing authorization data for an Amazon ECR registry.
authorizationToken (string) --
A base64-encoded string that contains authorization data for the specified Amazon ECR registry. When the string is decoded, it is presented in the format user:password for private registry authentication using docker login .
expiresAt (datetime) --
The Unix time in seconds and milliseconds when the authorization token expires. Authorization tokens are valid for 12 hours.
proxyEndpoint (string) --
The registry URL to use for this authorization token in a docker login command. The Amazon ECR registry URL format is https://aws_account_id.dkr.ecr.region.amazonaws.com . For example, https://012345678910.dkr.ecr.us-east-1.amazonaws.com .
Applies a repository policy on a specified repository to control access permissions.
Request Syntax
client.set_repository_policy( registryId='string', repositoryName='string', policyText='string', force=True|False )
string
The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
string
[REQUIRED]
The name of the repository to receive the policy.
string
[REQUIRED]
The JSON repository policy text to apply to the repository.
boolean
If the policy you are attempting to set on a repository policy would prevent you from setting another policy in the future, you must force the SetRepositoryPolicy operation. This is intended to prevent accidental repository lock outs.
dict
Response Syntax
{ 'registryId': 'string', 'repositoryName': 'string', 'policyText': 'string' }
Response Structure
(dict) --
registryId (string) --
The registry ID associated with the request.
repositoryName (string) --
The repository name associated with the request.
policyText (string) --
The JSON repository policy text applied to the repository.
Deletes an existing image repository. If a repository contains images, you must use the force option to delete it.
Request Syntax
client.delete_repository( registryId='string', repositoryName='string', force=True|False )
string
The AWS account ID associated with the registry that contains the repository to delete. If you do not specify a registry, the default registry is assumed.
string
[REQUIRED]
The name of the repository to delete.
boolean
Force the deletion of the repository if it contains images.
dict
Response Syntax
{ 'repository': { 'repositoryArn': 'string', 'registryId': 'string', 'repositoryName': 'string' } }
Response Structure
(dict) --
repository (dict) --
Object representing a repository.
repositoryArn (string) --
The Amazon Resource Name (ARN) that identifies the repository. The ARN contains the arn:aws:ecr namespace, followed by the region of the repository, the AWS account ID of the repository owner, the repository namespace, and then the repository name. For example, arn:aws:ecr:region:012345678910:repository/test .
registryId (string) --
The AWS account ID associated with the registry that contains the repository.
repositoryName (string) --
The name of the repository.
Lists all the image IDs for a given repository.
Request Syntax
client.list_images( registryId='string', repositoryName='string', nextToken='string', maxResults=123 )
string
The AWS account ID associated with the registry that contains the repository to list images in. If you do not specify a registry, the default registry is assumed.
string
[REQUIRED]
The repository whose image IDs are to be listed.
string
The nextToken value returned from a previous paginated ListImages request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return.
integer
The maximum number of image results returned by ListImages in paginated output. When this parameter is used, ListImages only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another ListImages request with the returned nextToken value. This value can be between 1 and 100. If this parameter is not used, then ListImages returns up to 100 results and a nextToken value, if applicable.
dict
Response Syntax
{ 'imageIds': [ { 'imageDigest': 'string', 'imageTag': 'string' }, ], 'nextToken': 'string' }
Response Structure
(dict) --
imageIds (list) --
The list of image IDs for the requested repository.
(dict) --
imageDigest (string) --
The sha256 digest of the image manifest.
imageTag (string) --
The tag used for the image.
nextToken (string) --
The nextToken value to include in a future ListImages request. When the results of a ListImages request exceed maxResults , this value can be used to retrieve the next page of results. This value is null when there are no more results to return.
Inform Amazon ECR that the image layer upload for a specified registry, repository name, and upload ID, has completed. You can optionally provide a sha256 digest of the image layer for data validation purposes.
Note
This operation is used by the Amazon ECR proxy, and it is not intended for general use by customers. Use the docker CLI to pull, tag, and push images.
Request Syntax
client.complete_layer_upload( registryId='string', repositoryName='string', uploadId='string', layerDigests=[ 'string', ] )
string
The AWS account ID associated with the registry to which to upload layers. If you do not specify a registry, the default registry is assumed.
string
[REQUIRED]
The name of the repository to associate with the image layer.
string
[REQUIRED]
The upload ID from a previous InitiateLayerUpload operation to associate with the image layer.
list
[REQUIRED]
The sha256 digest of the image layer.
(string) --
dict
Response Syntax
{ 'registryId': 'string', 'repositoryName': 'string', 'uploadId': 'string', 'layerDigest': 'string' }
Response Structure
(dict) --
registryId (string) --
The registry ID associated with the request.
repositoryName (string) --
The repository name associated with the request.
uploadId (string) --
The upload ID associated with the layer.
layerDigest (string) --
The sha256 digest of the image layer.
Notify Amazon ECR that you intend to upload an image layer.
Note
This operation is used by the Amazon ECR proxy, and it is not intended for general use by customers. Use the docker CLI to pull, tag, and push images.
Request Syntax
client.initiate_layer_upload( registryId='string', repositoryName='string' )
string
The AWS account ID associated with the registry that you intend to upload layers to. If you do not specify a registry, the default registry is assumed.
string
[REQUIRED]
The name of the repository that you intend to upload layers to.
dict
Response Syntax
{ 'uploadId': 'string', 'partSize': 123 }
Response Structure
(dict) --
uploadId (string) --
The upload ID for the layer upload. This parameter is passed to further UploadLayerPart and CompleteLayerUpload operations.
partSize (integer) --
The size, in bytes, that Amazon ECR expects future layer part uploads to be.
Retrieves the repository policy for a specified repository.
Request Syntax
client.get_repository_policy( registryId='string', repositoryName='string' )
string
The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
string
[REQUIRED]
The name of the repository whose policy you want to retrieve.
dict
Response Syntax
{ 'registryId': 'string', 'repositoryName': 'string', 'policyText': 'string' }
Response Structure
(dict) --
registryId (string) --
The registry ID associated with the request.
repositoryName (string) --
The repository name associated with the request.
policyText (string) --
The JSON repository policy text associated with the repository.
Creates an image repository.
Request Syntax
client.create_repository( repositoryName='string' )
string
[REQUIRED]
The name to use for the repository. The repository name may be specified on its own (such as nginx-web-app ) or it can be prepended with a namespace to group the repository into a category (such as project-a/nginx-web-app ).
dict
Response Syntax
{ 'repository': { 'repositoryArn': 'string', 'registryId': 'string', 'repositoryName': 'string' } }
Response Structure
(dict) --
repository (dict) --
Object representing a repository.
repositoryArn (string) --
The Amazon Resource Name (ARN) that identifies the repository. The ARN contains the arn:aws:ecr namespace, followed by the region of the repository, the AWS account ID of the repository owner, the repository namespace, and then the repository name. For example, arn:aws:ecr:region:012345678910:repository/test .
registryId (string) --
The AWS account ID associated with the registry that contains the repository.
repositoryName (string) --
The name of the repository.
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.
Note
This operation is used by the Amazon ECR proxy, and it is not intended for general use by customers. Use the docker CLI to pull, tag, and push images.
Request Syntax
client.get_download_url_for_layer( registryId='string', repositoryName='string', layerDigest='string' )
string
The AWS account ID associated with the registry that contains the image layer to download. If you do not specify a registry, the default registry is assumed.
string
[REQUIRED]
The name of the repository that is associated with the image layer to download.
string
[REQUIRED]
The digest of the image layer to download.
dict
Response Syntax
{ 'downloadUrl': 'string', 'layerDigest': 'string' }
Response Structure
(dict) --
downloadUrl (string) --
The pre-signed Amazon S3 download URL for the requested layer.
layerDigest (string) --
The digest of the image layer to download.
Describes image repositories in a registry.
Request Syntax
client.describe_repositories( registryId='string', repositoryNames=[ 'string', ], nextToken='string', maxResults=123 )
string
The AWS account ID associated with the registry that contains the repositories to be described. If you do not specify a registry, the default registry is assumed.
list
A list of repositories to describe. If this parameter is omitted, then all repositories in a registry are described.
(string) --
string
The nextToken value returned from a previous paginated DescribeRepositories request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return.
integer
The maximum number of repository results returned by DescribeRepositories in paginated output. When this parameter is used, DescribeRepositories only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another DescribeRepositories request with the returned nextToken value. This value can be between 1 and 100. If this parameter is not used, then DescribeRepositories returns up to 100 results and a nextToken value, if applicable.
dict
Response Syntax
{ 'repositories': [ { 'repositoryArn': 'string', 'registryId': 'string', 'repositoryName': 'string' }, ], 'nextToken': 'string' }
Response Structure
(dict) --
repositories (list) --
A list of repository objects corresponding to valid repositories.
(dict) --
Object representing a repository.
repositoryArn (string) --
The Amazon Resource Name (ARN) that identifies the repository. The ARN contains the arn:aws:ecr namespace, followed by the region of the repository, the AWS account ID of the repository owner, the repository namespace, and then the repository name. For example, arn:aws:ecr:region:012345678910:repository/test .
registryId (string) --
The AWS account ID associated with the registry that contains the repository.
repositoryName (string) --
The name of the repository.
nextToken (string) --
The nextToken value to include in a future DescribeRepositories request. When the results of a DescribeRepositories request exceed maxResults , this value can be used to retrieve the next page of results. This value is null when there are no more results to return.