- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
GetNetworkRoutesCommand
Gets the network routes of the specified global network.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { NetworkManagerClient, GetNetworkRoutesCommand } from "@aws-sdk/client-networkmanager"; // ES Modules import
// const { NetworkManagerClient, GetNetworkRoutesCommand } = require("@aws-sdk/client-networkmanager"); // CommonJS import
const client = new NetworkManagerClient(config);
const input = { // GetNetworkRoutesRequest
GlobalNetworkId: "STRING_VALUE", // required
RouteTableIdentifier: { // RouteTableIdentifier
TransitGatewayRouteTableArn: "STRING_VALUE",
CoreNetworkSegmentEdge: { // CoreNetworkSegmentEdgeIdentifier
CoreNetworkId: "STRING_VALUE",
SegmentName: "STRING_VALUE",
EdgeLocation: "STRING_VALUE",
},
CoreNetworkNetworkFunctionGroup: { // CoreNetworkNetworkFunctionGroupIdentifier
CoreNetworkId: "STRING_VALUE",
NetworkFunctionGroupName: "STRING_VALUE",
EdgeLocation: "STRING_VALUE",
},
},
ExactCidrMatches: [ // ConstrainedStringList
"STRING_VALUE",
],
LongestPrefixMatches: [
"STRING_VALUE",
],
SubnetOfMatches: [
"STRING_VALUE",
],
SupernetOfMatches: [
"STRING_VALUE",
],
PrefixListIds: [
"STRING_VALUE",
],
States: [ // RouteStateList
"ACTIVE" || "BLACKHOLE",
],
Types: [ // RouteTypeList
"PROPAGATED" || "STATIC",
],
DestinationFilters: { // FilterMap
"<keys>": [ // FilterValues
"STRING_VALUE",
],
},
};
const command = new GetNetworkRoutesCommand(input);
const response = await client.send(command);
// { // GetNetworkRoutesResponse
// RouteTableArn: "STRING_VALUE",
// CoreNetworkSegmentEdge: { // CoreNetworkSegmentEdgeIdentifier
// CoreNetworkId: "STRING_VALUE",
// SegmentName: "STRING_VALUE",
// EdgeLocation: "STRING_VALUE",
// },
// RouteTableType: "TRANSIT_GATEWAY_ROUTE_TABLE" || "CORE_NETWORK_SEGMENT" || "NETWORK_FUNCTION_GROUP",
// RouteTableTimestamp: new Date("TIMESTAMP"),
// NetworkRoutes: [ // NetworkRouteList
// { // NetworkRoute
// DestinationCidrBlock: "STRING_VALUE",
// Destinations: [ // NetworkRouteDestinationList
// { // NetworkRouteDestination
// CoreNetworkAttachmentId: "STRING_VALUE",
// TransitGatewayAttachmentId: "STRING_VALUE",
// SegmentName: "STRING_VALUE",
// NetworkFunctionGroupName: "STRING_VALUE",
// EdgeLocation: "STRING_VALUE",
// ResourceType: "STRING_VALUE",
// ResourceId: "STRING_VALUE",
// },
// ],
// PrefixListId: "STRING_VALUE",
// State: "ACTIVE" || "BLACKHOLE",
// Type: "PROPAGATED" || "STATIC",
// },
// ],
// };
GetNetworkRoutesCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
GlobalNetworkId Required | string | undefined | The ID of the global network. |
RouteTableIdentifier Required | RouteTableIdentifier | undefined | The ID of the route table. |
DestinationFilters | Record<string, string[]> | undefined | Filter by route table destination. Possible Values: TRANSIT_GATEWAY_ATTACHMENT_ID, RESOURCE_ID, or RESOURCE_TYPE. |
ExactCidrMatches | string[] | undefined | An exact CIDR block. |
LongestPrefixMatches | string[] | undefined | The most specific route that matches the traffic (longest prefix match). |
PrefixListIds | string[] | undefined | The IDs of the prefix lists. |
States | RouteState[] | undefined | The route states. |
SubnetOfMatches | string[] | undefined | The routes with a subnet that match the specified CIDR filter. |
SupernetOfMatches | string[] | undefined | 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. |
Types | RouteType[] | undefined | The route types. |
GetNetworkRoutesCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
CoreNetworkSegmentEdge | CoreNetworkSegmentEdgeIdentifier | undefined | Describes a core network segment edge. |
NetworkRoutes | NetworkRoute[] | undefined | The network routes. |
RouteTableArn | string | undefined | The ARN of the route table. |
RouteTableTimestamp | Date | undefined | The route table creation time. |
RouteTableType | RouteTableType | undefined | The route table type. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | You do not have sufficient access to perform this action. |
InternalServerException | server | The request has failed due to an internal error. |
ResourceNotFoundException | client | The specified resource could not be found. |
ThrottlingException | client | The request was denied due to request throttling. |
ValidationException | client | The input fails to satisfy the constraints. |
NetworkManagerServiceException | Base exception class for all service exceptions from NetworkManager service. |