getNetworkRoutes method

Future<GetNetworkRoutesResponse> getNetworkRoutes({
  1. required String globalNetworkId,
  2. required RouteTableIdentifier routeTableIdentifier,
  3. Map<String, List<String>>? destinationFilters,
  4. List<String>? exactCidrMatches,
  5. List<String>? longestPrefixMatches,
  6. List<String>? prefixListIds,
  7. List<RouteState>? states,
  8. List<String>? subnetOfMatches,
  9. List<String>? supernetOfMatches,
  10. List<RouteType>? types,
})

Gets the network routes of the specified global network.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter globalNetworkId : The ID of the global network.

Parameter routeTableIdentifier : The ID of the route table.

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

Parameter exactCidrMatches : An exact CIDR block.

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

Parameter prefixListIds : The IDs of the prefix lists.

Parameter states : The route states.

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

Parameter supernetOfMatches : 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.

Parameter types : The route types.

Implementation

Future<GetNetworkRoutesResponse> getNetworkRoutes({
  required String globalNetworkId,
  required RouteTableIdentifier routeTableIdentifier,
  Map<String, List<String>>? destinationFilters,
  List<String>? exactCidrMatches,
  List<String>? longestPrefixMatches,
  List<String>? prefixListIds,
  List<RouteState>? states,
  List<String>? subnetOfMatches,
  List<String>? supernetOfMatches,
  List<RouteType>? types,
}) async {
  final $payload = <String, dynamic>{
    'RouteTableIdentifier': routeTableIdentifier,
    if (destinationFilters != null) 'DestinationFilters': destinationFilters,
    if (exactCidrMatches != null) 'ExactCidrMatches': exactCidrMatches,
    if (longestPrefixMatches != null)
      'LongestPrefixMatches': longestPrefixMatches,
    if (prefixListIds != null) 'PrefixListIds': prefixListIds,
    if (states != null) 'States': states.map((e) => e.value).toList(),
    if (subnetOfMatches != null) 'SubnetOfMatches': subnetOfMatches,
    if (supernetOfMatches != null) 'SupernetOfMatches': supernetOfMatches,
    if (types != null) 'Types': types.map((e) => e.value).toList(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/global-networks/${Uri.encodeComponent(globalNetworkId)}/network-routes',
    exceptionFnMap: _exceptionFns,
  );
  return GetNetworkRoutesResponse.fromJson(response);
}