Jump to Content

This API Documentation is now deprecated

We are excited to announce our new API Documentation.

@aws-sdk/client-networkmanager

@aws-sdk/client-networkmanager

Description

AWS SDK for JavaScript NetworkManager Client for Node.js, Browser and React Native.

Amazon Web Services enables you to centrally manage your Amazon Web Services Cloud WAN core network and your Transit Gateway network across Amazon Web Services accounts, Regions, and on-premises locations.

Installing

To install the this package, simply type add or install @aws-sdk/client-networkmanager using your favorite package manager:

  • npm install @aws-sdk/client-networkmanager
  • yarn add @aws-sdk/client-networkmanager
  • pnpm add @aws-sdk/client-networkmanager

Getting Started

Import

The AWS SDK is modulized by clients and commands. To send a request, you only need to import the NetworkManagerClient and the commands you need, for example ListAttachmentsCommand:

// ES5 example
const { NetworkManagerClient, ListAttachmentsCommand } = require("@aws-sdk/client-networkmanager");
// ES6+ example
import { NetworkManagerClient, ListAttachmentsCommand } from "@aws-sdk/client-networkmanager";

Usage

To send a request, you:

  • Initiate client with configuration (e.g. credentials, region).
  • Initiate command with input parameters.
  • Call send operation on client with command object as input.
  • If you are using a custom http handler, you may call destroy() to close open connections.
// a client can be shared by different commands.
const client = new NetworkManagerClient({ region: "REGION" });

const params = {
/** input parameters */
};
const command = new ListAttachmentsCommand(params);

Async/await

We recommend using await operator to wait for the promise returned by send operation as follows:

// async/await.
try {
const data = await client.send(command);
// process data.
} catch (error) {
// error handling.
} finally {
// finally.
}

Async-await is clean, concise, intuitive, easy to debug and has better error handling as compared to using Promise chains or callbacks.

Promises

You can also use Promise chaining to execute send operation.

client.send(command).then(
(data) => {
// process data.
},
(error) => {
// error handling.
}
);

Promises can also be called using .catch() and .finally() as follows:

client
.send(command)
.then((data) => {
// process data.
})
.catch((error) => {
// error handling.
})
.finally(() => {
// finally.
});

Callbacks

We do not recommend using callbacks because of callback hell, but they are supported by the send operation.

// callbacks.
client.send(command, (err, data) => {
// process err and data.
});

v2 compatible style

The client can also send requests using v2 compatible style. However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post on modular packages in AWS SDK for JavaScript

import * as AWS from "@aws-sdk/client-networkmanager";
const client = new AWS.NetworkManager({ region: "REGION" });

// async/await.
try {
const data = await client.listAttachments(params);
// process data.
} catch (error) {
// error handling.
}

// Promises.
client
.listAttachments(params)
.then((data) => {
// process data.
})
.catch((error) => {
// error handling.
});

// callbacks.
client.listAttachments(params, (err, data) => {
// process err and data.
});

Troubleshooting

When the service returns an exception, the error will include the exception information, as well as response metadata (e.g. request id).

try {
const data = await client.send(command);
// process data.
} catch (error) {
const { requestId, cfId, extendedRequestId } = error.$$metadata;
console.log({ requestId, cfId, extendedRequestId });
/**
* The keys within exceptions are also parsed.
* You can access them by specifying exception names:
* if (error.name === 'SomeServiceException') {
* const value = error.specialKeyInException;
* }
*/
}

Getting Help

Please use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.

To test your universal JavaScript code in Node.js, browser and react-native environments, visit our code samples repo.

Contributing

This client code is generated automatically. Any modifications will be overwritten the next time the @aws-sdk/client-networkmanager package is updated. To contribute to client you can check our generate clients scripts.

License

This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.

Client Commands (Operations List)

AcceptAttachment

Command API Reference / Input / Output

AssociateConnectPeer

Command API Reference / Input / Output

AssociateCustomerGateway

Command API Reference / Input / Output

AssociateLink

Command API Reference / Input / Output

AssociateTransitGatewayConnectPeer

Command API Reference / Input / Output

CreateConnectAttachment

Command API Reference / Input / Output

CreateConnection

Command API Reference / Input / Output

CreateConnectPeer

Command API Reference / Input / Output

CreateCoreNetwork

Command API Reference / Input / Output

CreateDevice

Command API Reference / Input / Output

CreateGlobalNetwork

Command API Reference / Input / Output

CreateLink

Command API Reference / Input / Output

CreateSite

Command API Reference / Input / Output

CreateSiteToSiteVpnAttachment

Command API Reference / Input / Output

CreateTransitGatewayPeering

Command API Reference / Input / Output

CreateTransitGatewayRouteTableAttachment

Command API Reference / Input / Output

CreateVpcAttachment

Command API Reference / Input / Output

DeleteAttachment

Command API Reference / Input / Output

DeleteConnection

Command API Reference / Input / Output

DeleteConnectPeer

Command API Reference / Input / Output

DeleteCoreNetwork

Command API Reference / Input / Output

DeleteCoreNetworkPolicyVersion

Command API Reference / Input / Output

DeleteDevice

Command API Reference / Input / Output

DeleteGlobalNetwork

Command API Reference / Input / Output

DeleteLink

Command API Reference / Input / Output

DeletePeering

Command API Reference / Input / Output

DeleteResourcePolicy

Command API Reference / Input / Output

DeleteSite

Command API Reference / Input / Output

DeregisterTransitGateway

Command API Reference / Input / Output

DescribeGlobalNetworks

Command API Reference / Input / Output

DisassociateConnectPeer

Command API Reference / Input / Output

DisassociateCustomerGateway

Command API Reference / Input / Output

DisassociateLink

Command API Reference / Input / Output

DisassociateTransitGatewayConnectPeer

Command API Reference / Input / Output

ExecuteCoreNetworkChangeSet

Command API Reference / Input / Output

GetConnectAttachment

Command API Reference / Input / Output

GetConnections

Command API Reference / Input / Output

GetConnectPeer

Command API Reference / Input / Output

GetConnectPeerAssociations

Command API Reference / Input / Output

GetCoreNetwork

Command API Reference / Input / Output

GetCoreNetworkChangeEvents

Command API Reference / Input / Output

GetCoreNetworkChangeSet

Command API Reference / Input / Output

GetCoreNetworkPolicy

Command API Reference / Input / Output

GetCustomerGatewayAssociations

Command API Reference / Input / Output

GetDevices

Command API Reference / Input / Output

GetLinkAssociations

Command API Reference / Input / Output

GetLinks

Command API Reference / Input / Output

GetNetworkResourceCounts

Command API Reference / Input / Output

GetNetworkResourceRelationships

Command API Reference / Input / Output

GetNetworkResources

Command API Reference / Input / Output

GetNetworkRoutes

Command API Reference / Input / Output

GetNetworkTelemetry

Command API Reference / Input / Output

GetResourcePolicy

Command API Reference / Input / Output

GetRouteAnalysis

Command API Reference / Input / Output

GetSites

Command API Reference / Input / Output

GetSiteToSiteVpnAttachment

Command API Reference / Input / Output

GetTransitGatewayConnectPeerAssociations

Command API Reference / Input / Output

GetTransitGatewayPeering

Command API Reference / Input / Output

GetTransitGatewayRegistrations

Command API Reference / Input / Output

GetTransitGatewayRouteTableAttachment

Command API Reference / Input / Output

GetVpcAttachment

Command API Reference / Input / Output

ListAttachments

Command API Reference / Input / Output

ListConnectPeers

Command API Reference / Input / Output

ListCoreNetworkPolicyVersions

Command API Reference / Input / Output

ListCoreNetworks

Command API Reference / Input / Output

ListOrganizationServiceAccessStatus

Command API Reference / Input / Output

ListPeerings

Command API Reference / Input / Output

ListTagsForResource

Command API Reference / Input / Output

PutCoreNetworkPolicy

Command API Reference / Input / Output

PutResourcePolicy

Command API Reference / Input / Output

RegisterTransitGateway

Command API Reference / Input / Output

RejectAttachment

Command API Reference / Input / Output

RestoreCoreNetworkPolicyVersion

Command API Reference / Input / Output

StartOrganizationServiceAccessUpdate

Command API Reference / Input / Output

StartRouteAnalysis

Command API Reference / Input / Output

TagResource

Command API Reference / Input / Output

UntagResource

Command API Reference / Input / Output

UpdateConnection

Command API Reference / Input / Output

UpdateCoreNetwork

Command API Reference / Input / Output

UpdateDevice

Command API Reference / Input / Output

UpdateGlobalNetwork

Command API Reference / Input / Output

UpdateLink

Command API Reference / Input / Output

UpdateNetworkResourceMetadata

Command API Reference / Input / Output

UpdateSite

Command API Reference / Input / Output

UpdateVpcAttachment

Command API Reference / Input / Output