Table of Contents
A low-level client representing Amazon Elastic Container Registry Public (ECR Public)
Amazon Elastic Container Registry (Amazon ECR) is a managed container image registry service. Amazon ECR provides both public and private registries to host your container images. You 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 public repositories with this API. For information about the Amazon ECR API for private repositories, see Amazon Elastic Container Registry API Reference .
import boto3
client = boto3.client('ecr-public')
These are the available methods:
Checks the availability of one or more image layers within a repository in a public registry. 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.
Note
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.
See also: AWS API Documentation
Request Syntax
response = client.batch_check_layer_availability(
registryId='string',
repositoryName='string',
layerDigests=[
'string',
]
)
[REQUIRED]
The name of the repository that is associated with the image layers to check.
[REQUIRED]
The digests of the image layers to check.
dict
Response Syntax
{
'layers': [
{
'layerDigest': 'string',
'layerAvailability': 'AVAILABLE'|'UNAVAILABLE',
'layerSize': 123,
'mediaType': 'string'
},
],
'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) --
An object representing an Amazon ECR image layer.
layerDigest (string) --
The sha256 digest of the image layer.
layerAvailability (string) --
The availability status of the image layer.
layerSize (integer) --
The size, in bytes, of the image layer.
mediaType (string) --
The media type of the layer, such as application/vnd.docker.image.rootfs.diff.tar.gzip or application/vnd.oci.image.layer.v1.tar+gzip .
failures (list) --
Any failures associated with the call.
(dict) --
An object representing an Amazon ECR image layer failure.
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.
Exceptions
Deletes a list of specified images within a repository in a public registry. 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.
See also: AWS API Documentation
Request Syntax
response = client.batch_delete_image(
registryId='string',
repositoryName='string',
imageIds=[
{
'imageDigest': 'string',
'imageTag': 'string'
},
]
)
[REQUIRED]
The repository in a public registry that contains the image to delete.
[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 .
An object with identifying information for an Amazon ECR image.
The sha256 digest of the image manifest.
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'|'ImageReferencedByManifestList'|'KmsError',
'failureReason': 'string'
},
]
}
Response Structure
(dict) --
imageIds (list) --
The image IDs of the deleted images.
(dict) --
An object with identifying information for an Amazon ECR image.
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) --
An object representing an Amazon ECR image failure.
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.
Exceptions
Check if an operation can be paginated.
Informs Amazon ECR that the image layer upload has completed for a specified public 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.
Note
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.
See also: AWS API Documentation
Request Syntax
response = client.complete_layer_upload(
registryId='string',
repositoryName='string',
uploadId='string',
layerDigests=[
'string',
]
)
[REQUIRED]
The name of the repository in a public registry to associate with the image layer.
[REQUIRED]
The upload ID from a previous InitiateLayerUpload operation to associate with the image layer.
[REQUIRED]
The sha256 digest of the image layer.
dict
Response Syntax
{
'registryId': 'string',
'repositoryName': 'string',
'uploadId': 'string',
'layerDigest': 'string'
}
Response Structure
(dict) --
registryId (string) --
The public 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.
Exceptions
Creates a repository in a public registry. For more information, see Amazon ECR repositories in the Amazon Elastic Container Registry User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_repository(
repositoryName='string',
catalogData={
'description': 'string',
'architectures': [
'string',
],
'operatingSystems': [
'string',
],
'logoImageBlob': b'bytes',
'aboutText': 'string',
'usageText': 'string'
},
tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The name to use for the repository. This appears publicly in the Amazon ECR Public Gallery. 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 ).
The details about the repository that are publicly visible in the Amazon ECR Public Gallery.
A short description of the contents of the repository. This text appears in both the image details and also when searching for repositories on the Amazon ECR Public Gallery.
The system architecture that the images in the repository are compatible with. On the Amazon ECR Public Gallery, the following supported architectures will appear as badges on the repository and are used as search filters.
Note
If an unsupported tag is added to your repository catalog data, it will be associated with the repository and can be retrieved using the API but will not be discoverable in the Amazon ECR Public Gallery.
The operating systems that the images in the repository are compatible with. On the Amazon ECR Public Gallery, the following supported operating systems will appear as badges on the repository and are used as search filters.
Note
If an unsupported tag is added to your repository catalog data, it will be associated with the repository and can be retrieved using the API but will not be discoverable in the Amazon ECR Public Gallery.
The base64-encoded repository logo payload.
Note
The repository logo is only publicly visible in the Amazon ECR Public Gallery for verified accounts.
A detailed description of the contents of the repository. It is publicly visible in the Amazon ECR Public Gallery. The text must be in markdown format.
Detailed information on how to use the contents of the repository. It is publicly visible in the Amazon ECR Public Gallery. The usage text provides context, support information, and additional usage details for users of the repository. The text must be in markdown format.
The metadata that you apply to the repository to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.
The metadata that you apply to a resource to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.
One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values.
The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).
dict
Response Syntax
{
'repository': {
'repositoryArn': 'string',
'registryId': 'string',
'repositoryName': 'string',
'repositoryUri': 'string',
'createdAt': datetime(2015, 1, 1)
},
'catalogData': {
'description': 'string',
'architectures': [
'string',
],
'operatingSystems': [
'string',
],
'logoUrl': 'string',
'aboutText': 'string',
'usageText': 'string',
'marketplaceCertified': True|False
}
}
Response Structure
(dict) --
repository (dict) --
The repository that was created.
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, AWS account ID of the repository owner, repository namespace, and repository name. For example, arn:aws:ecr:region:012345678910:repository/test .
registryId (string) --
The AWS account ID associated with the public registry that contains the repository.
repositoryName (string) --
The name of the repository.
repositoryUri (string) --
The URI for the repository. You can use this URI for container image push and pull operations.
createdAt (datetime) --
The date and time, in JavaScript date format, when the repository was created.
catalogData (dict) --
The catalog data for a repository. This data is publicly visible in the Amazon ECR Public Gallery.
description (string) --
The short description of the repository.
architectures (list) --
The architecture tags that are associated with the repository.
Note
Only supported operating system tags appear publicly in the Amazon ECR Public Gallery. For more information, see RepositoryCatalogDataInput .
operatingSystems (list) --
The operating system tags that are associated with the repository.
Note
Only supported operating system tags appear publicly in the Amazon ECR Public Gallery. For more information, see RepositoryCatalogDataInput .
logoUrl (string) --
The URL containing the logo associated with the repository.
aboutText (string) --
The longform description of the contents of the repository. This text appears in the repository details on the Amazon ECR Public Gallery.
usageText (string) --
The longform usage details of the contents of the repository. The usage text provides context for users of the repository.
marketplaceCertified (boolean) --
Whether or not the repository is certified by AWS Marketplace.
Exceptions
Deletes a repository in a public registry. If the repository contains images, you must either delete all images in the repository or use the force option which deletes all images on your behalf before deleting the repository.
See also: AWS API Documentation
Request Syntax
response = client.delete_repository(
registryId='string',
repositoryName='string',
force=True|False
)
[REQUIRED]
The name of the repository to delete.
dict
Response Syntax
{
'repository': {
'repositoryArn': 'string',
'registryId': 'string',
'repositoryName': 'string',
'repositoryUri': 'string',
'createdAt': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
repository (dict) --
The repository that was deleted.
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, AWS account ID of the repository owner, repository namespace, and repository name. For example, arn:aws:ecr:region:012345678910:repository/test .
registryId (string) --
The AWS account ID associated with the public registry that contains the repository.
repositoryName (string) --
The name of the repository.
repositoryUri (string) --
The URI for the repository. You can use this URI for container image push and pull operations.
createdAt (datetime) --
The date and time, in JavaScript date format, when the repository was created.
Exceptions
Deletes the repository policy associated with the specified repository.
See also: AWS API Documentation
Request Syntax
response = client.delete_repository_policy(
registryId='string',
repositoryName='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.
Exceptions
Returns the image tag details for a repository in a public registry.
See also: AWS API Documentation
Request Syntax
response = client.describe_image_tags(
registryId='string',
repositoryName='string',
nextToken='string',
maxResults=123
)
[REQUIRED]
The name of the repository that contains the image tag details to describe.
dict
Response Syntax
{
'imageTagDetails': [
{
'imageTag': 'string',
'createdAt': datetime(2015, 1, 1),
'imageDetail': {
'imageDigest': 'string',
'imageSizeInBytes': 123,
'imagePushedAt': datetime(2015, 1, 1),
'imageManifestMediaType': 'string',
'artifactMediaType': 'string'
}
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
imageTagDetails (list) --
The image tag details for the images in the requested repository.
(dict) --
An object representing the image tag details for an image.
imageTag (string) --
The tag associated with the image.
createdAt (datetime) --
The time stamp indicating when the image tag was created.
imageDetail (dict) --
An object that describes the details of an image.
imageDigest (string) --
The sha256 digest of the image manifest.
imageSizeInBytes (integer) --
The size, in bytes, of the image in the repository.
If the image is a manifest list, this will be the max size of all manifests in the list.
Note
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 .
imagePushedAt (datetime) --
The date and time, expressed in standard JavaScript date format, at which the current image tag was pushed to the repository.
imageManifestMediaType (string) --
The media type of the image manifest.
artifactMediaType (string) --
The artifact media type of the image.
nextToken (string) --
The nextToken value to include in a future DescribeImageTags request. When the results of a DescribeImageTags 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.
Exceptions
Returns metadata about the images in a repository in a public registry.
Note
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 .
See also: AWS API Documentation
Request Syntax
response = client.describe_images(
registryId='string',
repositoryName='string',
imageIds=[
{
'imageDigest': 'string',
'imageTag': 'string'
},
],
nextToken='string',
maxResults=123
)
[REQUIRED]
The repository that contains the images to describe.
The list of image IDs for the requested repository.
An object with identifying information for an Amazon ECR image.
The sha256 digest of the image manifest.
The tag used for the image.
dict
Response Syntax
{
'imageDetails': [
{
'registryId': 'string',
'repositoryName': 'string',
'imageDigest': 'string',
'imageTags': [
'string',
],
'imageSizeInBytes': 123,
'imagePushedAt': datetime(2015, 1, 1),
'imageManifestMediaType': 'string',
'artifactMediaType': 'string'
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
imageDetails (list) --
A list of ImageDetail objects that contain data about the image.
(dict) --
An object that describes an image returned by a DescribeImages operation.
registryId (string) --
The AWS account ID associated with the public registry to which this image belongs.
repositoryName (string) --
The name of the repository to which this image belongs.
imageDigest (string) --
The sha256 digest of the image manifest.
imageTags (list) --
The list of tags associated with this image.
imageSizeInBytes (integer) --
The size, in bytes, of the image in the repository.
If the image is a manifest list, this will be the max size of all manifests in the list.
Note
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 .
imagePushedAt (datetime) --
The date and time, expressed in standard JavaScript date format, at which the current image was pushed to the repository.
imageManifestMediaType (string) --
The media type of the image manifest.
artifactMediaType (string) --
The artifact media type of the image.
nextToken (string) --
The nextToken value to include in a future DescribeImages request. When the results of a DescribeImages 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.
Exceptions
Returns details for a public registry.
See also: AWS API Documentation
Request Syntax
response = client.describe_registries(
nextToken='string',
maxResults=123
)
The nextToken value returned from a previous paginated DescribeRegistries 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.
Note
This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
dict
Response Syntax
{
'registries': [
{
'registryId': 'string',
'registryArn': 'string',
'registryUri': 'string',
'verified': True|False,
'aliases': [
{
'name': 'string',
'status': 'ACTIVE'|'PENDING'|'REJECTED',
'primaryRegistryAlias': True|False,
'defaultRegistryAlias': True|False
},
]
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
registries (list) --
An object containing the details for a public registry.
(dict) --
The details of a public registry.
registryId (string) --
The AWS account ID associated with the registry. If you do not specify a registry, the default public registry is assumed.
registryArn (string) --
The Amazon Resource Name (ARN) of the public registry.
registryUri (string) --
The URI of a public registry. The URI contains a universal prefix and the registry alias.
verified (boolean) --
Whether the account is verified. This indicates whether the account is an AWS Marketplace vendor. If an account is verified, each public repository will received a verified account badge on the Amazon ECR Public Gallery.
aliases (list) --
An array of objects representing the aliases for a public registry.
(dict) --
An object representing the aliases for a public registry. A public registry is given an alias upon creation but a custom alias can be set using the Amazon ECR console. For more information, see Registries in the Amazon Elastic Container Registry User Guide .
name (string) --
The name of the registry alias.
status (string) --
The status of the registry alias.
primaryRegistryAlias (boolean) --
Whether or not the registry alias is the primary alias for the registry. If true, the alias is the primary registry alias and is displayed in both the repository URL and the image URI used in the docker pull commands on the Amazon ECR Public Gallery.
Note
A registry alias that is not the primary registry alias can be used in the repository URI in a docker pull command.
defaultRegistryAlias (boolean) --
Whether or not the registry alias is the default alias for the registry. When the first public repository is created, your public registry is assigned a default registry alias.
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.
Exceptions
Describes repositories in a public registry.
See also: AWS API Documentation
Request Syntax
response = client.describe_repositories(
registryId='string',
repositoryNames=[
'string',
],
nextToken='string',
maxResults=123
)
A list of repositories to describe. If this parameter is omitted, then all repositories in a registry are described.
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. This option cannot be used when you specify repositories with repositoryNames .
Note
This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
dict
Response Syntax
{
'repositories': [
{
'repositoryArn': 'string',
'registryId': 'string',
'repositoryName': 'string',
'repositoryUri': 'string',
'createdAt': datetime(2015, 1, 1)
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
repositories (list) --
A list of repository objects corresponding to valid repositories.
(dict) --
An 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, AWS account ID of the repository owner, repository namespace, and repository name. For example, arn:aws:ecr:region:012345678910:repository/test .
registryId (string) --
The AWS account ID associated with the public registry that contains the repository.
repositoryName (string) --
The name of the repository.
repositoryUri (string) --
The URI for the repository. You can use this URI for container image push and pull operations.
createdAt (datetime) --
The date and time, in JavaScript date format, when the repository was created.
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.
Exceptions
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. This API requires the ecr-public:GetAuthorizationToken and sts:GetServiceBearerToken permissions.
See also: AWS API Documentation
Request Syntax
response = client.get_authorization_token()
{
'authorizationData': {
'authorizationToken': 'string',
'expiresAt': datetime(2015, 1, 1)
}
}
Response Structure
An authorization token data object that corresponds to a public registry.
A base64-encoded string that contains authorization data for a public Amazon ECR registry. When the string is decoded, it is presented in the format user:password for public registry authentication using docker login .
The Unix time in seconds and milliseconds when the authorization token expires. Authorization tokens are valid for 12 hours.
Exceptions
Create a paginator for an operation.
Retrieves catalog metadata for a public registry.
See also: AWS API Documentation
Request Syntax
response = client.get_registry_catalog_data()
{
'registryCatalogData': {
'displayName': 'string'
}
}
Response Structure
The catalog metadata for the public registry.
The display name for a public registry. This appears on the Amazon ECR Public Gallery.
Warning
Only accounts that have the verified account badge can have a registry display name.
Exceptions
Retrieve catalog metadata for a repository in a public registry. This metadata is displayed publicly in the Amazon ECR Public Gallery.
See also: AWS API Documentation
Request Syntax
response = client.get_repository_catalog_data(
registryId='string',
repositoryName='string'
)
[REQUIRED]
The name of the repository to retrieve the catalog metadata for.
dict
Response Syntax
{
'catalogData': {
'description': 'string',
'architectures': [
'string',
],
'operatingSystems': [
'string',
],
'logoUrl': 'string',
'aboutText': 'string',
'usageText': 'string',
'marketplaceCertified': True|False
}
}
Response Structure
(dict) --
catalogData (dict) --
The catalog metadata for the repository.
description (string) --
The short description of the repository.
architectures (list) --
The architecture tags that are associated with the repository.
Note
Only supported operating system tags appear publicly in the Amazon ECR Public Gallery. For more information, see RepositoryCatalogDataInput .
operatingSystems (list) --
The operating system tags that are associated with the repository.
Note
Only supported operating system tags appear publicly in the Amazon ECR Public Gallery. For more information, see RepositoryCatalogDataInput .
logoUrl (string) --
The URL containing the logo associated with the repository.
aboutText (string) --
The longform description of the contents of the repository. This text appears in the repository details on the Amazon ECR Public Gallery.
usageText (string) --
The longform usage details of the contents of the repository. The usage text provides context for users of the repository.
marketplaceCertified (boolean) --
Whether or not the repository is certified by AWS Marketplace.
Exceptions
Retrieves the repository policy for the specified repository.
See also: AWS API Documentation
Request Syntax
response = client.get_repository_policy(
registryId='string',
repositoryName='string'
)
[REQUIRED]
The name of the repository with the policy 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 repository policy text associated with the repository. The policy text will be in JSON format.
Exceptions
Returns an object that can wait for some condition.
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.
Note
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.
See also: AWS API Documentation
Request Syntax
response = client.initiate_layer_upload(
registryId='string',
repositoryName='string'
)
[REQUIRED]
The name of the repository to which you intend to upload layers.
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.
Exceptions
List the tags for an Amazon ECR Public resource.
See also: AWS API Documentation
Request Syntax
response = client.list_tags_for_resource(
resourceArn='string'
)
[REQUIRED]
The Amazon Resource Name (ARN) that identifies the resource for which to list the tags. Currently, the supported resource is an Amazon ECR Public repository.
{
'tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
Response Structure
The tags for the resource.
The metadata that you apply to a resource to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.
One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values.
The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).
Exceptions
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.
Note
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.
See also: AWS API Documentation
Request Syntax
response = client.put_image(
registryId='string',
repositoryName='string',
imageManifest='string',
imageManifestMediaType='string',
imageTag='string',
imageDigest='string'
)
[REQUIRED]
The name of the repository in which to put the image.
[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',
'imageManifestMediaType': '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.
imageManifestMediaType (string) --
The manifest media type of the image.
Exceptions
Create or updates the catalog data for a public registry.
See also: AWS API Documentation
Request Syntax
response = client.put_registry_catalog_data(
displayName='string'
)
The display name for a public registry. The display name is shown as the repository author in the Amazon ECR Public Gallery.
Note
The registry display name is only publicly visible in the Amazon ECR Public Gallery for verified accounts.
{
'registryCatalogData': {
'displayName': 'string'
}
}
Response Structure
The catalog data for the public registry.
The display name for a public registry. This appears on the Amazon ECR Public Gallery.
Warning
Only accounts that have the verified account badge can have a registry display name.
Exceptions
Creates or updates the catalog data for a repository in a public registry.
See also: AWS API Documentation
Request Syntax
response = client.put_repository_catalog_data(
registryId='string',
repositoryName='string',
catalogData={
'description': 'string',
'architectures': [
'string',
],
'operatingSystems': [
'string',
],
'logoImageBlob': b'bytes',
'aboutText': 'string',
'usageText': 'string'
}
)
[REQUIRED]
The name of the repository to create or update the catalog data for.
[REQUIRED]
An object containing the catalog data for a repository. This data is publicly visible in the Amazon ECR Public Gallery.
A short description of the contents of the repository. This text appears in both the image details and also when searching for repositories on the Amazon ECR Public Gallery.
The system architecture that the images in the repository are compatible with. On the Amazon ECR Public Gallery, the following supported architectures will appear as badges on the repository and are used as search filters.
Note
If an unsupported tag is added to your repository catalog data, it will be associated with the repository and can be retrieved using the API but will not be discoverable in the Amazon ECR Public Gallery.
The operating systems that the images in the repository are compatible with. On the Amazon ECR Public Gallery, the following supported operating systems will appear as badges on the repository and are used as search filters.
Note
If an unsupported tag is added to your repository catalog data, it will be associated with the repository and can be retrieved using the API but will not be discoverable in the Amazon ECR Public Gallery.
The base64-encoded repository logo payload.
Note
The repository logo is only publicly visible in the Amazon ECR Public Gallery for verified accounts.
A detailed description of the contents of the repository. It is publicly visible in the Amazon ECR Public Gallery. The text must be in markdown format.
Detailed information on how to use the contents of the repository. It is publicly visible in the Amazon ECR Public Gallery. The usage text provides context, support information, and additional usage details for users of the repository. The text must be in markdown format.
dict
Response Syntax
{
'catalogData': {
'description': 'string',
'architectures': [
'string',
],
'operatingSystems': [
'string',
],
'logoUrl': 'string',
'aboutText': 'string',
'usageText': 'string',
'marketplaceCertified': True|False
}
}
Response Structure
(dict) --
catalogData (dict) --
The catalog data for the repository.
description (string) --
The short description of the repository.
architectures (list) --
The architecture tags that are associated with the repository.
Note
Only supported operating system tags appear publicly in the Amazon ECR Public Gallery. For more information, see RepositoryCatalogDataInput .
operatingSystems (list) --
The operating system tags that are associated with the repository.
Note
Only supported operating system tags appear publicly in the Amazon ECR Public Gallery. For more information, see RepositoryCatalogDataInput .
logoUrl (string) --
The URL containing the logo associated with the repository.
aboutText (string) --
The longform description of the contents of the repository. This text appears in the repository details on the Amazon ECR Public Gallery.
usageText (string) --
The longform usage details of the contents of the repository. The usage text provides context for users of the repository.
marketplaceCertified (boolean) --
Whether or not the repository is certified by AWS Marketplace.
Exceptions
Applies a repository policy to the specified public repository to control access permissions. For more information, see Amazon ECR Repository Policies in the Amazon Elastic Container Registry User Guide .
See also: AWS API Documentation
Request Syntax
response = client.set_repository_policy(
registryId='string',
repositoryName='string',
policyText='string',
force=True|False
)
[REQUIRED]
The name of the repository to receive the policy.
[REQUIRED]
The JSON repository policy text to apply to the repository. For more information, see Amazon ECR Repository Policies in the Amazon Elastic Container Registry User Guide .
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.
Exceptions
Associates the specified tags to a resource with the specified resourceArn . If existing tags on a resource are not specified in the request parameters, they are not changed. When a resource is deleted, the tags associated with that resource are deleted as well.
See also: AWS API Documentation
Request Syntax
response = client.tag_resource(
resourceArn='string',
tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The Amazon Resource Name (ARN) of the resource to which to add tags. Currently, the supported resource is an Amazon ECR Public repository.
[REQUIRED]
The tags to add to the resource. A tag is an array of key-value pairs. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.
The metadata that you apply to a resource to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.
One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values.
The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).
dict
Response Syntax
{}
Response Structure
Exceptions
Deletes specified tags from a resource.
See also: AWS API Documentation
Request Syntax
response = client.untag_resource(
resourceArn='string',
tagKeys=[
'string',
]
)
[REQUIRED]
The Amazon Resource Name (ARN) of the resource from which to delete tags. Currently, the supported resource is an Amazon ECR Public repository.
[REQUIRED]
The keys of the tags to be removed.
dict
Response Syntax
{}
Response Structure
Exceptions
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.
Note
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.
See also: AWS API Documentation
Request Syntax
response = client.upload_layer_part(
registryId='string',
repositoryName='string',
uploadId='string',
partFirstByte=123,
partLastByte=123,
layerPartBlob=b'bytes'
)
[REQUIRED]
The name of the repository to which you are uploading layer parts.
[REQUIRED]
The upload ID from a previous InitiateLayerUpload operation to associate with the layer part upload.
[REQUIRED]
The position of the first byte of the layer part witin the overall image layer.
[REQUIRED]
The position of the last byte of the layer part within the overall image layer.
[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.
Exceptions
The available paginators are:
paginator = client.get_paginator('describe_image_tags')
Creates an iterator that will paginate through responses from ECRPublic.Client.describe_image_tags().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
registryId='string',
repositoryName='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The name of the repository that contains the image tag details to describe.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'imageTagDetails': [
{
'imageTag': 'string',
'createdAt': datetime(2015, 1, 1),
'imageDetail': {
'imageDigest': 'string',
'imageSizeInBytes': 123,
'imagePushedAt': datetime(2015, 1, 1),
'imageManifestMediaType': 'string',
'artifactMediaType': 'string'
}
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
imageTagDetails (list) --
The image tag details for the images in the requested repository.
(dict) --
An object representing the image tag details for an image.
imageTag (string) --
The tag associated with the image.
createdAt (datetime) --
The time stamp indicating when the image tag was created.
imageDetail (dict) --
An object that describes the details of an image.
imageDigest (string) --
The sha256 digest of the image manifest.
imageSizeInBytes (integer) --
The size, in bytes, of the image in the repository.
If the image is a manifest list, this will be the max size of all manifests in the list.
Note
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 .
imagePushedAt (datetime) --
The date and time, expressed in standard JavaScript date format, at which the current image tag was pushed to the repository.
imageManifestMediaType (string) --
The media type of the image manifest.
artifactMediaType (string) --
The artifact media type of the image.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('describe_images')
Creates an iterator that will paginate through responses from ECRPublic.Client.describe_images().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
registryId='string',
repositoryName='string',
imageIds=[
{
'imageDigest': 'string',
'imageTag': 'string'
},
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The repository that contains the images to describe.
The list of image IDs for the requested repository.
An object with identifying information for an Amazon ECR image.
The sha256 digest of the image manifest.
The tag used for the image.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'imageDetails': [
{
'registryId': 'string',
'repositoryName': 'string',
'imageDigest': 'string',
'imageTags': [
'string',
],
'imageSizeInBytes': 123,
'imagePushedAt': datetime(2015, 1, 1),
'imageManifestMediaType': 'string',
'artifactMediaType': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
imageDetails (list) --
A list of ImageDetail objects that contain data about the image.
(dict) --
An object that describes an image returned by a DescribeImages operation.
registryId (string) --
The AWS account ID associated with the public registry to which this image belongs.
repositoryName (string) --
The name of the repository to which this image belongs.
imageDigest (string) --
The sha256 digest of the image manifest.
imageTags (list) --
The list of tags associated with this image.
imageSizeInBytes (integer) --
The size, in bytes, of the image in the repository.
If the image is a manifest list, this will be the max size of all manifests in the list.
Note
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 .
imagePushedAt (datetime) --
The date and time, expressed in standard JavaScript date format, at which the current image was pushed to the repository.
imageManifestMediaType (string) --
The media type of the image manifest.
artifactMediaType (string) --
The artifact media type of the image.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('describe_registries')
Creates an iterator that will paginate through responses from ECRPublic.Client.describe_registries().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
{
'registries': [
{
'registryId': 'string',
'registryArn': 'string',
'registryUri': 'string',
'verified': True|False,
'aliases': [
{
'name': 'string',
'status': 'ACTIVE'|'PENDING'|'REJECTED',
'primaryRegistryAlias': True|False,
'defaultRegistryAlias': True|False
},
]
},
],
'NextToken': 'string'
}
Response Structure
An object containing the details for a public registry.
The details of a public registry.
The AWS account ID associated with the registry. If you do not specify a registry, the default public registry is assumed.
The Amazon Resource Name (ARN) of the public registry.
The URI of a public registry. The URI contains a universal prefix and the registry alias.
Whether the account is verified. This indicates whether the account is an AWS Marketplace vendor. If an account is verified, each public repository will received a verified account badge on the Amazon ECR Public Gallery.
An array of objects representing the aliases for a public registry.
An object representing the aliases for a public registry. A public registry is given an alias upon creation but a custom alias can be set using the Amazon ECR console. For more information, see Registries in the Amazon Elastic Container Registry User Guide .
The name of the registry alias.
The status of the registry alias.
Whether or not the registry alias is the primary alias for the registry. If true, the alias is the primary registry alias and is displayed in both the repository URL and the image URI used in the docker pull commands on the Amazon ECR Public Gallery.
Note
A registry alias that is not the primary registry alias can be used in the repository URI in a docker pull command.
Whether or not the registry alias is the default alias for the registry. When the first public repository is created, your public registry is assigned a default registry alias.
A token to resume pagination.
paginator = client.get_paginator('describe_repositories')
Creates an iterator that will paginate through responses from ECRPublic.Client.describe_repositories().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
registryId='string',
repositoryNames=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
A list of repositories to describe. If this parameter is omitted, then all repositories in a registry are described.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'repositories': [
{
'repositoryArn': 'string',
'registryId': 'string',
'repositoryName': 'string',
'repositoryUri': 'string',
'createdAt': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
repositories (list) --
A list of repository objects corresponding to valid repositories.
(dict) --
An 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, AWS account ID of the repository owner, repository namespace, and repository name. For example, arn:aws:ecr:region:012345678910:repository/test .
registryId (string) --
The AWS account ID associated with the public registry that contains the repository.
repositoryName (string) --
The name of the repository.
repositoryUri (string) --
The URI for the repository. You can use this URI for container image push and pull operations.
createdAt (datetime) --
The date and time, in JavaScript date format, when the repository was created.
NextToken (string) --
A token to resume pagination.