Skip to content

list_regions async

list_regions(
    instance_arn: InstanceArn,
    *,
    config_overrides: Optional[AsyncSSOAdminClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[Token] = None,
) -> ListRegionsResponse

Lists all enabled Regions of an IAM Identity Center instance, including those that are being added or removed. This operation returns Regions with ACTIVE, ADDING, or REMOVING status.

The following actions are related to ListRegions:

Parameters:

  • instance_arn (InstanceArn) –

    The Amazon Resource Name (ARN) of the IAM Identity Center instance.

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

    The maximum number of results to return in a single call. Default is 100.

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

    The pagination token for the list API. Initially the value is null. Use the output of previous API calls to make subsequent calls.

Raises:

Source code in docs_src/capo_sso_admin/_services/async_sso_admin.py
async def list_regions(
    self,
    instance_arn: "capo_sso_admin.types.instance_arn.InstanceArn",
    *,
    config_overrides: Optional[AsyncSSOAdminClientConfig] = None,
    max_results: Optional["capo_sso_admin.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_sso_admin.types.token.Token"] = None,
) -> "capo_sso_admin.types.list_regions_response.ListRegionsResponse":
    """<p>Lists all enabled Regions of an IAM Identity Center instance, including those that are being added or removed. This operation returns Regions with ACTIVE, ADDING, or REMOVING status.</p> <p>The following actions are related to <code>ListRegions</code>:</p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/singlesignon/latest/APIReference/API_AddRegion.html"> AddRegion</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/singlesignon/latest/APIReference/API_RemoveRegion.html">RemoveRegion</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/singlesignon/latest/APIReference/API_DescribeRegion.html">DescribeRegion</a> </p> </li> </ul>

    Args:
        instance_arn: <p>The Amazon Resource Name (ARN) of the IAM Identity Center instance.</p>
        max_results: <p>The maximum number of results to return in a single call. Default is 100.</p>
        next_token: <p>The pagination token for the list API. Initially the value is null. Use the output of previous API calls to make subsequent calls.</p>

    Raises:
        capo_sso_admin.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_sso_admin.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception, or failure with an internal server.</p>
        capo_sso_admin.errors.throttling_exception.ThrottlingException: <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
        capo_sso_admin.errors.validation_exception.ValidationException: <p>The request failed because it contains a syntax error.</p>
        capo_sso_admin.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sso_admin.types.list_regions_request.ListRegionsRequest]",
    ) -> AsyncOperationResponse[
        "capo_sso_admin.types.list_regions_response.ListRegionsResponse"
    ]:
        import capo_sso_admin._operations.swb_external_service.list_regions

        (
            output,
            http_response,
        ) = await capo_sso_admin._operations.swb_external_service.list_regions.async_list_regions(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListRegions")
    )
    input_: capo_sso_admin.types.list_regions_request.ListRegionsRequest = {
        "instance_arn": instance_arn
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output