Skip to content

list_ip_routes

list_ip_routes(
    directory_id: DirectoryId,
    *,
    config_overrides: Optional[DirectoryServiceClientConfig] = None,
    next_token: Optional[NextToken] = None,
    limit: Optional[Limit] = None,
) -> ListIpRoutesResult

Lists the address blocks that you have added to a directory.

Parameters:

  • directory_id (DirectoryId) –

    Identifier (ID) of the directory for which you want to retrieve the IP addresses.

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

    The ListIpRoutes.NextToken value from a previous call to ListIpRoutes. Pass null if this is the first call.

  • limit (Optional[Limit], default: None ) –

    Maximum number of items to return. If this value is zero, the maximum number of items is specified by the limitations of the operation.

Raises:

Examples:

To list IP routes The following example lists the address blocks that have been added to a specified directory.

>>> client.list_ip_routes(directory_id='d-92654abfed', limit=0)
Source code in docs_src/capo_directory_service/_services/directory_service.py
def list_ip_routes(
    self,
    directory_id: "capo_directory_service.types.directory_id.DirectoryId",
    *,
    config_overrides: Optional[DirectoryServiceClientConfig] = None,
    next_token: Optional[
        "capo_directory_service.types.next_token.NextToken"
    ] = None,
    limit: Optional["capo_directory_service.types.limit.Limit"] = None,
) -> "capo_directory_service.types.list_ip_routes_result.ListIpRoutesResult":
    """<p>Lists the address blocks that you have added to a directory.</p>

    Args:
        directory_id: <p>Identifier (ID) of the directory for which you want to retrieve the IP addresses.</p>
        next_token: <p>The <i>ListIpRoutes.NextToken</i> value from a previous call to <a>ListIpRoutes</a>. Pass null if this is the first call.</p>
        limit: <p>Maximum number of items to return. If this value is zero, the maximum number of items is specified by the limitations of the operation.</p>

    Raises:
        capo_directory_service.errors.client_exception.ClientException: <p>A client exception has occurred.</p>
        capo_directory_service.errors.entity_does_not_exist_exception.EntityDoesNotExistException: <p>The specified entity could not be found.</p>
        capo_directory_service.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The <code>NextToken</code> value is not valid.</p>
        capo_directory_service.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more parameters are not valid.</p>
        capo_directory_service.errors.service_exception.ServiceException: <p>An exception has occurred in Directory Service.</p>
        capo_directory_service.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To list IP routes
        The following example lists the address blocks that have been added to a specified directory.

        >>> client.list_ip_routes(directory_id='d-92654abfed', limit=0)
    """

    def _handler(
        req: "OperationRequest[capo_directory_service.types.list_ip_routes_request.ListIpRoutesRequest]",
    ) -> OperationResponse[
        "capo_directory_service.types.list_ip_routes_result.ListIpRoutesResult"
    ]:
        import capo_directory_service._operations.directory_service_20150416.list_ip_routes

        output, http_response = (
            capo_directory_service._operations.directory_service_20150416.list_ip_routes.list_ip_routes(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListIpRoutes")
    )
    input_: capo_directory_service.types.list_ip_routes_request.ListIpRoutesRequest = {
        "directory_id": directory_id
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if limit is not None:
        input_["limit"] = limit

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