Method: Aws::ECR::Client#describe_repositories
- Defined in:
- lib/aws-sdk-ecr/client.rb
#describe_repositories(params = {}) ⇒ Types::DescribeRepositoriesResponse
Describes image repositories in a registry.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
Examples:
Example: To describe all repositories in the current account
Example: To describe all repositories in the current account
# The following example obtains a list and description of all repositories in the default registry to which the current
# user has access.
resp = client.describe_repositories({
})
resp.to_h outputs the following:
{
repositories: [
{
registry_id: "012345678910",
repository_arn: "arn:aws:ecr:us-west-2:012345678910:repository/ubuntu",
repository_name: "ubuntu",
},
{
registry_id: "012345678910",
repository_arn: "arn:aws:ecr:us-west-2:012345678910:repository/test",
repository_name: "test",
},
],
}
Request syntax with placeholder values
Request syntax with placeholder values
resp = client.describe_repositories({
registry_id: "RegistryId",
repository_names: ["RepositoryName"],
next_token: "NextToken",
max_results: 1,
})
Response structure
Response structure
resp.repositories #=> Array
resp.repositories[0].repository_arn #=> String
resp.repositories[0].registry_id #=> String
resp.repositories[0].repository_name #=> String
resp.repositories[0].repository_uri #=> String
resp.repositories[0].created_at #=> Time
resp.repositories[0].image_tag_mutability #=> String, one of "MUTABLE", "IMMUTABLE"
resp.repositories[0].image_scanning_configuration.scan_on_push #=> Boolean
resp.repositories[0].encryption_configuration.encryption_type #=> String, one of "AES256", "KMS", "KMS_DSSE"
resp.repositories[0].encryption_configuration.kms_key #=> String
resp.next_token #=> String
Parameters:
-
params
(Hash)
(defaults to: {})
—
({})
Options Hash (params):
-
:registry_id
(String)
—
The Amazon Web Services account ID associated with the registry that contains the repositories to be described. If you do not specify a registry, the default registry is assumed.
-
:repository_names
(Array<String>)
—
A list of repositories to describe. If this parameter is omitted, then all repositories in a registry are described.
-
:next_token
(String)
—
The ‘nextToken` value returned from a previous paginated `DescribeRepositories` request where `maxResults` was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the `nextToken` value. This value is `null` when there are no more results to return. This option cannot be used when you specify repositories with `repositoryNames`.
<note markdown=“1”> 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.
</note>
-
: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:
-
(Types::DescribeRepositoriesResponse)
—
Returns a response object which responds to the following methods:
-
#repositories => Array<Types::Repository>
-
#next_token => String
-
See Also:
1995 1996 1997 1998 |
# File 'lib/aws-sdk-ecr/client.rb', line 1995 def describe_repositories(params = {}, options = {}) req = build_request(:describe_repositories, params) req.send_request(options) end |