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

  • :credentials (required, Aws::CredentialProvider)

    Your AWS credentials. This can be an 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, and :session_token options.
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
    • ~/.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::InstanceProfileCredentails or Aws::ECSCredentials to enable retries and extended timeouts.
  • :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)
  • :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.

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

  • :disable_host_prefix_injection (Boolean) — default: false

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available.

  • :endpoint (String)

    The client endpoint is normally constructed from the :region option. You should only configure an :endpoint when connecting to test or custom endpoints. This should be a valid HTTP(S) URI.

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

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

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

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

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

    Specifies which retry algorithm to use. Values are:

    • legacy - The pre-existing retry behavior. This is default value if no retry mode is provided.

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

    • adaptive - An experimental retry mode that includes all the functionality of standard mode along with automatic client side throttling. This is a provisional mode that may change behavior in the future.

  • :secret_access_key (String)
  • :session_token (String)
  • :simple_json (Boolean) — default: false

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

    When :simple_json is enabled, the request parameters hash must be formatted exactly as the DynamoDB API expects.

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

  • :validate_params (Boolean) — default: true

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

  • :http_proxy (URI::HTTP, String)

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

  • :http_open_timeout (Float) — default: 15

    The number of seconds to wait when opening a HTTP session before raising a Timeout::Error.

  • :http_read_timeout (Integer) — default: 60

    The default number of seconds to wait for response data. 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_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_wire_trace (Boolean) — default: false

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

  • :ssl_verify_peer (Boolean) — default: true

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

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



334
335
336
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 334

def initialize(*args)
  super
end

Instance Method Details

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

Checks the availability of one or more image layers 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
  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 AWS account ID 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 is associated with the image layers to check.

  • :layer_digests (required, Array<String>)

    The digests of the image layers to check.

Returns:

See Also:



393
394
395
396
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 393

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 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 image's digest in your request.

Examples:

Request syntax with placeholder values


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

Response structure


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

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String)

    The AWS account ID associated with the registry that contains the image to delete. If you do not specify a registry, the default public registry is assumed.

  • :repository_name (required, String)

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

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

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

Returns:

See Also:



455
456
457
458
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 455

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 has completed 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 per each new image layer to verify that the upload has completed.

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

Examples:

Request syntax with placeholder values


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

Response structure


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

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String)

    The AWS account ID associated with the registry to which to upload layers. If you do not specify a registry, the default public registry is assumed.

  • :repository_name (required, String)

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

  • :upload_id (required, String)

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

  • :layer_digests (required, Array<String>)

    The sha256 digest of the image layer.

Returns:

See Also:



517
518
519
520
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 517

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

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

Creates a repository in a public registry. For more information, see Amazon ECR repositories in the Amazon Elastic Container Registry 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",
  },
  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.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

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 may be specified on its own (such as nginx-web-app) or it can be prepended with a namespace to group the repository into a category (such as project-a/nginx-web-app).

  • :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 the repository to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.

Returns:

See Also:



594
595
596
597
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 594

def create_repository(params = {}, options = {})
  req = build_request(:create_repository, 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 delete all images in the repository or use the force option which 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

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String)

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

    If a repository contains images, forces the deletion.

Returns:

See Also:



639
640
641
642
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 639

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 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 AWS account ID 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 is associated with the repository policy to delete.

Returns:

See Also:



679
680
681
682
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 679

def delete_repository_policy(params = {}, options = {})
  req = build_request(:delete_repository_policy, 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
  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.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String)

    The AWS account ID associated with the public registry that contains the repository in which to describe images. 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.

  • :next_token (String)

    The nextToken value 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. This value is null when there are no more results to return. This option cannot be used when you specify images with imageIds.

  • :max_results (Integer)

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

Returns:

See Also:



746
747
748
749
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 746

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 about 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, so it may return a larger image size than the image sizes 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
  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].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.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String)

    The AWS account ID associated with the public registry that contains the repository in which to describe images. 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.

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

    The list of image IDs for the requested repository.

  • :next_token (String)

    The nextToken value returned from a previous paginated DescribeImages request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return. This option cannot be used when you specify images with imageIds.

  • :max_results (Integer)

    The maximum number of repository results returned by DescribeImages in paginated output. When this parameter is used, DescribeImages only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another DescribeImages request with the returned nextToken value. This value can be between 1 and 1000. If this parameter is not used, then DescribeImages returns up to 100 results and a nextToken value, if applicable. This option cannot be used when you specify images with imageIds.

Returns:

See Also:



832
833
834
835
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 832

def describe_images(params = {}, options = {})
  req = build_request(:describe_images, 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.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :next_token (String)

    The nextToken value 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. This value is null when there are no more results to return.

    This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.

  • :max_results (Integer)

    The maximum number of repository results 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 is not used, then DescribeRegistries returns up to 100 results and a nextToken value, if applicable.

Returns:

See Also:



895
896
897
898
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 895

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

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

Describes repositories 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.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String)

    The AWS account ID associated with the registry that contains the repositories to be described. If you do not specify a registry, the default 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 returned from a previous paginated DescribeRepositories request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return. This option cannot be used when you specify repositories with repositoryNames.

    This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.

  • :max_results (Integer)

    The maximum number of repository results returned by DescribeRepositories in paginated output. When this parameter is used, DescribeRepositories only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another DescribeRepositories request with the returned nextToken value. This value can be between 1 and 1000. If this parameter is not used, then DescribeRepositories returns up to 100 results and a nextToken value, if applicable. This option cannot be used when you specify repositories with repositoryNames.

Returns:

See Also:



968
969
970
971
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 968

def describe_repositories(params = {}, options = {})
  req = build_request(:describe_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 and can be used to access any Amazon ECR registry that your IAM principal has access to. The authorization token is valid for 12 hours. 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:



993
994
995
996
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 993

def get_authorization_token(params = {}, options = {})
  req = build_request(:get_authorization_token, 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

Parameters:

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

    ({})

Returns:

See Also:



1012
1013
1014
1015
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 1012

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

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String)

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

  • :repository_name (required, String)

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

Returns:

See Also:



1055
1056
1057
1058
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 1055

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 AWS account ID 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:



1093
1094
1095
1096
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 1093

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 per image layer that has not already been uploaded. Whether or not an image layer has been uploaded is determined by the BatchCheckLayerAvailability API action.

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

Examples:

Request syntax with placeholder values


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

Response structure


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

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String)

    The AWS account ID associated with the registry to which you intend to upload layers. If you do not specify a registry, the default public registry is assumed.

  • :repository_name (required, String)

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

Returns:

See Also:



1140
1141
1142
1143
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 1140

def initiate_layer_upload(params = {}, options = {})
  req = build_request(:initiate_layer_upload, 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 for which to list the tags. Currently, the supported resource is an Amazon ECR Public repository.

Returns:

See Also:



1172
1173
1174
1175
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 1172

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 associated with an image.

When an image is pushed and all new image layers have been uploaded, the PutImage API is called once to create or update the image manifest and the tags associated with the image.

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

Examples:

Request syntax with placeholder values


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

Response structure


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

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String)

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

  • :repository_name (required, String)

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

  • :image_manifest (required, String)

    The image manifest corresponding to the image to be uploaded.

  • :image_manifest_media_type (String)

    The media type of the image manifest. If you push an image manifest that does not contain the mediaType field, you must specify the imageManifestMediaType in the request.

  • :image_tag (String)

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

  • :image_digest (String)

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

Returns:

See Also:



1242
1243
1244
1245
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 1242

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

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

Create or updates the catalog data for a public registry.

Examples:

Request syntax with placeholder values


resp = client.put_registry_catalog_data({
  display_name: "RegistryDisplayName",
})

Response structure


resp.registry_catalog_data.display_name #=> 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.

Returns:

See Also:



1276
1277
1278
1279
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 1276

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",
  },
})

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

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String)

    The AWS account ID 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:



1331
1332
1333
1334
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 1331

def put_repository_catalog_data(params = {}, options = {})
  req = build_request(:put_repository_catalog_data, 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 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 AWS account ID 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 User Guide.

  • :force (Boolean)

    If the policy you are attempting to set on a repository policy would prevent you from setting another policy in the future, you must force the SetRepositoryPolicy operation. This is intended to prevent accidental repository lock outs.

Returns:

See Also:



1393
1394
1395
1396
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 1393

def set_repository_policy(params = {}, options = {})
  req = build_request(:set_repository_policy, 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 are not specified in the request parameters, they are not changed. When a resource is deleted, the tags associated with that resource are deleted as well.

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 which to add tags. 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:



1430
1431
1432
1433
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 1430

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 from which to delete tags. 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:



1458
1459
1460
1461
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 1458

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 (or about 20MB). The UploadLayerPart API is called once per each new image layer part.

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

Examples:

Request syntax with placeholder values


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

Response structure


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

Parameters:

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

    ({})

Options Hash (params):

  • :registry_id (String)

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

  • :repository_name (required, String)

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

  • :upload_id (required, String)

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

  • :part_first_byte (required, Integer)

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

  • :part_last_byte (required, Integer)

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

  • :layer_part_blob (required, String, StringIO, File)

    The base64-encoded layer part payload.

Returns:

See Also:



1528
1529
1530
1531
# File 'gems/aws-sdk-ecrpublic/lib/aws-sdk-ecrpublic/client.rb', line 1528

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