Skip to content

list_cidr_blocks async

list_cidr_blocks(
    collection_id: UUID,
    *,
    config_overrides: Optional[AsyncRoute53ClientConfig] = None,
    location_name: Optional[CidrLocationNameDefaultNotAllowed] = None,
    next_token: Optional[PaginationToken] = None,
    max_results: Optional[int] = None,
) -> ListCidrBlocksResponse

Returns a paginated list of location objects and their CIDR blocks.

Parameters:

  • collection_id (UUID) –

    The UUID of the CIDR collection.

  • location_name (Optional[CidrLocationNameDefaultNotAllowed], default: None ) –

    The name of the CIDR collection location.

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

    An opaque pagination token to indicate where the service is to begin enumerating results.

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

    Maximum number of results you want returned.

Raises:

Source code in docs_src/capo_route_53/_services/async_route53.py
async def list_cidr_blocks(
    self,
    collection_id: "capo_route_53.types.uuid.UUID",
    *,
    config_overrides: Optional[AsyncRoute53ClientConfig] = None,
    location_name: Optional[
        "capo_route_53.types.cidr_location_name_default_not_allowed.CidrLocationNameDefaultNotAllowed"
    ] = None,
    next_token: Optional[
        "capo_route_53.types.pagination_token.PaginationToken"
    ] = None,
    max_results: Optional[int] = None,
) -> "capo_route_53.types.list_cidr_blocks_response.ListCidrBlocksResponse":
    """<p>Returns a paginated list of location objects and their CIDR blocks.</p>

    Args:
        collection_id: <p>The UUID of the CIDR collection.</p>
        location_name: <p>The name of the CIDR collection location.</p>
        next_token: <p>An opaque pagination token to indicate where the service is to begin enumerating results.</p>
        max_results: <p>Maximum number of results you want returned.</p>

    Raises:
        capo_route_53.errors.invalid_input.InvalidInput: <p>The input is not valid.</p>
        capo_route_53.errors.no_such_cidr_collection_exception.NoSuchCidrCollectionException: <p>The CIDR collection you specified, doesn't exist.</p>
        capo_route_53.errors.no_such_cidr_location_exception.NoSuchCidrLocationException: <p>The CIDR collection location doesn't match any locations in your account.</p>
        capo_route_53.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_route_53.types.list_cidr_blocks_request.ListCidrBlocksRequest]",
    ) -> AsyncOperationResponse[
        "capo_route_53.types.list_cidr_blocks_response.ListCidrBlocksResponse"
    ]:
        import capo_route_53._operations.aws_dns_v20130401.list_cidr_blocks

        (
            output,
            http_response,
        ) = await capo_route_53._operations.aws_dns_v20130401.list_cidr_blocks.async_list_cidr_blocks(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListCidrBlocks")
    )
    input_: capo_route_53.types.list_cidr_blocks_request.ListCidrBlocksRequest = {
        "collection_id": collection_id
    }
    if location_name is not None:
        input_["location_name"] = location_name
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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