Class: Aws::ECRPublic::Client

Inherits:
Seahorse::Client::Base show all
Includes:
ClientStubs
Defined in:
gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb

Overview

An API client for ECRPublic. To construct a client, you need to configure a :region and :credentials.

client = Aws::ECRPublic::Client.new(
  region: region_name,
  credentials: credentials,
  # ...
)

For details on configuring region and credentials see the developer guide.

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

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from ClientStubs

#api_requests, #stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

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

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options) ⇒ Client

Returns a new instance of Client.

Parameters:

  • options (Hash)

Options Hash (options):

  • :plugins (Array<Seahorse::Client::Plugin>) — default: []] —

    A list of plugins to apply to the client. Each plugin is either a class name or an instance of a plugin class.

  • :credentials (required, Aws::CredentialProvider) —

    Your AWS credentials used for authentication. This can be any class that includes and implements Aws::CredentialProvider, or instance of any one of the following classes:

    • Aws::Credentials - Used for configuring static, non-refreshing credentials.

    • Aws::SharedCredentials - Used for loading static credentials from a shared file, such as ~/.aws/config.

    • Aws::AssumeRoleCredentials - Used when you need to assume a role.

    • Aws::AssumeRoleWebIdentityCredentials - Used when you need to assume a role after providing credentials via the web.

    • Aws::SSOCredentials - Used for loading credentials from AWS SSO using an access token generated from aws login.

    • Aws::ProcessCredentials - Used for loading credentials from a process that outputs to stdout.

    • Aws::InstanceProfileCredentials - Used for loading credentials from an EC2 IMDS on an EC2 instance.

    • Aws::ECSCredentials - Used for loading credentials from instances running in ECS.

    • Aws::CognitoIdentityCredentials - Used for loading credentials from the Cognito Identity service.

    When :credentials are not configured directly, the following locations will be searched for credentials:

    • Aws.config[:credentials]

    • The :access_key_id, :secret_access_key, :session_token, and :account_id options.

    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'], ENV['AWS_SESSION_TOKEN'], and ENV['AWS_ACCOUNT_ID'].

    • ~/.aws/credentials

    • ~/.aws/config

    • EC2/ECS IMDS instance profile - When used by default, the timeouts are very aggressive. Construct and pass an instance of Aws::InstanceProfileCredentials or Aws::ECSCredentials to enable retries and extended timeouts. Instance profile credential fetching can be disabled by setting ENV['AWS_EC2_METADATA_DISABLED'] to true.

  • :region (required, String) —

    The AWS region to connect to. The configured :region is used to determine the service :endpoint. When not passed, a default :region is searched for in the following locations:

    • Aws.config[:region]
    • ENV['AWS_REGION']
    • ENV['AMAZON_REGION']
    • ENV['AWS_DEFAULT_REGION']
    • ~/.aws/credentials
    • ~/.aws/config
  • :access_key_id (String)
  • :account_id (String)
  • :active_endpoint_cache (Boolean) — default: false —

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

  • :adaptive_retry_wait_to_fill (Boolean) — default: true —

    Used only in adaptive retry mode. When true, the request will sleep until there is sufficent client side capacity to retry the request. When false, the request will raise a RetryCapacityNotAvailableError and will not retry instead of sleeping.

  • :auth_scheme_preference (Array<String>) —

    A list of preferred authentication schemes to use when making a request. Supported values are: sigv4, sigv4a, httpBearerAuth, and noAuth. When set using ENV['AWS_AUTH_SCHEME_PREFERENCE'] or in shared config as auth_scheme_preference, the value should be a comma-separated list.

  • :client_side_monitoring (Boolean) — default: false —

    When true, client-side metrics will be collected for all API requests from this client.

  • :client_side_monitoring_client_id (String) — default: "" —

    Allows you to provide an identifier for this client which will be attached to all generated client side metrics. Defaults to an empty string.

  • :client_side_monitoring_host (String) — default: "127.0.0.1" —

    Allows you to specify the DNS hostname or IPv4 or IPv6 address that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_port (Integer) — default: 31000 —

    Required for publishing client metrics. The port that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher) — default: Aws::ClientSideMonitoring::Publisher —

    Allows you to provide a custom client-side monitoring publisher class. By default, will use the Client Side Monitoring Agent Publisher.

  • :convert_params (Boolean) — default: true —

    When true, an attempt is made to coerce request parameters into the required types.

  • :correct_clock_skew (Boolean) — default: true —

    Used only in standard and adaptive retry modes. Specifies whether to apply a clock skew correction and retry requests with skewed client clocks. Takes effect only when disable_clock_skew_correction is not set.

  • :defaults_mode (String) — default: "legacy" —

    See DefaultsModeConfiguration for a list of the accepted modes and the configuration defaults that are included.

  • :disable_clock_skew_correction (Boolean) —

    Used only in standard and adaptive retry modes. When true, the SDK does not apply a clock skew correction, does not update its stored skew from responses, and does not retry clock skew errors. Clock skew correction is enabled by default.

  • :disable_host_prefix_injection (Boolean) — default: false —

    When true, the SDK will not prepend the modeled host prefix to the endpoint.

  • :disable_request_compression (Boolean) — default: false —

    When set to 'true' the request body will not be compressed for supported operations.

  • :endpoint (String, URI::HTTPS, URI::HTTP) —

    Normally you should not configure the :endpoint option directly. This is normally constructed from the :region option. Configuring :endpoint is normally reserved for connecting to test or custom endpoints. The endpoint should be a URI formatted like:

    'http://example.com'
    'https://example.com'
    'http://example.com:123'
    
  • :endpoint_cache_max_entries (Integer) — default: 1000 —

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000.

  • :endpoint_cache_max_threads (Integer) — default: 10 —

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.

  • :endpoint_cache_poll_interval (Integer) — default: 60 —

    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.

  • :endpoint_discovery (Boolean) — default: false —

    When set to true, endpoint discovery will be enabled for operations when available.

  • :ignore_configured_endpoint_urls (Boolean) —

    Setting to true disables use of endpoint URLs provided via environment variables and the shared configuration file.

  • :log_formatter (Aws::Log::Formatter) — default: Aws::Log::Formatter.default —

    The log formatter.

  • :log_level (Symbol) — default: :info —

    The log level to send messages to the :logger at.

  • :logger (Logger) —

    The Logger instance to send log messages to. If this option is not set, logging will be disabled.

  • :max_attempts (Integer) — default: 3 —

    An integer representing the maximum number attempts that will be made for a single request, including the initial attempt. For example, setting this value to 5 will result in a request being retried up to 4 times. Used in standard and adaptive retry modes. Defaults to 3, except for DynamoDB and DynamoDB Streams, which default to 4.

  • :profile (String) — default: "default" —

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used.

  • :request_checksum_calculation (String) — default: "when_supported" —

    Determines when a checksum will be calculated for request payloads. Values are:

    • when_supported - (default) When set, a checksum will be calculated for all request payloads of operations modeled with the httpChecksum trait where requestChecksumRequired is true and/or a requestAlgorithmMember is modeled.
    • when_required - When set, a checksum will only be calculated for request payloads of operations modeled with the httpChecksum trait where requestChecksumRequired is true or where a requestAlgorithmMember is modeled and supplied.
  • :request_min_compression_size_bytes (Integer) — default: 10240 —

    The minimum size in bytes that triggers compression for request bodies. The value must be non-negative integer value between 0 and 10485780 bytes inclusive.

  • :response_checksum_validation (String) — default: "when_supported" —

    Determines when checksum validation will be performed on response payloads. Values are:

    • when_supported - (default) When set, checksum validation is performed on all response payloads of operations modeled with the httpChecksum trait where responseAlgorithms is modeled, except when no modeled checksum algorithms are supported.
    • when_required - When set, checksum validation is not performed on response payloads of operations unless the checksum algorithm is supported and the requestValidationModeMember member is set to ENABLED.
  • :retry_backoff (Proc) —

    A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay. This option is only used in the legacy retry mode.

  • :retry_base_delay (Float) — default: 0.3 —

    The base delay in seconds used by the default backoff function. This option is only used in the legacy retry mode.

  • :retry_jitter (Symbol) — default: :none —

    A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number. This option is only used in the legacy retry mode.

    @see https://www.awsarchitectureblog.com/2015/03/backoff.html

  • :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, auth errors, endpoint discovery, and errors from expired credentials. This option is only used in the legacy retry mode.

  • :retry_max_delay (Integer) — default: 0 —

    The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function. This option is only used in the legacy retry mode.

  • :retry_mode (String) — default: "standard" —

    Specifies which retry algorithm to use. Values are:

    • legacy - The pre-existing retry behavior.

    • standard - A standardized set of retry rules across the AWS SDKs. This includes support for retry quotas, which limit the number of unsuccessful retries a client can make. This is the default value if no retry mode is provided.

    • adaptive - A retry mode that includes all the functionality of standard mode along with automatic client side throttling.

  • :sdk_ua_app_id (String) —

    A unique and opaque application ID that is appended to the User-Agent header as app/sdk_ua_app_id. It should have a maximum length of 50. This variable is sourced from environment variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.

  • :secret_access_key (String)
  • :session_token (String)
  • :sigv4a_signing_region_set (Array) —

    A list of regions that should be signed with SigV4a signing. When not passed, a default :sigv4a_signing_region_set is searched for in the following locations:

    • Aws.config[:sigv4a_signing_region_set]
    • ENV['AWS_SIGV4A_SIGNING_REGION_SET']
    • ~/.aws/config
  • :simple_json (Boolean) — default: false —

    Disables request parameter conversion, validation, and formatting. Also disables response data type conversions. The request parameters hash must be formatted exactly as the API expects.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.

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

  • :telemetry_provider (Aws::Telemetry::TelemetryProviderBase) — default: Aws::Telemetry::NoOpTelemetryProvider —

    Allows you to provide a telemetry provider, which is used to emit telemetry data. By default, uses NoOpTelemetryProvider which will not record or emit any telemetry data. The SDK supports the following telemetry providers:

    • OpenTelemetry (OTel) - To use the OTel provider, install and require the opentelemetry-sdk gem and then, pass in an instance of a Aws::Telemetry::OTelProvider for telemetry provider.
  • :token_provider (Aws::TokenProvider) —

    Your Bearer token used for authentication. This can be any class that includes and implements Aws::TokenProvider, or instance of any one of the following classes:

    • Aws::StaticTokenProvider - Used for configuring static, non-refreshing tokens.

    • Aws::SSOTokenProvider - Used for loading tokens from AWS SSO using an access token generated from aws login.

    When :token_provider is not configured directly, the Aws::TokenProviderChain will be used to search for tokens configured for your profile in shared configuration files.

  • :use_dualstack_endpoint (Boolean) —

    When set to true, dualstack enabled endpoints (with .aws TLD) will be used if available.

  • :use_fips_endpoint (Boolean) —

    When set to true, fips compatible endpoints will be used if available. When a fips region is used, the region is normalized and this config is set to true.

  • :validate_params (Boolean) — default: true —

    When true, request parameters are validated before sending the request.

  • :endpoint_provider (Aws::ECRPublic::EndpointProvider) —

    The endpoint provider used to resolve endpoints. Any object that responds to #resolve_endpoint(parameters) where parameters is a Struct similar to Aws::ECRPublic::EndpointParameters.

  • :http_continue_timeout (Float) — default: 1 —

    The number of seconds to wait for a 100-continue response before sending the request body. This option has no effect unless the request has "Expect" header set to "100-continue". Defaults to nil which disables this behaviour. This value can safely be set per request on the session.

  • :http_idle_timeout (Float) — default: 5 —

    The number of seconds a connection is allowed to sit idle before it is considered stale. Stale connections are closed and removed from the pool before making a request.

  • :http_open_timeout (Float) — default: 15 —

    The default number of seconds to wait for response data. This value can safely be set per-request on the session.

  • :http_proxy (URI::HTTP, String) —

    A proxy to send requests through. Formatted like 'http://proxy.com:123'.

  • :http_read_timeout (Float) — default: 60 —

    The default number of seconds to wait for response data. This value can safely be set per-request on the session.

  • :http_wire_trace (Boolean) — default: false —

    When true, HTTP debug output will be sent to the :logger.

  • :on_chunk_received (Proc) —

    When a Proc object is provided, it will be used as callback when each chunk of the response body is received. It provides three arguments: the chunk, the number of bytes received, and the total number of bytes in the response (or nil if the server did not send a content-length).

  • :on_chunk_sent (Proc) —

    When a Proc object is provided, it will be used as callback when each chunk of the request body is sent. It provides three arguments: the chunk, the number of bytes read from the body, and the total number of bytes in the body.

  • :raise_response_errors (Boolean) — default: true —

    When true, response errors are raised.

  • :ssl_ca_bundle (String) —

    Full path to the SSL certificate authority bundle file that should be used when verifying peer certificates. If you do not pass :ssl_ca_bundle or :ssl_ca_directory the the system default will be used if available.

  • :ssl_ca_directory (String) —

    Full path of the directory that contains the unbundled SSL certificate authority files for verifying peer certificates. If you do not pass :ssl_ca_bundle or :ssl_ca_directory the the system default will be used if available.

  • :ssl_ca_store (String) —

    Sets the X509::Store to verify peer certificate.

  • :ssl_cert (OpenSSL::X509::Certificate) —

    Sets a client certificate when creating http connections.

  • :ssl_key (OpenSSL::PKey) —

    Sets a client key when creating http connections.

  • :ssl_timeout (Float) —

    Sets the SSL timeout in seconds

  • :ssl_verify_peer (Boolean) — default: true —

    When true, SSL peer certificates are verified when establishing a connection.



486
487
488
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 486

def initialize(*args)
  super
end

Instance Method Details

#associate_repositories(params = {}) ⇒ Types::AssociateRepositoriesResponse

Associates a repository with another repository of a different type in the same public registry, so that the Amazon ECR Public Gallery shows them side by side. One repository must be FREE and the other must be PREMIUM. Both repositories must already exist, and each repository can have at most one associated repository.

Examples:

Example: To associate a free repository with a premium repository


# This example associates the free repository my-free-repository with the premium repository my-premium-repository in your
# default registry.

resp = client.associate_repositories({
  associated_repository_name: "my-free-repository", 
  associated_repository_type: "FREE", 
  repository_name: "my-premium-repository", 
  repository_type: "PREMIUM", 
})

resp.to_h outputs the following:
{
  associated_repository_name: "my-free-repository", 
  associated_repository_type: "FREE", 
  registry_id: "123456789012", 
  repository_name: "my-premium-repository", 
  repository_type: "PREMIUM", 
}

Request syntax with placeholder values


resp = client.associate_repositories({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  repository_type: "FREE", # required, accepts FREE, PREMIUM
  associated_repository_name: "RepositoryName", # required
  associated_repository_type: "FREE", # required, accepts FREE, PREMIUM
})

Response structure


resp.registry_id #=> String
resp.repository_name #=> String
resp.repository_type #=> String, one of "FREE", "PREMIUM"
resp.associated_repository_name #=> String
resp.associated_repository_type #=> String, one of "FREE", "PREMIUM"

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID that's associated with the public registry that contains the repositories to associate. If you do not specify a registry, the default public registry is assumed. You can specify only your own account ID. Cross-account access through a repository policy isn't supported for this operation.

  • :repository_name (required, String) —

    The name of the source repository.

  • :repository_type (required, String) —

    The type of the source repository. Valid values:

    • FREE: A free repository.

    • PREMIUM: A premium repository that holds paid content.

  • :associated_repository_name (required, String) —

    The name of the repository to associate with the source repository.

  • :associated_repository_type (required, String) —

    The type of the repository to associate with the source repository. This must be different from the type of the source repository. Valid values:

    • FREE: A free repository.

    • PREMIUM: A premium repository that holds paid content.

Returns:

See Also:



579
580
581
582
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 579

def associate_repositories(params = {}, options = {})
  req = build_request(:associate_repositories, params)
  req.send_request(options)
end

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

Checks the availability of one or more image layers that are within a repository in a public registry. 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: "RegistryIdOrAlias",
  repository_name: "RepositoryName", # required
  repository_type: "FREE", # accepts FREE, PREMIUM
  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

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID, or registry alias, associated with the public registry that contains the image layers to check. If you do not specify a registry, the default public registry is assumed.

  • :repository_name (required, String) —

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

  • :repository_type (String) —

    The type of the repository. If you don't specify a type, Amazon ECR uses FREE. Valid values:

    • FREE: A free repository.

    • PREMIUM: A premium repository that holds paid content.

  • :layer_digests (required, Array<String>) —

    The digests of the image layers to check.

Returns:

See Also:



646
647
648
649
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 646

def batch_check_layer_availability(params = {}, options = {})
  req = build_request(:batch_check_layer_availability, params)
  req.send_request(options)
end

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

Deletes a list of specified images that are within a repository in a public registry. 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 digest of the image in your request.

Examples:

Request syntax with placeholder values


resp = client.batch_delete_image({
  registry_id: "RegistryIdOrAlias",
  repository_name: "RepositoryName", # required
  repository_type: "FREE", # accepts FREE, PREMIUM
  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", "ImageNotEligibleForDeletion"
resp.failures[0].failure_reason #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID, or registry alias, that's associated with the registry that contains the image to delete. If you do not specify a registry, the default public registry is assumed.

  • :repository_name (required, String) —

    The repository in a public registry that contains the image to delete.

  • :repository_type (String) —

    The type of the repository. If you don't specify a type, Amazon ECR uses FREE. Valid values:

    • FREE: A free repository.

    • PREMIUM: A premium repository that holds paid content.

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



717
718
719
720
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 717

def batch_delete_image(params = {}, options = {})
  req = build_request(:batch_delete_image, params)
  req.send_request(options)
end

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

Informs Amazon ECR that the image layer upload is complete for a specified public 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 for each new image layer to verify that the upload is complete.

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: "RegistryIdOrAlias",
  repository_name: "RepositoryName", # required
  repository_type: "FREE", # accepts FREE, PREMIUM
  upload_id: "UploadId", # required
  layer_digests: ["LayerDigest"], # required
})

Response structure


resp.registry_id #=> String
resp.repository_name #=> String
resp.repository_type #=> String, one of "FREE", "PREMIUM"
resp.upload_id #=> String
resp.layer_digest #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID, or registry alias, associated with the registry where layers are uploaded. If you do not specify a registry, the default public registry is assumed.

  • :repository_name (required, String) —

    The name of the repository in a public registry to associate with the image layer.

  • :repository_type (String) —

    The type of the repository. If you don't specify a type, Amazon ECR uses FREE. Valid values:

    • FREE: A free repository.

    • PREMIUM: A premium repository that holds paid content.

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



790
791
792
793
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 790

def complete_layer_upload(params = {}, options = {})
  req = build_request(:complete_layer_upload, params)
  req.send_request(options)
end

#create_premium_repository(params = {}) ⇒ Types::CreatePremiumRepositoryResponse

Creates a premium repository in a public registry for paid content that's sold through Amazon Web Services Marketplace. Your registry must be verified and have an approved custom registry alias; otherwise, the request fails with ValidationException. The repository starts in the DRAFT state, and you make it available with SetRepositoryState.

Examples:

Example: To create a premium repository


# This example creates a premium repository called my-premium-repository and links it to one AWS Marketplace product. The
# new repository starts in the DRAFT state.

resp = client.create_premium_repository({
  catalog_data: {
    architectures: [
      "x86-64", 
      "ARM 64", 
    ], 
    categories: [
      "BASE_IMAGES", 
      "SECURITY", 
    ], 
    description: "Hardened base image with premium support", 
    operating_systems: [
      "Linux", 
    ], 
  }, 
  marketplace_products: [
    "prod-ad8EXAMPLE651", 
  ], 
  repository_name: "my-premium-repository", 
})

resp.to_h outputs the following:
{
  catalog_data: {
    architectures: [
      "x86-64", 
      "ARM 64", 
    ], 
    categories: [
      "BASE_IMAGES", 
      "SECURITY", 
    ], 
    description: "Hardened base image with premium support", 
    operating_systems: [
      "Linux", 
    ], 
  }, 
  premium_repository: {
    created_at: Time.parse("2026-11-03T00:00:00Z"), 
    marketplace_products: [
      "prod-ad8EXAMPLE651", 
    ], 
    registry_id: "123456789012", 
    repository_arn: "arn:aws:ecr-public::123456789012:premium-repository/my-premium-repository", 
    repository_name: "my-premium-repository", 
    repository_uri: "ecr-premium.aws.com/example-alias/my-premium-repository", 
    state: "DRAFT", 
  }, 
}

Request syntax with placeholder values


resp = client.create_premium_repository({
  repository_name: "RepositoryName", # required
  catalog_data: {
    description: "RepositoryDescription",
    architectures: ["Architecture"],
    operating_systems: ["OperatingSystem"],
    logo_image_blob: "data",
    about_text: "AboutText",
    usage_text: "UsageText",
    categories: ["BASE_IMAGES"], # accepts BASE_IMAGES, APPLICATION_RUNTIMES, DATABASES, AI_ML, NETWORKING, SECURITY, MONITORING, CI_CD_TOOLS, KUBERNETES_EXTENSIONS, WEB_SERVERS, STREAMING
  },
  marketplace_products: ["MarketplaceProductId"], # required
  tags: [
    {
      key: "TagKey",
      value: "TagValue",
    },
  ],
})

Response structure


resp.premium_repository.repository_arn #=> String
resp.premium_repository.registry_id #=> String
resp.premium_repository.repository_name #=> String
resp.premium_repository.repository_uri #=> String
resp.premium_repository.created_at #=> Time
resp.premium_repository.marketplace_products #=> Array
resp.premium_repository.marketplace_products[0] #=> String
resp.premium_repository.associated_repositories #=> Array
resp.premium_repository.associated_repositories[0].repository_name #=> String
resp.premium_repository.associated_repositories[0].repository_type #=> String, one of "FREE", "PREMIUM"
resp.premium_repository.state #=> String, one of "DRAFT", "AVAILABLE", "HIDDEN"
resp.catalog_data.description #=> String
resp.catalog_data.architectures #=> Array
resp.catalog_data.architectures[0] #=> String
resp.catalog_data.operating_systems #=> Array
resp.catalog_data.operating_systems[0] #=> String
resp.catalog_data.logo_url #=> String
resp.catalog_data.about_text #=> String
resp.catalog_data.usage_text #=> String
resp.catalog_data.marketplace_certified #=> Boolean
resp.catalog_data.categories #=> Array
resp.catalog_data.categories[0] #=> String, one of "BASE_IMAGES", "APPLICATION_RUNTIMES", "DATABASES", "AI_ML", "NETWORKING", "SECURITY", "MONITORING", "CI_CD_TOOLS", "KUBERNETES_EXTENSIONS", "WEB_SERVERS", "STREAMING"
resp.catalog_data.badges #=> Array
resp.catalog_data.badges[0] #=> String, one of "FIPS", "STIG", "SIGNED", "SBOM", "CIS"
resp.catalog_data.artifact_types #=> Array
resp.catalog_data.artifact_types[0] #=> String, one of "IMAGE", "HELM"

Parameters:

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

    ({})

Options Hash (params):

  • :repository_name (required, String) —

    The name to use for the premium repository. You can specify the name on its own (for example nginx-web-app) or prepend a namespace to group the repository into a category (for example project-a/nginx-web-app). You can give a premium repository the same name as a free repository in the same registry.

  • :catalog_data (Types::RepositoryCatalogDataInput) —

    The details about the premium repository that are publicly visible in the Amazon ECR Public Gallery. A premium repository is listed in the Amazon ECR Public Gallery when it's AVAILABLE and at least one of its Amazon Web Services Marketplace products is public.

  • :marketplace_products (required, Array<String>) —

    The list of Amazon Web Services Marketplace product IDs for the premium repository. You can specify from one to five product IDs. Your account must own each product, and each product must have an Amazon ECR Public Premium delivery option. You can't specify the same product ID more than once.

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

    The metadata that you apply to the premium repository to help categorize and organize your repositories. Each tag consists of a key and an optional value. You define both of them. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.

Returns:

See Also:



945
946
947
948
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 945

def create_premium_repository(params = {}, options = {})
  req = build_request(:create_premium_repository, params)
  req.send_request(options)
end

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

Creates a repository in a public registry. For more information, see Public repositories in the Amazon Elastic Container Registry Public User Guide.

Examples:

Request syntax with placeholder values


resp = client.create_repository({
  repository_name: "RepositoryName", # required
  catalog_data: {
    description: "RepositoryDescription",
    architectures: ["Architecture"],
    operating_systems: ["OperatingSystem"],
    logo_image_blob: "data",
    about_text: "AboutText",
    usage_text: "UsageText",
    categories: ["BASE_IMAGES"], # accepts BASE_IMAGES, APPLICATION_RUNTIMES, DATABASES, AI_ML, NETWORKING, SECURITY, MONITORING, CI_CD_TOOLS, KUBERNETES_EXTENSIONS, WEB_SERVERS, STREAMING
  },
  tags: [
    {
      key: "TagKey",
      value: "TagValue",
    },
  ],
})

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.associated_repositories #=> Array
resp.repository.associated_repositories[0].repository_name #=> String
resp.repository.associated_repositories[0].repository_type #=> String, one of "FREE", "PREMIUM"
resp.catalog_data.description #=> String
resp.catalog_data.architectures #=> Array
resp.catalog_data.architectures[0] #=> String
resp.catalog_data.operating_systems #=> Array
resp.catalog_data.operating_systems[0] #=> String
resp.catalog_data.logo_url #=> String
resp.catalog_data.about_text #=> String
resp.catalog_data.usage_text #=> String
resp.catalog_data.marketplace_certified #=> Boolean
resp.catalog_data.categories #=> Array
resp.catalog_data.categories[0] #=> String, one of "BASE_IMAGES", "APPLICATION_RUNTIMES", "DATABASES", "AI_ML", "NETWORKING", "SECURITY", "MONITORING", "CI_CD_TOOLS", "KUBERNETES_EXTENSIONS", "WEB_SERVERS", "STREAMING"
resp.catalog_data.badges #=> Array
resp.catalog_data.badges[0] #=> String, one of "FIPS", "STIG", "SIGNED", "SBOM", "CIS"
resp.catalog_data.artifact_types #=> Array
resp.catalog_data.artifact_types[0] #=> String, one of "IMAGE", "HELM"

Parameters:

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

    ({})

Options Hash (params):

  • :repository_name (required, String) —

    The name to use for the repository. This appears publicly in the Amazon ECR Public Gallery. The repository name can be specified on its own (for example nginx-web-app) or prepended with a namespace to group the repository into a category (for example project-a/nginx-web-app).

  • :catalog_data (Types::RepositoryCatalogDataInput) —

    The details about the repository that are publicly visible in the Amazon ECR Public Gallery.

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

    The metadata that you apply to each repository to help categorize and organize your repositories. Each tag consists of a key and an optional value. You define both of them. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.

Returns:

See Also:



1032
1033
1034
1035
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 1032

def create_repository(params = {}, options = {})
  req = build_request(:create_repository, params)
  req.send_request(options)
end

#delete_premium_repository(params = {}) ⇒ Types::DeletePremiumRepositoryResponse

Deletes a premium repository in a public registry. The repository must be empty before you can delete it. While the repository is in the DRAFT state, you can remove images with BatchDeleteImage; after it leaves the DRAFT state, deprecate images with SetImageStatus.

Examples:

Example: To delete an empty premium repository


# This example deletes the empty premium repository my-premium-repository in your default registry.

resp = client.delete_premium_repository({
  repository_name: "my-premium-repository", 
})

resp.to_h outputs the following:
{
  premium_repository: {
    created_at: Time.parse("2026-11-03T00:00:00Z"), 
    registry_id: "123456789012", 
    repository_arn: "arn:aws:ecr-public::123456789012:premium-repository/my-premium-repository", 
    repository_name: "my-premium-repository", 
    repository_uri: "ecr-premium.aws.com/example-alias/my-premium-repository", 
  }, 
}

Request syntax with placeholder values


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

Response structure


resp.premium_repository.repository_arn #=> String
resp.premium_repository.registry_id #=> String
resp.premium_repository.repository_name #=> String
resp.premium_repository.repository_uri #=> String
resp.premium_repository.created_at #=> Time
resp.premium_repository.marketplace_products #=> Array
resp.premium_repository.marketplace_products[0] #=> String
resp.premium_repository.associated_repositories #=> Array
resp.premium_repository.associated_repositories[0].repository_name #=> String
resp.premium_repository.associated_repositories[0].repository_type #=> String, one of "FREE", "PREMIUM"
resp.premium_repository.state #=> String, one of "DRAFT", "AVAILABLE", "HIDDEN"

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID that's associated with the public registry that contains the premium repository to delete. If you do not specify a registry, the default public registry is assumed. You can specify only your own account ID. Cross-account access through a repository policy isn't supported for this operation.

  • :repository_name (required, String) —

    The name of the premium repository to delete.

Returns:

See Also:



1101
1102
1103
1104
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 1101

def delete_premium_repository(params = {}, options = {})
  req = build_request(:delete_premium_repository, params)
  req.send_request(options)
end

#delete_premium_repository_policy(params = {}) ⇒ Types::DeletePremiumRepositoryPolicyResponse

Deletes the repository policy that's associated with the specified premium repository.

Examples:

Example: To delete the policy of a premium repository


# This example deletes the repository policy of the premium repository my-premium-repository. The response returns the
# policy that was deleted.

resp = client.delete_premium_repository_policy({
  repository_name: "my-premium-repository", 
})

resp.to_h outputs the following:
{
  policy_text: "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"AllowDescribe\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::123456789012:role/ExampleRole\"},\"Action\":[\"ecr-public:DescribePremiumRepositories\"]}]}", 
  registry_id: "123456789012", 
  repository_name: "my-premium-repository", 
}

Request syntax with placeholder values


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

Response structure


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

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID that's associated with the public registry that contains the premium repository policy to delete. If you do not specify a registry, the default public registry is assumed. You can specify only your own account ID. Cross-account access through a repository policy isn't supported for this operation.

  • :repository_name (required, String) —

    The name of the premium repository that's associated with the repository policy to delete.

Returns:

See Also:



1160
1161
1162
1163
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 1160

def delete_premium_repository_policy(params = {}, options = {})
  req = build_request(:delete_premium_repository_policy, params)
  req.send_request(options)
end

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

Deletes a repository in a public registry. If the repository contains images, you must either manually delete all images in the repository or use the force option. This option deletes all images on your behalf before deleting the repository.

Examples:

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.associated_repositories #=> Array
resp.repository.associated_repositories[0].repository_name #=> String
resp.repository.associated_repositories[0].repository_type #=> String, one of "FREE", "PREMIUM"

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID that's associated with the public registry that contains the repository to delete. If you do not specify a registry, the default public registry is assumed.

  • :repository_name (required, String) —

    The name of the repository to delete.

  • :force (Boolean) —

    The force option can be used to delete a repository that contains images. If the force option is not used, the repository must be empty prior to deletion.

Returns:

See Also:



1210
1211
1212
1213
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 1210

def delete_repository(params = {}, options = {})
  req = build_request(:delete_repository, params)
  req.send_request(options)
end

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

Deletes the repository policy that's associated with the specified repository.

Examples:

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

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID that's associated with the public registry that contains the repository policy to delete. If you do not specify a registry, the default public registry is assumed.

  • :repository_name (required, String) —

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

Returns:

See Also:



1250
1251
1252
1253
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 1250

def delete_repository_policy(params = {}, options = {})
  req = build_request(:delete_repository_policy, params)
  req.send_request(options)
end

#describe_entitled_image_tags(params = {}) ⇒ Types::DescribeEntitledImageTagsResponse

Returns the image tag details for a premium repository that you're entitled to through an Amazon Web Services Marketplace purchase.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Example: To describe the image tags in an entitled premium repository


# This example describes the image tags in the premium repository my-premium-repository, which you're entitled to through
# an AWS Marketplace purchase.

resp = client.describe_entitled_image_tags({
  registry_alias: "example-alias", 
  repository_name: "my-premium-repository", 
})

resp.to_h outputs the following:
{
  image_tag_details: [
    {
      created_at: Time.parse("2026-11-03T00:00:00Z"), 
      image_detail: {
        artifact_media_type: "application/vnd.oci.image.config.v1+json", 
        image_digest: "sha256:f5c12bd3e4b8b1a2a3a5d5d0e6c4b3a2f1e0d9c8b7a6f5e4d3c2b1a0f9e8d7c6", 
        image_manifest_media_type: "application/vnd.oci.image.manifest.v1+json", 
        image_pushed_at: Time.parse("2026-11-03T00:00:00Z"), 
        image_size_in_bytes: 31637045, 
        image_status: "ACTIVE", 
      }, 
      image_tag: "1.0", 
    }, 
  ], 
  registry_alias: "example-alias", 
  repository_name: "my-premium-repository", 
}

Request syntax with placeholder values


resp = client.describe_entitled_image_tags({
  repository_name: "RepositoryName", # required
  registry_alias: "RegistryAliasName", # required
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.repository_name #=> String
resp.registry_alias #=> String
resp.image_tag_details #=> Array
resp.image_tag_details[0].image_tag #=> String
resp.image_tag_details[0].created_at #=> Time
resp.image_tag_details[0].image_detail.image_digest #=> String
resp.image_tag_details[0].image_detail.image_size_in_bytes #=> Integer
resp.image_tag_details[0].image_detail.image_pushed_at #=> Time
resp.image_tag_details[0].image_detail.image_manifest_media_type #=> String
resp.image_tag_details[0].image_detail.artifact_media_type #=> String
resp.image_tag_details[0].image_detail.image_status #=> String, one of "ACTIVE", "DEPRECATED"
resp.image_tag_details[0].image_detail.scheduled_deletion_at #=> Time
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :repository_name (required, String) —

    The name of the premium repository that contains the image tags to describe.

  • :registry_alias (required, String) —

    The registry alias of the publisher that owns the premium repository. The alias is the first part of the premium repository URI.

  • :next_token (String) —

    The nextToken value that's returned from a previous paginated DescribeEntitledImageTags request where you used maxResults and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. If there are no more results to return, this value is null.

    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 results that DescribeEntitledImageTags returns in paginated output. When you use this parameter, DescribeEntitledImageTags returns only maxResults results in a single page along with a nextToken response element. To see the remaining results, send another DescribeEntitledImageTags request with the returned nextToken value. You can specify a value between 1 and 1000. If you don't use this parameter, DescribeEntitledImageTags returns up to 100 results and a nextToken value, if applicable.

Returns:

See Also:



1359
1360
1361
1362
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 1359

def describe_entitled_image_tags(params = {}, options = {})
  req = build_request(:describe_entitled_image_tags, params)
  req.send_request(options)
end

#describe_entitled_images(params = {}) ⇒ Types::DescribeEntitledImagesResponse

Returns metadata about the images in a premium repository that you're entitled to through an Amazon Web Services Marketplace purchase.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Example: To describe the images in an entitled premium repository


# This example describes the images in the premium repository my-premium-repository, which you're entitled to through an
# AWS Marketplace purchase.

resp = client.describe_entitled_images({
  registry_alias: "example-alias", 
  repository_name: "my-premium-repository", 
})

resp.to_h outputs the following:
{
  image_details: [
    {
      artifact_media_type: "application/vnd.oci.image.config.v1+json", 
      image_digest: "sha256:f5c12bd3e4b8b1a2a3a5d5d0e6c4b3a2f1e0d9c8b7a6f5e4d3c2b1a0f9e8d7c6", 
      image_manifest_media_type: "application/vnd.oci.image.manifest.v1+json", 
      image_pushed_at: Time.parse("2026-11-03T00:00:00Z"), 
      image_size_in_bytes: 31637045, 
      image_status: "ACTIVE", 
      image_tags: [
        "1.0", 
        "latest", 
      ], 
      repository_name: "my-premium-repository", 
    }, 
  ], 
  registry_alias: "example-alias", 
  repository_name: "my-premium-repository", 
}

Request syntax with placeholder values


resp = client.describe_entitled_images({
  repository_name: "RepositoryName", # required
  registry_alias: "RegistryAliasName", # required
  image_ids: [
    {
      image_digest: "ImageDigest",
      image_tag: "ImageTag",
    },
  ],
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.repository_name #=> String
resp.registry_alias #=> String
resp.image_details #=> Array
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_manifest_media_type #=> String
resp.image_details[0].artifact_media_type #=> String
resp.image_details[0].image_status #=> String, one of "ACTIVE", "DEPRECATED"
resp.image_details[0].scheduled_deletion_at #=> Time
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :repository_name (required, String) —

    The name of the premium repository that contains the images to describe.

  • :registry_alias (required, String) —

    The registry alias of the publisher that owns the premium repository. The alias is the first part of the premium repository URI.

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

    The list of image IDs for the requested premium repository. If you specify images with imageIds, you can't use maxResults or nextToken.

  • :next_token (String) —

    The nextToken value that's returned from a previous paginated DescribeEntitledImages request where you used maxResults and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. If there are no more results to return, this value is null.

    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 results that DescribeEntitledImages returns in paginated output. When you use this parameter, DescribeEntitledImages returns only maxResults results in a single page along with a nextToken response element. To see the remaining results, send another DescribeEntitledImages request with the returned nextToken value. You can specify a value between 1 and 1000. If you don't use this parameter, DescribeEntitledImages returns up to 100 results and a nextToken value, if applicable.

Returns:

See Also:



1480
1481
1482
1483
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 1480

def describe_entitled_images(params = {}, options = {})
  req = build_request(:describe_entitled_images, params)
  req.send_request(options)
end

#describe_entitled_repositories(params = {}) ⇒ Types::DescribeEntitledRepositoriesResponse

Returns the premium repositories that you're entitled to through your active Amazon Web Services Marketplace purchases. Amazon ECR looks up your purchases by calling the Amazon Web Services Marketplace SearchAgreements operation on your behalf, so you need permission for the aws-marketplace:SearchAgreements action in addition to ecr-public:DescribeEntitledRepositories.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Example: To list the premium repositories you're entitled to


# This example lists the premium repositories that you're entitled to through active AWS Marketplace purchases.

resp = client.describe_entitled_repositories({
})

resp.to_h outputs the following:
{
  repositories: [
    {
      entitled_via_product_id: "prod-ad8EXAMPLE651", 
      registry_alias: "example-alias", 
      registry_display_name: "Example Publisher", 
      repository_arn: "arn:aws:ecr-public:::entitled-repository/example-alias/my-premium-repository", 
      repository_name: "my-premium-repository", 
      repository_uri: "ecr-premium.aws.com/example-alias/my-premium-repository", 
      state: "AVAILABLE", 
    }, 
  ], 
}

Request syntax with placeholder values


resp = client.describe_entitled_repositories({
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.repositories #=> Array
resp.repositories[0].registry_alias #=> String
resp.repositories[0].repository_name #=> String
resp.repositories[0].repository_arn #=> String
resp.repositories[0].repository_uri #=> String
resp.repositories[0].state #=> String, one of "DRAFT", "AVAILABLE", "HIDDEN"
resp.repositories[0].entitled_via_product_id #=> String
resp.repositories[0].registry_display_name #=> String
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :next_token (String) —

    The nextToken value that's returned from a previous paginated DescribeEntitledRepositories request. Pagination continues from the end of the previous results. A nextToken is valid only for the account that received it. If the request fails with InvalidParameterException because the token no longer matches, start again without a nextToken.

    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 results that DescribeEntitledRepositories returns in paginated output. You can specify a value between 1 and 1000. If you don't use this parameter, DescribeEntitledRepositories returns up to 100 results. A page can contain fewer than maxResults results, or none, and still return a nextToken. Keep sending requests until nextToken is null.

Returns:

See Also:



1567
1568
1569
1570
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 1567

def describe_entitled_repositories(params = {}, options = {})
  req = build_request(:describe_entitled_repositories, params)
  req.send_request(options)
end

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

Returns the scan status and vulnerability findings for an image in a premium repository. Images in premium repositories are scanned automatically when they're pushed, and are rescanned as new vulnerabilities are published. Image scanning isn't currently supported for free repositories.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

The following waiters are defined for this operation (see #wait_until for detailed usage):

  • image_scan_complete

Examples:

Example: To describe the scan findings for an image in a premium repository


# This example describes the vulnerability scan findings for an image in the premium repository my-premium-repository.

resp = client.describe_image_scan_findings({
  image_id: {
    image_digest: "sha256:f5c12bd3e4b8b1a2a3a5d5d0e6c4b3a2f1e0d9c8b7a6f5e4d3c2b1a0f9e8d7c6", 
  }, 
  repository_name: "my-premium-repository", 
  repository_type: "PREMIUM", 
})

resp.to_h outputs the following:
{
  image_id: {
    image_digest: "sha256:f5c12bd3e4b8b1a2a3a5d5d0e6c4b3a2f1e0d9c8b7a6f5e4d3c2b1a0f9e8d7c6", 
  }, 
  image_scan_findings: {
    finding_severity_counts: {
      "HIGH" => 1, 
    }, 
    findings: [
      {
        type: "PACKAGE_VULNERABILITY", 
        aws_account_id: "123456789012", 
        description: "An example vulnerability in the openssl package.", 
        exploit_available: "NO", 
        finding_id: "EXAMPLE1234567890abcdef", 
        first_observed_at: Time.parse("2026-11-04T00:00:00Z"), 
        fix_available: "YES", 
        last_observed_at: Time.parse("2026-11-04T00:00:00Z"), 
        package_vulnerability_details: {
          source: "NVD", 
          vendor_severity: "HIGH", 
          vulnerability_id: "CVE-2026-12345", 
          vulnerable_packages: [
            {
              version: "3.0.1", 
              name: "openssl", 
              arch: "x86_64", 
              fixed_in_version: "3.0.2", 
              package_manager: "OS", 
            }, 
          ], 
        }, 
        remediation: {
          recommendation: {
            text: "Upgrade openssl to version 3.0.2 or later.", 
          }, 
        }, 
        score: 7.5, 
        severity: "HIGH", 
        status: "ACTIVE", 
        title: "CVE-2026-12345 - openssl", 
        updated_at: Time.parse("2026-11-04T00:00:00Z"), 
      }, 
    ], 
    image_scan_completed_at: Time.parse("2026-11-04T00:00:00Z"), 
    vulnerability_source_updated_at: Time.parse("2026-11-04T00:00:00Z"), 
  }, 
  image_scan_status: {
    description: "Continuous scan is selected for image.", 
    status: "ACTIVE", 
  }, 
  registry_id: "123456789012", 
  repository_name: "my-premium-repository", 
}

Request syntax with placeholder values


resp = client.describe_image_scan_findings({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  repository_type: "FREE", # accepts FREE, PREMIUM
  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 "FAILED", "UNSUPPORTED_IMAGE", "ACTIVE", "COMPLETE", "PENDING", "SCAN_ELIGIBILITY_EXPIRED", "FINDINGS_UNAVAILABLE"
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.finding_severity_counts #=> Hash
resp.image_scan_findings.finding_severity_counts["FindingSeverity"] #=> Integer
resp.image_scan_findings.findings #=> Array
resp.image_scan_findings.findings[0]. #=> String
resp.image_scan_findings.findings[0].finding_id #=> String
resp.image_scan_findings.findings[0].description #=> String
resp.image_scan_findings.findings[0].first_observed_at #=> Time
resp.image_scan_findings.findings[0].last_observed_at #=> Time
resp.image_scan_findings.findings[0].package_vulnerability_details.cvss #=> Array
resp.image_scan_findings.findings[0].package_vulnerability_details.cvss[0].base_score #=> Float
resp.image_scan_findings.findings[0].package_vulnerability_details.cvss[0].scoring_vector #=> String
resp.image_scan_findings.findings[0].package_vulnerability_details.cvss[0].source #=> String
resp.image_scan_findings.findings[0].package_vulnerability_details.cvss[0].version #=> String
resp.image_scan_findings.findings[0].package_vulnerability_details.reference_urls #=> Array
resp.image_scan_findings.findings[0].package_vulnerability_details.reference_urls[0] #=> String
resp.image_scan_findings.findings[0].package_vulnerability_details.related_vulnerabilities #=> Array
resp.image_scan_findings.findings[0].package_vulnerability_details.related_vulnerabilities[0] #=> String
resp.image_scan_findings.findings[0].package_vulnerability_details.source #=> String
resp.image_scan_findings.findings[0].package_vulnerability_details.source_url #=> String
resp.image_scan_findings.findings[0].package_vulnerability_details.vendor_created_at #=> Time
resp.image_scan_findings.findings[0].package_vulnerability_details.vendor_severity #=> String
resp.image_scan_findings.findings[0].package_vulnerability_details.vendor_updated_at #=> Time
resp.image_scan_findings.findings[0].package_vulnerability_details.vulnerability_id #=> String
resp.image_scan_findings.findings[0].package_vulnerability_details.vulnerable_packages #=> Array
resp.image_scan_findings.findings[0].package_vulnerability_details.vulnerable_packages[0].arch #=> String
resp.image_scan_findings.findings[0].package_vulnerability_details.vulnerable_packages[0].epoch #=> Integer
resp.image_scan_findings.findings[0].package_vulnerability_details.vulnerable_packages[0].file_path #=> String
resp.image_scan_findings.findings[0].package_vulnerability_details.vulnerable_packages[0].name #=> String
resp.image_scan_findings.findings[0].package_vulnerability_details.vulnerable_packages[0].package_manager #=> String
resp.image_scan_findings.findings[0].package_vulnerability_details.vulnerable_packages[0].release #=> String
resp.image_scan_findings.findings[0].package_vulnerability_details.vulnerable_packages[0].source_layer_hash #=> String
resp.image_scan_findings.findings[0].package_vulnerability_details.vulnerable_packages[0].version #=> String
resp.image_scan_findings.findings[0].package_vulnerability_details.vulnerable_packages[0].fixed_in_version #=> String
resp.image_scan_findings.findings[0].remediation.recommendation.url #=> String
resp.image_scan_findings.findings[0].remediation.recommendation.text #=> String
resp.image_scan_findings.findings[0].resources #=> Array
resp.image_scan_findings.findings[0].resources[0].details.container_image.architecture #=> String
resp.image_scan_findings.findings[0].resources[0].details.container_image.author #=> String
resp.image_scan_findings.findings[0].resources[0].details.container_image.image_hash #=> String
resp.image_scan_findings.findings[0].resources[0].details.container_image.image_tags #=> Array
resp.image_scan_findings.findings[0].resources[0].details.container_image.image_tags[0] #=> String
resp.image_scan_findings.findings[0].resources[0].details.container_image.platform #=> String
resp.image_scan_findings.findings[0].resources[0].details.container_image.pushed_at #=> Time
resp.image_scan_findings.findings[0].resources[0].details.container_image.registry #=> String
resp.image_scan_findings.findings[0].resources[0].details.container_image.repository_name #=> String
resp.image_scan_findings.findings[0].resources[0].type #=> String
resp.image_scan_findings.findings[0].score #=> Float
resp.image_scan_findings.findings[0].score_details.cvss.adjustments #=> Array
resp.image_scan_findings.findings[0].score_details.cvss.adjustments[0].metric #=> String
resp.image_scan_findings.findings[0].score_details.cvss.adjustments[0].reason #=> String
resp.image_scan_findings.findings[0].score_details.cvss.score #=> Float
resp.image_scan_findings.findings[0].score_details.cvss.score_source #=> String
resp.image_scan_findings.findings[0].score_details.cvss.scoring_vector #=> String
resp.image_scan_findings.findings[0].score_details.cvss.version #=> String
resp.image_scan_findings.findings[0].severity #=> String
resp.image_scan_findings.findings[0].status #=> String
resp.image_scan_findings.findings[0].title #=> String
resp.image_scan_findings.findings[0].type #=> String
resp.image_scan_findings.findings[0].updated_at #=> Time
resp.image_scan_findings.findings[0].fix_available #=> String
resp.image_scan_findings.findings[0].exploit_available #=> String
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID that's associated with the public registry that contains the repository where the image is. If you do not specify a registry, the default public registry is assumed. You can specify only your own account ID. Cross-account access through a repository policy isn't supported for this operation.

  • :repository_name (required, String) —

    The repository that contains the image to describe scan findings for.

  • :repository_type (String) —

    The type of the repository. Currently, image scanning is supported only for premium repositories, so you must specify PREMIUM. If you don't specify a type, Amazon ECR uses FREE, and the request fails with ValidationException.

  • :image_id (required, Types::ImageIdentifier) —

    The image ID of the image to describe scan findings for.

  • :next_token (String) —

    The nextToken value that's returned from a previous paginated DescribeImageScanFindings request where you used maxResults and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. If there are no more results to return, this value is null.

    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 results that DescribeImageScanFindings returns in paginated output. When you use this parameter, DescribeImageScanFindings returns only maxResults results in a single page along with a nextToken response element. To see the remaining results, send another DescribeImageScanFindings request with the returned nextToken value. You can specify a value between 1 and 100. If you don't use this parameter, DescribeImageScanFindings returns up to 100 results and a nextToken value, if applicable.

Returns:

See Also:



1796
1797
1798
1799
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 1796

def describe_image_scan_findings(params = {}, options = {})
  req = build_request(:describe_image_scan_findings, params)
  req.send_request(options)
end

#describe_image_tags(params = {}) ⇒ Types::DescribeImageTagsResponse

Returns the image tag details for a repository in a public registry.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.describe_image_tags({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  repository_type: "FREE", # accepts FREE, PREMIUM
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.image_tag_details #=> Array
resp.image_tag_details[0].image_tag #=> String
resp.image_tag_details[0].created_at #=> Time
resp.image_tag_details[0].image_detail.image_digest #=> String
resp.image_tag_details[0].image_detail.image_size_in_bytes #=> Integer
resp.image_tag_details[0].image_detail.image_pushed_at #=> Time
resp.image_tag_details[0].image_detail.image_manifest_media_type #=> String
resp.image_tag_details[0].image_detail.artifact_media_type #=> String
resp.image_tag_details[0].image_detail.image_status #=> String, one of "ACTIVE", "DEPRECATED"
resp.image_tag_details[0].image_detail.scheduled_deletion_at #=> Time
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID that's associated with the public registry that contains the repository where images are described. If you do not specify a registry, the default public registry is assumed.

  • :repository_name (required, String) —

    The name of the repository that contains the image tag details to describe.

  • :repository_type (String) —

    The type of the repository. If you don't specify a type, Amazon ECR uses FREE. Valid values:

    • FREE: A free repository.

    • PREMIUM: A premium repository that holds paid content.

  • :next_token (String) —

    The nextToken value that's returned from a previous paginated DescribeImageTags 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. If there are no more results to return, this value is null. If you specify images with imageIds, you can't use this option.

  • :max_results (Integer) —

    The maximum number of repository results that's returned by DescribeImageTags in paginated output. When this parameter is used, DescribeImageTags only returns maxResults results in a single page along with a nextToken response element. You can see the remaining results of the initial request by sending another DescribeImageTags request with the returned nextToken value. This value can be between 1 and 1000. If this parameter isn't used, then DescribeImageTags returns up to 100 results and a nextToken value, if applicable. If you specify images with imageIds, you can't use this option.

Returns:

See Also:



1874
1875
1876
1877
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 1874

def describe_image_tags(params = {}, options = {})
  req = build_request(:describe_image_tags, params)
  req.send_request(options)
end

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

Returns metadata that's related to the images in a repository in a public registry.

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. Therefore, it might return a larger image size than the image sizes that are returned by DescribeImages.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.describe_images({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  repository_type: "FREE", # accepts FREE, PREMIUM
  image_ids: [
    {
      image_digest: "ImageDigest",
      image_tag: "ImageTag",
    },
  ],
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.image_details #=> Array
resp.image_details[0].registry_id #=> String
resp.image_details[0].repository_name #=> String
resp.image_details[0].repository_type #=> String, one of "FREE", "PREMIUM"
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_manifest_media_type #=> String
resp.image_details[0].artifact_media_type #=> String
resp.image_details[0].subject_manifest_digest #=> String
resp.image_details[0].image_status #=> String, one of "ACTIVE", "DEPRECATED"
resp.image_details[0].scheduled_deletion_at #=> Time
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID that's associated with the public registry that contains the repository where images are described. If you do not specify a registry, the default public registry is assumed.

  • :repository_name (required, String) —

    The repository that contains the images to describe.

  • :repository_type (String) —

    The type of the repository. If you don't specify a type, Amazon ECR uses FREE. Valid values:

    • FREE: A free repository.

    • PREMIUM: A premium repository that holds paid content.

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

    The list of image IDs for the requested repository.

  • :next_token (String) —

    The nextToken value that's 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. If there are no more results to return, this value is null. If you specify images with imageIds, you can't use this option.

  • :max_results (Integer) —

    The maximum number of repository results that's 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. You can see the remaining results of the initial request by sending another DescribeImages request with the returned nextToken value. This value can be between 1 and 1000. If this parameter isn't used, then DescribeImages returns up to 100 results and a nextToken value, if applicable. If you specify images with imageIds, you can't use this option.

Returns:

See Also:



1973
1974
1975
1976
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 1973

def describe_images(params = {}, options = {})
  req = build_request(:describe_images, params)
  req.send_request(options)
end

#describe_premium_repositories(params = {}) ⇒ Types::DescribePremiumRepositoriesResponse

Describes the premium repositories in a public registry, including their Amazon Web Services Marketplace products, associated repositories, and state. Repositories in the DRAFT, AVAILABLE, and HIDDEN states are returned.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Example: To describe the premium repositories in a registry


# This example describes all of the premium repositories in your default registry.

resp = client.describe_premium_repositories({
})

resp.to_h outputs the following:
{
  repositories: [
    {
      associated_repositories: [
        {
          repository_name: "my-free-repository", 
          repository_type: "FREE", 
        }, 
      ], 
      created_at: Time.parse("2026-11-03T00:00:00Z"), 
      marketplace_products: [
        "prod-ad8EXAMPLE651", 
        "prod-9f2EXAMPLE108", 
      ], 
      registry_id: "123456789012", 
      repository_arn: "arn:aws:ecr-public::123456789012:premium-repository/my-premium-repository", 
      repository_name: "my-premium-repository", 
      repository_uri: "ecr-premium.aws.com/example-alias/my-premium-repository", 
      state: "AVAILABLE", 
    }, 
  ], 
}

Request syntax with placeholder values


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

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].marketplace_products #=> Array
resp.repositories[0].marketplace_products[0] #=> String
resp.repositories[0].associated_repositories #=> Array
resp.repositories[0].associated_repositories[0].repository_name #=> String
resp.repositories[0].associated_repositories[0].repository_type #=> String, one of "FREE", "PREMIUM"
resp.repositories[0].state #=> String, one of "DRAFT", "AVAILABLE", "HIDDEN"
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID that's associated with the public registry that contains the premium repositories to describe. If you do not specify a registry, the default public registry is assumed. You can specify only your own account ID. Cross-account access through a repository policy isn't supported for this operation.

  • :repository_names (Array<String>) —

    The names of the premium repositories to describe. If this parameter isn't specified, all premium repositories in the registry are described. If you specify repository names, you can't use maxResults or nextToken.

  • :max_results (Integer) —

    The maximum number of results that DescribePremiumRepositories returns in paginated output. When you use this parameter, DescribePremiumRepositories returns only maxResults results in a single page along with a nextToken response element. To see the remaining results, send another DescribePremiumRepositories request with the returned nextToken value. You can specify a value between 1 and 1000. If you don't use this parameter, DescribePremiumRepositories returns up to 100 results and a nextToken value, if applicable.

  • :next_token (String) —

    The nextToken value that's returned from a previous paginated DescribePremiumRepositories request where you used maxResults and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. If there are no more results to return, this value is null.

    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.

Returns:

See Also:



2088
2089
2090
2091
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 2088

def describe_premium_repositories(params = {}, options = {})
  req = build_request(:describe_premium_repositories, params)
  req.send_request(options)
end

#describe_registries(params = {}) ⇒ Types::DescribeRegistriesResponse

Returns details for a public registry.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.describe_registries({
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.registries #=> Array
resp.registries[0].registry_id #=> String
resp.registries[0].registry_arn #=> String
resp.registries[0].registry_uri #=> String
resp.registries[0].verified #=> Boolean
resp.registries[0].aliases #=> Array
resp.registries[0].aliases[0].name #=> String
resp.registries[0].aliases[0].status #=> String, one of "ACTIVE", "PENDING", "REJECTED"
resp.registries[0].aliases[0].primary_registry_alias #=> Boolean
resp.registries[0].aliases[0].default_registry_alias #=> Boolean
resp.registries[0].premium_status #=> String, one of "ENABLED", "DISABLED"
resp.registries[0].premium_registry_uri #=> String
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :next_token (String) —

    The nextToken value that's returned from a previous paginated DescribeRegistries 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. If there are no more results to return, this value is null.

    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 that's returned by DescribeRegistries in paginated output. When this parameter is used, DescribeRegistries 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 DescribeRegistries request with the returned nextToken value. This value can be between 1 and 1000. If this parameter isn't used, then DescribeRegistries returns up to 100 results and a nextToken value, if applicable.

Returns:

See Also:



2153
2154
2155
2156
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 2153

def describe_registries(params = {}, options = {})
  req = build_request(:describe_registries, params)
  req.send_request(options)
end

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

Describes repositories that are in a public registry.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

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].associated_repositories #=> Array
resp.repositories[0].associated_repositories[0].repository_name #=> String
resp.repositories[0].associated_repositories[0].repository_type #=> String, one of "FREE", "PREMIUM"
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID that's associated with the registry that contains the repositories to be described. If you do not specify a registry, the default public 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 that's 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. If there are no more results to return, this value is null. If you specify repositories with repositoryNames, you can't use this option.

    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 that's 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. You can see the remaining results of the initial request by sending another DescribeRepositories request with the returned nextToken value. This value can be between 1 and 1000. If this parameter isn't used, then DescribeRepositories returns up to 100 results and a nextToken value, if applicable. If you specify repositories with repositoryNames, you can't use this option.

Returns:

See Also:



2229
2230
2231
2232
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 2229

def describe_repositories(params = {}, options = {})
  req = build_request(:describe_repositories, params)
  req.send_request(options)
end

#disassociate_repositories(params = {}) ⇒ Types::DisassociateRepositoriesResponse

Removes the association between two repositories in a public registry. One repository must be FREE and the other must be PREMIUM.

Examples:

Example: To disassociate a free repository from a premium repository


# This example removes the association between the premium repository my-premium-repository and the free repository
# my-free-repository.

resp = client.disassociate_repositories({
  associated_repository_name: "my-free-repository", 
  associated_repository_type: "FREE", 
  repository_name: "my-premium-repository", 
  repository_type: "PREMIUM", 
})

resp.to_h outputs the following:
{
  associated_repository_name: "my-free-repository", 
  associated_repository_type: "FREE", 
  registry_id: "123456789012", 
  repository_name: "my-premium-repository", 
  repository_type: "PREMIUM", 
}

Request syntax with placeholder values


resp = client.disassociate_repositories({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  repository_type: "FREE", # required, accepts FREE, PREMIUM
  associated_repository_name: "RepositoryName", # required
  associated_repository_type: "FREE", # required, accepts FREE, PREMIUM
})

Response structure


resp.registry_id #=> String
resp.repository_name #=> String
resp.repository_type #=> String, one of "FREE", "PREMIUM"
resp.associated_repository_name #=> String
resp.associated_repository_type #=> String, one of "FREE", "PREMIUM"

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID that's associated with the public registry that contains the repositories to disassociate. If you do not specify a registry, the default public registry is assumed. You can specify only your own account ID. Cross-account access through a repository policy isn't supported for this operation.

  • :repository_name (required, String) —

    The name of the source repository.

  • :repository_type (required, String) —

    The type of the source repository. Valid values:

    • FREE: A free repository.

    • PREMIUM: A premium repository that holds paid content.

  • :associated_repository_name (required, String) —

    The name of the repository to disassociate from the source repository.

  • :associated_repository_type (required, String) —

    The type of the repository to disassociate from the source repository. Valid values:

    • FREE: A free repository.

    • PREMIUM: A premium repository that holds paid content.

Returns:

See Also:



2317
2318
2319
2320
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 2317

def disassociate_repositories(params = {}, options = {})
  req = build_request(:disassociate_repositories, params)
  req.send_request(options)
end

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

Retrieves an authorization token. An authorization token represents your IAM authentication credentials. You can use it to access any Amazon ECR registry that your IAM principal has access to. The authorization token is valid for 12 hours. This API requires the ecr-public:GetAuthorizationToken and sts:GetServiceBearerToken permissions.

Examples:

Response structure


resp.authorization_data.authorization_token #=> String
resp.authorization_data.expires_at #=> Time

Parameters:

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

    ({})

Returns:

See Also:



2342
2343
2344
2345
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 2342

def get_authorization_token(params = {}, options = {})
  req = build_request(:get_authorization_token, params)
  req.send_request(options)
end

#get_download_url_for_publisher_report(params = {}) ⇒ Types::GetDownloadUrlForPublisherReportResponse

Returns a URL that you can use to download a publisher report as a compressed CSV file. You can download only reports for your own account. Use ListPublisherReports to get the report IDs.

Examples:

Example: To get a download URL for a publisher report


# This example returns a URL that you can use to download a publisher report.

resp = client.get_download_url_for_publisher_report({
  report_id: "k3x9q0m2v7b1n8z4c6w5ta", 
})

resp.to_h outputs the following:
{
  download_url: "https://example-bucket.s3.us-east-1.amazonaws.com/123456789012/reports/SUMMARY/MONTHLY/2026-10-01/k3x9q0m2v7b1n8z4c6w5ta.csv.gz?X-Amz-Expires=3600&X-Amz-Signature=EXAMPLE", 
  report_id: "k3x9q0m2v7b1n8z4c6w5ta", 
}

Request syntax with placeholder values


resp = client.get_download_url_for_publisher_report({
  report_id: "PublisherReportId", # required
})

Response structure


resp.report_id #=> String
resp.download_url #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :report_id (required, String) —

    The ID of the publisher report to download.

Returns:

See Also:



2389
2390
2391
2392
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 2389

def get_download_url_for_publisher_report(params = {}, options = {})
  req = build_request(:get_download_url_for_publisher_report, params)
  req.send_request(options)
end

#get_premium_repository_catalog_data(params = {}) ⇒ Types::GetPremiumRepositoryCatalogDataResponse

Retrieves the catalog data that's associated with a premium repository.

Examples:

Example: To get the catalog data for a premium repository


# This example gets the catalog data for the premium repository my-premium-repository.

resp = client.get_premium_repository_catalog_data({
  repository_name: "my-premium-repository", 
})

resp.to_h outputs the following:
{
  catalog_data: {
    architectures: [
      "x86-64", 
      "ARM 64", 
    ], 
    categories: [
      "BASE_IMAGES", 
      "SECURITY", 
    ], 
    description: "Hardened base image with premium support", 
    operating_systems: [
      "Linux", 
    ], 
  }, 
  registry_id: "123456789012", 
  repository_name: "my-premium-repository", 
}

Request syntax with placeholder values


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

Response structure


resp.registry_id #=> String
resp.repository_name #=> String
resp.catalog_data.description #=> String
resp.catalog_data.architectures #=> Array
resp.catalog_data.architectures[0] #=> String
resp.catalog_data.operating_systems #=> Array
resp.catalog_data.operating_systems[0] #=> String
resp.catalog_data.logo_url #=> String
resp.catalog_data.about_text #=> String
resp.catalog_data.usage_text #=> String
resp.catalog_data.marketplace_certified #=> Boolean
resp.catalog_data.categories #=> Array
resp.catalog_data.categories[0] #=> String, one of "BASE_IMAGES", "APPLICATION_RUNTIMES", "DATABASES", "AI_ML", "NETWORKING", "SECURITY", "MONITORING", "CI_CD_TOOLS", "KUBERNETES_EXTENSIONS", "WEB_SERVERS", "STREAMING"
resp.catalog_data.badges #=> Array
resp.catalog_data.badges[0] #=> String, one of "FIPS", "STIG", "SIGNED", "SBOM", "CIS"
resp.catalog_data.artifact_types #=> Array
resp.catalog_data.artifact_types[0] #=> String, one of "IMAGE", "HELM"

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID that's associated with the public registry that contains the premium repository. If you do not specify a registry, the default public registry is assumed. You can specify only your own account ID. Cross-account access through a repository policy isn't supported for this operation.

  • :repository_name (required, String) —

    The name of the premium repository to retrieve the catalog data for.

Returns:

See Also:



2473
2474
2475
2476
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 2473

def get_premium_repository_catalog_data(params = {}, options = {})
  req = build_request(:get_premium_repository_catalog_data, params)
  req.send_request(options)
end

#get_premium_repository_policy(params = {}) ⇒ Types::GetPremiumRepositoryPolicyResponse

Retrieves the repository policy for the specified premium repository.

Examples:

Example: To get the policy of a premium repository


# This example gets the repository policy of the premium repository my-premium-repository.

resp = client.get_premium_repository_policy({
  repository_name: "my-premium-repository", 
})

resp.to_h outputs the following:
{
  policy_text: "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"AllowDescribe\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::123456789012:role/ExampleRole\"},\"Action\":[\"ecr-public:DescribePremiumRepositories\"]}]}", 
  registry_id: "123456789012", 
  repository_name: "my-premium-repository", 
}

Request syntax with placeholder values


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

Response structure


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

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID that's associated with the public registry that contains the premium repository. If you do not specify a registry, the default public registry is assumed. You can specify only your own account ID. Cross-account access through a repository policy isn't supported for this operation.

  • :repository_name (required, String) —

    The name of the premium repository with the policy to retrieve.

Returns:

See Also:



2529
2530
2531
2532
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 2529

def get_premium_repository_policy(params = {}, options = {})
  req = build_request(:get_premium_repository_policy, params)
  req.send_request(options)
end

#get_registry_catalog_data(params = {}) ⇒ Types::GetRegistryCatalogDataResponse

Retrieves catalog metadata for a public registry.

Examples:

Response structure


resp.registry_catalog_data.display_name #=> String
resp.registry_catalog_data.description #=> String
resp.registry_catalog_data.logo_url #=> String

Parameters:

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

    ({})

Returns:

See Also:



2550
2551
2552
2553
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 2550

def get_registry_catalog_data(params = {}, options = {})
  req = build_request(:get_registry_catalog_data, params)
  req.send_request(options)
end

#get_repository_catalog_data(params = {}) ⇒ Types::GetRepositoryCatalogDataResponse

Retrieve catalog metadata for a repository in a public registry. This metadata is displayed publicly in the Amazon ECR Public Gallery.

Examples:

Request syntax with placeholder values


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

Response structure


resp.catalog_data.description #=> String
resp.catalog_data.architectures #=> Array
resp.catalog_data.architectures[0] #=> String
resp.catalog_data.operating_systems #=> Array
resp.catalog_data.operating_systems[0] #=> String
resp.catalog_data.logo_url #=> String
resp.catalog_data.about_text #=> String
resp.catalog_data.usage_text #=> String
resp.catalog_data.marketplace_certified #=> Boolean
resp.catalog_data.categories #=> Array
resp.catalog_data.categories[0] #=> String, one of "BASE_IMAGES", "APPLICATION_RUNTIMES", "DATABASES", "AI_ML", "NETWORKING", "SECURITY", "MONITORING", "CI_CD_TOOLS", "KUBERNETES_EXTENSIONS", "WEB_SERVERS", "STREAMING"
resp.catalog_data.badges #=> Array
resp.catalog_data.badges[0] #=> String, one of "FIPS", "STIG", "SIGNED", "SBOM", "CIS"
resp.catalog_data.artifact_types #=> Array
resp.catalog_data.artifact_types[0] #=> String, one of "IMAGE", "HELM"

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID that's associated with the registry that contains the repositories to be described. If you do not specify a registry, the default public registry is assumed.

  • :repository_name (required, String) —

    The name of the repository to retrieve the catalog metadata for.

Returns:

See Also:



2599
2600
2601
2602
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 2599

def get_repository_catalog_data(params = {}, options = {})
  req = build_request(:get_repository_catalog_data, params)
  req.send_request(options)
end

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

Retrieves the repository policy for the specified repository.

Examples:

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

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID that's associated with the public registry that contains the repository. If you do not specify a registry, the default public registry is assumed.

  • :repository_name (required, String) —

    The name of the repository with the policy to retrieve.

Returns:

See Also:



2637
2638
2639
2640
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 2637

def get_repository_policy(params = {}, options = {})
  req = build_request(:get_repository_policy, params)
  req.send_request(options)
end

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

Notifies Amazon ECR that you intend to upload an image layer.

When an image is pushed, the InitiateLayerUpload API is called once for each image layer that hasn't already been uploaded. Whether an image layer uploads 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: "RegistryIdOrAlias",
  repository_name: "RepositoryName", # required
  repository_type: "FREE", # accepts FREE, PREMIUM
})

Response structure


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

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID, or registry alias, that's associated with the registry to which you intend to upload layers. If you do not specify a registry, the default public registry is assumed.

  • :repository_name (required, String) —

    The name of the repository that you want to upload layers to.

  • :repository_type (String) —

    The type of the repository. If you don't specify a type, Amazon ECR uses FREE. Valid values:

    • FREE: A free repository.

    • PREMIUM: A premium repository that holds paid content.

Returns:

See Also:



2693
2694
2695
2696
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 2693

def initiate_layer_upload(params = {}, options = {})
  req = build_request(:initiate_layer_upload, params)
  req.send_request(options)
end

#list_publisher_reports(params = {}) ⇒ Types::ListPublisherReportsResponse

Lists the publisher reports for your public registry that were created in the last 365 days. Each report is a compressed CSV file. Reports include images in your premium repositories and in free repositories that are associated with a premium repository.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Example: To list the monthly summary reports for a registry


# This example lists the monthly summary publisher reports that are available for your public registry.

resp = client.list_publisher_reports({
  granularity: "MONTHLY", 
  report_type: "SUMMARY", 
})

resp.to_h outputs the following:
{
  reports: [
    {
      created_at: Time.parse("2026-11-01T00:00:00Z"), 
      granularity: "MONTHLY", 
      period: {
        end_date: "2026-10-31", 
        start_date: "2026-10-01", 
      }, 
      report_id: "k3x9q0m2v7b1n8z4c6w5ta", 
      report_type: "SUMMARY", 
      size_in_bytes: 20480, 
    }, 
  ], 
}

Request syntax with placeholder values


resp = client.list_publisher_reports({
  report_type: "SUMMARY", # accepts SUMMARY, TRENDS
  granularity: "WEEKLY", # accepts WEEKLY, MONTHLY
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.reports #=> Array
resp.reports[0].report_id #=> String
resp.reports[0].report_type #=> String, one of "SUMMARY", "TRENDS"
resp.reports[0].granularity #=> String, one of "WEEKLY", "MONTHLY"
resp.reports[0].period.start_date #=> String
resp.reports[0].period.end_date #=> String
resp.reports[0].size_in_bytes #=> Integer
resp.reports[0].created_at #=> Time
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :report_type (String) —

    The type of report to list. If you don't specify a type, reports of all types are listed. Valid values:

    • SUMMARY: The number of pulls and version checks for each image.

    • TRENDS: The same counts for each image, broken down by the country, cloud provider, client, domain and company of the puller.

  • :granularity (String) —

    The time period that each report covers. If you don't specify a granularity, reports of all granularities are listed. Valid values:

    • WEEKLY: Each report covers one week, from Monday to Sunday.

    • MONTHLY: Each report covers one calendar month.

  • :max_results (Integer) —

    The maximum number of results that ListPublisherReports returns in paginated output. When you use this parameter, ListPublisherReports returns only maxResults results in a single page along with a nextToken response element. To see the remaining results, send another ListPublisherReports request with the returned nextToken value. You can specify a value between 1 and 1000. If you don't use this parameter, ListPublisherReports returns up to 100 results and a nextToken value, if applicable. A page can contain fewer than maxResults reports, so use nextToken to check for more.

  • :next_token (String) —

    The nextToken value that's returned from a previous paginated ListPublisherReports request. Pagination continues from the end of the previous results. You must specify the same reportType and granularity values as the request that returned the token; otherwise, the request fails with InvalidParameterException.

    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.

Returns:

See Also:



2803
2804
2805
2806
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 2803

def list_publisher_reports(params = {}, options = {})
  req = build_request(:list_publisher_reports, params)
  req.send_request(options)
end

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

List the tags for an Amazon ECR Public 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

Parameters:

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

    ({})

Options Hash (params):

  • :resource_arn (required, String) —

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

Returns:

See Also:



2835
2836
2837
2838
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 2835

def list_tags_for_resource(params = {}, options = {})
  req = build_request(:list_tags_for_resource, params)
  req.send_request(options)
end

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

Creates or updates the image manifest and tags that are 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 that are 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: "RegistryIdOrAlias",
  repository_name: "RepositoryName", # required
  repository_type: "FREE", # accepts FREE, PREMIUM
  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.repository_type #=> String, one of "FREE", "PREMIUM"
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
resp.image.subject_manifest_digest #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID, or registry alias, that's associated with the public registry that contains the repository where the image is put. If you do not specify a registry, the default public registry is assumed.

  • :repository_name (required, String) —

    The name of the repository where the image is put.

  • :repository_type (String) —

    The type of the repository. If you don't specify a type, Amazon ECR uses FREE. Valid values:

    • FREE: A free repository.

    • PREMIUM: A premium repository that holds paid content.

  • :image_manifest (required, String) —

    The image manifest that corresponds 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 doesn't 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 optional.

  • :image_digest (String) —

    The image digest of the image manifest that corresponds to the image.

Returns:

See Also:



2915
2916
2917
2918
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 2915

def put_image(params = {}, options = {})
  req = build_request(:put_image, params)
  req.send_request(options)
end

#put_premium_repository_catalog_data(params = {}) ⇒ Types::PutPremiumRepositoryCatalogDataResponse

Updates the catalog data for a premium repository. Fields that you include replace the stored values, and fields that you leave out aren't changed. A premium repository is listed in the Amazon ECR Public Gallery when it's AVAILABLE and at least one of its Amazon Web Services Marketplace products is public.

Examples:

Example: To set the catalog data for a premium repository


# This example sets the catalog data for the premium repository my-premium-repository. The new catalog data replaces the
# existing catalog data.

resp = client.put_premium_repository_catalog_data({
  catalog_data: {
    architectures: [
      "x86-64", 
      "ARM 64", 
    ], 
    categories: [
      "BASE_IMAGES", 
      "SECURITY", 
    ], 
    description: "Hardened base image with premium support", 
    operating_systems: [
      "Linux", 
    ], 
  }, 
  repository_name: "my-premium-repository", 
})

resp.to_h outputs the following:
{
  catalog_data: {
    architectures: [
      "x86-64", 
      "ARM 64", 
    ], 
    categories: [
      "BASE_IMAGES", 
      "SECURITY", 
    ], 
    description: "Hardened base image with premium support", 
    operating_systems: [
      "Linux", 
    ], 
  }, 
  registry_id: "123456789012", 
  repository_name: "my-premium-repository", 
}

Request syntax with placeholder values


resp = client.put_premium_repository_catalog_data({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  catalog_data: { # required
    description: "RepositoryDescription",
    architectures: ["Architecture"],
    operating_systems: ["OperatingSystem"],
    logo_image_blob: "data",
    about_text: "AboutText",
    usage_text: "UsageText",
    categories: ["BASE_IMAGES"], # accepts BASE_IMAGES, APPLICATION_RUNTIMES, DATABASES, AI_ML, NETWORKING, SECURITY, MONITORING, CI_CD_TOOLS, KUBERNETES_EXTENSIONS, WEB_SERVERS, STREAMING
  },
})

Response structure


resp.registry_id #=> String
resp.repository_name #=> String
resp.catalog_data.description #=> String
resp.catalog_data.architectures #=> Array
resp.catalog_data.architectures[0] #=> String
resp.catalog_data.operating_systems #=> Array
resp.catalog_data.operating_systems[0] #=> String
resp.catalog_data.logo_url #=> String
resp.catalog_data.about_text #=> String
resp.catalog_data.usage_text #=> String
resp.catalog_data.marketplace_certified #=> Boolean
resp.catalog_data.categories #=> Array
resp.catalog_data.categories[0] #=> String, one of "BASE_IMAGES", "APPLICATION_RUNTIMES", "DATABASES", "AI_ML", "NETWORKING", "SECURITY", "MONITORING", "CI_CD_TOOLS", "KUBERNETES_EXTENSIONS", "WEB_SERVERS", "STREAMING"
resp.catalog_data.badges #=> Array
resp.catalog_data.badges[0] #=> String, one of "FIPS", "STIG", "SIGNED", "SBOM", "CIS"
resp.catalog_data.artifact_types #=> Array
resp.catalog_data.artifact_types[0] #=> String, one of "IMAGE", "HELM"

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID that's associated with the public registry that contains the premium repository. If you do not specify a registry, the default public registry is assumed. You can specify only your own account ID. Cross-account access through a repository policy isn't supported for this operation.

  • :repository_name (required, String) —

    The name of the premium repository to create or update the catalog data for.

  • :catalog_data (required, Types::RepositoryCatalogDataInput) —

    An object that contains the catalog data to update for the premium repository. Fields that you leave out aren't changed. To remove the logo, specify an empty logoImageBlob.

Returns:

See Also:



3032
3033
3034
3035
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 3032

def put_premium_repository_catalog_data(params = {}, options = {})
  req = build_request(:put_premium_repository_catalog_data, params)
  req.send_request(options)
end

#put_premium_repository_products(params = {}) ⇒ Types::PutPremiumRepositoryProductsResponse

Replaces the list of Amazon Web Services Marketplace products for a premium repository. You must specify the full list of products, from one to five. To add a product, include it with the existing products.

You can remove a product only while the repository is in the DRAFT state. After the repository leaves the DRAFT state, you can only add products. A request that leaves out an existing product fails with InvalidParameterException.

Examples:

Example: To add a product to a premium repository


# This example adds the AWS Marketplace product prod-9f2EXAMPLE108 to the premium repository my-premium-repository. You
# must provide the full list of products, so the request also includes the existing product prod-ad8EXAMPLE651.

resp = client.put_premium_repository_products({
  marketplace_products: [
    "prod-ad8EXAMPLE651", 
    "prod-9f2EXAMPLE108", 
  ], 
  repository_name: "my-premium-repository", 
})

resp.to_h outputs the following:
{
  marketplace_products: [
    "prod-ad8EXAMPLE651", 
    "prod-9f2EXAMPLE108", 
  ], 
  registry_id: "123456789012", 
  repository_name: "my-premium-repository", 
}

Request syntax with placeholder values


resp = client.put_premium_repository_products({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  marketplace_products: ["MarketplaceProductId"], # required
})

Response structure


resp.registry_id #=> String
resp.repository_name #=> String
resp.marketplace_products #=> Array
resp.marketplace_products[0] #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID that's associated with the public registry that contains the premium repository. If you do not specify a registry, the default public registry is assumed. You can specify only your own account ID. Cross-account access through a repository policy isn't supported for this operation.

  • :repository_name (required, String) —

    The name of the premium repository to set the products for.

  • :marketplace_products (required, Array<String>) —

    The full list of Amazon Web Services Marketplace product IDs for the premium repository. This list replaces the existing list. You can specify from one to five product IDs. Your account must own each product, and each product must have an Amazon ECR Public Premium delivery option. You can't specify the same product ID more than once.

Returns:

See Also:



3113
3114
3115
3116
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 3113

def put_premium_repository_products(params = {}, options = {})
  req = build_request(:put_premium_repository_products, params)
  req.send_request(options)
end

#put_registry_catalog_data(params = {}) ⇒ Types::PutRegistryCatalogDataResponse

Create or update the catalog data for a public registry.

Examples:

Request syntax with placeholder values


resp = client.put_registry_catalog_data({
  display_name: "RegistryDisplayName",
  description: "RegistryDescription",
  logo_image_blob: "data",
})

Response structure


resp.registry_catalog_data.display_name #=> String
resp.registry_catalog_data.description #=> String
resp.registry_catalog_data.logo_url #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :display_name (String) —

    The display name for a public registry. The display name is shown as the repository author in the Amazon ECR Public Gallery.

    The registry display name is only publicly visible in the Amazon ECR Public Gallery for verified accounts.

  • :description (String) —

    A description of the public registry. This description is shown in the Amazon ECR Public Gallery.

  • :logo_image_blob (String, StringIO, File) —

    The base64-encoded logo image for the public registry. This logo is shown in the Amazon ECR Public Gallery.

Returns:

See Also:



3159
3160
3161
3162
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 3159

def put_registry_catalog_data(params = {}, options = {})
  req = build_request(:put_registry_catalog_data, params)
  req.send_request(options)
end

#put_repository_catalog_data(params = {}) ⇒ Types::PutRepositoryCatalogDataResponse

Creates or updates the catalog data for a repository in a public registry.

Examples:

Request syntax with placeholder values


resp = client.put_repository_catalog_data({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  catalog_data: { # required
    description: "RepositoryDescription",
    architectures: ["Architecture"],
    operating_systems: ["OperatingSystem"],
    logo_image_blob: "data",
    about_text: "AboutText",
    usage_text: "UsageText",
    categories: ["BASE_IMAGES"], # accepts BASE_IMAGES, APPLICATION_RUNTIMES, DATABASES, AI_ML, NETWORKING, SECURITY, MONITORING, CI_CD_TOOLS, KUBERNETES_EXTENSIONS, WEB_SERVERS, STREAMING
  },
})

Response structure


resp.catalog_data.description #=> String
resp.catalog_data.architectures #=> Array
resp.catalog_data.architectures[0] #=> String
resp.catalog_data.operating_systems #=> Array
resp.catalog_data.operating_systems[0] #=> String
resp.catalog_data.logo_url #=> String
resp.catalog_data.about_text #=> String
resp.catalog_data.usage_text #=> String
resp.catalog_data.marketplace_certified #=> Boolean
resp.catalog_data.categories #=> Array
resp.catalog_data.categories[0] #=> String, one of "BASE_IMAGES", "APPLICATION_RUNTIMES", "DATABASES", "AI_ML", "NETWORKING", "SECURITY", "MONITORING", "CI_CD_TOOLS", "KUBERNETES_EXTENSIONS", "WEB_SERVERS", "STREAMING"
resp.catalog_data.badges #=> Array
resp.catalog_data.badges[0] #=> String, one of "FIPS", "STIG", "SIGNED", "SBOM", "CIS"
resp.catalog_data.artifact_types #=> Array
resp.catalog_data.artifact_types[0] #=> String, one of "IMAGE", "HELM"

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID that's associated with the public registry the repository is in. If you do not specify a registry, the default public registry is assumed.

  • :repository_name (required, String) —

    The name of the repository to create or update the catalog data for.

  • :catalog_data (required, Types::RepositoryCatalogDataInput) —

    An object containing the catalog data for a repository. This data is publicly visible in the Amazon ECR Public Gallery.

Returns:

See Also:



3221
3222
3223
3224
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 3221

def put_repository_catalog_data(params = {}, options = {})
  req = build_request(:put_repository_catalog_data, params)
  req.send_request(options)
end

#set_image_status(params = {}) ⇒ Types::SetImageStatusResponse

Sets the status of an image in a premium repository to ACTIVE or DEPRECATED. When you deprecate an image, Amazon ECR deletes it after the deprecation period ends. You can't use this operation while the repository is in the DRAFT state.

Examples:

Example: To deprecate an image in a premium repository


# This example deprecates an image in the premium repository my-premium-repository with a 90-day deprecation period.
# Amazon ECR deletes the image within 24 hours after the scheduled deletion time.

resp = client.set_image_status({
  deprecation_period_days: 90, 
  image_id: {
    image_digest: "sha256:f5c12bd3e4b8b1a2a3a5d5d0e6c4b3a2f1e0d9c8b7a6f5e4d3c2b1a0f9e8d7c6", 
  }, 
  repository_name: "my-premium-repository", 
  repository_type: "PREMIUM", 
  status: "DEPRECATED", 
})

resp.to_h outputs the following:
{
  image_id: {
    image_digest: "sha256:f5c12bd3e4b8b1a2a3a5d5d0e6c4b3a2f1e0d9c8b7a6f5e4d3c2b1a0f9e8d7c6", 
  }, 
  repository_name: "my-premium-repository", 
  repository_type: "PREMIUM", 
  scheduled_deletion_at: Time.parse("2027-02-01T17:42:10Z"), 
  status: "DEPRECATED", 
}

Request syntax with placeholder values


resp = client.set_image_status({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  repository_type: "FREE", # required, accepts FREE, PREMIUM
  image_id: { # required
    image_digest: "ImageDigest",
    image_tag: "ImageTag",
  },
  status: "ACTIVE", # required, accepts ACTIVE, DEPRECATED
  deprecation_period_days: 1,
})

Response structure


resp.repository_name #=> String
resp.repository_type #=> String, one of "FREE", "PREMIUM"
resp.image_id.image_digest #=> String
resp.image_id.image_tag #=> String
resp.status #=> String, one of "ACTIVE", "DEPRECATED"
resp.scheduled_deletion_at #=> Time

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID that's associated with the public registry that contains the image. If you do not specify a registry, the default public registry is assumed. You can specify only your own account ID. Cross-account access through a repository policy isn't supported for this operation.

  • :repository_name (required, String) —

    The name of the repository that contains the image.

  • :repository_type (required, String) —

    The type of the repository. You can set the image status only in a PREMIUM repository.

  • :image_id (required, Types::ImageIdentifier) —

    The image ID of the image to set the status for. If you specify a tag, the tag is resolved to the digest of the image that it currently points to, and the status is set on that image.

  • :status (required, String) —

    The status to set on the image. Valid values:

    • ACTIVE: Cancels a pending deletion. You can do this only before the scheduled deletion time.

    • DEPRECATED: Schedules the image for deletion after the deprecation period.

    After the scheduled deletion time, you can't change the status of the image.

    If the image is part of a manifest list, Amazon ECR requires that a manifest list is deleted before the images that it references. To deprecate an image that a manifest list references, deprecate the manifest list first, with a scheduled deletion time before the image's. You can't set a manifest list to ACTIVE while it references deprecated images. Requests that break these rules fail with ValidationException.

  • :deprecation_period_days (Integer) —

    The number of days that Amazon ECR waits before it deletes the deprecated image. You can specify a value between 90 and 365. This parameter is required when you set status to DEPRECATED. Don't specify it when you set status to ACTIVE.

Returns:

See Also:



3338
3339
3340
3341
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 3338

def set_image_status(params = {}, options = {})
  req = build_request(:set_image_status, params)
  req.send_request(options)
end

#set_premium_repository_policy(params = {}) ⇒ Types::SetPremiumRepositoryPolicyResponse

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

Examples:

Example: To set the policy of a premium repository


# This example sets a repository policy on the premium repository my-premium-repository.

resp = client.set_premium_repository_policy({
  policy_text: "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"AllowDescribe\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::123456789012:role/ExampleRole\"},\"Action\":[\"ecr-public:DescribePremiumRepositories\"]}]}", 
  repository_name: "my-premium-repository", 
})

resp.to_h outputs the following:
{
  policy_text: "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"AllowDescribe\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::123456789012:role/ExampleRole\"},\"Action\":[\"ecr-public:DescribePremiumRepositories\"]}]}", 
  registry_id: "123456789012", 
  repository_name: "my-premium-repository", 
}

Request syntax with placeholder values


resp = client.set_premium_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

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID that's associated with the public registry that contains the premium repository. If you do not specify a registry, the default public registry is assumed. You can specify only your own account ID. Cross-account access through a repository policy isn't supported for this operation.

  • :repository_name (required, String) —

    The name of the premium repository to receive the policy.

  • :policy_text (required, String) —

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

  • :force (Boolean) —

    If the policy that you want to set on a premium repository policy would prevent you from setting another policy in the future, you must force the SetPremiumRepositoryPolicy operation. This prevents accidental premium repository lockouts.

Returns:

See Also:



3419
3420
3421
3422
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 3419

def set_premium_repository_policy(params = {}, options = {})
  req = build_request(:set_premium_repository_policy, params)
  req.send_request(options)
end

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

Applies a repository policy to the specified public repository to control access permissions. For more information, see Amazon ECR repository policies in the Amazon Elastic Container Registry Public 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

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID that's associated with the registry that contains the repository. If you do not specify a registry, the default public 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 Public User Guide.

  • :force (Boolean) —

    If the policy that you want to set on a repository policy would prevent you from setting another policy in the future, you must force the SetRepositoryPolicy operation. This prevents accidental repository lockouts.

Returns:

See Also:



3481
3482
3483
3484
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 3481

def set_repository_policy(params = {}, options = {})
  req = build_request(:set_repository_policy, params)
  req.send_request(options)
end

#set_repository_state(params = {}) ⇒ Types::SetRepositoryStateResponse

Sets the state of a premium repository. Use the state to control whether the repository is shown in the Amazon ECR Public Gallery. A premium repository is listed in the Amazon ECR Public Gallery when it's AVAILABLE and at least one of its Amazon Web Services Marketplace products is public.

Examples:

Example: To make a premium repository available


# This example moves the premium repository my-premium-repository from the DRAFT state to the AVAILABLE state.

resp = client.set_repository_state({
  repository_name: "my-premium-repository", 
  repository_type: "PREMIUM", 
  state: "AVAILABLE", 
})

resp.to_h outputs the following:
{
  registry_id: "123456789012", 
  repository_name: "my-premium-repository", 
  repository_type: "PREMIUM", 
  state: "AVAILABLE", 
}

Request syntax with placeholder values


resp = client.set_repository_state({
  registry_id: "RegistryId",
  repository_name: "RepositoryName", # required
  repository_type: "FREE", # required, accepts FREE, PREMIUM
  state: "DRAFT", # required, accepts DRAFT, AVAILABLE, HIDDEN
})

Response structure


resp.registry_id #=> String
resp.repository_name #=> String
resp.repository_type #=> String, one of "FREE", "PREMIUM"
resp.state #=> String, one of "DRAFT", "AVAILABLE", "HIDDEN"

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID that's associated with the public registry that contains the repository. If you do not specify a registry, the default public registry is assumed. You can specify only your own account ID. Cross-account access through a repository policy isn't supported for this operation.

  • :repository_name (required, String) —

    The name of the repository to set the state for.

  • :repository_type (required, String) —

    The type of the repository. Currently, you can set the state only for a PREMIUM repository. FREE isn't supported, and the request fails with InvalidParameterException.

  • :state (required, String) —

    The state to set on the repository. Valid values:

    • AVAILABLE: Entitled buyers can pull from the repository, and it's listed in the Amazon ECR Public Gallery when at least one of its Amazon Web Services Marketplace products is public.

    • HIDDEN: The repository isn't listed in the Amazon ECR Public Gallery. Buyers with an active entitlement can still pull from it.

    A repository can move from DRAFT to AVAILABLE, and between AVAILABLE and HIDDEN. It can't return to DRAFT. Other changes fail with InvalidParameterException. If you specify the current state, the request succeeds and nothing changes.

Returns:

See Also:



3568
3569
3570
3571
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 3568

def set_repository_state(params = {}, options = {})
  req = build_request(:set_repository_state, params)
  req.send_request(options)
end

#tag_resource(params = {}) ⇒ Struct

Associates the specified tags to a resource with the specified resourceArn. If existing tags on a resource aren't specified in the request parameters, they aren't changed. When a resource is deleted, the tags associated with that resource are also deleted.

Examples:

Request syntax with placeholder values


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

Parameters:

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

    ({})

Options Hash (params):

  • :resource_arn (required, String) —

    The Amazon Resource Name (ARN) of the resource to add tags to. Currently, the supported resource is an Amazon ECR Public 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:



3605
3606
3607
3608
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 3605

def tag_resource(params = {}, options = {})
  req = build_request(:tag_resource, params)
  req.send_request(options)
end

#untag_resource(params = {}) ⇒ 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
})

Parameters:

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

    ({})

Options Hash (params):

  • :resource_arn (required, String) —

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

  • :tag_keys (required, Array<String>) —

    The keys of the tags to be removed.

Returns:

  • (Struct) —

    Returns an empty response.

See Also:



3632
3633
3634
3635
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 3632

def untag_resource(params = {}, options = {})
  req = build_request(:untag_resource, params)
  req.send_request(options)
end

#upload_layer_part(params = {}) ⇒ 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 (about 20MB). The UploadLayerPart API is called once for 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: "RegistryIdOrAlias",
  repository_name: "RepositoryName", # required
  repository_type: "FREE", # accepts FREE, PREMIUM
  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.repository_type #=> String, one of "FREE", "PREMIUM"
resp.upload_id #=> String
resp.last_byte_received #=> Integer

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String) —

    The Amazon Web Services account ID, or registry alias, that's associated with the registry that you're uploading layer parts to. If you do not specify a registry, the default public registry is assumed.

  • :repository_name (required, String) —

    The name of the repository that you're uploading layer parts to.

  • :repository_type (String) —

    The type of the repository. If you don't specify a type, Amazon ECR uses FREE. Valid values:

    • FREE: A free repository.

    • PREMIUM: A premium repository that holds paid content.

  • :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, String, StringIO, File) —

    The base64-encoded layer part payload.

Returns:

See Also:



3713
3714
3715
3716
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 3713

def upload_layer_part(params = {}, options = {})
  req = build_request(:upload_layer_part, params)
  req.send_request(options)
end

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

Polls an API operation until a resource enters a desired state.

Basic Usage

A waiter will call an API operation until:

  • It is successful
  • It enters a terminal state
  • It makes the maximum number of attempts

In between attempts, the waiter will sleep.

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

Configuration

You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You can pass configuration as the final arguments hash.

# poll for ~25 seconds
client.wait_until(waiter_name, params, {
  max_attempts: 5,
  delay: 5,
})

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(waiter_name, params, {

  # disable max attempts
  max_attempts: nil,

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

Handling Errors

When a waiter is unsuccessful, it will raise an error. All of the failure errors extend from Waiters::Errors::WaiterFailed.

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

Valid Waiters

The following table lists the valid waiter names, the operations they call, and the default :delay and :max_attempts values.

waiter_name params :delay :max_attempts
image_scan_complete #describe_image_scan_findings 10 30

Parameters:

  • waiter_name (Symbol)
  • params (Hash) (defaults to: {}) —

    ({})

  • options (Hash) (defaults to: {}) —

    ({})

Options Hash (options):

  • :max_attempts (Integer)
  • :delay (Integer)
  • :before_attempt (Proc)
  • :before_wait (Proc)

Yields:

  • (w.waiter)

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.



3828
3829
3830
3831
3832
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 3828

def wait_until(waiter_name, params = {}, options = {})
  w = waiter(waiter_name, options)
  yield(w.waiter) if block_given? # deprecated
  w.wait(params)
end