Skip to content

describe_repositories

describe_repositories(
    *,
    config_overrides: Optional[ECRClientConfig] = None,
    registry_id: Optional[RegistryId] = None,
    repository_names: Optional[RepositoryNameList] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> DescribeRepositoriesResponse

Describes image repositories in a registry.

Parameters:

  • registry_id (Optional[RegistryId], default: None ) –

    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 (Optional[RepositoryNameList], default: None ) –

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

  • next_token (Optional[NextToken], default: None ) –

    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 (Optional[MaxResults], default: None ) –

    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.

Raises:

  • InvalidParameterException –

    The specified parameter is invalid. Review the available parameters for the API request.

  • RepositoryNotFoundException –

    The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.

  • ServerException –

    These errors are usually caused by a server-side issue.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

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

>>> client.describe_repositories()
Source code in docs_src/capo_ecr/_services/ecr.py
def describe_repositories(
    self,
    *,
    config_overrides: Optional[ECRClientConfig] = None,
    registry_id: Optional["capo_ecr.types.registry_id.RegistryId"] = None,
    repository_names: Optional[
        "capo_ecr.types.repository_name_list.RepositoryNameList"
    ] = None,
    next_token: Optional["capo_ecr.types.next_token.NextToken"] = None,
    max_results: Optional["capo_ecr.types.max_results.MaxResults"] = None,
) -> "capo_ecr.types.describe_repositories_response.DescribeRepositoriesResponse":
    """<p>Describes image repositories in a registry.</p>

    Args:
        registry_id: <p>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.</p>
        repository_names: <p>A list of repositories to describe. If this parameter is omitted, then all repositories in a registry are described.</p>
        next_token: <p>The <code>nextToken</code> value returned from a previous paginated <code>DescribeRepositories</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return. This option cannot be used when you specify repositories with <code>repositoryNames</code>.</p> <note> <p>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.</p> </note>
        max_results: <p>The maximum number of repository results returned by <code>DescribeRepositories</code> in paginated output. When this parameter is used, <code>DescribeRepositories</code> only returns <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>DescribeRepositories</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 1000. If this parameter is not used, then <code>DescribeRepositories</code> returns up to 100 results and a <code>nextToken</code> value, if applicable. This option cannot be used when you specify repositories with <code>repositoryNames</code>.</p>

    Raises:
        capo_ecr.errors.invalid_parameter_exception.InvalidParameterException: <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
        capo_ecr.errors.repository_not_found_exception.RepositoryNotFoundException: <p>The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.</p>
        capo_ecr.errors.server_exception.ServerException: <p>These errors are usually caused by a server-side issue.</p>
        capo_ecr.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To describe all repositories in the current account
        The following example obtains a list and description of all repositories in the default registry to which the current user has access.

        >>> client.describe_repositories()
    """

    def _handler(
        req: "OperationRequest[capo_ecr.types.describe_repositories_request.DescribeRepositoriesRequest]",
    ) -> OperationResponse[
        "capo_ecr.types.describe_repositories_response.DescribeRepositoriesResponse"
    ]:
        import capo_ecr._operations.amazon_ec2_container_registry_v20150921.describe_repositories

        output, http_response = (
            capo_ecr._operations.amazon_ec2_container_registry_v20150921.describe_repositories.describe_repositories(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeRepositories")
    )
    input_: capo_ecr.types.describe_repositories_request.DescribeRepositoriesRequest = {}
    if registry_id is not None:
        input_["registry_id"] = registry_id
    if repository_names is not None:
        input_["repository_names"] = repository_names
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output