initiate_layer_upload

initiate_layer_upload(**kwargs)

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'
)
Parameters
  • registryId (string) -- The Amazon Web Services account ID associated with the registry to which you intend to upload layers. If you do not specify a registry, the default registry is assumed.
  • repositoryName (string) --

    [REQUIRED]

    The name of the repository to which you intend to upload layers.

Return type

dict

Returns

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

  • ECR.Client.exceptions.ServerException
  • ECR.Client.exceptions.InvalidParameterException
  • ECR.Client.exceptions.RepositoryNotFoundException
  • ECR.Client.exceptions.KmsException