Skip to content

list_domains

list_domains(
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[int] = None,
) -> ListDomainsOutput

Returns the caller's domains: the account-scoped domain and the organization-scoped domain, if either exists. At most two domains are returned.

Parameters:

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

    A token to retrieve the next page of results. Tokens expire after 24 hours.

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

    The maximum number of domains to return per page. Defaults to 100.

Raises:

Examples:

List domains The following example lists the caller's domains. At most two are returned — the account-scoped domain and the organization-scoped domain — so there is no nextToken. Payloads are shown as JSON; on the wire they are CBOR-encoded.

>>> client.list_domains()
Source code in docs_src/capo_cloudwatchomni/_services/cloud_watch_omni.py
def list_domains(
    self,
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
    next_token: Optional["capo_cloudwatchomni.types.next_token.NextToken"] = None,
    max_results: Optional[int] = None,
) -> "capo_cloudwatchomni.types.list_domains_output.ListDomainsOutput":
    """Returns the caller's domains: the account-scoped domain and the organization-scoped domain, if either exists. At most two domains are returned.

    Args:
        next_token: A token to retrieve the next page of results. Tokens expire after 24 hours.
        max_results: The maximum number of domains to return per page. Defaults to 100.

    Raises:
        capo_cloudwatchomni.errors.access_denied_exception.AccessDeniedException: The caller is not authorized to perform this action.
        capo_cloudwatchomni.errors.internal_server_exception.InternalServerException: An unexpected error occurred while processing the request.
        capo_cloudwatchomni.errors.throttling_exception.ThrottlingException: The request was throttled due to exceeding the allowed request rate.
        capo_cloudwatchomni.errors.validation_exception.ValidationException: A parameter is specified incorrectly.
        capo_cloudwatchomni.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        List domains
        The following example lists the caller's domains. At most two are returned — the account-scoped domain and the organization-scoped domain — so there is no nextToken. Payloads are shown as JSON; on the wire they are CBOR-encoded.

        >>> client.list_domains()
    """

    def _handler(
        req: "OperationRequest[capo_cloudwatchomni.types.list_domains_input.ListDomainsInput]",
    ) -> OperationResponse[
        "capo_cloudwatchomni.types.list_domains_output.ListDomainsOutput"
    ]:
        import capo_cloudwatchomni._operations.cloud_watch_omni_frontend.list_domains

        output, http_response = (
            capo_cloudwatchomni._operations.cloud_watch_omni_frontend.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_cloudwatchomni.types.list_domains_input.ListDomainsInput = {}
    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