Amazon EC2 Container Registry

2020/05/15 - Amazon EC2 Container Registry - 2 updated api methods

Changes  Update ecr client to latest version

BatchGetImage (updated) Link ¶
Changes (response)
{'images': {'imageManifestMediaType': 'string'}}

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.

See also: AWS API Documentation

Request Syntax

client.batch_get_image(
    registryId='string',
    repositoryName='string',
    imageIds=[
        {
            'imageDigest': 'string',
            'imageTag': 'string'
        },
    ],
    acceptedMediaTypes=[
        'string',
    ]
)
type registryId:

string

param registryId:

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.

type repositoryName:

string

param repositoryName:

[REQUIRED]

The repository that contains the images to describe.

type imageIds:

list

param imageIds:

[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) --

    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.

type acceptedMediaTypes:

list

param acceptedMediaTypes:

The accepted media types for the request.

Valid values: application/vnd.docker.distribution.manifest.v1+json | application/vnd.docker.distribution.manifest.v2+json | application/vnd.oci.image.manifest.v1+json

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'images': [
        {
            'registryId': 'string',
            'repositoryName': 'string',
            'imageId': {
                'imageDigest': 'string',
                'imageTag': 'string'
            },
            'imageManifest': 'string',
            'imageManifestMediaType': 'string'
        },
    ],
    'failures': [
        {
            'imageId': {
                'imageDigest': 'string',
                'imageTag': 'string'
            },
            'failureCode': 'InvalidImageDigest'|'InvalidImageTag'|'ImageTagDoesNotMatchDigest'|'ImageNotFound'|'MissingDigestAndTag'|'ImageReferencedByManifestList',
            'failureReason': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • images (list) --

      A list of image objects corresponding to the image references in the request.

      • (dict) --

        An object representing an Amazon ECR 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.

        • imageManifestMediaType (string) --

          The media type associated with the image manifest.

    • 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.

PutImage (updated) Link ¶
Changes (request, response)
Request
{'imageManifestMediaType': 'string'}
Response
{'image': {'imageManifestMediaType': 'string'}}

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.

See also: AWS API Documentation

Request Syntax

client.put_image(
    registryId='string',
    repositoryName='string',
    imageManifest='string',
    imageManifestMediaType='string',
    imageTag='string'
)
type registryId:

string

param registryId:

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.

type repositoryName:

string

param repositoryName:

[REQUIRED]

The name of the repository in which to put the image.

type imageManifest:

string

param imageManifest:

[REQUIRED]

The image manifest corresponding to the image to be uploaded.

type imageManifestMediaType:

string

param imageManifestMediaType:

The media type of the image manifest. If you push an image manifest that does not contain the mediaType field, you must specify the imageManifestMediaType in the request.

type imageTag:

string

param imageTag:

The tag to associate with the image. This parameter is required for images that use the Docker Image Manifest V2 Schema 2 or OCI formats.

rtype:

dict

returns:

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 media type associated with the image manifest.