Skip to content

get_network_routes

get_network_routes(
    global_network_id: GlobalNetworkId,
    route_table_identifier: RouteTableIdentifier,
    *,
    config_overrides: Optional[NetworkManagerClientConfig] = None,
    exact_cidr_matches: Optional[ConstrainedStringList] = None,
    longest_prefix_matches: Optional[ConstrainedStringList] = None,
    subnet_of_matches: Optional[ConstrainedStringList] = None,
    supernet_of_matches: Optional[ConstrainedStringList] = None,
    prefix_list_ids: Optional[ConstrainedStringList] = None,
    states: Optional[RouteStateList] = None,
    types: Optional[RouteTypeList] = None,
    destination_filters: Optional[FilterMap] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> GetNetworkRoutesResponse

Gets the network routes of the specified global network.

Parameters:

  • global_network_id (GlobalNetworkId) –

    The ID of the global network.

  • route_table_identifier (RouteTableIdentifier) –

    The ID of the route table.

  • exact_cidr_matches (Optional[ConstrainedStringList], default: None ) –

    An exact CIDR block.

  • longest_prefix_matches (Optional[ConstrainedStringList], default: None ) –

    The most specific route that matches the traffic (longest prefix match).

  • subnet_of_matches (Optional[ConstrainedStringList], default: None ) –

    The routes with a subnet that match the specified CIDR filter.

  • supernet_of_matches (Optional[ConstrainedStringList], default: None ) –

    The routes with a CIDR that encompasses the CIDR filter. Example: If you specify 10.0.1.0/30, then the result returns 10.0.1.0/29.

  • prefix_list_ids (Optional[ConstrainedStringList], default: None ) –

    The IDs of the prefix lists.

  • states (Optional[RouteStateList], default: None ) –

    The route states.

  • types (Optional[RouteTypeList], default: None ) –

    The route types.

  • destination_filters (Optional[FilterMap], default: None ) –

    Filter by route table destination. Possible Values: TRANSIT_GATEWAY_ATTACHMENT_ID, RESOURCE_ID, or RESOURCE_TYPE.

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

    The maximum number of results to return.

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

    The token for the next page of results.

Raises:

Source code in docs_src/capo_networkmanager/_services/network_manager.py
def get_network_routes(
    self,
    global_network_id: "capo_networkmanager.types.global_network_id.GlobalNetworkId",
    route_table_identifier: "capo_networkmanager.types.route_table_identifier.RouteTableIdentifier",
    *,
    config_overrides: Optional[NetworkManagerClientConfig] = None,
    exact_cidr_matches: Optional[
        "capo_networkmanager.types.constrained_string_list.ConstrainedStringList"
    ] = None,
    longest_prefix_matches: Optional[
        "capo_networkmanager.types.constrained_string_list.ConstrainedStringList"
    ] = None,
    subnet_of_matches: Optional[
        "capo_networkmanager.types.constrained_string_list.ConstrainedStringList"
    ] = None,
    supernet_of_matches: Optional[
        "capo_networkmanager.types.constrained_string_list.ConstrainedStringList"
    ] = None,
    prefix_list_ids: Optional[
        "capo_networkmanager.types.constrained_string_list.ConstrainedStringList"
    ] = None,
    states: Optional[
        "capo_networkmanager.types.route_state_list.RouteStateList"
    ] = None,
    types: Optional[
        "capo_networkmanager.types.route_type_list.RouteTypeList"
    ] = None,
    destination_filters: Optional[
        "capo_networkmanager.types.filter_map.FilterMap"
    ] = None,
    max_results: Optional[
        "capo_networkmanager.types.max_results.MaxResults"
    ] = None,
    next_token: Optional["capo_networkmanager.types.next_token.NextToken"] = None,
) -> (
    "capo_networkmanager.types.get_network_routes_response.GetNetworkRoutesResponse"
):
    """<p>Gets the network routes of the specified global network.</p>

    Args:
        global_network_id: <p>The ID of the global network.</p>
        route_table_identifier: <p>The ID of the route table.</p>
        exact_cidr_matches: <p>An exact CIDR block.</p>
        longest_prefix_matches: <p>The most specific route that matches the traffic (longest prefix match).</p>
        subnet_of_matches: <p>The routes with a subnet that match the specified CIDR filter.</p>
        supernet_of_matches: <p>The routes with a CIDR that encompasses the CIDR filter. Example: If you specify 10.0.1.0/30, then the result returns 10.0.1.0/29.</p>
        prefix_list_ids: <p>The IDs of the prefix lists.</p>
        states: <p>The route states.</p>
        types: <p>The route types.</p>
        destination_filters: <p>Filter by route table destination. Possible Values: TRANSIT_GATEWAY_ATTACHMENT_ID, RESOURCE_ID, or RESOURCE_TYPE.</p>
        max_results: <p>The maximum number of results to return.</p>
        next_token: <p>The token for the next page of results.</p>

    Raises:
        capo_networkmanager.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_networkmanager.errors.internal_server_exception.InternalServerException: <p>The request has failed due to an internal error.</p>
        capo_networkmanager.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource could not be found.</p>
        capo_networkmanager.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_networkmanager.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints.</p>
        capo_networkmanager.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_networkmanager.types.get_network_routes_request.GetNetworkRoutesRequest]",
    ) -> OperationResponse[
        "capo_networkmanager.types.get_network_routes_response.GetNetworkRoutesResponse"
    ]:
        import capo_networkmanager._operations.network_manager.get_network_routes

        output, http_response = (
            capo_networkmanager._operations.network_manager.get_network_routes.get_network_routes(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetNetworkRoutes")
    )
    input_: capo_networkmanager.types.get_network_routes_request.GetNetworkRoutesRequest = {
        "global_network_id": global_network_id,
        "route_table_identifier": route_table_identifier,
    }
    if exact_cidr_matches is not None:
        input_["exact_cidr_matches"] = exact_cidr_matches
    if longest_prefix_matches is not None:
        input_["longest_prefix_matches"] = longest_prefix_matches
    if subnet_of_matches is not None:
        input_["subnet_of_matches"] = subnet_of_matches
    if supernet_of_matches is not None:
        input_["supernet_of_matches"] = supernet_of_matches
    if prefix_list_ids is not None:
        input_["prefix_list_ids"] = prefix_list_ids
    if states is not None:
        input_["states"] = states
    if types is not None:
        input_["types"] = types
    if destination_filters is not None:
        input_["destination_filters"] = destination_filters
    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