You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::ECR::Client

Inherits:
Seahorse::Client::Base show all
Defined in:
(unknown)

Overview

An API client for Amazon EC2 Container Registry. To construct a client, you need to configure a :region and :credentials.

ecr = Aws::ECR::Client.new(
  region: region_name,
  credentials: credentials,
  # ...
)

See #initialize for a full list of supported configuration options.

Region

You can configure a default region in the following locations:

  • ENV['AWS_REGION']
  • Aws.config[:region]

Go here for a list of supported regions.

Credentials

Default credentials are loaded automatically from the following locations:

  • ENV['AWS_ACCESS_KEY_ID'] and ENV['AWS_SECRET_ACCESS_KEY']
  • Aws.config[:credentials]
  • The shared credentials ini file at ~/.aws/credentials (more information)
  • From an instance profile when running on EC2

You can also construct a credentials object from one of the following classes:

Alternatively, you configure credentials with :access_key_id and :secret_access_key:

# load credentials from disk
creds = YAML.load(File.read('/path/to/secrets'))

Aws::ECR::Client.new(
  access_key_id: creds['access_key_id'],
  secret_access_key: creds['secret_access_key']
)

Always load your credentials from outside your application. Avoid configuring credentials statically and never commit them to source control.

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

Constructor collapse

API Operations collapse

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Base

add_plugin, api, #build_request, clear_plugins, define, new, #operation, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options = {}) ⇒ Aws::ECR::Client

Constructs an API client.

Options Hash (options):

  • :access_key_id (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :active_endpoint_cache (Boolean)

    When set to true, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :convert_params (Boolean) — default: true

    When true, an attempt is made to coerce request parameters into the required types. See Plugins::ParamConverter for more details.

  • :credentials (required, Credentials)

    Your AWS credentials. The following locations will be searched in order for credentials:

    • :access_key_id, :secret_access_key, and :session_token options
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
    • HOME/.aws/credentials shared credentials file
    • EC2 instance profile credentials See Plugins::RequestSigner for more details.
  • :disable_host_prefix_injection (Boolean)

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available. See Plugins::EndpointPattern for more details.

  • :endpoint (String)

    A default endpoint is constructed from the :region. See Plugins::RegionalEndpoint for more details.

  • :endpoint_cache_max_entries (Integer)

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_max_threads (Integer)

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_poll_interval (Integer)

    When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec. See Plugins::EndpointDiscovery for more details.

  • :endpoint_discovery (Boolean)

    When set to true, endpoint discovery will be enabled for operations when available. Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :http_continue_timeout (Float) — default: 1

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_idle_timeout (Integer) — default: 5

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_open_timeout (Integer) — default: 15

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_proxy (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_read_timeout (Integer) — default: 60

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_wire_trace (Boolean) — default: false

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the logger at. See Plugins::Logging for more details.

  • :log_formatter (Logging::LogFormatter)

    The log formatter. Defaults to Seahorse::Client::Logging::Formatter.default. See Plugins::Logging for more details.

  • :logger (Logger) — default: nil

    The Logger instance to send log messages to. If this option is not set, logging will be disabled. See Plugins::Logging for more details.

  • :profile (String)

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used. See Plugins::RequestSigner for more details.

  • :raise_response_errors (Boolean) — default: true

    When true, response errors are raised. See Seahorse::Client::Plugins::RaiseResponseErrors for more details.

  • :region (required, String)

    The AWS region to connect to. The region is used to construct the client endpoint. Defaults to ENV['AWS_REGION']. Also checks AMAZON_REGION and AWS_DEFAULT_REGION. See Plugins::RegionalEndpoint for more details.

  • :retry_limit (Integer) — default: 3

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors and auth errors from expired credentials. See Plugins::RetryErrors for more details.

  • :secret_access_key (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :session_token (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :simple_json (Boolean) — default: false

    Disables request parameter conversion, validation, and formatting. Also disable response data type conversions. This option is useful when you want to ensure the highest level of performance by avoiding overhead of walking request parameters and response data structures.

    When :simple_json is enabled, the request parameters hash must be formatted exactly as the DynamoDB API expects. See Plugins::Protocols::JsonRpc for more details.

  • :ssl_ca_bundle (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_directory (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_store (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_verify_peer (Boolean) — default: true

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :stub_responses (Boolean) — default: false

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling ClientStubs#stub_responses. See ClientStubs for more information.

    Please note When response stubbing is enabled, no HTTP requests are made, and retries are disabled. See Plugins::StubResponses for more details.

  • :validate_params (Boolean) — default: true

    When true, request parameters are validated before sending the request. See Plugins::ParamValidator for more details.

Instance Method Details

#batch_check_layer_availability(options = {}) ⇒ Types::BatchCheckLayerAvailabilityResponse

Checks the availability of one or more image layers in a repository.

When an image is pushed to a repository, each image layer is checked to verify if it has been uploaded before. If it has been uploaded, then the image layer is skipped.

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.

Examples:

Request syntax with placeholder values


resp = client.batch_check_layer_availability({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  layer_digests: ["BatchedOperationLayerDigest"], # required
})

Response structure


resp.layers #=> Array
resp.layers[0].layer_digest #=> String
resp.layers[0].layer_availability #=> String, one of "AVAILABLE", "UNAVAILABLE"
resp.layers[0].layer_size #=> Integer
resp.layers[0].media_type #=> String
resp.failures #=> Array
resp.failures[0].layer_digest #=> String
resp.failures[0].failure_code #=> String, one of "InvalidLayerDigest", "MissingLayerDigest"
resp.failures[0].failure_reason #=> String

Options Hash (options):

  • :registry_id (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.

  • :repository_name (required, String)

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

  • :layer_digests (required, Array<String>)

    The digests of the image layers to check.

Returns:

See Also:

#batch_delete_image(options = {}) ⇒ Types::BatchDeleteImageResponse

Deletes a list of specified images within a repository. Images are specified with either an imageTag or imageDigest.

You can remove a tag from an image by specifying the image's tag in your request. When you remove the last tag from an image, the image is deleted from your repository.

You can completely delete an image (and all of its tags) by specifying the image's digest in your request.

Examples:

Example: 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.

resp = client.batch_delete_image({
  image_ids: [
    {
      image_tag: "precise", 
    }, 
  ], 
  repository_name: "ubuntu", 
})

# resp.to_h outputs the following:
{
  failures: [
  ], 
  image_ids: [
    {
      image_digest: "sha256:examplee6d1e504117a17000003d3753086354a38375961f2e665416ef4b1b2f", 
      image_tag: "precise", 
    }, 
  ], 
}

Request syntax with placeholder values


resp = client.batch_delete_image({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  image_ids: [ # required
    {
      image_digest: "ImageDigest",
      image_tag: "ImageTag",
    },
  ],
})

Response structure


resp.image_ids #=> Array
resp.image_ids[0].image_digest #=> String
resp.image_ids[0].image_tag #=> String
resp.failures #=> Array
resp.failures[0].image_id.image_digest #=> String
resp.failures[0].image_id.image_tag #=> String
resp.failures[0].failure_code #=> String, one of "InvalidImageDigest", "InvalidImageTag", "ImageTagDoesNotMatchDigest", "ImageNotFound", "MissingDigestAndTag", "ImageReferencedByManifestList", "KmsError"
resp.failures[0].failure_reason #=> String

Options Hash (options):

  • :registry_id (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.

  • :repository_name (required, String)

    The repository that contains the image to delete.

  • :image_ids (required, Array<Types::ImageIdentifier>)

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

Returns:

See Also:

#batch_get_image(options = {}) ⇒ Types::BatchGetImageResponse

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.

Examples:

Example: 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.

resp = client.batch_get_image({
  image_ids: [
    {
      image_tag: "precise", 
    }, 
  ], 
  repository_name: "ubuntu", 
})

# resp.to_h outputs the following:
{
  failures: [
  ], 
  images: [
    {
      image_id: {
        image_digest: "sha256:example76bdff6d83a09ba2a818f0d00000063724a9ac3ba5019c56f74ebf42a", 
        image_tag: "precise", 
      }, 
      image_manifest: "{\n \"schemaVersion\": 1,\n \"name\": \"ubuntu\",\n \"tag\": \"precise\",\n...", 
      registry_id: "244698725403", 
      repository_name: "ubuntu", 
    }, 
  ], 
}

Request syntax with placeholder values


resp = client.batch_get_image({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  image_ids: [ # required
    {
      image_digest: "ImageDigest",
      image_tag: "ImageTag",
    },
  ],
  accepted_media_types: ["MediaType"],
})

Response structure


resp.images #=> Array
resp.images[0].registry_id #=> String
resp.images[0].repository_name #=> String
resp.images[0].image_id.image_digest #=> String
resp.images[0].image_id.image_tag #=> String
resp.images[0].image_manifest #=> String
resp.images[0].image_manifest_media_type #=> String
resp.failures #=> Array
resp.failures[0].image_id.image_digest #=> String
resp.failures[0].image_id.image_tag #=> String
resp.failures[0].failure_code #=> String, one of "InvalidImageDigest", "InvalidImageTag", "ImageTagDoesNotMatchDigest", "ImageNotFound", "MissingDigestAndTag", "ImageReferencedByManifestList", "KmsError"
resp.failures[0].failure_reason #=> String

Options Hash (options):

  • :registry_id (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.

  • :repository_name (required, String)

    The repository that contains the images to describe.

  • :image_ids (required, Array<Types::ImageIdentifier>)

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

  • :accepted_media_types (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

Returns:

See Also:

#complete_layer_upload(options = {}) ⇒ Types::CompleteLayerUploadResponse

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.

When an image is pushed, the CompleteLayerUpload API is called once per each new image layer to verify that the upload has completed.

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.

Examples:

Request syntax with placeholder values


resp = client.complete_layer_upload({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  upload_id: "UploadId", # required
  layer_digests: ["LayerDigest"], # required
})

Response structure


resp.registry_id #=> String
resp.repository_name #=> String
resp.upload_id #=> String
resp.layer_digest #=> String

Options Hash (options):

  • :registry_id (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.

  • :repository_name (required, String)

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

  • :upload_id (required, String)

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

  • :layer_digests (required, Array<String>)

    The sha256 digest of the image layer.

Returns:

See Also:

#create_repository(options = {}) ⇒ Types::CreateRepositoryResponse

Creates a repository. For more information, see Amazon ECR Repositories in the Amazon Elastic Container Registry User Guide.

Examples:

Example: 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.

resp = client.create_repository({
  repository_name: "project-a/nginx-web-app", 
})

# resp.to_h outputs the following:
{
  repository: {
    registry_id: "012345678901", 
    repository_arn: "arn:aws:ecr:us-west-2:012345678901:repository/project-a/nginx-web-app", 
    repository_name: "project-a/nginx-web-app", 
  }, 
}

Request syntax with placeholder values


resp = client.create_repository({
  repository_name: "RepositoryName", # required
  tags: [
    {
      key: "TagKey",
      value: "TagValue",
    },
  ],
  image_tag_mutability: "MUTABLE", # accepts MUTABLE, IMMUTABLE
  image_scanning_configuration: {
    scan_on_push: false,
  },
  encryption_configuration: {
    encryption_type: "AES256", # required, accepts AES256, KMS
    kms_key: "KmsKey",
  },
})

Response structure


resp.repository.repository_arn #=> String
resp.repository.registry_id #=> String
resp.repository.repository_name #=> String
resp.repository.repository_uri #=> String
resp.repository.created_at #=> Time
resp.repository.image_tag_mutability #=> String, one of "MUTABLE", "IMMUTABLE"
resp.repository.image_scanning_configuration.scan_on_push #=> true/false
resp.repository.encryption_configuration.encryption_type #=> String, one of "AES256", "KMS"
resp.repository.encryption_configuration.kms_key #=> String

Options Hash (options):

  • :repository_name (required, 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).

  • :tags (Array<Types::Tag>)

    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.

  • :image_tag_mutability (String)

    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.

  • :image_scanning_configuration (Types::ImageScanningConfiguration)

    The image scanning configuration for the repository. This determines whether images are scanned for known vulnerabilities after being pushed to the repository.

  • :encryption_configuration (Types::EncryptionConfiguration)

    The encryption configuration for the repository. This determines how the contents of your repository are encrypted at rest.

Returns:

See Also:

#delete_lifecycle_policy(options = {}) ⇒ Types::DeleteLifecyclePolicyResponse

Deletes the lifecycle policy associated with the specified repository.

Examples:

Request syntax with placeholder values


resp = client.delete_lifecycle_policy({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
})

Response structure


resp.registry_id #=> String
resp.repository_name #=> String
resp.lifecycle_policy_text #=> String
resp.last_evaluated_at #=> Time

Options Hash (options):

  • :registry_id (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.

  • :repository_name (required, String)

    The name of the repository.

Returns:

See Also:

#delete_repository(options = {}) ⇒ Types::DeleteRepositoryResponse

Deletes a repository. If the repository contains images, you must either delete all images in the repository or use the force option to delete the repository.

Examples:

Example: 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.

resp = client.delete_repository({
  force: true, 
  repository_name: "ubuntu", 
})

# resp.to_h outputs the following:
{
  repository: {
    registry_id: "012345678901", 
    repository_arn: "arn:aws:ecr:us-west-2:012345678901:repository/ubuntu", 
    repository_name: "ubuntu", 
  }, 
}

Request syntax with placeholder values


resp = client.delete_repository({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  force: false,
})

Response structure


resp.repository.repository_arn #=> String
resp.repository.registry_id #=> String
resp.repository.repository_name #=> String
resp.repository.repository_uri #=> String
resp.repository.created_at #=> Time
resp.repository.image_tag_mutability #=> String, one of "MUTABLE", "IMMUTABLE"
resp.repository.image_scanning_configuration.scan_on_push #=> true/false
resp.repository.encryption_configuration.encryption_type #=> String, one of "AES256", "KMS"
resp.repository.encryption_configuration.kms_key #=> String

Options Hash (options):

  • :registry_id (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.

  • :repository_name (required, String)

    The name of the repository to delete.

  • :force (Boolean)

    If a repository contains images, forces the deletion.

Returns:

See Also:

#delete_repository_policy(options = {}) ⇒ Types::DeleteRepositoryPolicyResponse

Deletes the repository policy associated with the specified repository.

Examples:

Example: To delete the policy associated with a repository


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

resp = client.delete_repository_policy({
  repository_name: "ubuntu", 
})

# resp.to_h outputs the following:
{
  policy_text: "{ ... }", 
  registry_id: "012345678901", 
  repository_name: "ubuntu", 
}

Request syntax with placeholder values


resp = client.delete_repository_policy({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
})

Response structure


resp.registry_id #=> String
resp.repository_name #=> String
resp.policy_text #=> String

Options Hash (options):

  • :registry_id (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.

  • :repository_name (required, String)

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

Returns:

See Also:

#describe_image_scan_findings(options = {}) ⇒ Types::DescribeImageScanFindingsResponse

Returns the scan findings for the specified image.

Examples:

Request syntax with placeholder values


resp = client.describe_image_scan_findings({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  image_id: { # required
    image_digest: "ImageDigest",
    image_tag: "ImageTag",
  },
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.registry_id #=> String
resp.repository_name #=> String
resp.image_id.image_digest #=> String
resp.image_id.image_tag #=> String
resp.image_scan_status.status #=> String, one of "IN_PROGRESS", "COMPLETE", "FAILED"
resp.image_scan_status.description #=> String
resp.image_scan_findings.image_scan_completed_at #=> Time
resp.image_scan_findings.vulnerability_source_updated_at #=> Time
resp.image_scan_findings.findings #=> Array
resp.image_scan_findings.findings[0].name #=> String
resp.image_scan_findings.findings[0].description #=> String
resp.image_scan_findings.findings[0].uri #=> String
resp.image_scan_findings.findings[0].severity #=> String, one of "INFORMATIONAL", "LOW", "MEDIUM", "HIGH", "CRITICAL", "UNDEFINED"
resp.image_scan_findings.findings[0].attributes #=> Array
resp.image_scan_findings.findings[0].attributes[0].key #=> String
resp.image_scan_findings.findings[0].attributes[0].value #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.image_scan_findings.finding_severity_counts #=> Hash
resp.image_scan_findings.finding_severity_counts["FindingSeverity"] #=> Integer
resp.next_token #=> String

Options Hash (options):

  • :registry_id (String)

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

  • :repository_name (required, String)

    The repository for the image for which to describe the scan findings.

  • :image_id (required, Types::ImageIdentifier)

    An object with identifying information for an Amazon ECR image.

  • :next_token (String)

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

  • :max_results (Integer)

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

Returns:

See Also:

#describe_images(options = {}) ⇒ Types::DescribeImagesResponse

Returns metadata about the images in a repository.

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.

Examples:

Request syntax with placeholder values


resp = client.describe_images({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  image_ids: [
    {
      image_digest: "ImageDigest",
      image_tag: "ImageTag",
    },
  ],
  next_token: "NextToken",
  max_results: 1,
  filter: {
    tag_status: "TAGGED", # accepts TAGGED, UNTAGGED, ANY
  },
})

Response structure


resp.image_details #=> Array
resp.image_details[0].registry_id #=> String
resp.image_details[0].repository_name #=> String
resp.image_details[0].image_digest #=> String
resp.image_details[0].image_tags #=> Array
resp.image_details[0].image_tags[0] #=> String
resp.image_details[0].image_size_in_bytes #=> Integer
resp.image_details[0].image_pushed_at #=> Time
resp.image_details[0].image_scan_status.status #=> String, one of "IN_PROGRESS", "COMPLETE", "FAILED"
resp.image_details[0].image_scan_status.description #=> String
resp.image_details[0].image_scan_findings_summary.image_scan_completed_at #=> Time
resp.image_details[0].image_scan_findings_summary.vulnerability_source_updated_at #=> Time
resp.image_details[0].image_scan_findings_summary.finding_severity_counts #=> Hash
resp.image_details[0].image_scan_findings_summary.finding_severity_counts["FindingSeverity"] #=> Integer
resp.image_details[0].image_manifest_media_type #=> String
resp.image_details[0].artifact_media_type #=> String
resp.next_token #=> String

Options Hash (options):

  • :registry_id (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.

  • :repository_name (required, String)

    The repository that contains the images to describe.

  • :image_ids (Array<Types::ImageIdentifier>)

    The list of image IDs for the requested repository.

  • :next_token (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. This option cannot be used when you specify images with imageIds.

  • :max_results (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 1000. If this parameter is not used, then DescribeImages returns up to 100 results and a nextToken value, if applicable. This option cannot be used when you specify images with imageIds.

  • :filter (Types::DescribeImagesFilter)

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

Returns:

See Also:

#describe_repositories(options = {}) ⇒ Types::DescribeRepositoriesResponse

Describes image repositories in a registry.

Examples:

Example: 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.

resp = client.describe_repositories({
})

# resp.to_h outputs the following:
{
  repositories: [
    {
      registry_id: "012345678910", 
      repository_arn: "arn:aws:ecr:us-west-2:012345678910:repository/ubuntu", 
      repository_name: "ubuntu", 
    }, 
    {
      registry_id: "012345678910", 
      repository_arn: "arn:aws:ecr:us-west-2:012345678910:repository/test", 
      repository_name: "test", 
    }, 
  ], 
}

Request syntax with placeholder values


resp = client.describe_repositories({
  registry_id: "RegistryId",
  repository_names: ["RepositoryName"],
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.repositories #=> Array
resp.repositories[0].repository_arn #=> String
resp.repositories[0].registry_id #=> String
resp.repositories[0].repository_name #=> String
resp.repositories[0].repository_uri #=> String
resp.repositories[0].created_at #=> Time
resp.repositories[0].image_tag_mutability #=> String, one of "MUTABLE", "IMMUTABLE"
resp.repositories[0].image_scanning_configuration.scan_on_push #=> true/false
resp.repositories[0].encryption_configuration.encryption_type #=> String, one of "AES256", "KMS"
resp.repositories[0].encryption_configuration.kms_key #=> String
resp.next_token #=> String

Options Hash (options):

  • :registry_id (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.

  • :repository_names (Array<String>)

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

  • :next_token (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. This option cannot be used when you specify repositories with repositoryNames.

    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.

  • :max_results (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 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.

Returns:

See Also:

#get_authorization_token(options = {}) ⇒ Types::GetAuthorizationTokenResponse

Retrieves an authorization token. An authorization token represents your IAM authentication credentials and can be used to access any Amazon ECR registry that your IAM principal has access to. The authorization token is valid for 12 hours.

The authorizationToken returned 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 get-login-password command that simplifies the login process. For more information, see Registry Authentication in the Amazon Elastic Container Registry User Guide.

Examples:

Example: To obtain an authorization token


# This example gets an authorization token for your default registry.

resp = client.get_authorization_token({
})

# resp.to_h outputs the following:
{
  authorization_data: [
    {
      authorization_token: "QVdTOkN...", 
      expires_at: Time.parse("1470951892432"), 
      proxy_endpoint: "https://012345678901.dkr.ecr.us-west-2.amazonaws.com", 
    }, 
  ], 
}

Request syntax with placeholder values


resp = client.get_authorization_token({
  registry_ids: ["RegistryId"],
})

Response structure


resp.authorization_data #=> Array
resp.authorization_data[0].authorization_token #=> String
resp.authorization_data[0].expires_at #=> Time
resp.authorization_data[0].proxy_endpoint #=> String

Options Hash (options):

  • :registry_ids (Array<String>)

    A list of AWS account IDs that are associated with the registries for which to get AuthorizationData objects. If you do not specify a registry, the default registry is assumed.

Returns:

See Also:

#get_download_url_for_layer(options = {}) ⇒ Types::GetDownloadUrlForLayerResponse

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.

When an image is pulled, the GetDownloadUrlForLayer API is called once per image layer that is not already cached.

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.

Examples:

Request syntax with placeholder values


resp = client.get_download_url_for_layer({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  layer_digest: "LayerDigest", # required
})

Response structure


resp.download_url #=> String
resp.layer_digest #=> String

Options Hash (options):

  • :registry_id (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.

  • :repository_name (required, String)

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

  • :layer_digest (required, String)

    The digest of the image layer to download.

Returns:

See Also:

#get_lifecycle_policy(options = {}) ⇒ Types::GetLifecyclePolicyResponse

Retrieves the lifecycle policy for the specified repository.

Examples:

Request syntax with placeholder values


resp = client.get_lifecycle_policy({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
})

Response structure


resp.registry_id #=> String
resp.repository_name #=> String
resp.lifecycle_policy_text #=> String
resp.last_evaluated_at #=> Time

Options Hash (options):

  • :registry_id (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.

  • :repository_name (required, String)

    The name of the repository.

Returns:

See Also:

#get_lifecycle_policy_preview(options = {}) ⇒ Types::GetLifecyclePolicyPreviewResponse

Retrieves the results of the lifecycle policy preview request for the specified repository.

Examples:

Request syntax with placeholder values


resp = client.get_lifecycle_policy_preview({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  image_ids: [
    {
      image_digest: "ImageDigest",
      image_tag: "ImageTag",
    },
  ],
  next_token: "NextToken",
  max_results: 1,
  filter: {
    tag_status: "TAGGED", # accepts TAGGED, UNTAGGED, ANY
  },
})

Response structure


resp.registry_id #=> String
resp.repository_name #=> String
resp.lifecycle_policy_text #=> String
resp.status #=> String, one of "IN_PROGRESS", "COMPLETE", "EXPIRED", "FAILED"
resp.next_token #=> String
resp.preview_results #=> Array
resp.preview_results[0].image_tags #=> Array
resp.preview_results[0].image_tags[0] #=> String
resp.preview_results[0].image_digest #=> String
resp.preview_results[0].image_pushed_at #=> Time
resp.preview_results[0].action.type #=> String, one of "EXPIRE"
resp.preview_results[0].applied_rule_priority #=> Integer
resp.summary.expiring_image_total_count #=> Integer

Options Hash (options):

  • :registry_id (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.

  • :repository_name (required, String)

    The name of the repository.

  • :image_ids (Array<Types::ImageIdentifier>)

    The list of imageIDs to be included.

  • :next_token (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. This option cannot be used when you specify images with imageIds.

  • :max_results (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 1000. If this
 parameter is not used, then GetLifecyclePolicyPreviewRequest returns up to
 100 results and a nextToken value, if
 applicable. This option cannot be used when you specify images with imageIds.

  • :filter (Types::LifecyclePolicyPreviewFilter)

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

Returns:

See Also:

#get_repository_policy(options = {}) ⇒ Types::GetRepositoryPolicyResponse

Retrieves the repository policy for the specified repository.

Examples:

Example: To get the current policy for a repository


# This example obtains the repository policy for the repository named ubuntu.

resp = client.get_repository_policy({
  repository_name: "ubuntu", 
})

# resp.to_h outputs the following:
{
  policy_text: "{\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}", 
  registry_id: "012345678901", 
  repository_name: "ubuntu", 
}

Request syntax with placeholder values


resp = client.get_repository_policy({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
})

Response structure


resp.registry_id #=> String
resp.repository_name #=> String
resp.policy_text #=> String

Options Hash (options):

  • :registry_id (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.

  • :repository_name (required, String)

    The name of the repository with the policy to retrieve.

Returns:

See Also:

#initiate_layer_upload(options = {}) ⇒ Types::InitiateLayerUploadResponse

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.

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.

Examples:

Request syntax with placeholder values


resp = client.initiate_layer_upload({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
})

Response structure


resp.upload_id #=> String
resp.part_size #=> Integer

Options Hash (options):

  • :registry_id (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.

  • :repository_name (required, String)

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

Returns:

See Also:

#list_images(options = {}) ⇒ Types::ListImagesResponse

Lists all the image IDs for the specified repository.

You can filter images based on whether or not they are tagged by using the tagStatus filter and specifying either TAGGED, UNTAGGED or ANY. 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.

Examples:

Example: 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. 

resp = client.list_images({
  repository_name: "ubuntu", 
})

# resp.to_h outputs the following:
{
  image_ids: [
    {
      image_digest: "sha256:764f63476bdff6d83a09ba2a818f0d35757063724a9ac3ba5019c56f74ebf42a", 
      image_tag: "precise", 
    }, 
  ], 
}

Request syntax with placeholder values


resp = client.list_images({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  next_token: "NextToken",
  max_results: 1,
  filter: {
    tag_status: "TAGGED", # accepts TAGGED, UNTAGGED, ANY
  },
})

Response structure


resp.image_ids #=> Array
resp.image_ids[0].image_digest #=> String
resp.image_ids[0].image_tag #=> String
resp.next_token #=> String

Options Hash (options):

  • :registry_id (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.

  • :repository_name (required, String)

    The repository with image IDs to be listed.

  • :next_token (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.

    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.

  • :max_results (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 1000. If this parameter is not used, then ListImages returns up to 100 results and a nextToken value, if applicable.

  • :filter (Types::ListImagesFilter)

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

Returns:

See Also:

#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResponse

List the tags for an Amazon ECR resource.

Examples:

Request syntax with placeholder values


resp = client.list_tags_for_resource({
  resource_arn: "Arn", # required
})

Response structure


resp.tags #=> Array
resp.tags[0].key #=> String
resp.tags[0].value #=> String

Options Hash (options):

  • :resource_arn (required, String)

    The Amazon Resource Name (ARN) that identifies the resource for which to list the tags. Currently, the only supported resource is an Amazon ECR repository.

Returns:

See Also:

#put_image(options = {}) ⇒ Types::PutImageResponse

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.

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.

Examples:

Request syntax with placeholder values


resp = client.put_image({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  image_manifest: "ImageManifest", # required
  image_manifest_media_type: "MediaType",
  image_tag: "ImageTag",
  image_digest: "ImageDigest",
})

Response structure


resp.image.registry_id #=> String
resp.image.repository_name #=> String
resp.image.image_id.image_digest #=> String
resp.image.image_id.image_tag #=> String
resp.image.image_manifest #=> String
resp.image.image_manifest_media_type #=> String

Options Hash (options):

  • :registry_id (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.

  • :repository_name (required, String)

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

  • :image_manifest (required, String)

    The image manifest corresponding to the image to be uploaded.

  • :image_manifest_media_type (String)

    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.

  • :image_tag (String)

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

  • :image_digest (String)

    The image digest of the image manifest corresponding to the image.

Returns:

See Also:

#put_image_scanning_configuration(options = {}) ⇒ Types::PutImageScanningConfigurationResponse

Updates the image scanning configuration for the specified repository.

Examples:

Request syntax with placeholder values


resp = client.put_image_scanning_configuration({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  image_scanning_configuration: { # required
    scan_on_push: false,
  },
})

Response structure


resp.registry_id #=> String
resp.repository_name #=> String
resp.image_scanning_configuration.scan_on_push #=> true/false

Options Hash (options):

  • :registry_id (String)

    The AWS account ID associated with the registry that contains the repository in which to update the image scanning configuration setting. If you do not specify a registry, the default registry is assumed.

  • :repository_name (required, String)

    The name of the repository in which to update the image scanning configuration setting.

  • :image_scanning_configuration (required, Types::ImageScanningConfiguration)

    The image scanning configuration for the repository. This setting determines whether images are scanned for known vulnerabilities after being pushed to the repository.

Returns:

See Also:

#put_image_tag_mutability(options = {}) ⇒ Types::PutImageTagMutabilityResponse

Updates the image tag mutability settings for the specified repository. For more information, see Image Tag Mutability in the Amazon Elastic Container Registry User Guide.

Examples:

Request syntax with placeholder values


resp = client.put_image_tag_mutability({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  image_tag_mutability: "MUTABLE", # required, accepts MUTABLE, IMMUTABLE
})

Response structure


resp.registry_id #=> String
resp.repository_name #=> String
resp.image_tag_mutability #=> String, one of "MUTABLE", "IMMUTABLE"

Options Hash (options):

  • :registry_id (String)

    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.

  • :repository_name (required, String)

    The name of the repository in which to update the image tag mutability settings.

  • :image_tag_mutability (required, String)

    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.

Returns:

See Also:

#put_lifecycle_policy(options = {}) ⇒ Types::PutLifecyclePolicyResponse

Creates or updates the lifecycle policy for the specified repository. For more information, see Lifecycle Policy Template.

Examples:

Request syntax with placeholder values


resp = client.put_lifecycle_policy({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  lifecycle_policy_text: "LifecyclePolicyText", # required
})

Response structure


resp.registry_id #=> String
resp.repository_name #=> String
resp.lifecycle_policy_text #=> String

Options Hash (options):

  • :registry_id (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.

  • :repository_name (required, String)

    The name of the repository to receive the policy.

  • :lifecycle_policy_text (required, String)

    The JSON repository policy text to apply to the repository.

Returns:

See Also:

#set_repository_policy(options = {}) ⇒ Types::SetRepositoryPolicyResponse

Applies a repository policy to the specified repository to control access permissions. For more information, see Amazon ECR Repository Policies in the Amazon Elastic Container Registry User Guide.

Examples:

Request syntax with placeholder values


resp = client.set_repository_policy({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  policy_text: "RepositoryPolicyText", # required
  force: false,
})

Response structure


resp.registry_id #=> String
resp.repository_name #=> String
resp.policy_text #=> String

Options Hash (options):

  • :registry_id (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.

  • :repository_name (required, String)

    The name of the repository to receive the policy.

  • :policy_text (required, String)

    The JSON repository policy text to apply to the repository. For more information, see Amazon ECR Repository Policies in the Amazon Elastic Container Registry User Guide.

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

Returns:

See Also:

#start_image_scan(options = {}) ⇒ Types::StartImageScanResponse

Starts an image vulnerability scan. An image scan can only be started once per day on an individual image. This limit includes if an image was scanned on initial push. For more information, see Image Scanning in the Amazon Elastic Container Registry User Guide.

Examples:

Request syntax with placeholder values


resp = client.start_image_scan({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  image_id: { # required
    image_digest: "ImageDigest",
    image_tag: "ImageTag",
  },
})

Response structure


resp.registry_id #=> String
resp.repository_name #=> String
resp.image_id.image_digest #=> String
resp.image_id.image_tag #=> String
resp.image_scan_status.status #=> String, one of "IN_PROGRESS", "COMPLETE", "FAILED"
resp.image_scan_status.description #=> String

Options Hash (options):

  • :registry_id (String)

    The AWS account ID associated with the registry that contains the repository in which to start an image scan request. If you do not specify a registry, the default registry is assumed.

  • :repository_name (required, String)

    The name of the repository that contains the images to scan.

  • :image_id (required, Types::ImageIdentifier)

    An object with identifying information for an Amazon ECR image.

Returns:

See Also:

#start_lifecycle_policy_preview(options = {}) ⇒ Types::StartLifecyclePolicyPreviewResponse

Starts a preview of a lifecycle policy for the specified repository. This allows you to see the results before associating the lifecycle policy with the repository.

Examples:

Request syntax with placeholder values


resp = client.start_lifecycle_policy_preview({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  lifecycle_policy_text: "LifecyclePolicyText",
})

Response structure


resp.registry_id #=> String
resp.repository_name #=> String
resp.lifecycle_policy_text #=> String
resp.status #=> String, one of "IN_PROGRESS", "COMPLETE", "EXPIRED", "FAILED"

Options Hash (options):

  • :registry_id (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.

  • :repository_name (required, String)

    The name of the repository to be evaluated.

  • :lifecycle_policy_text (String)

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

Returns:

See Also:

#tag_resource(options = {}) ⇒ Struct

Adds specified tags to a resource with the specified ARN. Existing tags on a resource are not changed if they are not specified in the request parameters.

Examples:

Request syntax with placeholder values


resp = client.tag_resource({
  resource_arn: "Arn", # required
  tags: [ # required
    {
      key: "TagKey",
      value: "TagValue",
    },
  ],
})

Options Hash (options):

  • :resource_arn (required, String)

    The Amazon Resource Name (ARN) of the the resource to which to add tags. Currently, the only supported resource is an Amazon ECR repository.

  • :tags (required, Array<Types::Tag>)

    The tags to add to the resource. A tag is an array of key-value pairs. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#untag_resource(options = {}) ⇒ Struct

Deletes specified tags from a resource.

Examples:

Request syntax with placeholder values


resp = client.untag_resource({
  resource_arn: "Arn", # required
  tag_keys: ["TagKey"], # required
})

Options Hash (options):

  • :resource_arn (required, String)

    The Amazon Resource Name (ARN) of the resource from which to remove tags. Currently, the only supported resource is an Amazon ECR repository.

  • :tag_keys (required, Array<String>)

    The keys of the tags to be removed.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#upload_layer_part(options = {}) ⇒ Types::UploadLayerPartResponse

Uploads an image layer part to Amazon ECR.

When an image is pushed, each new image layer is uploaded in parts. The maximum size of each image layer part can be 20971520 bytes (or about 20MB). The UploadLayerPart API is called once per each new image layer part.

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.

Examples:

Request syntax with placeholder values


resp = client.upload_layer_part({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  upload_id: "UploadId", # required
  part_first_byte: 1, # required
  part_last_byte: 1, # required
  layer_part_blob: "data", # required
})

Response structure


resp.registry_id #=> String
resp.repository_name #=> String
resp.upload_id #=> String
resp.last_byte_received #=> Integer

Options Hash (options):

  • :registry_id (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.

  • :repository_name (required, String)

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

  • :upload_id (required, String)

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

  • :part_first_byte (required, Integer)

    The position of the first byte of the layer part witin the overall image layer.

  • :part_last_byte (required, Integer)

    The position of the last byte of the layer part within the overall image layer.

  • :layer_part_blob (required, IO, String)

    The base64-encoded layer part payload.

Returns:

See Also:

#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean

Waiters polls an API operation until a resource enters a desired state.

Basic Usage

Waiters will poll until they are succesful, they fail by entering a terminal state, or until a maximum number of attempts are made.

# polls in a loop, sleeping between attempts client.waiter_until(waiter_name, params)

Configuration

You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You configure waiters by passing a block to #wait_until:

# poll for ~25 seconds
client.wait_until(...) do |w|
  w.max_attempts = 5
  w.delay = 5
end

Callbacks

You can be notified before each polling attempt and before each delay. If you throw :success or :failure from these callbacks, it will terminate the waiter.

started_at = Time.now
client.wait_until(...) do |w|

  # disable max attempts
  w.max_attempts = nil

  # poll for 1 hour, instead of a number of attempts
  w.before_wait do |attempts, response|
    throw :failure if Time.now - started_at > 3600
  end

end

Handling Errors

When a waiter is successful, it returns true. When a waiter fails, it raises an error. All errors raised extend from Waiters::Errors::WaiterFailed.

begin
  client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
  # resource did not enter the desired state in time
end

Parameters:

  • waiter_name (Symbol)

    The name of the waiter. See #waiter_names for a full list of supported waiters.

  • params (Hash) (defaults to: {})

    Additional request parameters. See the #waiter_names for a list of supported waiters and what request they call. The called request determines the list of accepted parameters.

Yield Parameters:

Returns:

  • (Boolean)

    Returns true if the waiter was successful.

Raises:

  • (Errors::FailureStateError)

    Raised when the waiter terminates because the waiter has entered a state that it will not transition out of, preventing success.

  • (Errors::TooManyAttemptsError)

    Raised when the configured maximum number of attempts have been made, and the waiter is not yet successful.

  • (Errors::UnexpectedError)

    Raised when an error is encounted while polling for a resource that is not expected.

  • (Errors::NoSuchWaiterError)

    Raised when you request to wait for an unknown state.

#waiter_namesArray<Symbol>

Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:

Waiter NameClient MethodDefault Delay:Default Max Attempts:
:image_scan_complete#describe_image_scan_findings560
:lifecycle_policy_preview_complete#get_lifecycle_policy_preview520

Returns:

  • (Array<Symbol>)

    the list of supported waiters.