Amazon EC2 Container Registry

2019/07/25 - Amazon EC2 Container Registry - 1 new 3 updated api methods

Changes  This release adds support for immutable image tags.

PutImageTagMutability (new) Link ¶

Updates the image tag mutability settings for a repository.

See also: AWS API Documentation

Request Syntax

client.put_image_tag_mutability(
    registryId='string',
    repositoryName='string',
    imageTagMutability='MUTABLE'|'IMMUTABLE'
)
type registryId

string

param registryId

The AWS account ID associated with the registry that contains the repository in which to update the image tag mutability settings. 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 update the image tag mutability settings.

type imageTagMutability

string

param imageTagMutability

[REQUIRED]

The tag mutability setting for the repository. If MUTABLE is specified, image tags can be overwritten. If IMMUTABLE is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.

rtype

dict

returns

Response Syntax

{
    'registryId': 'string',
    'repositoryName': 'string',
    'imageTagMutability': 'MUTABLE'|'IMMUTABLE'
}

Response Structure

  • (dict) --

    • registryId (string) --

      The registry ID associated with the request.

    • repositoryName (string) --

      The repository name associated with the request.

    • imageTagMutability (string) --

      The image tag mutability setting for the repository.

CreateRepository (updated) Link ¶
Changes (request, response)
Request
{'imageTagMutability': 'MUTABLE | IMMUTABLE'}
Response
{'repository': {'imageTagMutability': 'MUTABLE | IMMUTABLE'}}

Creates an image repository.

See also: AWS API Documentation

Request Syntax

client.create_repository(
    repositoryName='string',
    tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    imageTagMutability='MUTABLE'|'IMMUTABLE'
)
type repositoryName

string

param repositoryName

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

type tags

list

param tags

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.

  • (dict) --

    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.

    • Key (string) --

      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.

    • Value (string) --

      The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).

type imageTagMutability

string

param imageTagMutability

The tag mutability setting for the repository. If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten. If IMMUTABLE is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.

rtype

dict

returns

Response Syntax

{
    'repository': {
        'repositoryArn': 'string',
        'registryId': 'string',
        'repositoryName': 'string',
        'repositoryUri': 'string',
        'createdAt': datetime(2015, 1, 1),
        'imageTagMutability': 'MUTABLE'|'IMMUTABLE'
    }
}

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 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 Docker push or pull operations.

      • createdAt (datetime) --

        The date and time, in JavaScript date format, when the repository was created.

      • imageTagMutability (string) --

        The tag mutability setting for the repository.

DeleteRepository (updated) Link ¶
Changes (response)
{'repository': {'imageTagMutability': 'MUTABLE | IMMUTABLE'}}

Deletes an existing image repository. If a repository contains images, you must use the force option to delete it.

See also: AWS API Documentation

Request Syntax

client.delete_repository(
    registryId='string',
    repositoryName='string',
    force=True|False
)
type registryId

string

param registryId

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.

type repositoryName

string

param repositoryName

[REQUIRED]

The name of the repository to delete.

type force

boolean

param force

If a repository contains images, forces the deletion.

rtype

dict

returns

Response Syntax

{
    'repository': {
        'repositoryArn': 'string',
        'registryId': 'string',
        'repositoryName': 'string',
        'repositoryUri': 'string',
        'createdAt': datetime(2015, 1, 1),
        'imageTagMutability': 'MUTABLE'|'IMMUTABLE'
    }
}

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 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 Docker push or pull operations.

      • createdAt (datetime) --

        The date and time, in JavaScript date format, when the repository was created.

      • imageTagMutability (string) --

        The tag mutability setting for the repository.

DescribeRepositories (updated) Link ¶
Changes (response)
{'repositories': {'imageTagMutability': 'MUTABLE | IMMUTABLE'}}

Describes image repositories in a registry.

See also: AWS API Documentation

Request Syntax

client.describe_repositories(
    registryId='string',
    repositoryNames=[
        'string',
    ],
    nextToken='string',
    maxResults=123
)
type registryId

string

param registryId

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.

type repositoryNames

list

param repositoryNames

A list of repositories to describe. If this parameter is omitted, then all repositories in a registry are described.

  • (string) --

type nextToken

string

param nextToken

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.

type maxResults

integer

param maxResults

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 1000. If this parameter is not used, then DescribeRepositories returns up to 100 results and a nextToken value, if applicable. This option cannot be used when you specify repositories with repositoryNames .

rtype

dict

returns

Response Syntax

{
    'repositories': [
        {
            'repositoryArn': 'string',
            'registryId': 'string',
            'repositoryName': 'string',
            'repositoryUri': 'string',
            'createdAt': datetime(2015, 1, 1),
            'imageTagMutability': 'MUTABLE'|'IMMUTABLE'
        },
    ],
    '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 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 Docker push or pull operations.

        • createdAt (datetime) --

          The date and time, in JavaScript date format, when the repository was created.

        • imageTagMutability (string) --

          The tag mutability setting for 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.