Skip to content

list_domains

list_domains(
    *,
    config_overrides: Optional[codeartifactClientConfig] = None,
    max_results: Optional[ListDomainsMaxResults] = None,
    next_token: Optional[PaginationToken] = None,
) -> ListDomainsResult

Returns a list of DomainSummary objects for all domains owned by the Amazon Web Services account that makes this call. Each returned DomainSummary object contains information about a domain.

Parameters:

  • max_results (Optional[ListDomainsMaxResults], default: None ) –

    The maximum number of results to return per page.

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

    The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

Raises:

  • AccessDeniedException –

    The operation did not succeed because of an unauthorized access attempt.

  • InternalServerException –

    The operation did not succeed because of an error that occurred inside CodeArtifact.

  • ThrottlingException –

    The operation did not succeed because too many requests are sent to the service.

  • ValidationException –

    The operation did not succeed because a parameter in the request was sent with an invalid value.

  • UnknownServiceError –

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

Source code in docs_src/capo_codeartifact/_services/codeartifact.py
def list_domains(
    self,
    *,
    config_overrides: Optional[codeartifactClientConfig] = None,
    max_results: Optional[
        "capo_codeartifact.types.list_domains_max_results.ListDomainsMaxResults"
    ] = None,
    next_token: Optional[
        "capo_codeartifact.types.pagination_token.PaginationToken"
    ] = None,
) -> "capo_codeartifact.types.list_domains_result.ListDomainsResult":
    """<p> Returns a list of <a href="https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageVersionDescription.html">DomainSummary</a> objects for all domains owned by the Amazon Web Services account that makes this call. Each returned <code>DomainSummary</code> object contains information about a domain. </p>

    Args:
        max_results: <p> The maximum number of results to return per page. </p>
        next_token: <p> The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results. </p>

    Raises:
        capo_codeartifact.errors.access_denied_exception.AccessDeniedException: <p> The operation did not succeed because of an unauthorized access attempt. </p>
        capo_codeartifact.errors.internal_server_exception.InternalServerException: <p> The operation did not succeed because of an error that occurred inside CodeArtifact. </p>
        capo_codeartifact.errors.throttling_exception.ThrottlingException: <p> The operation did not succeed because too many requests are sent to the service. </p>
        capo_codeartifact.errors.validation_exception.ValidationException: <p> The operation did not succeed because a parameter in the request was sent with an invalid value. </p>
        capo_codeartifact.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_codeartifact.types.list_domains_request.ListDomainsRequest]",
    ) -> OperationResponse[
        "capo_codeartifact.types.list_domains_result.ListDomainsResult"
    ]:
        import capo_codeartifact._operations.code_artifact_control_plane_service.list_domains

        output, http_response = (
            capo_codeartifact._operations.code_artifact_control_plane_service.list_domains.list_domains(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListDomains")
    )
    input_: capo_codeartifact.types.list_domains_request.ListDomainsRequest = {}
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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