Class: AWS.ECR

Inherits:
AWS.Service show all
Identifier:
ecr
API Version:
2015-09-21
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Sending a Request Using ECR

var ecr = new AWS.ECR();
ecr.batchCheckLayerAvailability(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the ECR object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var ecr = new AWS.ECR({apiVersion: '2015-09-21'});

You can also set the API version globally in AWS.config.apiVersions using the ecr service identifier:

AWS.config.apiVersions = {
  ecr: '2015-09-21',
  // other service API versions
};

var ecr = new AWS.ECR();

Version:

  • 2015-09-21

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

new AWS.ECR(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a ECR object

var ecr = new AWS.ECR({apiVersion: '2015-09-21'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com'.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.ECR.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.ECR.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.ECR.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and returns the amount of time to delay in milliseconds. The base option will be ignored if this option is supplied.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

  • dynamoDbCrc32 (Boolean)

    whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default: true.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

batchCheckLayerAvailability(params = {}, callback) ⇒ AWS.Request

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 for pulling and pushing images. In most cases, you should use the docker CLI to pull, tag, and push images.

Service Reference:

Examples:

Calling the batchCheckLayerAvailability operation

var params = {
  layerDigests: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  repositoryName: 'STRING_VALUE', /* required */
  registryId: 'STRING_VALUE'
};
ecr.batchCheckLayerAvailability(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • registryId — (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.

    • repositoryName — (String)

      The name of the repository that is associated with the image layers to check.

    • layerDigests — (Array<String>)

      The digests of the image layers to check.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • layers — (Array<map>)

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

        • layerDigest — (String)

          The sha256 digest of the image layer.

        • layerAvailability — (String)

          The availability status of the image layer.

          Possible values include:
          • "AVAILABLE"
          • "UNAVAILABLE"
        • 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 — (Array<map>)

        Any failures associated with the call.

        • layerDigest — (String)

          The layer digest associated with the failure.

        • failureCode — (String)

          The failure code associated with the failure.

          Possible values include:
          • "InvalidLayerDigest"
          • "MissingLayerDigest"
        • failureReason — (String)

          The reason for the failure.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

batchDeleteImage(params = {}, callback) ⇒ AWS.Request

Deletes a list of specified images within a specified repository. Images are specified with either 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.

Service Reference:

Examples:

To delete multiple images


/* This example deletes images with the tags precise and trusty in a repository called ubuntu in the default registry for an account. */

 var params = {
  imageIds: [
     {
    imageTag: "precise"
   }
  ], 
  repositoryName: "ubuntu"
 };
 ecr.batchDeleteImage(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    failures: [
    ], 
    imageIds: [
       {
      imageDigest: "sha256:examplee6d1e504117a17000003d3753086354a38375961f2e665416ef4b1b2f", 
      imageTag: "precise"
     }
    ]
   }
   */
 });

Calling the batchDeleteImage operation

var params = {
  imageIds: [ /* required */
    {
      imageDigest: 'STRING_VALUE',
      imageTag: 'STRING_VALUE'
    },
    /* more items */
  ],
  repositoryName: 'STRING_VALUE', /* required */
  registryId: 'STRING_VALUE'
};
ecr.batchDeleteImage(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • registryId — (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.

    • repositoryName — (String)

      The repository that contains the image to delete.

    • imageIds — (Array<map>)

      A list of image ID references that correspond to images to delete. The format of the imageIds reference is imageTag=tag or imageDigest=digest.

      • imageDigest — (String)

        The sha256 digest of the image manifest.

      • imageTag — (String)

        The tag used for the image.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • imageIds — (Array<map>)

        The image IDs of the deleted images.

        • imageDigest — (String)

          The sha256 digest of the image manifest.

        • imageTag — (String)

          The tag used for the image.

      • failures — (Array<map>)

        Any failures associated with the call.

        • imageId — (map)

          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.

          Possible values include:
          • "InvalidImageDigest"
          • "InvalidImageTag"
          • "ImageTagDoesNotMatchDigest"
          • "ImageNotFound"
          • "MissingDigestAndTag"
        • failureReason — (String)

          The reason for the failure.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

batchGetImage(params = {}, callback) ⇒ AWS.Request

Gets detailed information for specified images within a specified repository. Images are specified with either imageTag or imageDigest.

Service Reference:

Examples:

To obtain multiple images in a single request


/* This example obtains information for an image with a specified image digest ID from the repository named ubuntu in the current account. */

 var params = {
  imageIds: [
     {
    imageTag: "precise"
   }
  ], 
  repositoryName: "ubuntu"
 };
 ecr.batchGetImage(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    failures: [
    ], 
    images: [
       {
      imageId: {
       imageDigest: "sha256:example76bdff6d83a09ba2a818f0d00000063724a9ac3ba5019c56f74ebf42a", 
       imageTag: "precise"
      }, 
      imageManifest: "{\n \"schemaVersion\": 1,\n \"name\": \"ubuntu\",\n \"tag\": \"precise\",\n...", 
      registryId: "244698725403", 
      repositoryName: "ubuntu"
     }
    ]
   }
   */
 });

Calling the batchGetImage operation

var params = {
  imageIds: [ /* required */
    {
      imageDigest: 'STRING_VALUE',
      imageTag: 'STRING_VALUE'
    },
    /* more items */
  ],
  repositoryName: 'STRING_VALUE', /* required */
  acceptedMediaTypes: [
    'STRING_VALUE',
    /* more items */
  ],
  registryId: 'STRING_VALUE'
};
ecr.batchGetImage(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • registryId — (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.

    • repositoryName — (String)

      The repository that contains the images to describe.

    • imageIds — (Array<map>)

      A list of image ID references that correspond to images to describe. The format of the imageIds reference is imageTag=tag or imageDigest=digest.

      • imageDigest — (String)

        The sha256 digest of the image manifest.

      • imageTag — (String)

        The tag used for the image.

    • acceptedMediaTypes — (Array<String>)

      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

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • images — (Array<map>)

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

        • 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 — (map)

          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 — (Array<map>)

        Any failures associated with the call.

        • imageId — (map)

          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.

          Possible values include:
          • "InvalidImageDigest"
          • "InvalidImageTag"
          • "ImageTagDoesNotMatchDigest"
          • "ImageNotFound"
          • "MissingDigestAndTag"
        • failureReason — (String)

          The reason for the failure.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

completeLayerUpload(params = {}, callback) ⇒ AWS.Request

Informs Amazon ECR that the image layer upload has completed for a specified registry, repository name, and upload ID. 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 for pulling and pushing images. In most cases, you should use the docker CLI to pull, tag, and push images.

Service Reference:

Examples:

Calling the completeLayerUpload operation

var params = {
  layerDigests: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  repositoryName: 'STRING_VALUE', /* required */
  uploadId: 'STRING_VALUE', /* required */
  registryId: 'STRING_VALUE'
};
ecr.completeLayerUpload(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • registryId — (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.

    • repositoryName — (String)

      The name of the repository to associate with the image layer.

    • uploadId — (String)

      The upload ID from a previous InitiateLayerUpload operation to associate with the image layer.

    • layerDigests — (Array<String>)

      The sha256 digest of the image layer.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createRepository(params = {}, callback) ⇒ AWS.Request

Creates an image repository.

Service Reference:

Examples:

To create a new repository


/* This example creates a repository called nginx-web-app inside the project-a namespace in the default registry for an account. */

 var params = {
  repositoryName: "project-a/nginx-web-app"
 };
 ecr.createRepository(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    repository: {
     registryId: "012345678901", 
     repositoryArn: "arn:aws:ecr:us-west-2:012345678901:repository/project-a/nginx-web-app", 
     repositoryName: "project-a/nginx-web-app"
    }
   }
   */
 });

Calling the createRepository operation

var params = {
  repositoryName: 'STRING_VALUE' /* required */
};
ecr.createRepository(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

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

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • repository — (map)

        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 — (Date)

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteLifecyclePolicy(params = {}, callback) ⇒ AWS.Request

Deletes the specified lifecycle policy.

Service Reference:

Examples:

Calling the deleteLifecyclePolicy operation

var params = {
  repositoryName: 'STRING_VALUE', /* required */
  registryId: 'STRING_VALUE'
};
ecr.deleteLifecyclePolicy(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • registryId — (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.

    • repositoryName — (String)

      The name of the repository that is associated with the repository policy to
 delete.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • registryId — (String)

        The registry ID associated with the request.

      • repositoryName — (String)

        The repository name associated with the request.

      • lifecyclePolicyText — (String)

        The JSON repository policy text.

      • lastEvaluatedAt — (Date)

        The time stamp of the last time that the lifecycle policy was run.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteRepository(params = {}, callback) ⇒ AWS.Request

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

Service Reference:

Examples:

To force delete a repository


/* This example force deletes a repository named ubuntu in the default registry for an account. The force parameter is required if the repository contains images. */

 var params = {
  force: true, 
  repositoryName: "ubuntu"
 };
 ecr.deleteRepository(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    repository: {
     registryId: "012345678901", 
     repositoryArn: "arn:aws:ecr:us-west-2:012345678901:repository/ubuntu", 
     repositoryName: "ubuntu"
    }
   }
   */
 });

Calling the deleteRepository operation

var params = {
  repositoryName: 'STRING_VALUE', /* required */
  force: true || false,
  registryId: 'STRING_VALUE'
};
ecr.deleteRepository(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • registryId — (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.

    • repositoryName — (String)

      The name of the repository to delete.

    • force — (Boolean)

      If a repository contains images, forces the deletion.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • repository — (map)

        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 — (Date)

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteRepositoryPolicy(params = {}, callback) ⇒ AWS.Request

Deletes the repository policy from a specified repository.

Service Reference:

Examples:

To delete the policy associated with a repository


/* This example deletes the policy associated with the repository named ubuntu in the current account. */

 var params = {
  repositoryName: "ubuntu"
 };
 ecr.deleteRepositoryPolicy(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    policyText: "{ ... }", 
    registryId: "012345678901", 
    repositoryName: "ubuntu"
   }
   */
 });

Calling the deleteRepositoryPolicy operation

var params = {
  repositoryName: 'STRING_VALUE', /* required */
  registryId: 'STRING_VALUE'
};
ecr.deleteRepositoryPolicy(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • registryId — (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.

    • repositoryName — (String)

      The name of the repository that is associated with the repository policy to delete.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeImages(params = {}, callback) ⇒ AWS.Request

Returns metadata about the images in a repository, including image size, image tags, and creation date.

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.

Service Reference:

Examples:

Calling the describeImages operation

var params = {
  repositoryName: 'STRING_VALUE', /* required */
  filter: {
    tagStatus: TAGGED | UNTAGGED
  },
  imageIds: [
    {
      imageDigest: 'STRING_VALUE',
      imageTag: 'STRING_VALUE'
    },
    /* more items */
  ],
  maxResults: 0,
  nextToken: 'STRING_VALUE',
  registryId: 'STRING_VALUE'
};
ecr.describeImages(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • registryId — (String)

      The AWS account ID associated with the registry that contains the repository in which to describe images. If you do not specify a registry, the default registry is assumed.

    • repositoryName — (String)

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

    • imageIds — (Array<map>)

      The list of image IDs for the requested repository.

      • imageDigest — (String)

        The sha256 digest of the image manifest.

      • imageTag — (String)

        The tag used for the image.

    • nextToken — (String)

      The nextToken value returned from a previous paginated DescribeImages 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.

    • maxResults — (Integer)

      The maximum number of repository results returned by DescribeImages in paginated output. When this parameter is used, DescribeImages 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 DescribeImages request with the returned nextToken value. This value can be between 1 and 100. If this parameter is not used, then DescribeImages returns up to 100 results and a nextToken value, if applicable.

    • filter — (map)

      The filter key and value with which to filter your DescribeImages results.

      • tagStatus — (String)

        The tag status with which to filter your DescribeImages results. You can filter results based on whether they are TAGGED or UNTAGGED.

        Possible values include:
        • "TAGGED"
        • "UNTAGGED"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • imageDetails — (Array<map>)

        A list of ImageDetail objects that contain data about the image.

        • registryId — (String)

          The AWS account ID associated with the 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 — (Array<String>)

          The list of tags associated with this image.

        • imageSizeInBytes — (Integer)

          The size, in bytes, of the image in the repository.

          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 — (Date)

          The date and time, expressed in standard JavaScript date format, at which the current image was pushed to the repository.

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeRepositories(params = {}, callback) ⇒ AWS.Request

Describes image repositories in a registry.

Service Reference:

Examples:

To describe all repositories in the current account


/* The following example obtains a list and description of all repositories in the default registry to which the current user has access. */

 var params = {
 };
 ecr.describeRepositories(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    repositories: [
       {
      registryId: "012345678910", 
      repositoryArn: "arn:aws:ecr:us-west-2:012345678910:repository/ubuntu", 
      repositoryName: "ubuntu"
     }, 
       {
      registryId: "012345678910", 
      repositoryArn: "arn:aws:ecr:us-west-2:012345678910:repository/test", 
      repositoryName: "test"
     }
    ]
   }
   */
 });

Calling the describeRepositories operation

var params = {
  maxResults: 0,
  nextToken: 'STRING_VALUE',
  registryId: 'STRING_VALUE',
  repositoryNames: [
    'STRING_VALUE',
    /* more items */
  ]
};
ecr.describeRepositories(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • registryId — (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.

    • repositoryNames — (Array<String>)

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

    • nextToken — (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.

      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.
    • maxResults — (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.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • repositories — (Array<map>)

        A list of repository objects corresponding to valid repositories.

        • 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 — (Date)

          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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getAuthorizationToken(params = {}, callback) ⇒ AWS.Request

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.

Service Reference:

Examples:

To obtain an authorization token


/* This example gets an authorization token for your default registry. */

 var params = {
 };
 ecr.getAuthorizationToken(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    authorizationData: [
       {
      authorizationToken: "QVdTOkN...", 
      expiresAt: <Date Representation>, 
      proxyEndpoint: "https://012345678901.dkr.ecr.us-west-2.amazonaws.com"
     }
    ]
   }
   */
 });

Calling the getAuthorizationToken operation

var params = {
  registryIds: [
    'STRING_VALUE',
    /* more items */
  ]
};
ecr.getAuthorizationToken(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • registryIds — (Array<String>)

      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.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • authorizationData — (Array<map>)

        A list of authorization token data objects that correspond to the registryIds values in the request.

        • 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 — (Date)

          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&#95;account&#95;id.dkr.ecr.region.amazonaws.com. For example, https://012345678910.dkr.ecr.us-east-1.amazonaws.com..

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getDownloadUrlForLayer(params = {}, callback) ⇒ AWS.Request

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 for pulling and pushing images. In most cases, you should use the docker CLI to pull, tag, and push images.

Service Reference:

Examples:

Calling the getDownloadUrlForLayer operation

var params = {
  layerDigest: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE', /* required */
  registryId: 'STRING_VALUE'
};
ecr.getDownloadUrlForLayer(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • registryId — (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.

    • repositoryName — (String)

      The name of the repository that is associated with the image layer to download.

    • layerDigest — (String)

      The digest of the image layer to download.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • downloadUrl — (String)

        The pre-signed Amazon S3 download URL for the requested layer.

      • layerDigest — (String)

        The digest of the image layer to download.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getLifecyclePolicy(params = {}, callback) ⇒ AWS.Request

Retrieves the specified lifecycle policy.

Service Reference:

Examples:

Calling the getLifecyclePolicy operation

var params = {
  repositoryName: 'STRING_VALUE', /* required */
  registryId: 'STRING_VALUE'
};
ecr.getLifecyclePolicy(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • registryId — (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.

    • repositoryName — (String)

      The name of the repository with the policy to retrieve.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • registryId — (String)

        The registry ID associated with the request.

      • repositoryName — (String)

        The repository name associated with the request.

      • lifecyclePolicyText — (String)

        The JSON repository policy text.

      • lastEvaluatedAt — (Date)

        The time stamp of the last time that the lifecycle policy was run.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getLifecyclePolicyPreview(params = {}, callback) ⇒ AWS.Request

Retrieves the results of the specified lifecycle policy preview request.

Service Reference:

Examples:

Calling the getLifecyclePolicyPreview operation

var params = {
  repositoryName: 'STRING_VALUE', /* required */
  filter: {
    tagStatus: TAGGED | UNTAGGED
  },
  imageIds: [
    {
      imageDigest: 'STRING_VALUE',
      imageTag: 'STRING_VALUE'
    },
    /* more items */
  ],
  maxResults: 0,
  nextToken: 'STRING_VALUE',
  registryId: 'STRING_VALUE'
};
ecr.getLifecyclePolicyPreview(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • registryId — (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.

    • repositoryName — (String)

      The name of the repository with the policy to retrieve.

    • imageIds — (Array<map>)

      The list of imageIDs to be included.

      • imageDigest — (String)

        The sha256 digest of the image manifest.

      • imageTag — (String)

        The tag used for the image.

    • nextToken — (String)

      The nextToken value returned from a previous paginated
 GetLifecyclePolicyPreviewRequest 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.

    • maxResults — (Integer)

      The maximum number of repository results returned by GetLifecyclePolicyPreviewRequest in
 paginated output. When this parameter is used, GetLifecyclePolicyPreviewRequest 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 GetLifecyclePolicyPreviewRequest request with the returned nextToken
 value. This value can be between 1 and 100. If this
 parameter is not used, then GetLifecyclePolicyPreviewRequest returns up to
 100 results and a nextToken value, if
 applicable.

    • filter — (map)

      An optional parameter that filters results based on image tag status and all tags, if tagged.

      • tagStatus — (String)

        The tag status of the image.

        Possible values include:
        • "TAGGED"
        • "UNTAGGED"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • registryId — (String)

        The registry ID associated with the request.

      • repositoryName — (String)

        The repository name associated with the request.

      • lifecyclePolicyText — (String)

        The JSON repository policy text.

      • status — (String)

        The status of the lifecycle policy preview request.

        Possible values include:
        • "IN_PROGRESS"
        • "COMPLETE"
        • "EXPIRED"
        • "FAILED"
      • nextToken — (String)

        The nextToken value to include in a future GetLifecyclePolicyPreview request. When the results of a GetLifecyclePolicyPreview 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.

      • previewResults — (Array<map>)

        The results of the lifecycle policy preview request.

        • imageTags — (Array<String>)

          The list of tags associated with this image.

        • imageDigest — (String)

          The sha256 digest of the image manifest.

        • imagePushedAt — (Date)

          The date and time, expressed in standard JavaScript date format, at which the current image was pushed to the repository.

        • action — (map)

          The type of action to be taken.

          • type — (String)

            The type of action to be taken.

            Possible values include:
            • "EXPIRE"
        • appliedRulePriority — (Integer)

          The priority of the applied rule.

      • summary — (map)

        The list of images that is returned as a result of the action.

        • expiringImageTotalCount — (Integer)

          The number of expiring images.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getRepositoryPolicy(params = {}, callback) ⇒ AWS.Request

Retrieves the repository policy for a specified repository.

Service Reference:

Examples:

To get the current policy for a repository


/* This example obtains the repository policy for the repository named ubuntu. */

 var params = {
  repositoryName: "ubuntu"
 };
 ecr.getRepositoryPolicy(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    policyText: "{\n  \"Version\" : \"2008-10-17\",\n  \"Statement\" : [ {\n    \"Sid\" : \"new statement\",\n    \"Effect\" : \"Allow\",\n    \"Principal\" : {\n     \"AWS\" : \"arn:aws:iam::012345678901:role/CodeDeployDemo\"\n    },\n\"Action\" : [ \"ecr:GetDownloadUrlForLayer\", \"ecr:BatchGetImage\", \"ecr:BatchCheckLayerAvailability\" ]\n } ]\n}", 
    registryId: "012345678901", 
    repositoryName: "ubuntu"
   }
   */
 });

Calling the getRepositoryPolicy operation

var params = {
  repositoryName: 'STRING_VALUE', /* required */
  registryId: 'STRING_VALUE'
};
ecr.getRepositoryPolicy(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • registryId — (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.

    • repositoryName — (String)

      The name of the repository with the policy to retrieve.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

initiateLayerUpload(params = {}, callback) ⇒ AWS.Request

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 for pulling and pushing images. In most cases, you should use the docker CLI to pull, tag, and push images.

Service Reference:

Examples:

Calling the initiateLayerUpload operation

var params = {
  repositoryName: 'STRING_VALUE', /* required */
  registryId: 'STRING_VALUE'
};
ecr.initiateLayerUpload(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • registryId — (String)

      The AWS 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)

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

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listImages(params = {}, callback) ⇒ AWS.Request

Lists all the image IDs for a given repository.

You can filter images based on whether or not they are tagged by setting the tagStatus parameter to TAGGED or UNTAGGED. For example, you can filter your results to return only UNTAGGED images and then pipe that result to a BatchDeleteImage operation to delete them. Or, you can filter your results to return only TAGGED images to list all of the tags in your repository.

Service Reference:

Examples:

To list all images in a repository


/* This example lists all of the images in the repository named ubuntu in the default registry in the current account.  */

 var params = {
  repositoryName: "ubuntu"
 };
 ecr.listImages(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    imageIds: [
       {
      imageDigest: "sha256:764f63476bdff6d83a09ba2a818f0d35757063724a9ac3ba5019c56f74ebf42a", 
      imageTag: "precise"
     }
    ]
   }
   */
 });

Calling the listImages operation

var params = {
  repositoryName: 'STRING_VALUE', /* required */
  filter: {
    tagStatus: TAGGED | UNTAGGED
  },
  maxResults: 0,
  nextToken: 'STRING_VALUE',
  registryId: 'STRING_VALUE'
};
ecr.listImages(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • registryId — (String)

      The AWS account ID associated with the registry that contains the repository in which to list images. If you do not specify a registry, the default registry is assumed.

    • repositoryName — (String)

      The repository with image IDs to be listed.

    • nextToken — (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.

      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.
    • maxResults — (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.

    • filter — (map)

      The filter key and value with which to filter your ListImages results.

      • tagStatus — (String)

        The tag status with which to filter your ListImages results. You can filter results based on whether they are TAGGED or UNTAGGED.

        Possible values include:
        • "TAGGED"
        • "UNTAGGED"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • imageIds — (Array<map>)

        The list of image IDs for the requested repository.

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putImage(params = {}, callback) ⇒ AWS.Request

Creates or updates the image manifest and tags associated with an image.

Note: This operation is used by the Amazon ECR proxy, and it is not intended for general use by customers for pulling and pushing images. In most cases, you should use the docker CLI to pull, tag, and push images.

Service Reference:

Examples:

Calling the putImage operation

var params = {
  imageManifest: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE', /* required */
  imageTag: 'STRING_VALUE',
  registryId: 'STRING_VALUE'
};
ecr.putImage(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • registryId — (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.

    • repositoryName — (String)

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

    • imageManifest — (String)

      The image manifest corresponding to the image to be uploaded.

    • imageTag — (String)

      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.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • image — (map)

        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 — (map)

          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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putLifecyclePolicy(params = {}, callback) ⇒ AWS.Request

Creates or updates a lifecycle policy.

Service Reference:

Examples:

Calling the putLifecyclePolicy operation

var params = {
  lifecyclePolicyText: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE', /* required */
  registryId: 'STRING_VALUE'
};
ecr.putLifecyclePolicy(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • registryId — (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.

    • repositoryName — (String)

      The name of the repository to receive the policy.

    • lifecyclePolicyText — (String)

      The JSON repository policy text to apply to the repository.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • registryId — (String)

        The registry ID associated with the request.

      • repositoryName — (String)

        The repository name associated with the request.

      • lifecyclePolicyText — (String)

        The JSON repository policy text.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

setRepositoryPolicy(params = {}, callback) ⇒ AWS.Request

Applies a repository policy on a specified repository to control access permissions.

Service Reference:

Examples:

Calling the setRepositoryPolicy operation

var params = {
  policyText: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE', /* required */
  force: true || false,
  registryId: 'STRING_VALUE'
};
ecr.setRepositoryPolicy(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • registryId — (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.

    • repositoryName — (String)

      The name of the repository to receive the policy.

    • policyText — (String)

      The JSON repository policy text to apply to the repository.

    • force — (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.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

startLifecyclePolicyPreview(params = {}, callback) ⇒ AWS.Request

Starts a preview of the specified lifecycle policy. This allows you to see the results before creating the lifecycle policy.

Service Reference:

Examples:

Calling the startLifecyclePolicyPreview operation

var params = {
  repositoryName: 'STRING_VALUE', /* required */
  lifecyclePolicyText: 'STRING_VALUE',
  registryId: 'STRING_VALUE'
};
ecr.startLifecyclePolicyPreview(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • registryId — (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.

    • repositoryName — (String)

      The name of the repository to be evaluated.

    • lifecyclePolicyText — (String)

      The policy to be evaluated against. If you do not specify a policy, the current policy for the repository is used.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • registryId — (String)

        The registry ID associated with the request.

      • repositoryName — (String)

        The repository name associated with the request.

      • lifecyclePolicyText — (String)

        The JSON repository policy text.

      • status — (String)

        The status of the lifecycle policy preview request.

        Possible values include:
        • "IN_PROGRESS"
        • "COMPLETE"
        • "EXPIRED"
        • "FAILED"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

uploadLayerPart(params = {}, callback) ⇒ AWS.Request

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 for pulling and pushing images. In most cases, you should use the docker CLI to pull, tag, and push images.

Service Reference:

Examples:

Calling the uploadLayerPart operation

var params = {
  layerPartBlob: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */, /* required */
  partFirstByte: 0, /* required */
  partLastByte: 0, /* required */
  repositoryName: 'STRING_VALUE', /* required */
  uploadId: 'STRING_VALUE', /* required */
  registryId: 'STRING_VALUE'
};
ecr.uploadLayerPart(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • registryId — (String)

      The AWS account ID associated with the registry to which you are uploading layer parts. If you do not specify a registry, the default registry is assumed.

    • repositoryName — (String)

      The name of the repository to which you are uploading layer parts.

    • uploadId — (String)

      The upload ID from a previous InitiateLayerUpload operation to associate with the layer part upload.

    • partFirstByte — (Integer)

      The integer value of the first byte of the layer part.

    • partLastByte — (Integer)

      The integer value of the last byte of the layer part.

    • layerPartBlob — (Buffer, Typed Array, Blob, String)

      The base64-encoded layer part payload.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.