Back to Aws Sdk Js V3

@aws-sdk/client-fms

clients/client-fms/README.md

3.1043.025.0 KB
Original Source
<!-- generated file, do not edit directly -->

@aws-sdk/client-fms

Description

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

<p>This is the <i>Firewall Manager API Reference</i>. This guide is for developers who need detailed information about the Firewall Manager API actions, data types, and errors. For detailed information about Firewall Manager features, see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/fms-chapter.html">Firewall Manager Developer Guide</a>.</p> <p>Some API actions require explicit resource permissions. For information, see the developer guide topic <a href="https://docs.aws.amazon.com/waf/latest/developerguide/fms-security_iam_service-with-iam.html#fms-security_iam_service-with-iam-roles-service">Service roles for Firewall Manager</a>. </p>

Installing

To install this package, use the CLI of your favorite package manager:

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

Getting Started

Import

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

js
// ES5 example
const { FMSClient, ListPoliciesCommand } = require("@aws-sdk/client-fms");
ts
// ES6+ example
import { FMSClient, ListPoliciesCommand } from "@aws-sdk/client-fms";

Usage

To send a request:

  • Instantiate a client with configuration (e.g. credentials, region).
  • Instantiate a command with input parameters.
  • Call the send operation on the client, providing the command object as input.
js
const client = new FMSClient({ region: "REGION" });

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

Async/await

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

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

Promises

You can also use Promise chaining.

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

Aggregated client

The aggregated client class is exported from the same package, but without the "Client" suffix.

FMS extends FMSClient and additionally supports all operations, waiters, and paginators as methods. This style may be familiar to you from the AWS SDK for JavaScript v2.

If you are bundling the AWS SDK, we recommend using only the bare-bones client (FMSClient). More details are in the blog post on modular packages in AWS SDK for JavaScript.

ts
import { FMS } from "@aws-sdk/client-fms";

const client = new FMS({ region: "REGION" });

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

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

// callbacks (not recommended).
client.listPolicies(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).

js
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;
   * }
   */
}

See also docs/ERROR_HANDLING.

Getting Help

Please use these community resources for getting help. We use 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-fms 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)

<details> <summary> AssociateAdminAccount </summary>

Command API Reference / Input / Output

</details> <details> <summary> AssociateThirdPartyFirewall </summary>

Command API Reference / Input / Output

</details> <details> <summary> BatchAssociateResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> BatchDisassociateResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteAppsList </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteNotificationChannel </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeletePolicy </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteProtocolsList </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteResourceSet </summary>

Command API Reference / Input / Output

</details> <details> <summary> DisassociateAdminAccount </summary>

Command API Reference / Input / Output

</details> <details> <summary> DisassociateThirdPartyFirewall </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetAdminAccount </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetAdminScope </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetAppsList </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetComplianceDetail </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetNotificationChannel </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetPolicy </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetProtectionStatus </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetProtocolsList </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetResourceSet </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetThirdPartyFirewallAssociationStatus </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetViolationDetails </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListAdminAccountsForOrganization </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListAdminsManagingAccount </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListAppsLists </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListComplianceStatus </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListDiscoveredResources </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListMemberAccounts </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListPolicies </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListProtocolsLists </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListResourceSetResources </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListResourceSets </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListTagsForResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListThirdPartyFirewallFirewallPolicies </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutAdminAccount </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutAppsList </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutNotificationChannel </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutPolicy </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutProtocolsList </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutResourceSet </summary>

Command API Reference / Input / Output

</details> <details> <summary> TagResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> UntagResource </summary>

Command API Reference / Input / Output

</details>