From ec0ecf75f9adc77ca80e4ad13c3eaa5ee96ac22c Mon Sep 17 00:00:00 2001 From: awstools Date: Fri, 22 Dec 2023 19:16:32 +0000 Subject: [PATCH] feat(client-networkmonitor): CloudWatch Network Monitor is a new service within CloudWatch that will help network administrators and operators continuously monitor network performance metrics such as round-trip-time and packet loss between their AWS-hosted applications and their on-premises locations. --- clients/client-networkmonitor/.gitignore | 9 + clients/client-networkmonitor/LICENSE | 201 ++ clients/client-networkmonitor/README.md | 309 ++ .../client-networkmonitor/api-extractor.json | 4 + clients/client-networkmonitor/package.json | 103 + .../src/NetworkMonitor.ts | 211 ++ .../src/NetworkMonitorClient.ts | 333 ++ .../src/commands/CreateMonitorCommand.ts | 178 ++ .../src/commands/CreateProbeCommand.ts | 183 ++ .../src/commands/DeleteMonitorCommand.ts | 150 + .../src/commands/DeleteProbeCommand.ts | 154 + .../src/commands/GetMonitorCommand.ts | 179 ++ .../src/commands/GetProbeCommand.ts | 167 + .../src/commands/ListMonitorsCommand.ts | 162 + .../commands/ListTagsForResourceCommand.ts | 159 + .../src/commands/TagResourceCommand.ts | 156 + .../src/commands/UntagResourceCommand.ts | 156 + .../src/commands/UpdateMonitorCommand.ts | 162 + .../src/commands/UpdateProbeCommand.ts | 175 ++ .../src/commands/index.ts | 13 + .../src/endpoint/EndpointParameters.ts | 34 + .../src/endpoint/endpointResolver.ts | 16 + .../src/endpoint/ruleset.ts | 32 + .../src/extensionConfiguration.ts | 12 + clients/client-networkmonitor/src/index.ts | 27 + .../models/NetworkMonitorServiceException.ts | 22 + .../client-networkmonitor/src/models/index.ts | 2 + .../src/models/models_0.ts | 1090 +++++++ .../src/pagination/Interfaces.ts | 11 + .../src/pagination/ListMonitorsPaginator.ts | 24 + .../src/pagination/index.ts | 3 + .../src/protocols/Aws_restJson1.ts | 1323 ++++++++ .../src/runtimeConfig.browser.ts | 44 + .../src/runtimeConfig.native.ts | 18 + .../src/runtimeConfig.shared.ts | 27 + .../src/runtimeConfig.ts | 61 + .../src/runtimeExtensions.ts | 45 + .../client-networkmonitor/tsconfig.cjs.json | 6 + .../client-networkmonitor/tsconfig.es.json | 8 + clients/client-networkmonitor/tsconfig.json | 13 + .../client-networkmonitor/tsconfig.types.json | 10 + .../aws-models/networkmonitor.json | 2699 +++++++++++++++++ 42 files changed, 8691 insertions(+) create mode 100644 clients/client-networkmonitor/.gitignore create mode 100644 clients/client-networkmonitor/LICENSE create mode 100644 clients/client-networkmonitor/README.md create mode 100644 clients/client-networkmonitor/api-extractor.json create mode 100644 clients/client-networkmonitor/package.json create mode 100644 clients/client-networkmonitor/src/NetworkMonitor.ts create mode 100644 clients/client-networkmonitor/src/NetworkMonitorClient.ts create mode 100644 clients/client-networkmonitor/src/commands/CreateMonitorCommand.ts create mode 100644 clients/client-networkmonitor/src/commands/CreateProbeCommand.ts create mode 100644 clients/client-networkmonitor/src/commands/DeleteMonitorCommand.ts create mode 100644 clients/client-networkmonitor/src/commands/DeleteProbeCommand.ts create mode 100644 clients/client-networkmonitor/src/commands/GetMonitorCommand.ts create mode 100644 clients/client-networkmonitor/src/commands/GetProbeCommand.ts create mode 100644 clients/client-networkmonitor/src/commands/ListMonitorsCommand.ts create mode 100644 clients/client-networkmonitor/src/commands/ListTagsForResourceCommand.ts create mode 100644 clients/client-networkmonitor/src/commands/TagResourceCommand.ts create mode 100644 clients/client-networkmonitor/src/commands/UntagResourceCommand.ts create mode 100644 clients/client-networkmonitor/src/commands/UpdateMonitorCommand.ts create mode 100644 clients/client-networkmonitor/src/commands/UpdateProbeCommand.ts create mode 100644 clients/client-networkmonitor/src/commands/index.ts create mode 100644 clients/client-networkmonitor/src/endpoint/EndpointParameters.ts create mode 100644 clients/client-networkmonitor/src/endpoint/endpointResolver.ts create mode 100644 clients/client-networkmonitor/src/endpoint/ruleset.ts create mode 100644 clients/client-networkmonitor/src/extensionConfiguration.ts create mode 100644 clients/client-networkmonitor/src/index.ts create mode 100644 clients/client-networkmonitor/src/models/NetworkMonitorServiceException.ts create mode 100644 clients/client-networkmonitor/src/models/index.ts create mode 100644 clients/client-networkmonitor/src/models/models_0.ts create mode 100644 clients/client-networkmonitor/src/pagination/Interfaces.ts create mode 100644 clients/client-networkmonitor/src/pagination/ListMonitorsPaginator.ts create mode 100644 clients/client-networkmonitor/src/pagination/index.ts create mode 100644 clients/client-networkmonitor/src/protocols/Aws_restJson1.ts create mode 100644 clients/client-networkmonitor/src/runtimeConfig.browser.ts create mode 100644 clients/client-networkmonitor/src/runtimeConfig.native.ts create mode 100644 clients/client-networkmonitor/src/runtimeConfig.shared.ts create mode 100644 clients/client-networkmonitor/src/runtimeConfig.ts create mode 100644 clients/client-networkmonitor/src/runtimeExtensions.ts create mode 100644 clients/client-networkmonitor/tsconfig.cjs.json create mode 100644 clients/client-networkmonitor/tsconfig.es.json create mode 100644 clients/client-networkmonitor/tsconfig.json create mode 100644 clients/client-networkmonitor/tsconfig.types.json create mode 100644 codegen/sdk-codegen/aws-models/networkmonitor.json diff --git a/clients/client-networkmonitor/.gitignore b/clients/client-networkmonitor/.gitignore new file mode 100644 index 000000000000..54f14c9aef25 --- /dev/null +++ b/clients/client-networkmonitor/.gitignore @@ -0,0 +1,9 @@ +/node_modules/ +/build/ +/coverage/ +/docs/ +/dist-* +*.tsbuildinfo +*.tgz +*.log +package-lock.json diff --git a/clients/client-networkmonitor/LICENSE b/clients/client-networkmonitor/LICENSE new file mode 100644 index 000000000000..5001cd317c44 --- /dev/null +++ b/clients/client-networkmonitor/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/clients/client-networkmonitor/README.md b/clients/client-networkmonitor/README.md new file mode 100644 index 000000000000..39c86f2d006f --- /dev/null +++ b/clients/client-networkmonitor/README.md @@ -0,0 +1,309 @@ + + +# @aws-sdk/client-networkmonitor + +## Description + +AWS SDK for JavaScript NetworkMonitor Client for Node.js, Browser and React Native. + +

Amazon CloudWatch Network Monitor is an Amazon Web Services active network monitoring +service that identifies if a network issues exists within the Amazon Web Services network +or your own company network. Within Network Monitor you'll choose the source VPCs and +subnets from the Amazon Web Services network in which you operate and then you'll choose +the destination IP addresses from your on-premises network. From these sources and +destinations, Network Monitor creates a monitor containing all the possible source and +destination combinations, each of which is called a probe, within a single monitor. +These probes then monitor network traffic to help you identify where network issues might be affecting your traffic.

+

For more information, see Using Amazon CloudWatch Network Monitor in the Amazon CloudWatch User Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-networkmonitor +using your favorite package manager: + +- `npm install @aws-sdk/client-networkmonitor` +- `yarn add @aws-sdk/client-networkmonitor` +- `pnpm add @aws-sdk/client-networkmonitor` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `NetworkMonitorClient` and +the commands you need, for example `ListMonitorsCommand`: + +```js +// ES5 example +const { NetworkMonitorClient, ListMonitorsCommand } = require("@aws-sdk/client-networkmonitor"); +``` + +```ts +// ES6+ example +import { NetworkMonitorClient, ListMonitorsCommand } from "@aws-sdk/client-networkmonitor"; +``` + +### 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. + +```js +// a client can be shared by different commands. +const client = new NetworkMonitorClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new ListMonitorsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/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. +} +``` + +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](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// 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](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-networkmonitor"; +const client = new AWS.NetworkMonitor({ region: "REGION" }); + +// async/await. +try { + const data = await client.listMonitors(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .listMonitors(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.listMonitors(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; + * } + */ +} +``` + +## 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. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-networkmonitor` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/main/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. + +## Client Commands (Operations List) + +
+ +CreateMonitor + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/networkmonitor/command/CreateMonitorCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-networkmonitor/Interface/CreateMonitorCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-networkmonitor/Interface/CreateMonitorCommandOutput/) + +
+
+ +CreateProbe + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/networkmonitor/command/CreateProbeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-networkmonitor/Interface/CreateProbeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-networkmonitor/Interface/CreateProbeCommandOutput/) + +
+
+ +DeleteMonitor + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/networkmonitor/command/DeleteMonitorCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-networkmonitor/Interface/DeleteMonitorCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-networkmonitor/Interface/DeleteMonitorCommandOutput/) + +
+
+ +DeleteProbe + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/networkmonitor/command/DeleteProbeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-networkmonitor/Interface/DeleteProbeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-networkmonitor/Interface/DeleteProbeCommandOutput/) + +
+
+ +GetMonitor + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/networkmonitor/command/GetMonitorCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-networkmonitor/Interface/GetMonitorCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-networkmonitor/Interface/GetMonitorCommandOutput/) + +
+
+ +GetProbe + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/networkmonitor/command/GetProbeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-networkmonitor/Interface/GetProbeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-networkmonitor/Interface/GetProbeCommandOutput/) + +
+
+ +ListMonitors + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/networkmonitor/command/ListMonitorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-networkmonitor/Interface/ListMonitorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-networkmonitor/Interface/ListMonitorsCommandOutput/) + +
+
+ +ListTagsForResource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/networkmonitor/command/ListTagsForResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-networkmonitor/Interface/ListTagsForResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-networkmonitor/Interface/ListTagsForResourceCommandOutput/) + +
+
+ +TagResource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/networkmonitor/command/TagResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-networkmonitor/Interface/TagResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-networkmonitor/Interface/TagResourceCommandOutput/) + +
+
+ +UntagResource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/networkmonitor/command/UntagResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-networkmonitor/Interface/UntagResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-networkmonitor/Interface/UntagResourceCommandOutput/) + +
+
+ +UpdateMonitor + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/networkmonitor/command/UpdateMonitorCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-networkmonitor/Interface/UpdateMonitorCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-networkmonitor/Interface/UpdateMonitorCommandOutput/) + +
+
+ +UpdateProbe + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/networkmonitor/command/UpdateProbeCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-networkmonitor/Interface/UpdateProbeCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-networkmonitor/Interface/UpdateProbeCommandOutput/) + +
diff --git a/clients/client-networkmonitor/api-extractor.json b/clients/client-networkmonitor/api-extractor.json new file mode 100644 index 000000000000..d5bf5ffeee85 --- /dev/null +++ b/clients/client-networkmonitor/api-extractor.json @@ -0,0 +1,4 @@ +{ + "extends": "../../api-extractor.json", + "mainEntryPointFilePath": "/dist-types/index.d.ts" +} diff --git a/clients/client-networkmonitor/package.json b/clients/client-networkmonitor/package.json new file mode 100644 index 000000000000..07c93b6da3e1 --- /dev/null +++ b/clients/client-networkmonitor/package.json @@ -0,0 +1,103 @@ +{ + "name": "@aws-sdk/client-networkmonitor", + "description": "AWS SDK for JavaScript Networkmonitor Client for Node.js, Browser and React Native", + "version": "3.0.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0", + "extract:docs": "api-extractor run --local", + "generate:client": "node ../../scripts/generate-clients/single-service --solo networkmonitor" + }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", + "sideEffects": false, + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/client-sts": "*", + "@aws-sdk/core": "*", + "@aws-sdk/credential-provider-node": "*", + "@aws-sdk/middleware-host-header": "*", + "@aws-sdk/middleware-logger": "*", + "@aws-sdk/middleware-recursion-detection": "*", + "@aws-sdk/middleware-signing": "*", + "@aws-sdk/middleware-user-agent": "*", + "@aws-sdk/region-config-resolver": "*", + "@aws-sdk/types": "*", + "@aws-sdk/util-endpoints": "*", + "@aws-sdk/util-user-agent-browser": "*", + "@aws-sdk/util-user-agent-node": "*", + "@smithy/config-resolver": "^2.0.21", + "@smithy/core": "^1.2.0", + "@smithy/fetch-http-handler": "^2.3.1", + "@smithy/hash-node": "^2.0.17", + "@smithy/invalid-dependency": "^2.0.15", + "@smithy/middleware-content-length": "^2.0.17", + "@smithy/middleware-endpoint": "^2.2.3", + "@smithy/middleware-retry": "^2.0.24", + "@smithy/middleware-serde": "^2.0.15", + "@smithy/middleware-stack": "^2.0.9", + "@smithy/node-config-provider": "^2.1.8", + "@smithy/node-http-handler": "^2.2.1", + "@smithy/protocol-http": "^3.0.11", + "@smithy/smithy-client": "^2.1.18", + "@smithy/types": "^2.7.0", + "@smithy/url-parser": "^2.0.15", + "@smithy/util-base64": "^2.0.1", + "@smithy/util-body-length-browser": "^2.0.1", + "@smithy/util-body-length-node": "^2.1.0", + "@smithy/util-defaults-mode-browser": "^2.0.22", + "@smithy/util-defaults-mode-node": "^2.0.29", + "@smithy/util-endpoints": "^1.0.7", + "@smithy/util-retry": "^2.0.8", + "@smithy/util-utf8": "^2.0.2", + "tslib": "^2.5.0", + "uuid": "^8.3.2" + }, + "devDependencies": { + "@smithy/service-client-documentation-generator": "^2.0.0", + "@tsconfig/node14": "1.0.3", + "@types/node": "^14.14.31", + "@types/uuid": "^8.3.0", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typescript": "~4.9.5" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*/**" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-networkmonitor", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "clients/client-networkmonitor" + } +} diff --git a/clients/client-networkmonitor/src/NetworkMonitor.ts b/clients/client-networkmonitor/src/NetworkMonitor.ts new file mode 100644 index 000000000000..9a87117a54cb --- /dev/null +++ b/clients/client-networkmonitor/src/NetworkMonitor.ts @@ -0,0 +1,211 @@ +// smithy-typescript generated code +import { createAggregatedClient } from "@smithy/smithy-client"; +import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types"; + +import { + CreateMonitorCommand, + CreateMonitorCommandInput, + CreateMonitorCommandOutput, +} from "./commands/CreateMonitorCommand"; +import { CreateProbeCommand, CreateProbeCommandInput, CreateProbeCommandOutput } from "./commands/CreateProbeCommand"; +import { + DeleteMonitorCommand, + DeleteMonitorCommandInput, + DeleteMonitorCommandOutput, +} from "./commands/DeleteMonitorCommand"; +import { DeleteProbeCommand, DeleteProbeCommandInput, DeleteProbeCommandOutput } from "./commands/DeleteProbeCommand"; +import { GetMonitorCommand, GetMonitorCommandInput, GetMonitorCommandOutput } from "./commands/GetMonitorCommand"; +import { GetProbeCommand, GetProbeCommandInput, GetProbeCommandOutput } from "./commands/GetProbeCommand"; +import { + ListMonitorsCommand, + ListMonitorsCommandInput, + ListMonitorsCommandOutput, +} from "./commands/ListMonitorsCommand"; +import { + ListTagsForResourceCommand, + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "./commands/ListTagsForResourceCommand"; +import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand"; +import { + UntagResourceCommand, + UntagResourceCommandInput, + UntagResourceCommandOutput, +} from "./commands/UntagResourceCommand"; +import { + UpdateMonitorCommand, + UpdateMonitorCommandInput, + UpdateMonitorCommandOutput, +} from "./commands/UpdateMonitorCommand"; +import { UpdateProbeCommand, UpdateProbeCommandInput, UpdateProbeCommandOutput } from "./commands/UpdateProbeCommand"; +import { NetworkMonitorClient, NetworkMonitorClientConfig } from "./NetworkMonitorClient"; + +const commands = { + CreateMonitorCommand, + CreateProbeCommand, + DeleteMonitorCommand, + DeleteProbeCommand, + GetMonitorCommand, + GetProbeCommand, + ListMonitorsCommand, + ListTagsForResourceCommand, + TagResourceCommand, + UntagResourceCommand, + UpdateMonitorCommand, + UpdateProbeCommand, +}; + +export interface NetworkMonitor { + /** + * @see {@link CreateMonitorCommand} + */ + createMonitor(args: CreateMonitorCommandInput, options?: __HttpHandlerOptions): Promise; + createMonitor(args: CreateMonitorCommandInput, cb: (err: any, data?: CreateMonitorCommandOutput) => void): void; + createMonitor( + args: CreateMonitorCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateMonitorCommandOutput) => void + ): void; + + /** + * @see {@link CreateProbeCommand} + */ + createProbe(args: CreateProbeCommandInput, options?: __HttpHandlerOptions): Promise; + createProbe(args: CreateProbeCommandInput, cb: (err: any, data?: CreateProbeCommandOutput) => void): void; + createProbe( + args: CreateProbeCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateProbeCommandOutput) => void + ): void; + + /** + * @see {@link DeleteMonitorCommand} + */ + deleteMonitor(args: DeleteMonitorCommandInput, options?: __HttpHandlerOptions): Promise; + deleteMonitor(args: DeleteMonitorCommandInput, cb: (err: any, data?: DeleteMonitorCommandOutput) => void): void; + deleteMonitor( + args: DeleteMonitorCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteMonitorCommandOutput) => void + ): void; + + /** + * @see {@link DeleteProbeCommand} + */ + deleteProbe(args: DeleteProbeCommandInput, options?: __HttpHandlerOptions): Promise; + deleteProbe(args: DeleteProbeCommandInput, cb: (err: any, data?: DeleteProbeCommandOutput) => void): void; + deleteProbe( + args: DeleteProbeCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteProbeCommandOutput) => void + ): void; + + /** + * @see {@link GetMonitorCommand} + */ + getMonitor(args: GetMonitorCommandInput, options?: __HttpHandlerOptions): Promise; + getMonitor(args: GetMonitorCommandInput, cb: (err: any, data?: GetMonitorCommandOutput) => void): void; + getMonitor( + args: GetMonitorCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetMonitorCommandOutput) => void + ): void; + + /** + * @see {@link GetProbeCommand} + */ + getProbe(args: GetProbeCommandInput, options?: __HttpHandlerOptions): Promise; + getProbe(args: GetProbeCommandInput, cb: (err: any, data?: GetProbeCommandOutput) => void): void; + getProbe( + args: GetProbeCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetProbeCommandOutput) => void + ): void; + + /** + * @see {@link ListMonitorsCommand} + */ + listMonitors(args: ListMonitorsCommandInput, options?: __HttpHandlerOptions): Promise; + listMonitors(args: ListMonitorsCommandInput, cb: (err: any, data?: ListMonitorsCommandOutput) => void): void; + listMonitors( + args: ListMonitorsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListMonitorsCommandOutput) => void + ): void; + + /** + * @see {@link ListTagsForResourceCommand} + */ + listTagsForResource( + args: ListTagsForResourceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listTagsForResource( + args: ListTagsForResourceCommandInput, + cb: (err: any, data?: ListTagsForResourceCommandOutput) => void + ): void; + listTagsForResource( + args: ListTagsForResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListTagsForResourceCommandOutput) => void + ): void; + + /** + * @see {@link TagResourceCommand} + */ + tagResource(args: TagResourceCommandInput, options?: __HttpHandlerOptions): Promise; + tagResource(args: TagResourceCommandInput, cb: (err: any, data?: TagResourceCommandOutput) => void): void; + tagResource( + args: TagResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: TagResourceCommandOutput) => void + ): void; + + /** + * @see {@link UntagResourceCommand} + */ + untagResource(args: UntagResourceCommandInput, options?: __HttpHandlerOptions): Promise; + untagResource(args: UntagResourceCommandInput, cb: (err: any, data?: UntagResourceCommandOutput) => void): void; + untagResource( + args: UntagResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UntagResourceCommandOutput) => void + ): void; + + /** + * @see {@link UpdateMonitorCommand} + */ + updateMonitor(args: UpdateMonitorCommandInput, options?: __HttpHandlerOptions): Promise; + updateMonitor(args: UpdateMonitorCommandInput, cb: (err: any, data?: UpdateMonitorCommandOutput) => void): void; + updateMonitor( + args: UpdateMonitorCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateMonitorCommandOutput) => void + ): void; + + /** + * @see {@link UpdateProbeCommand} + */ + updateProbe(args: UpdateProbeCommandInput, options?: __HttpHandlerOptions): Promise; + updateProbe(args: UpdateProbeCommandInput, cb: (err: any, data?: UpdateProbeCommandOutput) => void): void; + updateProbe( + args: UpdateProbeCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateProbeCommandOutput) => void + ): void; +} + +/** + * @public + *

Amazon CloudWatch Network Monitor is an Amazon Web Services active network monitoring + * service that identifies if a network issues exists within the Amazon Web Services network + * or your own company network. Within Network Monitor you'll choose the source VPCs and + * subnets from the Amazon Web Services network in which you operate and then you'll choose + * the destination IP addresses from your on-premises network. From these sources and + * destinations, Network Monitor creates a monitor containing all the possible source and + * destination combinations, each of which is called a probe, within a single monitor. + * These probes then monitor network traffic to help you identify where network issues might be affecting your traffic.

+ *

For more information, see Using Amazon CloudWatch Network Monitor in the Amazon CloudWatch User Guide.

+ */ +export class NetworkMonitor extends NetworkMonitorClient implements NetworkMonitor {} +createAggregatedClient(commands, NetworkMonitor); diff --git a/clients/client-networkmonitor/src/NetworkMonitorClient.ts b/clients/client-networkmonitor/src/NetworkMonitorClient.ts new file mode 100644 index 000000000000..753a17f144f0 --- /dev/null +++ b/clients/client-networkmonitor/src/NetworkMonitorClient.ts @@ -0,0 +1,333 @@ +// smithy-typescript generated code +import { + getHostHeaderPlugin, + HostHeaderInputConfig, + HostHeaderResolvedConfig, + resolveHostHeaderConfig, +} from "@aws-sdk/middleware-host-header"; +import { getLoggerPlugin } from "@aws-sdk/middleware-logger"; +import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection"; +import { + AwsAuthInputConfig, + AwsAuthResolvedConfig, + getAwsAuthPlugin, + resolveAwsAuthConfig, +} from "@aws-sdk/middleware-signing"; +import { + getUserAgentPlugin, + resolveUserAgentConfig, + UserAgentInputConfig, + UserAgentResolvedConfig, +} from "@aws-sdk/middleware-user-agent"; +import { Credentials as __Credentials } from "@aws-sdk/types"; +import { RegionInputConfig, RegionResolvedConfig, resolveRegionConfig } from "@smithy/config-resolver"; +import { getContentLengthPlugin } from "@smithy/middleware-content-length"; +import { EndpointInputConfig, EndpointResolvedConfig, resolveEndpointConfig } from "@smithy/middleware-endpoint"; +import { getRetryPlugin, resolveRetryConfig, RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry"; +import { HttpHandler as __HttpHandler } from "@smithy/protocol-http"; +import { + Client as __Client, + DefaultsMode as __DefaultsMode, + SmithyConfiguration as __SmithyConfiguration, + SmithyResolvedConfiguration as __SmithyResolvedConfiguration, +} from "@smithy/smithy-client"; +import { + BodyLengthCalculator as __BodyLengthCalculator, + CheckOptionalClientConfig as __CheckOptionalClientConfig, + ChecksumConstructor as __ChecksumConstructor, + Decoder as __Decoder, + Encoder as __Encoder, + EndpointV2 as __EndpointV2, + HashConstructor as __HashConstructor, + HttpHandlerOptions as __HttpHandlerOptions, + Logger as __Logger, + Provider as __Provider, + Provider, + StreamCollector as __StreamCollector, + UrlParser as __UrlParser, + UserAgent as __UserAgent, +} from "@smithy/types"; + +import { CreateMonitorCommandInput, CreateMonitorCommandOutput } from "./commands/CreateMonitorCommand"; +import { CreateProbeCommandInput, CreateProbeCommandOutput } from "./commands/CreateProbeCommand"; +import { DeleteMonitorCommandInput, DeleteMonitorCommandOutput } from "./commands/DeleteMonitorCommand"; +import { DeleteProbeCommandInput, DeleteProbeCommandOutput } from "./commands/DeleteProbeCommand"; +import { GetMonitorCommandInput, GetMonitorCommandOutput } from "./commands/GetMonitorCommand"; +import { GetProbeCommandInput, GetProbeCommandOutput } from "./commands/GetProbeCommand"; +import { ListMonitorsCommandInput, ListMonitorsCommandOutput } from "./commands/ListMonitorsCommand"; +import { + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "./commands/ListTagsForResourceCommand"; +import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand"; +import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand"; +import { UpdateMonitorCommandInput, UpdateMonitorCommandOutput } from "./commands/UpdateMonitorCommand"; +import { UpdateProbeCommandInput, UpdateProbeCommandOutput } from "./commands/UpdateProbeCommand"; +import { + ClientInputEndpointParameters, + ClientResolvedEndpointParameters, + EndpointParameters, + resolveClientEndpointParameters, +} from "./endpoint/EndpointParameters"; +import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig"; +import { resolveRuntimeExtensions, RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions"; + +export { __Client }; + +/** + * @public + */ +export type ServiceInputTypes = + | CreateMonitorCommandInput + | CreateProbeCommandInput + | DeleteMonitorCommandInput + | DeleteProbeCommandInput + | GetMonitorCommandInput + | GetProbeCommandInput + | ListMonitorsCommandInput + | ListTagsForResourceCommandInput + | TagResourceCommandInput + | UntagResourceCommandInput + | UpdateMonitorCommandInput + | UpdateProbeCommandInput; + +/** + * @public + */ +export type ServiceOutputTypes = + | CreateMonitorCommandOutput + | CreateProbeCommandOutput + | DeleteMonitorCommandOutput + | DeleteProbeCommandOutput + | GetMonitorCommandOutput + | GetProbeCommandOutput + | ListMonitorsCommandOutput + | ListTagsForResourceCommandOutput + | TagResourceCommandOutput + | UntagResourceCommandOutput + | UpdateMonitorCommandOutput + | UpdateProbeCommandOutput; + +/** + * @public + */ +export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> { + /** + * The HTTP handler to use. Fetch in browser and Https in Nodejs. + */ + requestHandler?: __HttpHandler; + + /** + * A constructor for a class implementing the {@link @smithy/types#ChecksumConstructor} interface + * that computes the SHA-256 HMAC or checksum of a string or binary buffer. + * @internal + */ + sha256?: __ChecksumConstructor | __HashConstructor; + + /** + * The function that will be used to convert strings into HTTP endpoints. + * @internal + */ + urlParser?: __UrlParser; + + /** + * A function that can calculate the length of a request body. + * @internal + */ + bodyLengthChecker?: __BodyLengthCalculator; + + /** + * A function that converts a stream into an array of bytes. + * @internal + */ + streamCollector?: __StreamCollector; + + /** + * The function that will be used to convert a base64-encoded string to a byte array. + * @internal + */ + base64Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a base64-encoded string. + * @internal + */ + base64Encoder?: __Encoder; + + /** + * The function that will be used to convert a UTF8-encoded string to a byte array. + * @internal + */ + utf8Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a UTF-8 encoded string. + * @internal + */ + utf8Encoder?: __Encoder; + + /** + * The runtime environment. + * @internal + */ + runtime?: string; + + /** + * Disable dynamically changing the endpoint of the client based on the hostPrefix + * trait of an operation. + */ + disableHostPrefix?: boolean; + + /** + * Unique service identifier. + * @internal + */ + serviceId?: string; + + /** + * Enables IPv6/IPv4 dualstack endpoint. + */ + useDualstackEndpoint?: boolean | __Provider; + + /** + * Enables FIPS compatible endpoints. + */ + useFipsEndpoint?: boolean | __Provider; + + /** + * The AWS region to which this client will send requests + */ + region?: string | __Provider; + + /** + * Default credentials provider; Not available in browser runtime. + * @internal + */ + credentialDefaultProvider?: (input: any) => __Provider<__Credentials>; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + + /** + * Value for how many times a request will be made at most in case of retry. + */ + maxAttempts?: number | __Provider; + + /** + * Specifies which retry algorithm to use. + * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-smithy-util-retry/Enum/RETRY_MODES/ + * + */ + retryMode?: string | __Provider; + + /** + * Optional logger for logging debug/info/warn/error. + */ + logger?: __Logger; + + /** + * Optional extensions + */ + extensions?: RuntimeExtension[]; + + /** + * The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK. + */ + defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>; +} + +/** + * @public + */ +export type NetworkMonitorClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & + ClientDefaults & + RegionInputConfig & + EndpointInputConfig & + RetryInputConfig & + HostHeaderInputConfig & + AwsAuthInputConfig & + UserAgentInputConfig & + ClientInputEndpointParameters; +/** + * @public + * + * The configuration interface of NetworkMonitorClient class constructor that set the region, credentials and other options. + */ +export interface NetworkMonitorClientConfig extends NetworkMonitorClientConfigType {} + +/** + * @public + */ +export type NetworkMonitorClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & + Required & + RuntimeExtensionsConfig & + RegionResolvedConfig & + EndpointResolvedConfig & + RetryResolvedConfig & + HostHeaderResolvedConfig & + AwsAuthResolvedConfig & + UserAgentResolvedConfig & + ClientResolvedEndpointParameters; +/** + * @public + * + * The resolved configuration interface of NetworkMonitorClient class. This is resolved and normalized from the {@link NetworkMonitorClientConfig | constructor configuration interface}. + */ +export interface NetworkMonitorClientResolvedConfig extends NetworkMonitorClientResolvedConfigType {} + +/** + * @public + *

Amazon CloudWatch Network Monitor is an Amazon Web Services active network monitoring + * service that identifies if a network issues exists within the Amazon Web Services network + * or your own company network. Within Network Monitor you'll choose the source VPCs and + * subnets from the Amazon Web Services network in which you operate and then you'll choose + * the destination IP addresses from your on-premises network. From these sources and + * destinations, Network Monitor creates a monitor containing all the possible source and + * destination combinations, each of which is called a probe, within a single monitor. + * These probes then monitor network traffic to help you identify where network issues might be affecting your traffic.

+ *

For more information, see Using Amazon CloudWatch Network Monitor in the Amazon CloudWatch User Guide.

+ */ +export class NetworkMonitorClient extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + NetworkMonitorClientResolvedConfig +> { + /** + * The resolved configuration of NetworkMonitorClient class. This is resolved and normalized from the {@link NetworkMonitorClientConfig | constructor configuration interface}. + */ + readonly config: NetworkMonitorClientResolvedConfig; + + constructor(...[configuration]: __CheckOptionalClientConfig) { + const _config_0 = __getRuntimeConfig(configuration || {}); + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = resolveRegionConfig(_config_1); + const _config_3 = resolveEndpointConfig(_config_2); + const _config_4 = resolveRetryConfig(_config_3); + const _config_5 = resolveHostHeaderConfig(_config_4); + const _config_6 = resolveAwsAuthConfig(_config_5); + const _config_7 = resolveUserAgentConfig(_config_6); + const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []); + super(_config_8); + this.config = _config_8; + this.middlewareStack.use(getRetryPlugin(this.config)); + this.middlewareStack.use(getContentLengthPlugin(this.config)); + this.middlewareStack.use(getHostHeaderPlugin(this.config)); + this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getRecursionDetectionPlugin(this.config)); + this.middlewareStack.use(getAwsAuthPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); + } + + /** + * Destroy underlying resources, like sockets. It's usually not necessary to do this. + * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed. + * Otherwise, sockets might stay open for quite a long time before the server terminates them. + */ + destroy(): void { + super.destroy(); + } +} diff --git a/clients/client-networkmonitor/src/commands/CreateMonitorCommand.ts b/clients/client-networkmonitor/src/commands/CreateMonitorCommand.ts new file mode 100644 index 000000000000..a5aca68d35e4 --- /dev/null +++ b/clients/client-networkmonitor/src/commands/CreateMonitorCommand.ts @@ -0,0 +1,178 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { CreateMonitorInput, CreateMonitorOutput } from "../models/models_0"; +import { NetworkMonitorClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../NetworkMonitorClient"; +import { de_CreateMonitorCommand, se_CreateMonitorCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link CreateMonitorCommand}. + */ +export interface CreateMonitorCommandInput extends CreateMonitorInput {} +/** + * @public + * + * The output of {@link CreateMonitorCommand}. + */ +export interface CreateMonitorCommandOutput extends CreateMonitorOutput, __MetadataBearer {} + +/** + * @public + *

Creates a monitor between a source subnet and destination IP address. Within a monitor you'll create one or more probes that monitor network traffic between your source Amazon Web Services VPC subnets and your destination IP addresses. Each probe then aggregates and sends metrics to Amazon CloudWatch.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { NetworkMonitorClient, CreateMonitorCommand } from "@aws-sdk/client-networkmonitor"; // ES Modules import + * // const { NetworkMonitorClient, CreateMonitorCommand } = require("@aws-sdk/client-networkmonitor"); // CommonJS import + * const client = new NetworkMonitorClient(config); + * const input = { // CreateMonitorInput + * monitorName: "STRING_VALUE", // required + * probes: [ // CreateMonitorProbeInputList + * { // CreateMonitorProbeInput + * sourceArn: "STRING_VALUE", // required + * destination: "STRING_VALUE", // required + * destinationPort: Number("int"), + * protocol: "TCP" || "ICMP", // required + * packetSize: Number("int"), + * probeTags: { // TagMap + * "": "STRING_VALUE", + * }, + * }, + * ], + * aggregationPeriod: Number("long"), + * clientToken: "STRING_VALUE", + * tags: { + * "": "STRING_VALUE", + * }, + * }; + * const command = new CreateMonitorCommand(input); + * const response = await client.send(command); + * // { // CreateMonitorOutput + * // monitorArn: "STRING_VALUE", // required + * // monitorName: "STRING_VALUE", // required + * // state: "PENDING" || "ACTIVE" || "INACTIVE" || "ERROR" || "DELETING", // required + * // aggregationPeriod: Number("long"), + * // tags: { // TagMap + * // "": "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param CreateMonitorCommandInput - {@link CreateMonitorCommandInput} + * @returns {@link CreateMonitorCommandOutput} + * @see {@link CreateMonitorCommandInput} for command's `input` shape. + * @see {@link CreateMonitorCommandOutput} for command's `response` shape. + * @see {@link NetworkMonitorClientResolvedConfig | config} for NetworkMonitorClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

+ * + * @throws {@link ConflictException} (client fault) + *

This operation attempted to create a resource that already exists.

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing has failed because of an unknown error, exception or failure.

+ * + * @throws {@link ServiceQuotaExceededException} (client fault) + *

This request exceeds a service quota.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling

+ * + * @throws {@link ValidationException} (client fault) + *

One of the parameters for the request is not valid.

+ * + * @throws {@link NetworkMonitorServiceException} + *

Base exception class for all service exceptions from NetworkMonitor service.

+ * + */ +export class CreateMonitorCommand extends $Command< + CreateMonitorCommandInput, + CreateMonitorCommandOutput, + NetworkMonitorClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: CreateMonitorCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: NetworkMonitorClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, CreateMonitorCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "NetworkMonitorClient"; + const commandName = "CreateMonitorCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "NetworkMonitor", + operation: "CreateMonitor", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: CreateMonitorCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_CreateMonitorCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_CreateMonitorCommand(output, context); + } +} diff --git a/clients/client-networkmonitor/src/commands/CreateProbeCommand.ts b/clients/client-networkmonitor/src/commands/CreateProbeCommand.ts new file mode 100644 index 000000000000..1313901ef616 --- /dev/null +++ b/clients/client-networkmonitor/src/commands/CreateProbeCommand.ts @@ -0,0 +1,183 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { CreateProbeInput, CreateProbeOutput } from "../models/models_0"; +import { NetworkMonitorClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../NetworkMonitorClient"; +import { de_CreateProbeCommand, se_CreateProbeCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link CreateProbeCommand}. + */ +export interface CreateProbeCommandInput extends CreateProbeInput {} +/** + * @public + * + * The output of {@link CreateProbeCommand}. + */ +export interface CreateProbeCommandOutput extends CreateProbeOutput, __MetadataBearer {} + +/** + * @public + *

Create a probe within a monitor. Once you create a probe, and it begins monitoring your network traffic, you'll incur billing charges for that probe.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { NetworkMonitorClient, CreateProbeCommand } from "@aws-sdk/client-networkmonitor"; // ES Modules import + * // const { NetworkMonitorClient, CreateProbeCommand } = require("@aws-sdk/client-networkmonitor"); // CommonJS import + * const client = new NetworkMonitorClient(config); + * const input = { // CreateProbeInput + * monitorName: "STRING_VALUE", // required + * probe: { // ProbeInput + * sourceArn: "STRING_VALUE", // required + * destination: "STRING_VALUE", // required + * destinationPort: Number("int"), + * protocol: "TCP" || "ICMP", // required + * packetSize: Number("int"), + * tags: { // TagMap + * "": "STRING_VALUE", + * }, + * }, + * clientToken: "STRING_VALUE", + * tags: { + * "": "STRING_VALUE", + * }, + * }; + * const command = new CreateProbeCommand(input); + * const response = await client.send(command); + * // { // CreateProbeOutput + * // probeId: "STRING_VALUE", + * // probeArn: "STRING_VALUE", + * // sourceArn: "STRING_VALUE", // required + * // destination: "STRING_VALUE", // required + * // destinationPort: Number("int"), + * // protocol: "TCP" || "ICMP", // required + * // packetSize: Number("int"), + * // addressFamily: "IPV4" || "IPV6", + * // vpcId: "STRING_VALUE", + * // state: "PENDING" || "ACTIVE" || "INACTIVE" || "ERROR" || "DELETING" || "DELETED", + * // createdAt: new Date("TIMESTAMP"), + * // modifiedAt: new Date("TIMESTAMP"), + * // tags: { // TagMap + * // "": "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param CreateProbeCommandInput - {@link CreateProbeCommandInput} + * @returns {@link CreateProbeCommandOutput} + * @see {@link CreateProbeCommandInput} for command's `input` shape. + * @see {@link CreateProbeCommandOutput} for command's `response` shape. + * @see {@link NetworkMonitorClientResolvedConfig | config} for NetworkMonitorClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing has failed because of an unknown error, exception or failure.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The specified resource does not exist.

+ * + * @throws {@link ServiceQuotaExceededException} (client fault) + *

This request exceeds a service quota.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling

+ * + * @throws {@link ValidationException} (client fault) + *

One of the parameters for the request is not valid.

+ * + * @throws {@link NetworkMonitorServiceException} + *

Base exception class for all service exceptions from NetworkMonitor service.

+ * + */ +export class CreateProbeCommand extends $Command< + CreateProbeCommandInput, + CreateProbeCommandOutput, + NetworkMonitorClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: CreateProbeCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: NetworkMonitorClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, CreateProbeCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "NetworkMonitorClient"; + const commandName = "CreateProbeCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "NetworkMonitor", + operation: "CreateProbe", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: CreateProbeCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_CreateProbeCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_CreateProbeCommand(output, context); + } +} diff --git a/clients/client-networkmonitor/src/commands/DeleteMonitorCommand.ts b/clients/client-networkmonitor/src/commands/DeleteMonitorCommand.ts new file mode 100644 index 000000000000..81bd807bff67 --- /dev/null +++ b/clients/client-networkmonitor/src/commands/DeleteMonitorCommand.ts @@ -0,0 +1,150 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { DeleteMonitorInput, DeleteMonitorOutput } from "../models/models_0"; +import { NetworkMonitorClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../NetworkMonitorClient"; +import { de_DeleteMonitorCommand, se_DeleteMonitorCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link DeleteMonitorCommand}. + */ +export interface DeleteMonitorCommandInput extends DeleteMonitorInput {} +/** + * @public + * + * The output of {@link DeleteMonitorCommand}. + */ +export interface DeleteMonitorCommandOutput extends DeleteMonitorOutput, __MetadataBearer {} + +/** + * @public + *

Deletes a specified monitor.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { NetworkMonitorClient, DeleteMonitorCommand } from "@aws-sdk/client-networkmonitor"; // ES Modules import + * // const { NetworkMonitorClient, DeleteMonitorCommand } = require("@aws-sdk/client-networkmonitor"); // CommonJS import + * const client = new NetworkMonitorClient(config); + * const input = { // DeleteMonitorInput + * monitorName: "STRING_VALUE", // required + * }; + * const command = new DeleteMonitorCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param DeleteMonitorCommandInput - {@link DeleteMonitorCommandInput} + * @returns {@link DeleteMonitorCommandOutput} + * @see {@link DeleteMonitorCommandInput} for command's `input` shape. + * @see {@link DeleteMonitorCommandOutput} for command's `response` shape. + * @see {@link NetworkMonitorClientResolvedConfig | config} for NetworkMonitorClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing has failed because of an unknown error, exception or failure.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The specified resource does not exist.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling

+ * + * @throws {@link ValidationException} (client fault) + *

One of the parameters for the request is not valid.

+ * + * @throws {@link NetworkMonitorServiceException} + *

Base exception class for all service exceptions from NetworkMonitor service.

+ * + */ +export class DeleteMonitorCommand extends $Command< + DeleteMonitorCommandInput, + DeleteMonitorCommandOutput, + NetworkMonitorClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: DeleteMonitorCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: NetworkMonitorClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, DeleteMonitorCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "NetworkMonitorClient"; + const commandName = "DeleteMonitorCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "NetworkMonitor", + operation: "DeleteMonitor", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: DeleteMonitorCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_DeleteMonitorCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_DeleteMonitorCommand(output, context); + } +} diff --git a/clients/client-networkmonitor/src/commands/DeleteProbeCommand.ts b/clients/client-networkmonitor/src/commands/DeleteProbeCommand.ts new file mode 100644 index 000000000000..373814b979bf --- /dev/null +++ b/clients/client-networkmonitor/src/commands/DeleteProbeCommand.ts @@ -0,0 +1,154 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { DeleteProbeInput, DeleteProbeOutput } from "../models/models_0"; +import { NetworkMonitorClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../NetworkMonitorClient"; +import { de_DeleteProbeCommand, se_DeleteProbeCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link DeleteProbeCommand}. + */ +export interface DeleteProbeCommandInput extends DeleteProbeInput {} +/** + * @public + * + * The output of {@link DeleteProbeCommand}. + */ +export interface DeleteProbeCommandOutput extends DeleteProbeOutput, __MetadataBearer {} + +/** + * @public + *

Deletes the specified monitor. Once a probe is deleted you'll no longer incur any billing fees for that probe.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { NetworkMonitorClient, DeleteProbeCommand } from "@aws-sdk/client-networkmonitor"; // ES Modules import + * // const { NetworkMonitorClient, DeleteProbeCommand } = require("@aws-sdk/client-networkmonitor"); // CommonJS import + * const client = new NetworkMonitorClient(config); + * const input = { // DeleteProbeInput + * monitorName: "STRING_VALUE", // required + * probeId: "STRING_VALUE", // required + * }; + * const command = new DeleteProbeCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param DeleteProbeCommandInput - {@link DeleteProbeCommandInput} + * @returns {@link DeleteProbeCommandOutput} + * @see {@link DeleteProbeCommandInput} for command's `input` shape. + * @see {@link DeleteProbeCommandOutput} for command's `response` shape. + * @see {@link NetworkMonitorClientResolvedConfig | config} for NetworkMonitorClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing has failed because of an unknown error, exception or failure.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The specified resource does not exist.

+ * + * @throws {@link ServiceQuotaExceededException} (client fault) + *

This request exceeds a service quota.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling

+ * + * @throws {@link ValidationException} (client fault) + *

One of the parameters for the request is not valid.

+ * + * @throws {@link NetworkMonitorServiceException} + *

Base exception class for all service exceptions from NetworkMonitor service.

+ * + */ +export class DeleteProbeCommand extends $Command< + DeleteProbeCommandInput, + DeleteProbeCommandOutput, + NetworkMonitorClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: DeleteProbeCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: NetworkMonitorClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, DeleteProbeCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "NetworkMonitorClient"; + const commandName = "DeleteProbeCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "NetworkMonitor", + operation: "DeleteProbe", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: DeleteProbeCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_DeleteProbeCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_DeleteProbeCommand(output, context); + } +} diff --git a/clients/client-networkmonitor/src/commands/GetMonitorCommand.ts b/clients/client-networkmonitor/src/commands/GetMonitorCommand.ts new file mode 100644 index 000000000000..2a4116b88ff1 --- /dev/null +++ b/clients/client-networkmonitor/src/commands/GetMonitorCommand.ts @@ -0,0 +1,179 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { GetMonitorInput, GetMonitorOutput } from "../models/models_0"; +import { NetworkMonitorClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../NetworkMonitorClient"; +import { de_GetMonitorCommand, se_GetMonitorCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link GetMonitorCommand}. + */ +export interface GetMonitorCommandInput extends GetMonitorInput {} +/** + * @public + * + * The output of {@link GetMonitorCommand}. + */ +export interface GetMonitorCommandOutput extends GetMonitorOutput, __MetadataBearer {} + +/** + * @public + *

Returns details about a specific monitor.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { NetworkMonitorClient, GetMonitorCommand } from "@aws-sdk/client-networkmonitor"; // ES Modules import + * // const { NetworkMonitorClient, GetMonitorCommand } = require("@aws-sdk/client-networkmonitor"); // CommonJS import + * const client = new NetworkMonitorClient(config); + * const input = { // GetMonitorInput + * monitorName: "STRING_VALUE", // required + * }; + * const command = new GetMonitorCommand(input); + * const response = await client.send(command); + * // { // GetMonitorOutput + * // monitorArn: "STRING_VALUE", // required + * // monitorName: "STRING_VALUE", // required + * // state: "PENDING" || "ACTIVE" || "INACTIVE" || "ERROR" || "DELETING", // required + * // aggregationPeriod: Number("long"), // required + * // tags: { // TagMap + * // "": "STRING_VALUE", + * // }, + * // probes: [ // ProbeList + * // { // Probe + * // probeId: "STRING_VALUE", + * // probeArn: "STRING_VALUE", + * // sourceArn: "STRING_VALUE", // required + * // destination: "STRING_VALUE", // required + * // destinationPort: Number("int"), + * // protocol: "TCP" || "ICMP", // required + * // packetSize: Number("int"), + * // addressFamily: "IPV4" || "IPV6", + * // vpcId: "STRING_VALUE", + * // state: "PENDING" || "ACTIVE" || "INACTIVE" || "ERROR" || "DELETING" || "DELETED", + * // createdAt: new Date("TIMESTAMP"), + * // modifiedAt: new Date("TIMESTAMP"), + * // tags: { + * // "": "STRING_VALUE", + * // }, + * // }, + * // ], + * // createdAt: new Date("TIMESTAMP"), // required + * // modifiedAt: new Date("TIMESTAMP"), // required + * // }; + * + * ``` + * + * @param GetMonitorCommandInput - {@link GetMonitorCommandInput} + * @returns {@link GetMonitorCommandOutput} + * @see {@link GetMonitorCommandInput} for command's `input` shape. + * @see {@link GetMonitorCommandOutput} for command's `response` shape. + * @see {@link NetworkMonitorClientResolvedConfig | config} for NetworkMonitorClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing has failed because of an unknown error, exception or failure.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The specified resource does not exist.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling

+ * + * @throws {@link ValidationException} (client fault) + *

One of the parameters for the request is not valid.

+ * + * @throws {@link NetworkMonitorServiceException} + *

Base exception class for all service exceptions from NetworkMonitor service.

+ * + */ +export class GetMonitorCommand extends $Command< + GetMonitorCommandInput, + GetMonitorCommandOutput, + NetworkMonitorClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: GetMonitorCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: NetworkMonitorClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, GetMonitorCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "NetworkMonitorClient"; + const commandName = "GetMonitorCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "NetworkMonitor", + operation: "GetMonitor", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: GetMonitorCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_GetMonitorCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_GetMonitorCommand(output, context); + } +} diff --git a/clients/client-networkmonitor/src/commands/GetProbeCommand.ts b/clients/client-networkmonitor/src/commands/GetProbeCommand.ts new file mode 100644 index 000000000000..b22d57fdebba --- /dev/null +++ b/clients/client-networkmonitor/src/commands/GetProbeCommand.ts @@ -0,0 +1,167 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { GetProbeInput, GetProbeOutput } from "../models/models_0"; +import { NetworkMonitorClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../NetworkMonitorClient"; +import { de_GetProbeCommand, se_GetProbeCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link GetProbeCommand}. + */ +export interface GetProbeCommandInput extends GetProbeInput {} +/** + * @public + * + * The output of {@link GetProbeCommand}. + */ +export interface GetProbeCommandOutput extends GetProbeOutput, __MetadataBearer {} + +/** + * @public + *

Returns the details about a probe. You'll need both the monitorName and probeId.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { NetworkMonitorClient, GetProbeCommand } from "@aws-sdk/client-networkmonitor"; // ES Modules import + * // const { NetworkMonitorClient, GetProbeCommand } = require("@aws-sdk/client-networkmonitor"); // CommonJS import + * const client = new NetworkMonitorClient(config); + * const input = { // GetProbeInput + * monitorName: "STRING_VALUE", // required + * probeId: "STRING_VALUE", // required + * }; + * const command = new GetProbeCommand(input); + * const response = await client.send(command); + * // { // GetProbeOutput + * // probeId: "STRING_VALUE", + * // probeArn: "STRING_VALUE", + * // sourceArn: "STRING_VALUE", // required + * // destination: "STRING_VALUE", // required + * // destinationPort: Number("int"), + * // protocol: "TCP" || "ICMP", // required + * // packetSize: Number("int"), + * // addressFamily: "IPV4" || "IPV6", + * // vpcId: "STRING_VALUE", + * // state: "PENDING" || "ACTIVE" || "INACTIVE" || "ERROR" || "DELETING" || "DELETED", + * // createdAt: new Date("TIMESTAMP"), + * // modifiedAt: new Date("TIMESTAMP"), + * // tags: { // TagMap + * // "": "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param GetProbeCommandInput - {@link GetProbeCommandInput} + * @returns {@link GetProbeCommandOutput} + * @see {@link GetProbeCommandInput} for command's `input` shape. + * @see {@link GetProbeCommandOutput} for command's `response` shape. + * @see {@link NetworkMonitorClientResolvedConfig | config} for NetworkMonitorClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing has failed because of an unknown error, exception or failure.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The specified resource does not exist.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling

+ * + * @throws {@link ValidationException} (client fault) + *

One of the parameters for the request is not valid.

+ * + * @throws {@link NetworkMonitorServiceException} + *

Base exception class for all service exceptions from NetworkMonitor service.

+ * + */ +export class GetProbeCommand extends $Command< + GetProbeCommandInput, + GetProbeCommandOutput, + NetworkMonitorClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: GetProbeCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: NetworkMonitorClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, GetProbeCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "NetworkMonitorClient"; + const commandName = "GetProbeCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "NetworkMonitor", + operation: "GetProbe", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: GetProbeCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_GetProbeCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_GetProbeCommand(output, context); + } +} diff --git a/clients/client-networkmonitor/src/commands/ListMonitorsCommand.ts b/clients/client-networkmonitor/src/commands/ListMonitorsCommand.ts new file mode 100644 index 000000000000..4adee39d381b --- /dev/null +++ b/clients/client-networkmonitor/src/commands/ListMonitorsCommand.ts @@ -0,0 +1,162 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { ListMonitorsInput, ListMonitorsOutput } from "../models/models_0"; +import { NetworkMonitorClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../NetworkMonitorClient"; +import { de_ListMonitorsCommand, se_ListMonitorsCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListMonitorsCommand}. + */ +export interface ListMonitorsCommandInput extends ListMonitorsInput {} +/** + * @public + * + * The output of {@link ListMonitorsCommand}. + */ +export interface ListMonitorsCommandOutput extends ListMonitorsOutput, __MetadataBearer {} + +/** + * @public + *

Returns a list of all of your monitors.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { NetworkMonitorClient, ListMonitorsCommand } from "@aws-sdk/client-networkmonitor"; // ES Modules import + * // const { NetworkMonitorClient, ListMonitorsCommand } = require("@aws-sdk/client-networkmonitor"); // CommonJS import + * const client = new NetworkMonitorClient(config); + * const input = { // ListMonitorsInput + * nextToken: "STRING_VALUE", + * maxResults: Number("int"), + * state: "STRING_VALUE", + * }; + * const command = new ListMonitorsCommand(input); + * const response = await client.send(command); + * // { // ListMonitorsOutput + * // monitors: [ // MonitorList // required + * // { // MonitorSummary + * // monitorArn: "STRING_VALUE", // required + * // monitorName: "STRING_VALUE", // required + * // state: "PENDING" || "ACTIVE" || "INACTIVE" || "ERROR" || "DELETING", // required + * // aggregationPeriod: Number("long"), + * // tags: { // TagMap + * // "": "STRING_VALUE", + * // }, + * // }, + * // ], + * // nextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListMonitorsCommandInput - {@link ListMonitorsCommandInput} + * @returns {@link ListMonitorsCommandOutput} + * @see {@link ListMonitorsCommandInput} for command's `input` shape. + * @see {@link ListMonitorsCommandOutput} for command's `response` shape. + * @see {@link NetworkMonitorClientResolvedConfig | config} for NetworkMonitorClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing has failed because of an unknown error, exception or failure.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling

+ * + * @throws {@link ValidationException} (client fault) + *

One of the parameters for the request is not valid.

+ * + * @throws {@link NetworkMonitorServiceException} + *

Base exception class for all service exceptions from NetworkMonitor service.

+ * + */ +export class ListMonitorsCommand extends $Command< + ListMonitorsCommandInput, + ListMonitorsCommandOutput, + NetworkMonitorClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListMonitorsCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: NetworkMonitorClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, ListMonitorsCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "NetworkMonitorClient"; + const commandName = "ListMonitorsCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "NetworkMonitor", + operation: "ListMonitors", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ListMonitorsCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ListMonitorsCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_ListMonitorsCommand(output, context); + } +} diff --git a/clients/client-networkmonitor/src/commands/ListTagsForResourceCommand.ts b/clients/client-networkmonitor/src/commands/ListTagsForResourceCommand.ts new file mode 100644 index 000000000000..78c430642c35 --- /dev/null +++ b/clients/client-networkmonitor/src/commands/ListTagsForResourceCommand.ts @@ -0,0 +1,159 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { ListTagsForResourceInput, ListTagsForResourceOutput } from "../models/models_0"; +import { NetworkMonitorClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../NetworkMonitorClient"; +import { de_ListTagsForResourceCommand, se_ListTagsForResourceCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListTagsForResourceCommand}. + */ +export interface ListTagsForResourceCommandInput extends ListTagsForResourceInput {} +/** + * @public + * + * The output of {@link ListTagsForResourceCommand}. + */ +export interface ListTagsForResourceCommandOutput extends ListTagsForResourceOutput, __MetadataBearer {} + +/** + * @public + *

Lists the tags assigned to this resource.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { NetworkMonitorClient, ListTagsForResourceCommand } from "@aws-sdk/client-networkmonitor"; // ES Modules import + * // const { NetworkMonitorClient, ListTagsForResourceCommand } = require("@aws-sdk/client-networkmonitor"); // CommonJS import + * const client = new NetworkMonitorClient(config); + * const input = { // ListTagsForResourceInput + * resourceArn: "STRING_VALUE", // required + * }; + * const command = new ListTagsForResourceCommand(input); + * const response = await client.send(command); + * // { // ListTagsForResourceOutput + * // tags: { // TagMap + * // "": "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param ListTagsForResourceCommandInput - {@link ListTagsForResourceCommandInput} + * @returns {@link ListTagsForResourceCommandOutput} + * @see {@link ListTagsForResourceCommandInput} for command's `input` shape. + * @see {@link ListTagsForResourceCommandOutput} for command's `response` shape. + * @see {@link NetworkMonitorClientResolvedConfig | config} for NetworkMonitorClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

+ * + * @throws {@link ConflictException} (client fault) + *

This operation attempted to create a resource that already exists.

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing has failed because of an unknown error, exception or failure.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The specified resource does not exist.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling

+ * + * @throws {@link ValidationException} (client fault) + *

One of the parameters for the request is not valid.

+ * + * @throws {@link NetworkMonitorServiceException} + *

Base exception class for all service exceptions from NetworkMonitor service.

+ * + */ +export class ListTagsForResourceCommand extends $Command< + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, + NetworkMonitorClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListTagsForResourceCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: NetworkMonitorClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, ListTagsForResourceCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "NetworkMonitorClient"; + const commandName = "ListTagsForResourceCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "NetworkMonitor", + operation: "ListTagsForResource", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ListTagsForResourceCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ListTagsForResourceCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_ListTagsForResourceCommand(output, context); + } +} diff --git a/clients/client-networkmonitor/src/commands/TagResourceCommand.ts b/clients/client-networkmonitor/src/commands/TagResourceCommand.ts new file mode 100644 index 000000000000..f0e3c3e028c2 --- /dev/null +++ b/clients/client-networkmonitor/src/commands/TagResourceCommand.ts @@ -0,0 +1,156 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { TagResourceInput, TagResourceOutput } from "../models/models_0"; +import { NetworkMonitorClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../NetworkMonitorClient"; +import { de_TagResourceCommand, se_TagResourceCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link TagResourceCommand}. + */ +export interface TagResourceCommandInput extends TagResourceInput {} +/** + * @public + * + * The output of {@link TagResourceCommand}. + */ +export interface TagResourceCommandOutput extends TagResourceOutput, __MetadataBearer {} + +/** + * @public + *

Adds key-value pairs to a monitor or probe.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { NetworkMonitorClient, TagResourceCommand } from "@aws-sdk/client-networkmonitor"; // ES Modules import + * // const { NetworkMonitorClient, TagResourceCommand } = require("@aws-sdk/client-networkmonitor"); // CommonJS import + * const client = new NetworkMonitorClient(config); + * const input = { // TagResourceInput + * resourceArn: "STRING_VALUE", // required + * tags: { // TagMap // required + * "": "STRING_VALUE", + * }, + * }; + * const command = new TagResourceCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param TagResourceCommandInput - {@link TagResourceCommandInput} + * @returns {@link TagResourceCommandOutput} + * @see {@link TagResourceCommandInput} for command's `input` shape. + * @see {@link TagResourceCommandOutput} for command's `response` shape. + * @see {@link NetworkMonitorClientResolvedConfig | config} for NetworkMonitorClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

+ * + * @throws {@link ConflictException} (client fault) + *

This operation attempted to create a resource that already exists.

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing has failed because of an unknown error, exception or failure.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The specified resource does not exist.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling

+ * + * @throws {@link ValidationException} (client fault) + *

One of the parameters for the request is not valid.

+ * + * @throws {@link NetworkMonitorServiceException} + *

Base exception class for all service exceptions from NetworkMonitor service.

+ * + */ +export class TagResourceCommand extends $Command< + TagResourceCommandInput, + TagResourceCommandOutput, + NetworkMonitorClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: TagResourceCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: NetworkMonitorClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, TagResourceCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "NetworkMonitorClient"; + const commandName = "TagResourceCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "NetworkMonitor", + operation: "TagResource", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: TagResourceCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_TagResourceCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_TagResourceCommand(output, context); + } +} diff --git a/clients/client-networkmonitor/src/commands/UntagResourceCommand.ts b/clients/client-networkmonitor/src/commands/UntagResourceCommand.ts new file mode 100644 index 000000000000..75deb46afef7 --- /dev/null +++ b/clients/client-networkmonitor/src/commands/UntagResourceCommand.ts @@ -0,0 +1,156 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { UntagResourceInput, UntagResourceOutput } from "../models/models_0"; +import { NetworkMonitorClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../NetworkMonitorClient"; +import { de_UntagResourceCommand, se_UntagResourceCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link UntagResourceCommand}. + */ +export interface UntagResourceCommandInput extends UntagResourceInput {} +/** + * @public + * + * The output of {@link UntagResourceCommand}. + */ +export interface UntagResourceCommandOutput extends UntagResourceOutput, __MetadataBearer {} + +/** + * @public + *

Removes a key-value pair from a monitor or probe.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { NetworkMonitorClient, UntagResourceCommand } from "@aws-sdk/client-networkmonitor"; // ES Modules import + * // const { NetworkMonitorClient, UntagResourceCommand } = require("@aws-sdk/client-networkmonitor"); // CommonJS import + * const client = new NetworkMonitorClient(config); + * const input = { // UntagResourceInput + * resourceArn: "STRING_VALUE", // required + * tagKeys: [ // TagKeyList // required + * "STRING_VALUE", + * ], + * }; + * const command = new UntagResourceCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param UntagResourceCommandInput - {@link UntagResourceCommandInput} + * @returns {@link UntagResourceCommandOutput} + * @see {@link UntagResourceCommandInput} for command's `input` shape. + * @see {@link UntagResourceCommandOutput} for command's `response` shape. + * @see {@link NetworkMonitorClientResolvedConfig | config} for NetworkMonitorClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

+ * + * @throws {@link ConflictException} (client fault) + *

This operation attempted to create a resource that already exists.

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing has failed because of an unknown error, exception or failure.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The specified resource does not exist.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling

+ * + * @throws {@link ValidationException} (client fault) + *

One of the parameters for the request is not valid.

+ * + * @throws {@link NetworkMonitorServiceException} + *

Base exception class for all service exceptions from NetworkMonitor service.

+ * + */ +export class UntagResourceCommand extends $Command< + UntagResourceCommandInput, + UntagResourceCommandOutput, + NetworkMonitorClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: UntagResourceCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: NetworkMonitorClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, UntagResourceCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "NetworkMonitorClient"; + const commandName = "UntagResourceCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "NetworkMonitor", + operation: "UntagResource", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: UntagResourceCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_UntagResourceCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_UntagResourceCommand(output, context); + } +} diff --git a/clients/client-networkmonitor/src/commands/UpdateMonitorCommand.ts b/clients/client-networkmonitor/src/commands/UpdateMonitorCommand.ts new file mode 100644 index 000000000000..abfa6bdbe665 --- /dev/null +++ b/clients/client-networkmonitor/src/commands/UpdateMonitorCommand.ts @@ -0,0 +1,162 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { UpdateMonitorInput, UpdateMonitorOutput } from "../models/models_0"; +import { NetworkMonitorClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../NetworkMonitorClient"; +import { de_UpdateMonitorCommand, se_UpdateMonitorCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link UpdateMonitorCommand}. + */ +export interface UpdateMonitorCommandInput extends UpdateMonitorInput {} +/** + * @public + * + * The output of {@link UpdateMonitorCommand}. + */ +export interface UpdateMonitorCommandOutput extends UpdateMonitorOutput, __MetadataBearer {} + +/** + * @public + *

Updates the aggregationPeriod for a monitor. Monitors support an aggregationPeriod of either 30 or 60 seconds.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { NetworkMonitorClient, UpdateMonitorCommand } from "@aws-sdk/client-networkmonitor"; // ES Modules import + * // const { NetworkMonitorClient, UpdateMonitorCommand } = require("@aws-sdk/client-networkmonitor"); // CommonJS import + * const client = new NetworkMonitorClient(config); + * const input = { // UpdateMonitorInput + * monitorName: "STRING_VALUE", // required + * aggregationPeriod: Number("long"), // required + * }; + * const command = new UpdateMonitorCommand(input); + * const response = await client.send(command); + * // { // UpdateMonitorOutput + * // monitorArn: "STRING_VALUE", // required + * // monitorName: "STRING_VALUE", // required + * // state: "PENDING" || "ACTIVE" || "INACTIVE" || "ERROR" || "DELETING", // required + * // aggregationPeriod: Number("long"), + * // tags: { // TagMap + * // "": "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param UpdateMonitorCommandInput - {@link UpdateMonitorCommandInput} + * @returns {@link UpdateMonitorCommandOutput} + * @see {@link UpdateMonitorCommandInput} for command's `input` shape. + * @see {@link UpdateMonitorCommandOutput} for command's `response` shape. + * @see {@link NetworkMonitorClientResolvedConfig | config} for NetworkMonitorClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing has failed because of an unknown error, exception or failure.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The specified resource does not exist.

+ * + * @throws {@link ServiceQuotaExceededException} (client fault) + *

This request exceeds a service quota.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling

+ * + * @throws {@link ValidationException} (client fault) + *

One of the parameters for the request is not valid.

+ * + * @throws {@link NetworkMonitorServiceException} + *

Base exception class for all service exceptions from NetworkMonitor service.

+ * + */ +export class UpdateMonitorCommand extends $Command< + UpdateMonitorCommandInput, + UpdateMonitorCommandOutput, + NetworkMonitorClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: UpdateMonitorCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: NetworkMonitorClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, UpdateMonitorCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "NetworkMonitorClient"; + const commandName = "UpdateMonitorCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "NetworkMonitor", + operation: "UpdateMonitor", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: UpdateMonitorCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_UpdateMonitorCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_UpdateMonitorCommand(output, context); + } +} diff --git a/clients/client-networkmonitor/src/commands/UpdateProbeCommand.ts b/clients/client-networkmonitor/src/commands/UpdateProbeCommand.ts new file mode 100644 index 000000000000..2f54f7cf255d --- /dev/null +++ b/clients/client-networkmonitor/src/commands/UpdateProbeCommand.ts @@ -0,0 +1,175 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { UpdateProbeInput, UpdateProbeOutput } from "../models/models_0"; +import { NetworkMonitorClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../NetworkMonitorClient"; +import { de_UpdateProbeCommand, se_UpdateProbeCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link UpdateProbeCommand}. + */ +export interface UpdateProbeCommandInput extends UpdateProbeInput {} +/** + * @public + * + * The output of {@link UpdateProbeCommand}. + */ +export interface UpdateProbeCommandOutput extends UpdateProbeOutput, __MetadataBearer {} + +/** + * @public + *

Updates a monitor probe. This action requires both the monitorName and probeId parameters. Run ListMonitors to get a list of monitor names. Run GetMonitor to get a list of probes and probe IDs.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { NetworkMonitorClient, UpdateProbeCommand } from "@aws-sdk/client-networkmonitor"; // ES Modules import + * // const { NetworkMonitorClient, UpdateProbeCommand } = require("@aws-sdk/client-networkmonitor"); // CommonJS import + * const client = new NetworkMonitorClient(config); + * const input = { // UpdateProbeInput + * monitorName: "STRING_VALUE", // required + * probeId: "STRING_VALUE", // required + * state: "PENDING" || "ACTIVE" || "INACTIVE" || "ERROR" || "DELETING" || "DELETED", + * destination: "STRING_VALUE", + * destinationPort: Number("int"), + * protocol: "TCP" || "ICMP", + * packetSize: Number("int"), + * }; + * const command = new UpdateProbeCommand(input); + * const response = await client.send(command); + * // { // UpdateProbeOutput + * // probeId: "STRING_VALUE", + * // probeArn: "STRING_VALUE", + * // sourceArn: "STRING_VALUE", // required + * // destination: "STRING_VALUE", // required + * // destinationPort: Number("int"), + * // protocol: "TCP" || "ICMP", // required + * // packetSize: Number("int"), + * // addressFamily: "IPV4" || "IPV6", + * // vpcId: "STRING_VALUE", + * // state: "PENDING" || "ACTIVE" || "INACTIVE" || "ERROR" || "DELETING" || "DELETED", + * // createdAt: new Date("TIMESTAMP"), + * // modifiedAt: new Date("TIMESTAMP"), + * // tags: { // TagMap + * // "": "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param UpdateProbeCommandInput - {@link UpdateProbeCommandInput} + * @returns {@link UpdateProbeCommandOutput} + * @see {@link UpdateProbeCommandInput} for command's `input` shape. + * @see {@link UpdateProbeCommandOutput} for command's `response` shape. + * @see {@link NetworkMonitorClientResolvedConfig | config} for NetworkMonitorClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing has failed because of an unknown error, exception or failure.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The specified resource does not exist.

+ * + * @throws {@link ServiceQuotaExceededException} (client fault) + *

This request exceeds a service quota.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling

+ * + * @throws {@link ValidationException} (client fault) + *

One of the parameters for the request is not valid.

+ * + * @throws {@link NetworkMonitorServiceException} + *

Base exception class for all service exceptions from NetworkMonitor service.

+ * + */ +export class UpdateProbeCommand extends $Command< + UpdateProbeCommandInput, + UpdateProbeCommandOutput, + NetworkMonitorClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: UpdateProbeCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: NetworkMonitorClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, UpdateProbeCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "NetworkMonitorClient"; + const commandName = "UpdateProbeCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "NetworkMonitor", + operation: "UpdateProbe", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: UpdateProbeCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_UpdateProbeCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_UpdateProbeCommand(output, context); + } +} diff --git a/clients/client-networkmonitor/src/commands/index.ts b/clients/client-networkmonitor/src/commands/index.ts new file mode 100644 index 000000000000..2a01071003e2 --- /dev/null +++ b/clients/client-networkmonitor/src/commands/index.ts @@ -0,0 +1,13 @@ +// smithy-typescript generated code +export * from "./CreateMonitorCommand"; +export * from "./CreateProbeCommand"; +export * from "./DeleteMonitorCommand"; +export * from "./DeleteProbeCommand"; +export * from "./GetMonitorCommand"; +export * from "./GetProbeCommand"; +export * from "./ListMonitorsCommand"; +export * from "./ListTagsForResourceCommand"; +export * from "./TagResourceCommand"; +export * from "./UntagResourceCommand"; +export * from "./UpdateMonitorCommand"; +export * from "./UpdateProbeCommand"; diff --git a/clients/client-networkmonitor/src/endpoint/EndpointParameters.ts b/clients/client-networkmonitor/src/endpoint/EndpointParameters.ts new file mode 100644 index 000000000000..2aeb334197d5 --- /dev/null +++ b/clients/client-networkmonitor/src/endpoint/EndpointParameters.ts @@ -0,0 +1,34 @@ +// smithy-typescript generated code +import { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from "@smithy/types"; + +/** + * @public + */ +export interface ClientInputEndpointParameters { + region?: string | Provider; + useDualstackEndpoint?: boolean | Provider; + useFipsEndpoint?: boolean | Provider; + endpoint?: string | Provider | Endpoint | Provider | EndpointV2 | Provider; +} + +export type ClientResolvedEndpointParameters = ClientInputEndpointParameters & { + defaultSigningName: string; +}; + +export const resolveClientEndpointParameters = ( + options: T & ClientInputEndpointParameters +): T & ClientResolvedEndpointParameters => { + return { + ...options, + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + useFipsEndpoint: options.useFipsEndpoint ?? false, + defaultSigningName: "networkmonitor", + }; +}; + +export interface EndpointParameters extends __EndpointParameters { + Region?: string; + UseDualStack?: boolean; + UseFIPS?: boolean; + Endpoint?: string; +} diff --git a/clients/client-networkmonitor/src/endpoint/endpointResolver.ts b/clients/client-networkmonitor/src/endpoint/endpointResolver.ts new file mode 100644 index 000000000000..5a2f95973187 --- /dev/null +++ b/clients/client-networkmonitor/src/endpoint/endpointResolver.ts @@ -0,0 +1,16 @@ +// smithy-typescript generated code +import { EndpointV2, Logger } from "@smithy/types"; +import { EndpointParams, resolveEndpoint } from "@smithy/util-endpoints"; + +import { EndpointParameters } from "./EndpointParameters"; +import { ruleSet } from "./ruleset"; + +export const defaultEndpointResolver = ( + endpointParams: EndpointParameters, + context: { logger?: Logger } = {} +): EndpointV2 => { + return resolveEndpoint(ruleSet, { + endpointParams: endpointParams as EndpointParams, + logger: context.logger, + }); +}; diff --git a/clients/client-networkmonitor/src/endpoint/ruleset.ts b/clients/client-networkmonitor/src/endpoint/ruleset.ts new file mode 100644 index 000000000000..4324c74ff4e3 --- /dev/null +++ b/clients/client-networkmonitor/src/endpoint/ruleset.ts @@ -0,0 +1,32 @@ +// @ts-nocheck +// generated code, do not edit +import { RuleSetObject } from "@smithy/types"; + +/* This file is compressed. Log this object + or see "smithy.rules#endpointRuleSet" + in codegen/sdk-codegen/aws-models/networkmonitor.json */ + +const s="required", +t="fn", +u="argv", +v="ref"; +const a=true, +b="isSet", +c="booleanEquals", +d="error", +e="endpoint", +f="tree", +g="PartitionResult", +h={[s]:false,"type":"String"}, +i={[s]:true,"default":false,"type":"Boolean"}, +j={[v]:"Endpoint"}, +k={[t]:c,[u]:[{[v]:"UseFIPS"},true]}, +l={[t]:c,[u]:[{[v]:"UseDualStack"},true]}, +m={}, +n={[t]:"getAttr",[u]:[{[v]:g},"supportsFIPS"]}, +o={[t]:c,[u]:[true,{[t]:"getAttr",[u]:[{[v]:g},"supportsDualStack"]}]}, +p=[k], +q=[l], +r=[{[v]:"Region"}]; +const _data={version:"1.0",parameters:{Region:h,UseDualStack:i,UseFIPS:i,Endpoint:h},rules:[{conditions:[{[t]:b,[u]:[j]}],rules:[{conditions:p,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:d},{rules:[{conditions:q,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:d},{endpoint:{url:j,properties:m,headers:m},type:e}],type:f}],type:f},{rules:[{conditions:[{[t]:b,[u]:r}],rules:[{conditions:[{[t]:"aws.partition",[u]:r,assign:g}],rules:[{conditions:[k,l],rules:[{conditions:[{[t]:c,[u]:[a,n]},o],rules:[{rules:[{endpoint:{url:"https://networkmonitor-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:e}],type:f}],type:f},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:d}],type:f},{conditions:p,rules:[{conditions:[{[t]:c,[u]:[n,a]}],rules:[{rules:[{endpoint:{url:"https://networkmonitor-fips.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:e}],type:f}],type:f},{error:"FIPS is enabled but this partition does not support FIPS",type:d}],type:f},{conditions:q,rules:[{conditions:[o],rules:[{rules:[{endpoint:{url:"https://networkmonitor.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:e}],type:f}],type:f},{error:"DualStack is enabled but this partition does not support DualStack",type:d}],type:f},{rules:[{endpoint:{url:"https://networkmonitor.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:e}],type:f}],type:f}],type:f},{error:"Invalid Configuration: Missing Region",type:d}],type:f}]}; +export const ruleSet: RuleSetObject = _data; diff --git a/clients/client-networkmonitor/src/extensionConfiguration.ts b/clients/client-networkmonitor/src/extensionConfiguration.ts new file mode 100644 index 000000000000..41660daa3e31 --- /dev/null +++ b/clients/client-networkmonitor/src/extensionConfiguration.ts @@ -0,0 +1,12 @@ +// smithy-typescript generated code +import { AwsRegionExtensionConfiguration } from "@aws-sdk/types"; +import { HttpHandlerExtensionConfiguration } from "@smithy/protocol-http"; +import { DefaultExtensionConfiguration } from "@smithy/types"; + +/** + * @internal + */ +export interface NetworkMonitorExtensionConfiguration + extends HttpHandlerExtensionConfiguration, + DefaultExtensionConfiguration, + AwsRegionExtensionConfiguration {} diff --git a/clients/client-networkmonitor/src/index.ts b/clients/client-networkmonitor/src/index.ts new file mode 100644 index 000000000000..f5f3e24e1024 --- /dev/null +++ b/clients/client-networkmonitor/src/index.ts @@ -0,0 +1,27 @@ +// smithy-typescript generated code +/* eslint-disable */ +/** + *

Amazon CloudWatch Network Monitor is an Amazon Web Services active network monitoring + * service that identifies if a network issues exists within the Amazon Web Services network + * or your own company network. Within Network Monitor you'll choose the source VPCs and + * subnets from the Amazon Web Services network in which you operate and then you'll choose + * the destination IP addresses from your on-premises network. From these sources and + * destinations, Network Monitor creates a monitor containing all the possible source and + * destination combinations, each of which is called a probe, within a single monitor. + * These probes then monitor network traffic to help you identify where network issues might be affecting your traffic.

+ *

For more information, see Using Amazon CloudWatch Network Monitor in the Amazon CloudWatch User Guide.

+ * + * @packageDocumentation + */ +export * from "./NetworkMonitorClient"; +export * from "./NetworkMonitor"; +export { ClientInputEndpointParameters } from "./endpoint/EndpointParameters"; +export { RuntimeExtension } from "./runtimeExtensions"; +export { NetworkMonitorExtensionConfiguration } from "./extensionConfiguration"; +export * from "./commands"; +export * from "./pagination"; +export * from "./models"; + +import "@aws-sdk/util-endpoints"; + +export { NetworkMonitorServiceException } from "./models/NetworkMonitorServiceException"; diff --git a/clients/client-networkmonitor/src/models/NetworkMonitorServiceException.ts b/clients/client-networkmonitor/src/models/NetworkMonitorServiceException.ts new file mode 100644 index 000000000000..8d69248de680 --- /dev/null +++ b/clients/client-networkmonitor/src/models/NetworkMonitorServiceException.ts @@ -0,0 +1,22 @@ +// smithy-typescript generated code +import { + ServiceException as __ServiceException, + ServiceExceptionOptions as __ServiceExceptionOptions, +} from "@smithy/smithy-client"; + +export { __ServiceException, __ServiceExceptionOptions }; + +/** + * @public + * + * Base exception class for all service exceptions from NetworkMonitor service. + */ +export class NetworkMonitorServiceException extends __ServiceException { + /** + * @internal + */ + constructor(options: __ServiceExceptionOptions) { + super(options); + Object.setPrototypeOf(this, NetworkMonitorServiceException.prototype); + } +} diff --git a/clients/client-networkmonitor/src/models/index.ts b/clients/client-networkmonitor/src/models/index.ts new file mode 100644 index 000000000000..9eaceb12865f --- /dev/null +++ b/clients/client-networkmonitor/src/models/index.ts @@ -0,0 +1,2 @@ +// smithy-typescript generated code +export * from "./models_0"; diff --git a/clients/client-networkmonitor/src/models/models_0.ts b/clients/client-networkmonitor/src/models/models_0.ts new file mode 100644 index 000000000000..184e02417760 --- /dev/null +++ b/clients/client-networkmonitor/src/models/models_0.ts @@ -0,0 +1,1090 @@ +// smithy-typescript generated code +import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client"; + +import { NetworkMonitorServiceException as __BaseException } from "./NetworkMonitorServiceException"; + +/** + * @public + *

You do not have sufficient access to perform this action.

+ */ +export class AccessDeniedException extends __BaseException { + readonly name: "AccessDeniedException" = "AccessDeniedException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "AccessDeniedException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, AccessDeniedException.prototype); + } +} + +/** + * @public + * @enum + */ +export const AddressFamily = { + IPV4: "IPV4", + IPV6: "IPV6", +} as const; + +/** + * @public + */ +export type AddressFamily = (typeof AddressFamily)[keyof typeof AddressFamily]; + +/** + * @public + *

This operation attempted to create a resource that already exists.

+ */ +export class ConflictException extends __BaseException { + readonly name: "ConflictException" = "ConflictException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ConflictException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ConflictException.prototype); + } +} + +/** + * @public + * @enum + */ +export const Protocol = { + ICMP: "ICMP", + TCP: "TCP", +} as const; + +/** + * @public + */ +export type Protocol = (typeof Protocol)[keyof typeof Protocol]; + +/** + * @public + *

Creates a monitor probe.

+ */ +export interface CreateMonitorProbeInput { + /** + * @public + *

The ARN of the subnet.

+ */ + sourceArn: string | undefined; + + /** + * @public + *

The destination IP address. This will be either IPV4 or IPV6.

+ */ + destination: string | undefined; + + /** + * @public + *

The port associated with the destination. This is required only if the protocol is TCP and must be a number between 1 and 65536.

+ */ + destinationPort?: number; + + /** + * @public + *

The protocol used for the network traffic between the source and destination. This will be either TCP or ICMP.

+ */ + protocol: Protocol | undefined; + + /** + * @public + *

The size of the packets sent between the source and destination. This will be a number between 56 and 8500.

+ */ + packetSize?: number; + + /** + * @public + *

The list of key-value pairs created and assigned to the monitor.

+ */ + probeTags?: Record; +} + +/** + * @public + */ +export interface CreateMonitorInput { + /** + * @public + *

The name identifying the monitor. It can contain only letters, underscores (_), or dashes (-), and can be up to 255 characters.

+ */ + monitorName: string | undefined; + + /** + * @public + *

Displays a list of all of the probes created for a monitor.

+ */ + probes?: CreateMonitorProbeInput[]; + + /** + * @public + *

The time, in seconds, that metrics are aggregated and sent to Amazon CloudWatch. Valid values are either 30 or 60.

+ */ + aggregationPeriod?: number; + + /** + * @public + *

Unique, case-sensitive identifier to ensure the idempotency of the request. Only returned if a client token was provided in the request.

+ */ + clientToken?: string; + + /** + * @public + *

The list of key-value pairs created and assigned to the monitor.

+ */ + tags?: Record; +} + +/** + * @public + * @enum + */ +export const MonitorState = { + ACTIVE: "ACTIVE", + DELETING: "DELETING", + ERROR: "ERROR", + INACTIVE: "INACTIVE", + PENDING: "PENDING", +} as const; + +/** + * @public + */ +export type MonitorState = (typeof MonitorState)[keyof typeof MonitorState]; + +/** + * @public + */ +export interface CreateMonitorOutput { + /** + * @public + *

The ARN of the monitor.

+ */ + monitorArn: string | undefined; + + /** + * @public + *

The name of the monitor.

+ */ + monitorName: string | undefined; + + /** + * @public + *

The state of the monitor.

+ */ + state: MonitorState | undefined; + + /** + * @public + *

The number of seconds that metrics are aggregated by and sent to Amazon CloudWatch. This will be either 30 or 60.

+ */ + aggregationPeriod?: number; + + /** + * @public + *

The list of key-value pairs assigned to the monitor.

+ */ + tags?: Record; +} + +/** + * @public + *

The request processing has failed because of an unknown error, exception or failure.

+ */ +export class InternalServerException extends __BaseException { + readonly name: "InternalServerException" = "InternalServerException"; + readonly $fault: "server" = "server"; + $retryable = {}; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "InternalServerException", + $fault: "server", + ...opts, + }); + Object.setPrototypeOf(this, InternalServerException.prototype); + } +} + +/** + * @public + *

This request exceeds a service quota.

+ */ +export class ServiceQuotaExceededException extends __BaseException { + readonly name: "ServiceQuotaExceededException" = "ServiceQuotaExceededException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ServiceQuotaExceededException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ServiceQuotaExceededException.prototype); + } +} + +/** + * @public + *

The request was denied due to request throttling

+ */ +export class ThrottlingException extends __BaseException { + readonly name: "ThrottlingException" = "ThrottlingException"; + readonly $fault: "client" = "client"; + $retryable = { + throttling: true, + }; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ThrottlingException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ThrottlingException.prototype); + } +} + +/** + * @public + *

One of the parameters for the request is not valid.

+ */ +export class ValidationException extends __BaseException { + readonly name: "ValidationException" = "ValidationException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ValidationException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ValidationException.prototype); + } +} + +/** + * @public + *

Defines a probe when creating a probe or monitor.

+ */ +export interface ProbeInput { + /** + * @public + *

The ARN of the subnet.

+ */ + sourceArn: string | undefined; + + /** + * @public + *

The destination IP address. This will be either IPV4 or IPV6.

+ */ + destination: string | undefined; + + /** + * @public + *

The port associated with the destination. This is required only if the protocol is TCP and must be a number between 1 and 65536.

+ */ + destinationPort?: number; + + /** + * @public + *

The protocol used for the network traffic between the source and destination. This will be either TCP or ICMP.

+ */ + protocol: Protocol | undefined; + + /** + * @public + *

The size of the packets sent between the source and destination. This will be a number between 56 and 8500.

+ */ + packetSize?: number; + + /** + * @public + *

The list of key-value pairs created and assigned to the monitor.

+ */ + tags?: Record; +} + +/** + * @public + */ +export interface CreateProbeInput { + /** + * @public + *

The name of the monitor to associated with the probe. To get a list of available monitors, use ListMonitors.

+ */ + monitorName: string | undefined; + + /** + * @public + *

Describes the details of an individual probe for a monitor.

+ */ + probe: ProbeInput | undefined; + + /** + * @public + *

Unique, case-sensitive identifier to ensure the idempotency of the request. Only returned if a client token was provided in the request.

+ */ + clientToken?: string; + + /** + * @public + *

The list of key-value pairs created and assigned to the probe.

+ */ + tags?: Record; +} + +/** + * @public + * @enum + */ +export const ProbeState = { + ACTIVE: "ACTIVE", + DELETED: "DELETED", + DELETING: "DELETING", + ERROR: "ERROR", + INACTIVE: "INACTIVE", + PENDING: "PENDING", +} as const; + +/** + * @public + */ +export type ProbeState = (typeof ProbeState)[keyof typeof ProbeState]; + +/** + * @public + */ +export interface CreateProbeOutput { + /** + * @public + *

The ID of the probe for which details are returned.

+ */ + probeId?: string; + + /** + * @public + *

The ARN of the probe.

+ */ + probeArn?: string; + + /** + * @public + *

The ARN of the probe.

+ */ + sourceArn: string | undefined; + + /** + * @public + *

The destination IP address for the monitor. This will be either an IPv4 or IPv6 address.

+ */ + destination: string | undefined; + + /** + * @public + *

The port associated with the destination. This is required only if the protocol is TCP and must be a number between 1 and 65536.

+ */ + destinationPort?: number; + + /** + * @public + *

The protocol used for the network traffic between the source and destination. This will be either TCP or ICMP.

+ */ + protocol: Protocol | undefined; + + /** + * @public + *

The size of the packets sent between the source and destination. This will be a number between 56 and 8500.

+ */ + packetSize?: number; + + /** + * @public + *

Indicates whether the IP address is IPV4 or IPV6.

+ */ + addressFamily?: AddressFamily; + + /** + * @public + *

The ID of the source VPC or subnet.

+ */ + vpcId?: string; + + /** + * @public + *

The state of the probe.

+ */ + state?: ProbeState; + + /** + * @public + *

The time and date that the probe was created.

+ */ + createdAt?: Date; + + /** + * @public + *

The time and date when the probe was last modified.

+ */ + modifiedAt?: Date; + + /** + * @public + *

The list of key-value pairs assigned to the probe.

+ */ + tags?: Record; +} + +/** + * @public + *

The specified resource does not exist.

+ */ +export class ResourceNotFoundException extends __BaseException { + readonly name: "ResourceNotFoundException" = "ResourceNotFoundException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ResourceNotFoundException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ResourceNotFoundException.prototype); + } +} + +/** + * @public + */ +export interface DeleteMonitorInput { + /** + * @public + *

The name of the monitor to delete. Use the ListMonitors action to get a list of your current monitors.

+ */ + monitorName: string | undefined; +} + +/** + * @public + */ +export interface DeleteMonitorOutput {} + +/** + * @public + */ +export interface DeleteProbeInput { + /** + * @public + *

The name of the monitor to delete. For a list of the available monitors, use the ListMonitors action.

+ */ + monitorName: string | undefined; + + /** + * @public + *

The ID of the probe to delete. Run GetMonitor to get a lst of all probes and probe IDs associated with the monitor.

+ */ + probeId: string | undefined; +} + +/** + * @public + */ +export interface DeleteProbeOutput {} + +/** + * @public + */ +export interface GetMonitorInput { + /** + * @public + *

The name of the monitor that details are returned for.

+ */ + monitorName: string | undefined; +} + +/** + * @public + *

Describes information about a monitor probe.

+ */ +export interface Probe { + /** + * @public + *

The ID of the probe.

+ */ + probeId?: string; + + /** + * @public + *

The ARN of the probe.

+ */ + probeArn?: string; + + /** + * @public + *

The ARN of the probe source subnet.

+ */ + sourceArn: string | undefined; + + /** + * @public + *

The destination for the probe. This should be either an IPV4 or IPV6.

+ */ + destination: string | undefined; + + /** + * @public + *

The destination port for the probe. This is required only if the protocol is TCP and must be a number between 1 and 65536.

+ */ + destinationPort?: number; + + /** + * @public + *

The network protocol for the destination. This can be either TCP or ICMP. If the protocol is TCP, then port is also required.

+ */ + protocol: Protocol | undefined; + + /** + * @public + *

The size of the packets traveling between the source and destination. This must be a number between 56 and

+ */ + packetSize?: number; + + /** + * @public + *

The IPv4 or IPv6 address for the probe.

+ */ + addressFamily?: AddressFamily; + + /** + * @public + *

The ID of the source VPC subnet.

+ */ + vpcId?: string; + + /** + * @public + *

The state of the probe.

+ */ + state?: ProbeState; + + /** + * @public + *

The time and date the probe was created.

+ */ + createdAt?: Date; + + /** + * @public + *

The time and date that the probe was last modified.

+ */ + modifiedAt?: Date; + + /** + * @public + *

The list of key-value pairs created and assigned to the probe.

+ */ + tags?: Record; +} + +/** + * @public + */ +export interface GetMonitorOutput { + /** + * @public + *

The ARN of the selected monitor.

+ */ + monitorArn: string | undefined; + + /** + * @public + *

The name of the monitor. To get a list of the current monitors and their names, use the ListMonitors action.

+ */ + monitorName: string | undefined; + + /** + * @public + *

Returns a list of the state of each monitor.

+ */ + state: MonitorState | undefined; + + /** + * @public + *

The aggregation period for the specified monitor.

+ */ + aggregationPeriod: number | undefined; + + /** + * @public + *

The list of key-value pairs assigned to the monitor.

+ */ + tags?: Record; + + /** + * @public + *

The details about each probe associated with that monitor.

+ */ + probes?: Probe[]; + + /** + * @public + *

The time and date when the monitor was created.

+ */ + createdAt: Date | undefined; + + /** + * @public + *

The time and date when the monitor was last modified.

+ */ + modifiedAt: Date | undefined; +} + +/** + * @public + */ +export interface GetProbeInput { + /** + * @public + *

The name of the monitor associated with the probe. Run ListMonitors to get a list of monitor names.

+ */ + monitorName: string | undefined; + + /** + * @public + *

The ID of the probe to get information about. Run GetMonitor action to get a list of probes and probe IDs for the monitor.

+ */ + probeId: string | undefined; +} + +/** + * @public + */ +export interface GetProbeOutput { + /** + * @public + *

The ID of the probe for which details are returned.

+ */ + probeId?: string; + + /** + * @public + *

The ARN of the probe.

+ */ + probeArn?: string; + + /** + * @public + *

The ARN of the probe.

+ */ + sourceArn: string | undefined; + + /** + * @public + *

The destination IP address for the monitor. This will be either an IPv4 or IPv6 address.

+ */ + destination: string | undefined; + + /** + * @public + *

The port associated with the destination. This is required only if the protocol is TCP and must be a number between 1 and 65536.

+ */ + destinationPort?: number; + + /** + * @public + *

The protocol used for the network traffic between the source and destination. This will be either TCP or ICMP.

+ */ + protocol: Protocol | undefined; + + /** + * @public + *

The size of the packets sent between the source and destination. This will be a number between 56 and 8500.

+ */ + packetSize?: number; + + /** + * @public + *

Indicates whether the IP address is IPV4 or IPV6.

+ */ + addressFamily?: AddressFamily; + + /** + * @public + *

The ID of the source VPC or subnet.

+ */ + vpcId?: string; + + /** + * @public + *

The state of the probe.

+ */ + state?: ProbeState; + + /** + * @public + *

The time and date that the probe was created.

+ */ + createdAt?: Date; + + /** + * @public + *

The time and date that the probe was last modified.

+ */ + modifiedAt?: Date; + + /** + * @public + *

The list of key-value pairs assigned to the probe.

+ */ + tags?: Record; +} + +/** + * @public + */ +export interface ListMonitorsInput { + /** + * @public + *

The token for the next page of results.

+ */ + nextToken?: string; + + /** + * @public + *

The maximum number of results to return with a single call. + * To retrieve the remaining results, make another call with the returned nextToken value.

+ *

If MaxResults is given a value larger than 100, only 100 results are + * returned.

+ */ + maxResults?: number; + + /** + * @public + *

The list of all monitors and their states.

+ */ + state?: string; +} + +/** + * @public + *

Displays summary information about a monitor.

+ */ +export interface MonitorSummary { + /** + * @public + *

The ARN of the monitor.

+ */ + monitorArn: string | undefined; + + /** + * @public + *

The name of the monitor.

+ */ + monitorName: string | undefined; + + /** + * @public + *

The state of the monitor.

+ */ + state: MonitorState | undefined; + + /** + * @public + *

The time, in seconds, that metrics are collected and sent to Amazon CloudWatch. Valid values are either 30 or 60.

+ */ + aggregationPeriod?: number; + + /** + * @public + *

The list of key-value pairs assigned to the monitor.

+ */ + tags?: Record; +} + +/** + * @public + */ +export interface ListMonitorsOutput { + /** + * @public + *

Lists individual details about each of your monitors.

+ */ + monitors: MonitorSummary[] | undefined; + + /** + * @public + *

The token for the next page of results.

+ */ + nextToken?: string; +} + +/** + * @public + */ +export interface ListTagsForResourceInput { + /** + * @public + *

The

+ */ + resourceArn: string | undefined; +} + +/** + * @public + */ +export interface ListTagsForResourceOutput { + /** + * @public + *

Lists the tags assigned to the resource.

+ */ + tags?: Record; +} + +/** + * @public + */ +export interface UpdateMonitorInput { + /** + * @public + *

The name of the monitor to update. Run ListMonitors to get a list of monitor names.

+ */ + monitorName: string | undefined; + + /** + * @public + *

The aggregation time, in seconds, to change to. This must be either 30 or 60.

+ */ + aggregationPeriod: number | undefined; +} + +/** + * @public + */ +export interface UpdateMonitorOutput { + /** + * @public + *

The ARN of the monitor that was updated.

+ */ + monitorArn: string | undefined; + + /** + * @public + *

The name of the monitor that was updated.

+ */ + monitorName: string | undefined; + + /** + * @public + *

The state of the updated monitor.

+ */ + state: MonitorState | undefined; + + /** + * @public + *

The changed aggregation period.

+ */ + aggregationPeriod?: number; + + /** + * @public + *

The list of key-value pairs associated with the monitor.

+ */ + tags?: Record; +} + +/** + * @public + */ +export interface UpdateProbeInput { + /** + * @public + *

The name of the monitor that the probe was updated for.

+ */ + monitorName: string | undefined; + + /** + * @public + *

Run GetMonitor to get a list of probes and probe IDs.

+ */ + probeId: string | undefined; + + /** + * @public + *

The state of the probe update.

+ */ + state?: ProbeState; + + /** + * @public + *

The updated IP address for the probe destination. This must be either an IPv4 or IPv6 address.

+ */ + destination?: string; + + /** + * @public + *

The updated port for the probe destination. This is required only if the protocol is TCP and must be a number between 1 and 65536.

+ */ + destinationPort?: number; + + /** + * @public + *

The updated network protocol for the destination. This can be either TCP or ICMP. If the protocol is TCP, then port is also required.

+ */ + protocol?: Protocol; + + /** + * @public + *

he updated packets size for network traffic between the source and destination. This must be a number between 56 and 8500.

+ */ + packetSize?: number; +} + +/** + * @public + */ +export interface UpdateProbeOutput { + /** + * @public + *

The updated ID of the probe.

+ */ + probeId?: string; + + /** + * @public + *

The updated ARN of the probe.

+ */ + probeArn?: string; + + /** + * @public + *

The updated ARN of the source subnet.

+ */ + sourceArn: string | undefined; + + /** + * @public + *

The updated destination IP address for the probe.

+ */ + destination: string | undefined; + + /** + * @public + *

The updated destination port. This will be a number between 1 and 65536.

+ */ + destinationPort?: number; + + /** + * @public + *

The updated protocol for the probe.

+ */ + protocol: Protocol | undefined; + + /** + * @public + *

The updated packet size for the probe.

+ */ + packetSize?: number; + + /** + * @public + *

The updated IP address family. This will be either IPV4 or IPV6.

+ */ + addressFamily?: AddressFamily; + + /** + * @public + *

The updated ID of the source VPC subnet ID.

+ */ + vpcId?: string; + + /** + * @public + *

The state of the updated probe.

+ */ + state?: ProbeState; + + /** + * @public + *

The time and date that the probe was created.

+ */ + createdAt?: Date; + + /** + * @public + *

The time and date that the probe was last updated.

+ */ + modifiedAt?: Date; + + /** + * @public + *

Update tags for a probe.

+ */ + tags?: Record; +} + +/** + * @public + */ +export interface TagResourceInput { + /** + * @public + *

The ARN of the monitor or probe to tag.

+ */ + resourceArn: string | undefined; + + /** + * @public + *

The list of key-value pairs assigned to the monitor or probe.

+ */ + tags: Record | undefined; +} + +/** + * @public + */ +export interface TagResourceOutput {} + +/** + * @public + */ +export interface UntagResourceInput { + /** + * @public + *

The ARN of the monitor or probe that the tag should be removed from.

+ */ + resourceArn: string | undefined; + + /** + * @public + *

The key-value pa

+ */ + tagKeys: string[] | undefined; +} + +/** + * @public + */ +export interface UntagResourceOutput {} diff --git a/clients/client-networkmonitor/src/pagination/Interfaces.ts b/clients/client-networkmonitor/src/pagination/Interfaces.ts new file mode 100644 index 000000000000..2e0fb655ca66 --- /dev/null +++ b/clients/client-networkmonitor/src/pagination/Interfaces.ts @@ -0,0 +1,11 @@ +// smithy-typescript generated code +import { PaginationConfiguration } from "@smithy/types"; + +import { NetworkMonitorClient } from "../NetworkMonitorClient"; + +/** + * @public + */ +export interface NetworkMonitorPaginationConfiguration extends PaginationConfiguration { + client: NetworkMonitorClient; +} diff --git a/clients/client-networkmonitor/src/pagination/ListMonitorsPaginator.ts b/clients/client-networkmonitor/src/pagination/ListMonitorsPaginator.ts new file mode 100644 index 000000000000..7a542b0d48af --- /dev/null +++ b/clients/client-networkmonitor/src/pagination/ListMonitorsPaginator.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { createPaginator } from "@smithy/core"; +import { Paginator } from "@smithy/types"; + +import { + ListMonitorsCommand, + ListMonitorsCommandInput, + ListMonitorsCommandOutput, +} from "../commands/ListMonitorsCommand"; +import { NetworkMonitorClient } from "../NetworkMonitorClient"; +import { NetworkMonitorPaginationConfiguration } from "./Interfaces"; + +/** + * @public + */ +export const paginateListMonitors: ( + config: NetworkMonitorPaginationConfiguration, + input: ListMonitorsCommandInput, + ...rest: any[] +) => Paginator = createPaginator< + NetworkMonitorPaginationConfiguration, + ListMonitorsCommandInput, + ListMonitorsCommandOutput +>(NetworkMonitorClient, ListMonitorsCommand, "nextToken", "nextToken", "maxResults"); diff --git a/clients/client-networkmonitor/src/pagination/index.ts b/clients/client-networkmonitor/src/pagination/index.ts new file mode 100644 index 000000000000..cfe4be1b3620 --- /dev/null +++ b/clients/client-networkmonitor/src/pagination/index.ts @@ -0,0 +1,3 @@ +// smithy-typescript generated code +export * from "./Interfaces"; +export * from "./ListMonitorsPaginator"; diff --git a/clients/client-networkmonitor/src/protocols/Aws_restJson1.ts b/clients/client-networkmonitor/src/protocols/Aws_restJson1.ts new file mode 100644 index 000000000000..3b5621e8d4de --- /dev/null +++ b/clients/client-networkmonitor/src/protocols/Aws_restJson1.ts @@ -0,0 +1,1323 @@ +// smithy-typescript generated code +import { requestBuilder as rb } from "@smithy/core"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { + _json, + collectBody, + decorateServiceException as __decorateServiceException, + expectInt32 as __expectInt32, + expectLong as __expectLong, + expectNonNull as __expectNonNull, + expectNumber as __expectNumber, + expectObject as __expectObject, + expectString as __expectString, + extendedEncodeURIComponent as __extendedEncodeURIComponent, + map, + parseEpochTimestamp as __parseEpochTimestamp, + resolvedPath as __resolvedPath, + take, + withBaseException, +} from "@smithy/smithy-client"; +import { + Endpoint as __Endpoint, + ResponseMetadata as __ResponseMetadata, + SerdeContext as __SerdeContext, +} from "@smithy/types"; +import { v4 as generateIdempotencyToken } from "uuid"; + +import { CreateMonitorCommandInput, CreateMonitorCommandOutput } from "../commands/CreateMonitorCommand"; +import { CreateProbeCommandInput, CreateProbeCommandOutput } from "../commands/CreateProbeCommand"; +import { DeleteMonitorCommandInput, DeleteMonitorCommandOutput } from "../commands/DeleteMonitorCommand"; +import { DeleteProbeCommandInput, DeleteProbeCommandOutput } from "../commands/DeleteProbeCommand"; +import { GetMonitorCommandInput, GetMonitorCommandOutput } from "../commands/GetMonitorCommand"; +import { GetProbeCommandInput, GetProbeCommandOutput } from "../commands/GetProbeCommand"; +import { ListMonitorsCommandInput, ListMonitorsCommandOutput } from "../commands/ListMonitorsCommand"; +import { + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "../commands/ListTagsForResourceCommand"; +import { TagResourceCommandInput, TagResourceCommandOutput } from "../commands/TagResourceCommand"; +import { UntagResourceCommandInput, UntagResourceCommandOutput } from "../commands/UntagResourceCommand"; +import { UpdateMonitorCommandInput, UpdateMonitorCommandOutput } from "../commands/UpdateMonitorCommand"; +import { UpdateProbeCommandInput, UpdateProbeCommandOutput } from "../commands/UpdateProbeCommand"; +import { + AccessDeniedException, + ConflictException, + CreateMonitorProbeInput, + InternalServerException, + Probe, + ProbeInput, + ResourceNotFoundException, + ServiceQuotaExceededException, + ThrottlingException, + ValidationException, +} from "../models/models_0"; +import { NetworkMonitorServiceException as __BaseException } from "../models/NetworkMonitorServiceException"; + +/** + * serializeAws_restJson1CreateMonitorCommand + */ +export const se_CreateMonitorCommand = async ( + input: CreateMonitorCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/monitors"); + let body: any; + body = JSON.stringify( + take(input, { + aggregationPeriod: [], + clientToken: [true, (_) => _ ?? generateIdempotencyToken()], + monitorName: [], + probes: (_) => _json(_), + tags: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1CreateProbeCommand + */ +export const se_CreateProbeCommand = async ( + input: CreateProbeCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/monitors/{monitorName}/probes"); + b.p("monitorName", () => input.monitorName!, "{monitorName}", false); + let body: any; + body = JSON.stringify( + take(input, { + clientToken: [true, (_) => _ ?? generateIdempotencyToken()], + probe: (_) => _json(_), + tags: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1DeleteMonitorCommand + */ +export const se_DeleteMonitorCommand = async ( + input: DeleteMonitorCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/monitors/{monitorName}"); + b.p("monitorName", () => input.monitorName!, "{monitorName}", false); + let body: any; + b.m("DELETE").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1DeleteProbeCommand + */ +export const se_DeleteProbeCommand = async ( + input: DeleteProbeCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/monitors/{monitorName}/probes/{probeId}"); + b.p("monitorName", () => input.monitorName!, "{monitorName}", false); + b.p("probeId", () => input.probeId!, "{probeId}", false); + let body: any; + b.m("DELETE").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1GetMonitorCommand + */ +export const se_GetMonitorCommand = async ( + input: GetMonitorCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/monitors/{monitorName}"); + b.p("monitorName", () => input.monitorName!, "{monitorName}", false); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1GetProbeCommand + */ +export const se_GetProbeCommand = async ( + input: GetProbeCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/monitors/{monitorName}/probes/{probeId}"); + b.p("monitorName", () => input.monitorName!, "{monitorName}", false); + b.p("probeId", () => input.probeId!, "{probeId}", false); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1ListMonitorsCommand + */ +export const se_ListMonitorsCommand = async ( + input: ListMonitorsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/monitors"); + const query: any = map({ + [_nT]: [, input[_nT]!], + [_mR]: [() => input.maxResults !== void 0, () => input[_mR]!.toString()], + [_s]: [, input[_s]!], + }); + let body: any; + b.m("GET").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1ListTagsForResourceCommand + */ +export const se_ListTagsForResourceCommand = async ( + input: ListTagsForResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/tags/{resourceArn}"); + b.p("resourceArn", () => input.resourceArn!, "{resourceArn}", false); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1TagResourceCommand + */ +export const se_TagResourceCommand = async ( + input: TagResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/tags/{resourceArn}"); + b.p("resourceArn", () => input.resourceArn!, "{resourceArn}", false); + let body: any; + body = JSON.stringify( + take(input, { + tags: (_) => _json(_), + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1UntagResourceCommand + */ +export const se_UntagResourceCommand = async ( + input: UntagResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/tags/{resourceArn}"); + b.p("resourceArn", () => input.resourceArn!, "{resourceArn}", false); + const query: any = map({ + [_tK]: [ + __expectNonNull(input.tagKeys, `tagKeys`) != null, + () => (input[_tK]! || []).map((_entry) => _entry as any), + ], + }); + let body: any; + b.m("DELETE").h(headers).q(query).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1UpdateMonitorCommand + */ +export const se_UpdateMonitorCommand = async ( + input: UpdateMonitorCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/monitors/{monitorName}"); + b.p("monitorName", () => input.monitorName!, "{monitorName}", false); + let body: any; + body = JSON.stringify( + take(input, { + aggregationPeriod: [], + }) + ); + b.m("PATCH").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1UpdateProbeCommand + */ +export const se_UpdateProbeCommand = async ( + input: UpdateProbeCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/monitors/{monitorName}/probes/{probeId}"); + b.p("monitorName", () => input.monitorName!, "{monitorName}", false); + b.p("probeId", () => input.probeId!, "{probeId}", false); + let body: any; + body = JSON.stringify( + take(input, { + destination: [], + destinationPort: [], + packetSize: [], + protocol: [], + state: [], + }) + ); + b.m("PATCH").h(headers).b(body); + return b.build(); +}; + +/** + * deserializeAws_restJson1CreateMonitorCommand + */ +export const de_CreateMonitorCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CreateMonitorCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + aggregationPeriod: __expectLong, + monitorArn: __expectString, + monitorName: __expectString, + state: __expectString, + tags: _json, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1CreateMonitorCommandError + */ +const de_CreateMonitorCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.networkmonitor#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.networkmonitor#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.networkmonitor#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.networkmonitor#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.networkmonitor#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.networkmonitor#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1CreateProbeCommand + */ +export const de_CreateProbeCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CreateProbeCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + addressFamily: __expectString, + createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + destination: __expectString, + destinationPort: __expectInt32, + modifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + packetSize: __expectInt32, + probeArn: __expectString, + probeId: __expectString, + protocol: __expectString, + sourceArn: __expectString, + state: __expectString, + tags: _json, + vpcId: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1CreateProbeCommandError + */ +const de_CreateProbeCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.networkmonitor#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.networkmonitor#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.networkmonitor#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.networkmonitor#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.networkmonitor#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.networkmonitor#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1DeleteMonitorCommand + */ +export const de_DeleteMonitorCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_DeleteMonitorCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1DeleteMonitorCommandError + */ +const de_DeleteMonitorCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.networkmonitor#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.networkmonitor#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.networkmonitor#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.networkmonitor#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.networkmonitor#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1DeleteProbeCommand + */ +export const de_DeleteProbeCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_DeleteProbeCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1DeleteProbeCommandError + */ +const de_DeleteProbeCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.networkmonitor#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.networkmonitor#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.networkmonitor#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.networkmonitor#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.networkmonitor#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.networkmonitor#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1GetMonitorCommand + */ +export const de_GetMonitorCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_GetMonitorCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + aggregationPeriod: __expectLong, + createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + modifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + monitorArn: __expectString, + monitorName: __expectString, + probes: (_) => de_ProbeList(_, context), + state: __expectString, + tags: _json, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GetMonitorCommandError + */ +const de_GetMonitorCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.networkmonitor#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.networkmonitor#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.networkmonitor#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.networkmonitor#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.networkmonitor#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1GetProbeCommand + */ +export const de_GetProbeCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_GetProbeCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + addressFamily: __expectString, + createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + destination: __expectString, + destinationPort: __expectInt32, + modifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + packetSize: __expectInt32, + probeArn: __expectString, + probeId: __expectString, + protocol: __expectString, + sourceArn: __expectString, + state: __expectString, + tags: _json, + vpcId: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GetProbeCommandError + */ +const de_GetProbeCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.networkmonitor#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.networkmonitor#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.networkmonitor#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.networkmonitor#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.networkmonitor#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1ListMonitorsCommand + */ +export const de_ListMonitorsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_ListMonitorsCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + monitors: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListMonitorsCommandError + */ +const de_ListMonitorsCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.networkmonitor#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.networkmonitor#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.networkmonitor#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.networkmonitor#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1ListTagsForResourceCommand + */ +export const de_ListTagsForResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_ListTagsForResourceCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListTagsForResourceCommandError + */ +const de_ListTagsForResourceCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.networkmonitor#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.networkmonitor#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.networkmonitor#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.networkmonitor#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.networkmonitor#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.networkmonitor#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1TagResourceCommand + */ +export const de_TagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_TagResourceCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1TagResourceCommandError + */ +const de_TagResourceCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.networkmonitor#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.networkmonitor#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.networkmonitor#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.networkmonitor#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.networkmonitor#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.networkmonitor#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1UntagResourceCommand + */ +export const de_UntagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_UntagResourceCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1UntagResourceCommandError + */ +const de_UntagResourceCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.networkmonitor#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.networkmonitor#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.networkmonitor#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.networkmonitor#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.networkmonitor#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.networkmonitor#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1UpdateMonitorCommand + */ +export const de_UpdateMonitorCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_UpdateMonitorCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + aggregationPeriod: __expectLong, + monitorArn: __expectString, + monitorName: __expectString, + state: __expectString, + tags: _json, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1UpdateMonitorCommandError + */ +const de_UpdateMonitorCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.networkmonitor#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.networkmonitor#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.networkmonitor#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.networkmonitor#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.networkmonitor#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.networkmonitor#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1UpdateProbeCommand + */ +export const de_UpdateProbeCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_UpdateProbeCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + addressFamily: __expectString, + createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + destination: __expectString, + destinationPort: __expectInt32, + modifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + packetSize: __expectInt32, + probeArn: __expectString, + probeId: __expectString, + protocol: __expectString, + sourceArn: __expectString, + state: __expectString, + tags: _json, + vpcId: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1UpdateProbeCommandError + */ +const de_UpdateProbeCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.networkmonitor#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.networkmonitor#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.networkmonitor#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.networkmonitor#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.networkmonitor#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.networkmonitor#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +const throwDefaultError = withBaseException(__BaseException); +/** + * deserializeAws_restJson1AccessDeniedExceptionRes + */ +const de_AccessDeniedExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new AccessDeniedException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1ConflictExceptionRes + */ +const de_ConflictExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new ConflictException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1InternalServerExceptionRes + */ +const de_InternalServerExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new InternalServerException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1ResourceNotFoundExceptionRes + */ +const de_ResourceNotFoundExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new ResourceNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1ServiceQuotaExceededExceptionRes + */ +const de_ServiceQuotaExceededExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new ServiceQuotaExceededException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1ThrottlingExceptionRes + */ +const de_ThrottlingExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new ThrottlingException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1ValidationExceptionRes + */ +const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new ValidationException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +// se_CreateMonitorProbeInput omitted. + +// se_CreateMonitorProbeInputList omitted. + +// se_ProbeInput omitted. + +// se_TagMap omitted. + +// de_MonitorList omitted. + +// de_MonitorSummary omitted. + +/** + * deserializeAws_restJson1Probe + */ +const de_Probe = (output: any, context: __SerdeContext): Probe => { + return take(output, { + addressFamily: __expectString, + createdAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + destination: __expectString, + destinationPort: __expectInt32, + modifiedAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + packetSize: __expectInt32, + probeArn: __expectString, + probeId: __expectString, + protocol: __expectString, + sourceArn: __expectString, + state: __expectString, + tags: _json, + vpcId: __expectString, + }) as any; +}; + +/** + * deserializeAws_restJson1ProbeList + */ +const de_ProbeList = (output: any, context: __SerdeContext): Probe[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_Probe(entry, context); + }); + return retVal; +}; + +// de_TagMap omitted. + +const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ + httpStatusCode: output.statusCode, + requestId: + output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], +}); + +// Encode Uint8Array data into string with utf-8. +const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => + collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); + +const isSerializableHeaderValue = (value: any): boolean => + value !== undefined && + value !== null && + value !== "" && + (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && + (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); + +const _mR = "maxResults"; +const _nT = "nextToken"; +const _s = "state"; +const _tK = "tagKeys"; + +const parseBody = (streamBody: any, context: __SerdeContext): any => + collectBodyString(streamBody, context).then((encoded) => { + if (encoded.length) { + return JSON.parse(encoded); + } + return {}; + }); + +const parseErrorBody = async (errorBody: any, context: __SerdeContext) => { + const value = await parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string | number): string => { + let cleanValue = rawValue; + if (typeof cleanValue === "number") { + cleanValue = cleanValue.toString(); + } + if (cleanValue.indexOf(",") >= 0) { + cleanValue = cleanValue.split(",")[0]; + } + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } +}; diff --git a/clients/client-networkmonitor/src/runtimeConfig.browser.ts b/clients/client-networkmonitor/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..08174cac5c37 --- /dev/null +++ b/clients/client-networkmonitor/src/runtimeConfig.browser.ts @@ -0,0 +1,44 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver"; +import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler"; +import { invalidProvider } from "@smithy/invalid-dependency"; +import { calculateBodyLength } from "@smithy/util-body-length-browser"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { NetworkMonitorClientConfig } from "./NetworkMonitorClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@smithy/smithy-client"; +import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: NetworkMonitorClientConfig) => { + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)), + useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)), + }; +}; diff --git a/clients/client-networkmonitor/src/runtimeConfig.native.ts b/clients/client-networkmonitor/src/runtimeConfig.native.ts new file mode 100644 index 000000000000..000db5091d26 --- /dev/null +++ b/clients/client-networkmonitor/src/runtimeConfig.native.ts @@ -0,0 +1,18 @@ +// smithy-typescript generated code +import { Sha256 } from "@aws-crypto/sha256-js"; + +import { NetworkMonitorClientConfig } from "./NetworkMonitorClient"; +import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: NetworkMonitorClientConfig) => { + const browserDefaults = getBrowserRuntimeConfig(config); + return { + ...browserDefaults, + ...config, + runtime: "react-native", + sha256: config?.sha256 ?? Sha256, + }; +}; diff --git a/clients/client-networkmonitor/src/runtimeConfig.shared.ts b/clients/client-networkmonitor/src/runtimeConfig.shared.ts new file mode 100644 index 000000000000..6c0c95fe98e9 --- /dev/null +++ b/clients/client-networkmonitor/src/runtimeConfig.shared.ts @@ -0,0 +1,27 @@ +// smithy-typescript generated code +import { NoOpLogger } from "@smithy/smithy-client"; +import { parseUrl } from "@smithy/url-parser"; +import { fromBase64, toBase64 } from "@smithy/util-base64"; +import { fromUtf8, toUtf8 } from "@smithy/util-utf8"; + +import { defaultEndpointResolver } from "./endpoint/endpointResolver"; +import { NetworkMonitorClientConfig } from "./NetworkMonitorClient"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: NetworkMonitorClientConfig) => { + return { + apiVersion: "2023-08-01", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? defaultEndpointResolver, + extensions: config?.extensions ?? [], + logger: config?.logger ?? new NoOpLogger(), + serviceId: config?.serviceId ?? "NetworkMonitor", + urlParser: config?.urlParser ?? parseUrl, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-networkmonitor/src/runtimeConfig.ts b/clients/client-networkmonitor/src/runtimeConfig.ts new file mode 100644 index 000000000000..38a9064c01ea --- /dev/null +++ b/clients/client-networkmonitor/src/runtimeConfig.ts @@ -0,0 +1,61 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { + NODE_REGION_CONFIG_FILE_OPTIONS, + NODE_REGION_CONFIG_OPTIONS, + NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, + NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, +} from "@smithy/config-resolver"; +import { Hash } from "@smithy/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider"; +import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler"; +import { calculateBodyLength } from "@smithy/util-body-length-node"; +import { DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { NetworkMonitorClientConfig } from "./NetworkMonitorClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@smithy/smithy-client"; +import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node"; +import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: NetworkMonitorClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + awsCheckVersion(process.version); + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + retryMode: + config?.retryMode ?? + loadNodeConfig({ + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), + }; +}; diff --git a/clients/client-networkmonitor/src/runtimeExtensions.ts b/clients/client-networkmonitor/src/runtimeExtensions.ts new file mode 100644 index 000000000000..3e6881246161 --- /dev/null +++ b/clients/client-networkmonitor/src/runtimeExtensions.ts @@ -0,0 +1,45 @@ +// smithy-typescript generated code +import { + getAwsRegionExtensionConfiguration, + resolveAwsRegionExtensionConfiguration, +} from "@aws-sdk/region-config-resolver"; +import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http"; +import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client"; + +import { NetworkMonitorExtensionConfiguration } from "./extensionConfiguration"; + +/** + * @public + */ +export interface RuntimeExtension { + configure(extensionConfiguration: NetworkMonitorExtensionConfiguration): void; +} + +/** + * @public + */ +export interface RuntimeExtensionsConfig { + extensions: RuntimeExtension[]; +} + +const asPartial = >(t: T) => t; + +/** + * @internal + */ +export const resolveRuntimeExtensions = (runtimeConfig: any, extensions: RuntimeExtension[]) => { + const extensionConfiguration: NetworkMonitorExtensionConfiguration = { + ...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)), + ...asPartial(getDefaultExtensionConfiguration(runtimeConfig)), + ...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)), + }; + + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + + return { + ...runtimeConfig, + ...resolveAwsRegionExtensionConfiguration(extensionConfiguration), + ...resolveDefaultRuntimeConfig(extensionConfiguration), + ...resolveHttpHandlerRuntimeConfig(extensionConfiguration), + }; +}; diff --git a/clients/client-networkmonitor/tsconfig.cjs.json b/clients/client-networkmonitor/tsconfig.cjs.json new file mode 100644 index 000000000000..3567d85ba846 --- /dev/null +++ b/clients/client-networkmonitor/tsconfig.cjs.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "outDir": "dist-cjs" + } +} diff --git a/clients/client-networkmonitor/tsconfig.es.json b/clients/client-networkmonitor/tsconfig.es.json new file mode 100644 index 000000000000..809f57bde65e --- /dev/null +++ b/clients/client-networkmonitor/tsconfig.es.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "lib": ["dom"], + "module": "esnext", + "outDir": "dist-es" + } +} diff --git a/clients/client-networkmonitor/tsconfig.json b/clients/client-networkmonitor/tsconfig.json new file mode 100644 index 000000000000..344909de2128 --- /dev/null +++ b/clients/client-networkmonitor/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "@tsconfig/node14/tsconfig.json", + "compilerOptions": { + "downlevelIteration": true, + "importHelpers": true, + "incremental": true, + "removeComments": true, + "resolveJsonModule": true, + "rootDir": "src", + "useUnknownInCatchVariables": false + }, + "exclude": ["test/"] +} diff --git a/clients/client-networkmonitor/tsconfig.types.json b/clients/client-networkmonitor/tsconfig.types.json new file mode 100644 index 000000000000..4c3dfa7b3d25 --- /dev/null +++ b/clients/client-networkmonitor/tsconfig.types.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "removeComments": false, + "declaration": true, + "declarationDir": "dist-types", + "emitDeclarationOnly": true + }, + "exclude": ["test/**/*", "dist-types/**/*"] +} diff --git a/codegen/sdk-codegen/aws-models/networkmonitor.json b/codegen/sdk-codegen/aws-models/networkmonitor.json new file mode 100644 index 000000000000..98937f0ab873 --- /dev/null +++ b/codegen/sdk-codegen/aws-models/networkmonitor.json @@ -0,0 +1,2699 @@ +{ + "smithy": "2.0", + "shapes": { + "com.amazonaws.networkmonitor#AccessDeniedException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

You do not have sufficient access to perform this action.

", + "smithy.api#error": "client", + "smithy.api#httpError": 403 + } + }, + "com.amazonaws.networkmonitor#AddressFamily": { + "type": "enum", + "members": { + "IPV4": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IPV4" + } + }, + "IPV6": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IPV6" + } + } + } + }, + "com.amazonaws.networkmonitor#AggregationPeriod": { + "type": "long", + "traits": { + "smithy.api#range": { + "min": 30 + } + } + }, + "com.amazonaws.networkmonitor#Arn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 20, + "max": 2048 + }, + "smithy.api#pattern": "^arn:.*$" + } + }, + "com.amazonaws.networkmonitor#ConflictException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

This operation attempted to create a resource that already exists.

", + "smithy.api#error": "client", + "smithy.api#httpError": 409 + } + }, + "com.amazonaws.networkmonitor#CreateMonitor": { + "type": "operation", + "input": { + "target": "com.amazonaws.networkmonitor#CreateMonitorInput" + }, + "output": { + "target": "com.amazonaws.networkmonitor#CreateMonitorOutput" + }, + "errors": [ + { + "target": "com.amazonaws.networkmonitor#AccessDeniedException" + }, + { + "target": "com.amazonaws.networkmonitor#ConflictException" + }, + { + "target": "com.amazonaws.networkmonitor#InternalServerException" + }, + { + "target": "com.amazonaws.networkmonitor#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.networkmonitor#ThrottlingException" + }, + { + "target": "com.amazonaws.networkmonitor#ValidationException" + } + ], + "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to create a monitor" + }, + "smithy.api#documentation": "

Creates a monitor between a source subnet and destination IP address. Within a monitor you'll create one or more probes that monitor network traffic between your source Amazon Web Services VPC subnets and your destination IP addresses. Each probe then aggregates and sends metrics to Amazon CloudWatch.

", + "smithy.api#http": { + "uri": "/monitors", + "method": "POST" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.networkmonitor#CreateMonitorInput": { + "type": "structure", + "members": { + "monitorName": { + "target": "com.amazonaws.networkmonitor#ResourceName", + "traits": { + "smithy.api#documentation": "

The name identifying the monitor. It can contain only letters, underscores (_), or dashes (-), and can be up to 255 characters.

", + "smithy.api#required": {} + } + }, + "probes": { + "target": "com.amazonaws.networkmonitor#CreateMonitorProbeInputList", + "traits": { + "smithy.api#documentation": "

Displays a list of all of the probes created for a monitor.

" + } + }, + "aggregationPeriod": { + "target": "com.amazonaws.networkmonitor#AggregationPeriod", + "traits": { + "smithy.api#documentation": "

The time, in seconds, that metrics are aggregated and sent to Amazon CloudWatch. Valid values are either 30 or 60.

" + } + }, + "clientToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Unique, case-sensitive identifier to ensure the idempotency of the request. Only returned if a client token was provided in the request.

", + "smithy.api#idempotencyToken": {} + } + }, + "tags": { + "target": "com.amazonaws.networkmonitor#TagMap", + "traits": { + "smithy.api#documentation": "

The list of key-value pairs created and assigned to the monitor.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.networkmonitor#CreateMonitorOutput": { + "type": "structure", + "members": { + "monitorArn": { + "target": "com.amazonaws.networkmonitor#MonitorArn", + "traits": { + "smithy.api#documentation": "

The ARN of the monitor.

", + "smithy.api#required": {} + } + }, + "monitorName": { + "target": "com.amazonaws.networkmonitor#ResourceName", + "traits": { + "smithy.api#documentation": "

The name of the monitor.

", + "smithy.api#required": {} + } + }, + "state": { + "target": "com.amazonaws.networkmonitor#MonitorState", + "traits": { + "smithy.api#documentation": "

The state of the monitor.

", + "smithy.api#required": {} + } + }, + "aggregationPeriod": { + "target": "com.amazonaws.networkmonitor#AggregationPeriod", + "traits": { + "smithy.api#documentation": "

The number of seconds that metrics are aggregated by and sent to Amazon CloudWatch. This will be either 30 or 60.

" + } + }, + "tags": { + "target": "com.amazonaws.networkmonitor#TagMap", + "traits": { + "smithy.api#documentation": "

The list of key-value pairs assigned to the monitor.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.networkmonitor#CreateMonitorProbeInput": { + "type": "structure", + "members": { + "sourceArn": { + "target": "com.amazonaws.networkmonitor#Arn", + "traits": { + "smithy.api#documentation": "

The ARN of the subnet.

", + "smithy.api#required": {} + } + }, + "destination": { + "target": "com.amazonaws.networkmonitor#Destination", + "traits": { + "smithy.api#documentation": "

The destination IP address. This will be either IPV4 or IPV6.

", + "smithy.api#required": {} + } + }, + "destinationPort": { + "target": "com.amazonaws.networkmonitor#Port", + "traits": { + "smithy.api#documentation": "

The port associated with the destination. This is required only if the protocol is TCP and must be a number between 1 and 65536.

" + } + }, + "protocol": { + "target": "com.amazonaws.networkmonitor#Protocol", + "traits": { + "smithy.api#documentation": "

The protocol used for the network traffic between the source and destination. This will be either TCP or ICMP.

", + "smithy.api#required": {} + } + }, + "packetSize": { + "target": "com.amazonaws.networkmonitor#PacketSize", + "traits": { + "smithy.api#documentation": "

The size of the packets sent between the source and destination. This will be a number between 56 and 8500.

" + } + }, + "probeTags": { + "target": "com.amazonaws.networkmonitor#TagMap", + "traits": { + "smithy.api#documentation": "

The list of key-value pairs created and assigned to the monitor.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Creates a monitor probe.

" + } + }, + "com.amazonaws.networkmonitor#CreateMonitorProbeInputList": { + "type": "list", + "member": { + "target": "com.amazonaws.networkmonitor#CreateMonitorProbeInput" + } + }, + "com.amazonaws.networkmonitor#CreateProbe": { + "type": "operation", + "input": { + "target": "com.amazonaws.networkmonitor#CreateProbeInput" + }, + "output": { + "target": "com.amazonaws.networkmonitor#CreateProbeOutput" + }, + "errors": [ + { + "target": "com.amazonaws.networkmonitor#AccessDeniedException" + }, + { + "target": "com.amazonaws.networkmonitor#InternalServerException" + }, + { + "target": "com.amazonaws.networkmonitor#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.networkmonitor#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.networkmonitor#ThrottlingException" + }, + { + "target": "com.amazonaws.networkmonitor#ValidationException" + } + ], + "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to create a probe" + }, + "smithy.api#documentation": "

Create a probe within a monitor. Once you create a probe, and it begins monitoring your network traffic, you'll incur billing charges for that probe.

", + "smithy.api#http": { + "uri": "/monitors/{monitorName}/probes", + "method": "POST" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.networkmonitor#CreateProbeInput": { + "type": "structure", + "members": { + "monitorName": { + "target": "com.amazonaws.networkmonitor#ResourceName", + "traits": { + "smithy.api#documentation": "

The name of the monitor to associated with the probe. To get a list of available monitors, use ListMonitors.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "probe": { + "target": "com.amazonaws.networkmonitor#ProbeInput", + "traits": { + "smithy.api#documentation": "

Describes the details of an individual probe for a monitor.

", + "smithy.api#required": {} + } + }, + "clientToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Unique, case-sensitive identifier to ensure the idempotency of the request. Only returned if a client token was provided in the request.

", + "smithy.api#idempotencyToken": {} + } + }, + "tags": { + "target": "com.amazonaws.networkmonitor#TagMap", + "traits": { + "smithy.api#documentation": "

The list of key-value pairs created and assigned to the probe.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.networkmonitor#CreateProbeOutput": { + "type": "structure", + "members": { + "probeId": { + "target": "com.amazonaws.networkmonitor#ProbeId", + "traits": { + "smithy.api#documentation": "

The ID of the probe for which details are returned.

" + } + }, + "probeArn": { + "target": "com.amazonaws.networkmonitor#Arn", + "traits": { + "smithy.api#documentation": "

The ARN of the probe.

" + } + }, + "sourceArn": { + "target": "com.amazonaws.networkmonitor#Arn", + "traits": { + "smithy.api#documentation": "

The ARN of the probe.

", + "smithy.api#required": {} + } + }, + "destination": { + "target": "com.amazonaws.networkmonitor#Destination", + "traits": { + "smithy.api#documentation": "

The destination IP address for the monitor. This will be either an IPv4 or IPv6 address.

", + "smithy.api#required": {} + } + }, + "destinationPort": { + "target": "com.amazonaws.networkmonitor#Port", + "traits": { + "smithy.api#documentation": "

The port associated with the destination. This is required only if the protocol is TCP and must be a number between 1 and 65536.

" + } + }, + "protocol": { + "target": "com.amazonaws.networkmonitor#Protocol", + "traits": { + "smithy.api#documentation": "

The protocol used for the network traffic between the source and destination. This will be either TCP or ICMP.

", + "smithy.api#required": {} + } + }, + "packetSize": { + "target": "com.amazonaws.networkmonitor#PacketSize", + "traits": { + "smithy.api#documentation": "

The size of the packets sent between the source and destination. This will be a number between 56 and 8500.

" + } + }, + "addressFamily": { + "target": "com.amazonaws.networkmonitor#AddressFamily", + "traits": { + "smithy.api#documentation": "

Indicates whether the IP address is IPV4 or IPV6.

" + } + }, + "vpcId": { + "target": "com.amazonaws.networkmonitor#VpcId", + "traits": { + "smithy.api#documentation": "

The ID of the source VPC or subnet.

" + } + }, + "state": { + "target": "com.amazonaws.networkmonitor#ProbeState", + "traits": { + "smithy.api#documentation": "

The state of the probe.

" + } + }, + "createdAt": { + "target": "com.amazonaws.networkmonitor#Iso8601Timestamp", + "traits": { + "smithy.api#documentation": "

The time and date that the probe was created.

" + } + }, + "modifiedAt": { + "target": "com.amazonaws.networkmonitor#Iso8601Timestamp", + "traits": { + "smithy.api#documentation": "

The time and date when the probe was last modified.

" + } + }, + "tags": { + "target": "com.amazonaws.networkmonitor#TagMap", + "traits": { + "smithy.api#documentation": "

The list of key-value pairs assigned to the probe.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.networkmonitor#DeleteMonitor": { + "type": "operation", + "input": { + "target": "com.amazonaws.networkmonitor#DeleteMonitorInput" + }, + "output": { + "target": "com.amazonaws.networkmonitor#DeleteMonitorOutput" + }, + "errors": [ + { + "target": "com.amazonaws.networkmonitor#AccessDeniedException" + }, + { + "target": "com.amazonaws.networkmonitor#InternalServerException" + }, + { + "target": "com.amazonaws.networkmonitor#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.networkmonitor#ThrottlingException" + }, + { + "target": "com.amazonaws.networkmonitor#ValidationException" + } + ], + "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to delete a monitor" + }, + "smithy.api#documentation": "

Deletes a specified monitor.

", + "smithy.api#http": { + "uri": "/monitors/{monitorName}", + "method": "DELETE" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.networkmonitor#DeleteMonitorInput": { + "type": "structure", + "members": { + "monitorName": { + "target": "com.amazonaws.networkmonitor#ResourceName", + "traits": { + "smithy.api#documentation": "

The name of the monitor to delete. Use the ListMonitors action to get a list of your current monitors.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.networkmonitor#DeleteMonitorOutput": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.networkmonitor#DeleteProbe": { + "type": "operation", + "input": { + "target": "com.amazonaws.networkmonitor#DeleteProbeInput" + }, + "output": { + "target": "com.amazonaws.networkmonitor#DeleteProbeOutput" + }, + "errors": [ + { + "target": "com.amazonaws.networkmonitor#AccessDeniedException" + }, + { + "target": "com.amazonaws.networkmonitor#InternalServerException" + }, + { + "target": "com.amazonaws.networkmonitor#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.networkmonitor#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.networkmonitor#ThrottlingException" + }, + { + "target": "com.amazonaws.networkmonitor#ValidationException" + } + ], + "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to delete a probe" + }, + "smithy.api#documentation": "

Deletes the specified monitor. Once a probe is deleted you'll no longer incur any billing fees for that probe.

", + "smithy.api#http": { + "uri": "/monitors/{monitorName}/probes/{probeId}", + "method": "DELETE" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.networkmonitor#DeleteProbeInput": { + "type": "structure", + "members": { + "monitorName": { + "target": "com.amazonaws.networkmonitor#ResourceName", + "traits": { + "smithy.api#documentation": "

The name of the monitor to delete. For a list of the available monitors, use the ListMonitors action.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "probeId": { + "target": "com.amazonaws.networkmonitor#ProbeId", + "traits": { + "smithy.api#documentation": "

The ID of the probe to delete. Run GetMonitor to get a lst of all probes and probe IDs associated with the monitor.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.networkmonitor#DeleteProbeOutput": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.networkmonitor#Destination": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 255 + } + } + }, + "com.amazonaws.networkmonitor#GetMonitor": { + "type": "operation", + "input": { + "target": "com.amazonaws.networkmonitor#GetMonitorInput" + }, + "output": { + "target": "com.amazonaws.networkmonitor#GetMonitorOutput" + }, + "errors": [ + { + "target": "com.amazonaws.networkmonitor#AccessDeniedException" + }, + { + "target": "com.amazonaws.networkmonitor#InternalServerException" + }, + { + "target": "com.amazonaws.networkmonitor#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.networkmonitor#ThrottlingException" + }, + { + "target": "com.amazonaws.networkmonitor#ValidationException" + } + ], + "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to get information about a monitor" + }, + "smithy.api#documentation": "

Returns details about a specific monitor.

", + "smithy.api#http": { + "uri": "/monitors/{monitorName}", + "method": "GET" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.networkmonitor#GetMonitorInput": { + "type": "structure", + "members": { + "monitorName": { + "target": "com.amazonaws.networkmonitor#ResourceName", + "traits": { + "smithy.api#documentation": "

The name of the monitor that details are returned for.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.networkmonitor#GetMonitorOutput": { + "type": "structure", + "members": { + "monitorArn": { + "target": "com.amazonaws.networkmonitor#MonitorArn", + "traits": { + "smithy.api#documentation": "

The ARN of the selected monitor.

", + "smithy.api#required": {} + } + }, + "monitorName": { + "target": "com.amazonaws.networkmonitor#ResourceName", + "traits": { + "smithy.api#documentation": "

The name of the monitor. To get a list of the current monitors and their names, use the ListMonitors action.

", + "smithy.api#required": {} + } + }, + "state": { + "target": "com.amazonaws.networkmonitor#MonitorState", + "traits": { + "smithy.api#documentation": "

Returns a list of the state of each monitor.

", + "smithy.api#required": {} + } + }, + "aggregationPeriod": { + "target": "com.amazonaws.networkmonitor#AggregationPeriod", + "traits": { + "smithy.api#documentation": "

The aggregation period for the specified monitor.

", + "smithy.api#required": {} + } + }, + "tags": { + "target": "com.amazonaws.networkmonitor#TagMap", + "traits": { + "smithy.api#documentation": "

The list of key-value pairs assigned to the monitor.

" + } + }, + "probes": { + "target": "com.amazonaws.networkmonitor#ProbeList", + "traits": { + "smithy.api#documentation": "

The details about each probe associated with that monitor.

" + } + }, + "createdAt": { + "target": "com.amazonaws.networkmonitor#Iso8601Timestamp", + "traits": { + "smithy.api#documentation": "

The time and date when the monitor was created.

", + "smithy.api#required": {} + } + }, + "modifiedAt": { + "target": "com.amazonaws.networkmonitor#Iso8601Timestamp", + "traits": { + "smithy.api#documentation": "

The time and date when the monitor was last modified.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.networkmonitor#GetProbe": { + "type": "operation", + "input": { + "target": "com.amazonaws.networkmonitor#GetProbeInput" + }, + "output": { + "target": "com.amazonaws.networkmonitor#GetProbeOutput" + }, + "errors": [ + { + "target": "com.amazonaws.networkmonitor#AccessDeniedException" + }, + { + "target": "com.amazonaws.networkmonitor#InternalServerException" + }, + { + "target": "com.amazonaws.networkmonitor#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.networkmonitor#ThrottlingException" + }, + { + "target": "com.amazonaws.networkmonitor#ValidationException" + } + ], + "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to get information about a probe" + }, + "smithy.api#documentation": "

Returns the details about a probe. You'll need both the monitorName and probeId.

", + "smithy.api#http": { + "uri": "/monitors/{monitorName}/probes/{probeId}", + "method": "GET" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.networkmonitor#GetProbeInput": { + "type": "structure", + "members": { + "monitorName": { + "target": "com.amazonaws.networkmonitor#ResourceName", + "traits": { + "smithy.api#documentation": "

The name of the monitor associated with the probe. Run ListMonitors to get a list of monitor names.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "probeId": { + "target": "com.amazonaws.networkmonitor#ProbeId", + "traits": { + "smithy.api#documentation": "

The ID of the probe to get information about. Run GetMonitor action to get a list of probes and probe IDs for the monitor.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.networkmonitor#GetProbeOutput": { + "type": "structure", + "members": { + "probeId": { + "target": "com.amazonaws.networkmonitor#ProbeId", + "traits": { + "smithy.api#documentation": "

The ID of the probe for which details are returned.

" + } + }, + "probeArn": { + "target": "com.amazonaws.networkmonitor#Arn", + "traits": { + "smithy.api#documentation": "

The ARN of the probe.

" + } + }, + "sourceArn": { + "target": "com.amazonaws.networkmonitor#Arn", + "traits": { + "smithy.api#documentation": "

The ARN of the probe.

", + "smithy.api#required": {} + } + }, + "destination": { + "target": "com.amazonaws.networkmonitor#Destination", + "traits": { + "smithy.api#documentation": "

The destination IP address for the monitor. This will be either an IPv4 or IPv6 address.

", + "smithy.api#required": {} + } + }, + "destinationPort": { + "target": "com.amazonaws.networkmonitor#Port", + "traits": { + "smithy.api#documentation": "

The port associated with the destination. This is required only if the protocol is TCP and must be a number between 1 and 65536.

" + } + }, + "protocol": { + "target": "com.amazonaws.networkmonitor#Protocol", + "traits": { + "smithy.api#documentation": "

The protocol used for the network traffic between the source and destination. This will be either TCP or ICMP.

", + "smithy.api#required": {} + } + }, + "packetSize": { + "target": "com.amazonaws.networkmonitor#PacketSize", + "traits": { + "smithy.api#documentation": "

The size of the packets sent between the source and destination. This will be a number between 56 and 8500.

" + } + }, + "addressFamily": { + "target": "com.amazonaws.networkmonitor#AddressFamily", + "traits": { + "smithy.api#documentation": "

Indicates whether the IP address is IPV4 or IPV6.

" + } + }, + "vpcId": { + "target": "com.amazonaws.networkmonitor#VpcId", + "traits": { + "smithy.api#documentation": "

The ID of the source VPC or subnet.

" + } + }, + "state": { + "target": "com.amazonaws.networkmonitor#ProbeState", + "traits": { + "smithy.api#documentation": "

The state of the probe.

" + } + }, + "createdAt": { + "target": "com.amazonaws.networkmonitor#Iso8601Timestamp", + "traits": { + "smithy.api#documentation": "

The time and date that the probe was created.

" + } + }, + "modifiedAt": { + "target": "com.amazonaws.networkmonitor#Iso8601Timestamp", + "traits": { + "smithy.api#documentation": "

The time and date that the probe was last modified.

" + } + }, + "tags": { + "target": "com.amazonaws.networkmonitor#TagMap", + "traits": { + "smithy.api#documentation": "

The list of key-value pairs assigned to the probe.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.networkmonitor#InternalServerException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

The request processing has failed because of an unknown error, exception or failure.

", + "smithy.api#error": "server", + "smithy.api#httpError": 500, + "smithy.api#retryable": {} + } + }, + "com.amazonaws.networkmonitor#Iso8601Timestamp": { + "type": "timestamp" + }, + "com.amazonaws.networkmonitor#ListMonitors": { + "type": "operation", + "input": { + "target": "com.amazonaws.networkmonitor#ListMonitorsInput" + }, + "output": { + "target": "com.amazonaws.networkmonitor#ListMonitorsOutput" + }, + "errors": [ + { + "target": "com.amazonaws.networkmonitor#AccessDeniedException" + }, + { + "target": "com.amazonaws.networkmonitor#InternalServerException" + }, + { + "target": "com.amazonaws.networkmonitor#ThrottlingException" + }, + { + "target": "com.amazonaws.networkmonitor#ValidationException" + } + ], + "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to list all monitors in an account and their statuses" + }, + "smithy.api#documentation": "

Returns a list of all of your monitors.

", + "smithy.api#http": { + "uri": "/monitors", + "method": "GET" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "monitors" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.networkmonitor#ListMonitorsInput": { + "type": "structure", + "members": { + "nextToken": { + "target": "com.amazonaws.networkmonitor#PaginationToken", + "traits": { + "smithy.api#documentation": "

The token for the next page of results.

", + "smithy.api#httpQuery": "nextToken" + } + }, + "maxResults": { + "target": "com.amazonaws.networkmonitor#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results to return with a single call.\n\tTo retrieve the remaining results, make another call with the returned nextToken value.

\n

If MaxResults is given a value larger than 100, only 100 results are\n returned.

", + "smithy.api#httpQuery": "maxResults" + } + }, + "state": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The list of all monitors and their states.

", + "smithy.api#httpQuery": "state" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.networkmonitor#ListMonitorsOutput": { + "type": "structure", + "members": { + "monitors": { + "target": "com.amazonaws.networkmonitor#MonitorList", + "traits": { + "smithy.api#documentation": "

Lists individual details about each of your monitors.

", + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The token for the next page of results.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.networkmonitor#ListTagsForResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.networkmonitor#ListTagsForResourceInput" + }, + "output": { + "target": "com.amazonaws.networkmonitor#ListTagsForResourceOutput" + }, + "errors": [ + { + "target": "com.amazonaws.networkmonitor#AccessDeniedException" + }, + { + "target": "com.amazonaws.networkmonitor#ConflictException" + }, + { + "target": "com.amazonaws.networkmonitor#InternalServerException" + }, + { + "target": "com.amazonaws.networkmonitor#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.networkmonitor#ThrottlingException" + }, + { + "target": "com.amazonaws.networkmonitor#ValidationException" + } + ], + "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to list the tags for a resource" + }, + "smithy.api#documentation": "

Lists the tags assigned to this resource.

", + "smithy.api#http": { + "uri": "/tags/{resourceArn}", + "method": "GET" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.networkmonitor#ListTagsForResourceInput": { + "type": "structure", + "members": { + "resourceArn": { + "target": "com.amazonaws.networkmonitor#Arn", + "traits": { + "smithy.api#documentation": "

The

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "aws.api#data": "tagging", + "smithy.api#input": {}, + "smithy.api#references": [ + { + "resource": "com.amazonaws.networkmonitor#MonitorResource", + "ids": { + "monitorName": "resourceArn" + } + }, + { + "resource": "com.amazonaws.networkmonitor#ProbeResource", + "ids": { + "monitorName": "resourceArn", + "probeId": "resourceArn" + } + } + ] + } + }, + "com.amazonaws.networkmonitor#ListTagsForResourceOutput": { + "type": "structure", + "members": { + "tags": { + "target": "com.amazonaws.networkmonitor#TagMap", + "traits": { + "smithy.api#documentation": "

Lists the tags assigned to the resource.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.networkmonitor#MaxResults": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 25 + } + } + }, + "com.amazonaws.networkmonitor#MonitorArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 20, + "max": 512 + }, + "smithy.api#pattern": "^arn:.*$" + } + }, + "com.amazonaws.networkmonitor#MonitorList": { + "type": "list", + "member": { + "target": "com.amazonaws.networkmonitor#MonitorSummary" + } + }, + "com.amazonaws.networkmonitor#MonitorResource": { + "type": "resource", + "identifiers": { + "monitorName": { + "target": "com.amazonaws.networkmonitor#ResourceName" + } + }, + "put": { + "target": "com.amazonaws.networkmonitor#CreateMonitor" + }, + "read": { + "target": "com.amazonaws.networkmonitor#GetMonitor" + }, + "update": { + "target": "com.amazonaws.networkmonitor#UpdateMonitor" + }, + "delete": { + "target": "com.amazonaws.networkmonitor#DeleteMonitor" + }, + "list": { + "target": "com.amazonaws.networkmonitor#ListMonitors" + }, + "traits": { + "aws.api#arn": { + "template": "monitor/{monitorName}" + }, + "aws.iam#conditionKeys": ["aws:ResourceTag/${TagKey}"], + "aws.iam#disableConditionKeyInference": {}, + "aws.iam#iamResource": { + "name": "monitor" + } + } + }, + "com.amazonaws.networkmonitor#MonitorState": { + "type": "enum", + "members": { + "PENDING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PENDING" + } + }, + "ACTIVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ACTIVE" + } + }, + "INACTIVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "INACTIVE" + } + }, + "ERROR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ERROR" + } + }, + "DELETING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETING" + } + } + } + }, + "com.amazonaws.networkmonitor#MonitorSummary": { + "type": "structure", + "members": { + "monitorArn": { + "target": "com.amazonaws.networkmonitor#MonitorArn", + "traits": { + "smithy.api#documentation": "

The ARN of the monitor.

", + "smithy.api#required": {} + } + }, + "monitorName": { + "target": "com.amazonaws.networkmonitor#ResourceName", + "traits": { + "smithy.api#documentation": "

The name of the monitor.

", + "smithy.api#required": {} + } + }, + "state": { + "target": "com.amazonaws.networkmonitor#MonitorState", + "traits": { + "smithy.api#documentation": "

The state of the monitor.

", + "smithy.api#required": {} + } + }, + "aggregationPeriod": { + "target": "com.amazonaws.networkmonitor#AggregationPeriod", + "traits": { + "smithy.api#documentation": "

The time, in seconds, that metrics are collected and sent to Amazon CloudWatch. Valid values are either 30 or 60.

" + } + }, + "tags": { + "target": "com.amazonaws.networkmonitor#TagMap", + "traits": { + "smithy.api#documentation": "

The list of key-value pairs assigned to the monitor.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Displays summary information about a monitor.

" + } + }, + "com.amazonaws.networkmonitor#NetworkMonitor": { + "type": "service", + "version": "2023-08-01", + "operations": [ + { + "target": "com.amazonaws.networkmonitor#ListTagsForResource" + }, + { + "target": "com.amazonaws.networkmonitor#TagResource" + }, + { + "target": "com.amazonaws.networkmonitor#UntagResource" + } + ], + "resources": [ + { + "target": "com.amazonaws.networkmonitor#MonitorResource" + }, + { + "target": "com.amazonaws.networkmonitor#ProbeResource" + } + ], + "traits": { + "aws.api#service": { + "sdkId": "NetworkMonitor", + "arnNamespace": "networkmonitor", + "cloudFormationName": "NetworkMonitor", + "cloudTrailEventSource": "networkmonitor.amazonaws.com" + }, + "aws.auth#sigv4": { + "name": "networkmonitor" + }, + "aws.iam#defineConditionKeys": { + "aws:ResourceTag/${TagKey}": { + "type": "String", + "documentation": "Filters access by the tag key-value pairs attached to the resource", + "externalDocumentation": "${DocHomeURL}IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-resourcetag" + }, + "aws:RequestTag/${TagKey}": { + "type": "String", + "documentation": "Filters access by the tag key-value pairs in the request", + "externalDocumentation": "${DocHomeURL}IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-requesttag" + }, + "aws:TagKeys": { + "type": "ArrayOfString", + "documentation": "Filters access by the tag keys in the request", + "externalDocumentation": "${DocHomeURL}IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-tagkeys" + } + }, + "aws.iam#supportedPrincipalTypes": ["Root", "IAMUser", "IAMRole", "FederatedUser"], + "aws.protocols#restJson1": {}, + "smithy.api#cors": { + "additionalAllowedHeaders": ["Content-Type", "X-Amz-Requested-Operation"] + }, + "smithy.api#documentation": "

Amazon CloudWatch Network Monitor is an Amazon Web Services active network monitoring\n service that identifies if a network issues exists within the Amazon Web Services network\n or your own company network. Within Network Monitor you'll choose the source VPCs and\n subnets from the Amazon Web Services network in which you operate and then you'll choose\n the destination IP addresses from your on-premises network. From these sources and\n destinations, Network Monitor creates a monitor containing all the possible source and\n destination combinations, each of which is called a probe, within a single monitor.\n These probes then monitor network traffic to help you identify where network issues might be affecting your traffic.

\n

For more information, see Using Amazon CloudWatch Network Monitor in the Amazon CloudWatch User Guide.

", + "smithy.api#title": "Amazon CloudWatch Network Monitor", + "smithy.rules#endpointRuleSet": { + "version": "1.0", + "parameters": { + "Region": { + "builtIn": "AWS::Region", + "required": false, + "documentation": "The AWS region used to dispatch the request.", + "type": "String" + }, + "UseDualStack": { + "builtIn": "AWS::UseDualStack", + "required": true, + "default": false, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "Boolean" + }, + "UseFIPS": { + "builtIn": "AWS::UseFIPS", + "required": true, + "default": false, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "Boolean" + }, + "Endpoint": { + "builtIn": "SDK::Endpoint", + "required": false, + "documentation": "Override the endpoint used to send this request", + "type": "String" + } + }, + "rules": [ + { + "conditions": [ + { + "fn": "isSet", + "argv": [ + { + "ref": "Endpoint" + } + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + } + ], + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error" + }, + { + "conditions": [], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error" + }, + { + "conditions": [], + "endpoint": { + "url": { + "ref": "Endpoint" + }, + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "rules": [ + { + "conditions": [ + { + "fn": "isSet", + "argv": [ + { + "ref": "Region" + } + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "aws.partition", + "argv": [ + { + "ref": "Region" + } + ], + "assign": "PartitionResult" + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + } + ] + }, + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsDualStack" + ] + } + ] + } + ], + "rules": [ + { + "conditions": [], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://networkmonitor-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error" + } + ], + "type": "tree" + }, + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + }, + true + ] + } + ], + "rules": [ + { + "conditions": [], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://networkmonitor-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error" + } + ], + "type": "tree" + }, + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsDualStack" + ] + } + ] + } + ], + "rules": [ + { + "conditions": [], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://networkmonitor.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error" + } + ], + "type": "tree" + }, + { + "conditions": [], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://networkmonitor.{Region}.{PartitionResult#dnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "Invalid Configuration: Missing Region", + "type": "error" + } + ], + "type": "tree" + } + ] + }, + "smithy.rules#endpointTests": { + "testCases": [ + { + "documentation": "For region us-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://networkmonitor-fips.us-east-1.api.aws" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region us-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://networkmonitor-fips.us-east-1.amazonaws.com" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://networkmonitor.us-east-1.api.aws" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region us-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://networkmonitor.us-east-1.amazonaws.com" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region cn-north-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://networkmonitor-fips.cn-north-1.api.amazonwebservices.com.cn" + } + }, + "params": { + "Region": "cn-north-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region cn-north-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://networkmonitor-fips.cn-north-1.amazonaws.com.cn" + } + }, + "params": { + "Region": "cn-north-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region cn-north-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://networkmonitor.cn-north-1.api.amazonwebservices.com.cn" + } + }, + "params": { + "Region": "cn-north-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region cn-north-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://networkmonitor.cn-north-1.amazonaws.com.cn" + } + }, + "params": { + "Region": "cn-north-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://networkmonitor-fips.us-gov-east-1.api.aws" + } + }, + "params": { + "Region": "us-gov-east-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://networkmonitor-fips.us-gov-east-1.amazonaws.com" + } + }, + "params": { + "Region": "us-gov-east-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://networkmonitor.us-gov-east-1.api.aws" + } + }, + "params": { + "Region": "us-gov-east-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://networkmonitor.us-gov-east-1.amazonaws.com" + } + }, + "params": { + "Region": "us-gov-east-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "error": "FIPS and DualStack are enabled, but this partition does not support one or both" + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://networkmonitor-fips.us-iso-east-1.c2s.ic.gov" + } + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "error": "DualStack is enabled but this partition does not support DualStack" + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://networkmonitor.us-iso-east-1.c2s.ic.gov" + } + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "error": "FIPS and DualStack are enabled, but this partition does not support one or both" + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://networkmonitor-fips.us-isob-east-1.sc2s.sgov.gov" + } + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "error": "DualStack is enabled but this partition does not support DualStack" + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://networkmonitor.us-isob-east-1.sc2s.sgov.gov" + } + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For custom endpoint with region set and fips disabled and dualstack disabled", + "expect": { + "endpoint": { + "url": "https://example.com" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": false, + "Endpoint": "https://example.com" + } + }, + { + "documentation": "For custom endpoint with region not set and fips disabled and dualstack disabled", + "expect": { + "endpoint": { + "url": "https://example.com" + } + }, + "params": { + "UseFIPS": false, + "UseDualStack": false, + "Endpoint": "https://example.com" + } + }, + { + "documentation": "For custom endpoint with fips enabled and dualstack disabled", + "expect": { + "error": "Invalid Configuration: FIPS and custom endpoint are not supported" + }, + "params": { + "Region": "us-east-1", + "UseFIPS": true, + "UseDualStack": false, + "Endpoint": "https://example.com" + } + }, + { + "documentation": "For custom endpoint with fips disabled and dualstack enabled", + "expect": { + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported" + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": true, + "Endpoint": "https://example.com" + } + }, + { + "documentation": "Missing region", + "expect": { + "error": "Invalid Configuration: Missing Region" + } + } + ], + "version": "1.0" + } + } + }, + "com.amazonaws.networkmonitor#PacketSize": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 56, + "max": 8500 + } + } + }, + "com.amazonaws.networkmonitor#PaginationToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 4096 + } + } + }, + "com.amazonaws.networkmonitor#Port": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 0, + "max": 65536 + } + } + }, + "com.amazonaws.networkmonitor#Probe": { + "type": "structure", + "members": { + "probeId": { + "target": "com.amazonaws.networkmonitor#ProbeId", + "traits": { + "smithy.api#documentation": "

The ID of the probe.

" + } + }, + "probeArn": { + "target": "com.amazonaws.networkmonitor#Arn", + "traits": { + "smithy.api#documentation": "

The ARN of the probe.

" + } + }, + "sourceArn": { + "target": "com.amazonaws.networkmonitor#Arn", + "traits": { + "smithy.api#documentation": "

The ARN of the probe source subnet.

", + "smithy.api#required": {} + } + }, + "destination": { + "target": "com.amazonaws.networkmonitor#Destination", + "traits": { + "smithy.api#documentation": "

The destination for the probe. This should be either an IPV4 or IPV6.

", + "smithy.api#required": {} + } + }, + "destinationPort": { + "target": "com.amazonaws.networkmonitor#Port", + "traits": { + "smithy.api#documentation": "

The destination port for the probe. This is required only if the protocol is TCP and must be a number between 1 and 65536.

" + } + }, + "protocol": { + "target": "com.amazonaws.networkmonitor#Protocol", + "traits": { + "smithy.api#documentation": "

The network protocol for the destination. This can be either TCP or ICMP. If the protocol is TCP, then port is also required.

", + "smithy.api#required": {} + } + }, + "packetSize": { + "target": "com.amazonaws.networkmonitor#PacketSize", + "traits": { + "smithy.api#documentation": "

The size of the packets traveling between the source and destination. This must be a number between 56 and

" + } + }, + "addressFamily": { + "target": "com.amazonaws.networkmonitor#AddressFamily", + "traits": { + "smithy.api#documentation": "

The IPv4 or IPv6 address for the probe.

" + } + }, + "vpcId": { + "target": "com.amazonaws.networkmonitor#VpcId", + "traits": { + "smithy.api#documentation": "

The ID of the source VPC subnet.

" + } + }, + "state": { + "target": "com.amazonaws.networkmonitor#ProbeState", + "traits": { + "smithy.api#documentation": "

The state of the probe.

" + } + }, + "createdAt": { + "target": "com.amazonaws.networkmonitor#Iso8601Timestamp", + "traits": { + "smithy.api#documentation": "

The time and date the probe was created.

" + } + }, + "modifiedAt": { + "target": "com.amazonaws.networkmonitor#Iso8601Timestamp", + "traits": { + "smithy.api#documentation": "

The time and date that the probe was last modified.

" + } + }, + "tags": { + "target": "com.amazonaws.networkmonitor#TagMap", + "traits": { + "smithy.api#documentation": "

The list of key-value pairs created and assigned to the probe.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Describes information about a monitor probe.

" + } + }, + "com.amazonaws.networkmonitor#ProbeId": { + "type": "string", + "traits": { + "smithy.api#pattern": "^probe-[a-z0-9A-Z-]{21,64}$" + } + }, + "com.amazonaws.networkmonitor#ProbeInput": { + "type": "structure", + "members": { + "sourceArn": { + "target": "com.amazonaws.networkmonitor#Arn", + "traits": { + "smithy.api#documentation": "

The ARN of the subnet.

", + "smithy.api#required": {} + } + }, + "destination": { + "target": "com.amazonaws.networkmonitor#Destination", + "traits": { + "smithy.api#documentation": "

The destination IP address. This will be either IPV4 or IPV6.

", + "smithy.api#required": {} + } + }, + "destinationPort": { + "target": "com.amazonaws.networkmonitor#Port", + "traits": { + "smithy.api#documentation": "

The port associated with the destination. This is required only if the protocol is TCP and must be a number between 1 and 65536.

" + } + }, + "protocol": { + "target": "com.amazonaws.networkmonitor#Protocol", + "traits": { + "smithy.api#documentation": "

The protocol used for the network traffic between the source and destination. This will be either TCP or ICMP.

", + "smithy.api#required": {} + } + }, + "packetSize": { + "target": "com.amazonaws.networkmonitor#PacketSize", + "traits": { + "smithy.api#documentation": "

The size of the packets sent between the source and destination. This will be a number between 56 and 8500.

" + } + }, + "tags": { + "target": "com.amazonaws.networkmonitor#TagMap", + "traits": { + "smithy.api#documentation": "

The list of key-value pairs created and assigned to the monitor.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Defines a probe when creating a probe or monitor.

" + } + }, + "com.amazonaws.networkmonitor#ProbeList": { + "type": "list", + "member": { + "target": "com.amazonaws.networkmonitor#Probe" + } + }, + "com.amazonaws.networkmonitor#ProbeResource": { + "type": "resource", + "identifiers": { + "monitorName": { + "target": "com.amazonaws.networkmonitor#ResourceName" + }, + "probeId": { + "target": "com.amazonaws.networkmonitor#ProbeId" + } + }, + "create": { + "target": "com.amazonaws.networkmonitor#CreateProbe" + }, + "read": { + "target": "com.amazonaws.networkmonitor#GetProbe" + }, + "update": { + "target": "com.amazonaws.networkmonitor#UpdateProbe" + }, + "delete": { + "target": "com.amazonaws.networkmonitor#DeleteProbe" + }, + "traits": { + "aws.iam#conditionKeys": ["aws:ResourceTag/${TagKey}"], + "aws.iam#disableConditionKeyInference": {}, + "aws.iam#iamResource": { + "name": "probe" + } + } + }, + "com.amazonaws.networkmonitor#ProbeState": { + "type": "enum", + "members": { + "PENDING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PENDING" + } + }, + "ACTIVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ACTIVE" + } + }, + "INACTIVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "INACTIVE" + } + }, + "ERROR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ERROR" + } + }, + "DELETING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETING" + } + }, + "DELETED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETED" + } + } + } + }, + "com.amazonaws.networkmonitor#Protocol": { + "type": "enum", + "members": { + "TCP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TCP" + } + }, + "ICMP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ICMP" + } + } + } + }, + "com.amazonaws.networkmonitor#ResourceName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 255 + }, + "smithy.api#pattern": "^[a-zA-Z0-9_-]+$" + } + }, + "com.amazonaws.networkmonitor#ResourceNotFoundException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

The specified resource does not exist.

", + "smithy.api#error": "client", + "smithy.api#httpError": 404 + } + }, + "com.amazonaws.networkmonitor#ServiceQuotaExceededException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

This request exceeds a service quota.

", + "smithy.api#error": "client", + "smithy.api#httpError": 402 + } + }, + "com.amazonaws.networkmonitor#TagKey": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 128 + } + } + }, + "com.amazonaws.networkmonitor#TagKeyList": { + "type": "list", + "member": { + "target": "com.amazonaws.networkmonitor#TagKey" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 200 + } + } + }, + "com.amazonaws.networkmonitor#TagMap": { + "type": "map", + "key": { + "target": "com.amazonaws.networkmonitor#TagKey" + }, + "value": { + "target": "com.amazonaws.networkmonitor#TagValue" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 200 + } + } + }, + "com.amazonaws.networkmonitor#TagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.networkmonitor#TagResourceInput" + }, + "output": { + "target": "com.amazonaws.networkmonitor#TagResourceOutput" + }, + "errors": [ + { + "target": "com.amazonaws.networkmonitor#AccessDeniedException" + }, + { + "target": "com.amazonaws.networkmonitor#ConflictException" + }, + { + "target": "com.amazonaws.networkmonitor#InternalServerException" + }, + { + "target": "com.amazonaws.networkmonitor#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.networkmonitor#ThrottlingException" + }, + { + "target": "com.amazonaws.networkmonitor#ValidationException" + } + ], + "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to add tags to a resource" + }, + "smithy.api#documentation": "

Adds key-value pairs to a monitor or probe.

", + "smithy.api#http": { + "uri": "/tags/{resourceArn}", + "method": "POST" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.networkmonitor#TagResourceInput": { + "type": "structure", + "members": { + "resourceArn": { + "target": "com.amazonaws.networkmonitor#Arn", + "traits": { + "smithy.api#documentation": "

The ARN of the monitor or probe to tag.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "tags": { + "target": "com.amazonaws.networkmonitor#TagMap", + "traits": { + "smithy.api#documentation": "

The list of key-value pairs assigned to the monitor or probe.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "aws.api#data": "tagging", + "smithy.api#input": {}, + "smithy.api#references": [ + { + "resource": "com.amazonaws.networkmonitor#MonitorResource", + "ids": { + "monitorName": "resourceArn" + } + }, + { + "resource": "com.amazonaws.networkmonitor#ProbeResource", + "ids": { + "monitorName": "resourceArn", + "probeId": "resourceArn" + } + } + ] + } + }, + "com.amazonaws.networkmonitor#TagResourceOutput": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.networkmonitor#TagValue": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 256 + } + } + }, + "com.amazonaws.networkmonitor#ThrottlingException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

The request was denied due to request throttling

", + "smithy.api#error": "client", + "smithy.api#httpError": 429, + "smithy.api#retryable": { + "throttling": true + } + } + }, + "com.amazonaws.networkmonitor#UntagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.networkmonitor#UntagResourceInput" + }, + "output": { + "target": "com.amazonaws.networkmonitor#UntagResourceOutput" + }, + "errors": [ + { + "target": "com.amazonaws.networkmonitor#AccessDeniedException" + }, + { + "target": "com.amazonaws.networkmonitor#ConflictException" + }, + { + "target": "com.amazonaws.networkmonitor#InternalServerException" + }, + { + "target": "com.amazonaws.networkmonitor#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.networkmonitor#ThrottlingException" + }, + { + "target": "com.amazonaws.networkmonitor#ValidationException" + } + ], + "traits": { + "aws.iam#conditionKeys": ["aws:TagKeys"], + "aws.iam#iamAction": { + "documentation": "Grants permission to remove tags from a resource" + }, + "smithy.api#documentation": "

Removes a key-value pair from a monitor or probe.

", + "smithy.api#http": { + "uri": "/tags/{resourceArn}", + "method": "DELETE" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.networkmonitor#UntagResourceInput": { + "type": "structure", + "members": { + "resourceArn": { + "target": "com.amazonaws.networkmonitor#Arn", + "traits": { + "smithy.api#documentation": "

The ARN of the monitor or probe that the tag should be removed from.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "tagKeys": { + "target": "com.amazonaws.networkmonitor#TagKeyList", + "traits": { + "smithy.api#documentation": "

The key-value pa

", + "smithy.api#httpQuery": "tagKeys", + "smithy.api#required": {} + } + } + }, + "traits": { + "aws.api#data": "tagging", + "smithy.api#input": {}, + "smithy.api#references": [ + { + "resource": "com.amazonaws.networkmonitor#MonitorResource", + "ids": { + "monitorName": "resourceArn" + } + }, + { + "resource": "com.amazonaws.networkmonitor#ProbeResource", + "ids": { + "monitorName": "resourceArn", + "probeId": "resourceArn" + } + } + ] + } + }, + "com.amazonaws.networkmonitor#UntagResourceOutput": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.networkmonitor#UpdateMonitor": { + "type": "operation", + "input": { + "target": "com.amazonaws.networkmonitor#UpdateMonitorInput" + }, + "output": { + "target": "com.amazonaws.networkmonitor#UpdateMonitorOutput" + }, + "errors": [ + { + "target": "com.amazonaws.networkmonitor#AccessDeniedException" + }, + { + "target": "com.amazonaws.networkmonitor#InternalServerException" + }, + { + "target": "com.amazonaws.networkmonitor#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.networkmonitor#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.networkmonitor#ThrottlingException" + }, + { + "target": "com.amazonaws.networkmonitor#ValidationException" + } + ], + "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to update a monitor" + }, + "smithy.api#documentation": "

Updates the aggregationPeriod for a monitor. Monitors support an aggregationPeriod of either 30 or 60 seconds.

", + "smithy.api#http": { + "uri": "/monitors/{monitorName}", + "method": "PATCH" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.networkmonitor#UpdateMonitorInput": { + "type": "structure", + "members": { + "monitorName": { + "target": "com.amazonaws.networkmonitor#ResourceName", + "traits": { + "smithy.api#documentation": "

The name of the monitor to update. Run ListMonitors to get a list of monitor names.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "aggregationPeriod": { + "target": "com.amazonaws.networkmonitor#AggregationPeriod", + "traits": { + "smithy.api#documentation": "

The aggregation time, in seconds, to change to. This must be either 30 or 60.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.networkmonitor#UpdateMonitorOutput": { + "type": "structure", + "members": { + "monitorArn": { + "target": "com.amazonaws.networkmonitor#MonitorArn", + "traits": { + "smithy.api#documentation": "

The ARN of the monitor that was updated.

", + "smithy.api#required": {} + } + }, + "monitorName": { + "target": "com.amazonaws.networkmonitor#ResourceName", + "traits": { + "smithy.api#documentation": "

The name of the monitor that was updated.

", + "smithy.api#required": {} + } + }, + "state": { + "target": "com.amazonaws.networkmonitor#MonitorState", + "traits": { + "smithy.api#documentation": "

The state of the updated monitor.

", + "smithy.api#required": {} + } + }, + "aggregationPeriod": { + "target": "com.amazonaws.networkmonitor#AggregationPeriod", + "traits": { + "smithy.api#documentation": "

The changed aggregation period.

" + } + }, + "tags": { + "target": "com.amazonaws.networkmonitor#TagMap", + "traits": { + "smithy.api#documentation": "

The list of key-value pairs associated with the monitor.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.networkmonitor#UpdateProbe": { + "type": "operation", + "input": { + "target": "com.amazonaws.networkmonitor#UpdateProbeInput" + }, + "output": { + "target": "com.amazonaws.networkmonitor#UpdateProbeOutput" + }, + "errors": [ + { + "target": "com.amazonaws.networkmonitor#AccessDeniedException" + }, + { + "target": "com.amazonaws.networkmonitor#InternalServerException" + }, + { + "target": "com.amazonaws.networkmonitor#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.networkmonitor#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.networkmonitor#ThrottlingException" + }, + { + "target": "com.amazonaws.networkmonitor#ValidationException" + } + ], + "traits": { + "aws.iam#iamAction": { + "documentation": "Grants permission to update a probe" + }, + "smithy.api#documentation": "

Updates a monitor probe. This action requires both the monitorName and probeId parameters. Run ListMonitors to get a list of monitor names. Run GetMonitor to get a list of probes and probe IDs.

", + "smithy.api#http": { + "uri": "/monitors/{monitorName}/probes/{probeId}", + "method": "PATCH" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.networkmonitor#UpdateProbeInput": { + "type": "structure", + "members": { + "monitorName": { + "target": "com.amazonaws.networkmonitor#ResourceName", + "traits": { + "smithy.api#documentation": "

The name of the monitor that the probe was updated for.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "probeId": { + "target": "com.amazonaws.networkmonitor#ProbeId", + "traits": { + "smithy.api#documentation": "

Run GetMonitor to get a list of probes and probe IDs.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "state": { + "target": "com.amazonaws.networkmonitor#ProbeState", + "traits": { + "smithy.api#documentation": "

The state of the probe update.

" + } + }, + "destination": { + "target": "com.amazonaws.networkmonitor#Destination", + "traits": { + "smithy.api#documentation": "

The updated IP address for the probe destination. This must be either an IPv4 or IPv6 address.

" + } + }, + "destinationPort": { + "target": "com.amazonaws.networkmonitor#Port", + "traits": { + "smithy.api#documentation": "

The updated port for the probe destination. This is required only if the protocol is TCP and must be a number between 1 and 65536.

" + } + }, + "protocol": { + "target": "com.amazonaws.networkmonitor#Protocol", + "traits": { + "smithy.api#documentation": "

The updated network protocol for the destination. This can be either TCP or ICMP. If the protocol is TCP, then port is also required.

" + } + }, + "packetSize": { + "target": "com.amazonaws.networkmonitor#PacketSize", + "traits": { + "smithy.api#documentation": "

he updated packets size for network traffic between the source and destination. This must be a number between 56 and 8500.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.networkmonitor#UpdateProbeOutput": { + "type": "structure", + "members": { + "probeId": { + "target": "com.amazonaws.networkmonitor#ProbeId", + "traits": { + "smithy.api#documentation": "

The updated ID of the probe.

" + } + }, + "probeArn": { + "target": "com.amazonaws.networkmonitor#Arn", + "traits": { + "smithy.api#documentation": "

The updated ARN of the probe.

" + } + }, + "sourceArn": { + "target": "com.amazonaws.networkmonitor#Arn", + "traits": { + "smithy.api#documentation": "

The updated ARN of the source subnet.

", + "smithy.api#required": {} + } + }, + "destination": { + "target": "com.amazonaws.networkmonitor#Destination", + "traits": { + "smithy.api#documentation": "

The updated destination IP address for the probe.

", + "smithy.api#required": {} + } + }, + "destinationPort": { + "target": "com.amazonaws.networkmonitor#Port", + "traits": { + "smithy.api#documentation": "

The updated destination port. This will be a number between 1 and 65536.

" + } + }, + "protocol": { + "target": "com.amazonaws.networkmonitor#Protocol", + "traits": { + "smithy.api#documentation": "

The updated protocol for the probe.

", + "smithy.api#required": {} + } + }, + "packetSize": { + "target": "com.amazonaws.networkmonitor#PacketSize", + "traits": { + "smithy.api#documentation": "

The updated packet size for the probe.

" + } + }, + "addressFamily": { + "target": "com.amazonaws.networkmonitor#AddressFamily", + "traits": { + "smithy.api#documentation": "

The updated IP address family. This will be either IPV4 or IPV6.

" + } + }, + "vpcId": { + "target": "com.amazonaws.networkmonitor#VpcId", + "traits": { + "smithy.api#documentation": "

The updated ID of the source VPC subnet ID.

" + } + }, + "state": { + "target": "com.amazonaws.networkmonitor#ProbeState", + "traits": { + "smithy.api#documentation": "

The state of the updated probe.

" + } + }, + "createdAt": { + "target": "com.amazonaws.networkmonitor#Iso8601Timestamp", + "traits": { + "smithy.api#documentation": "

The time and date that the probe was created.

" + } + }, + "modifiedAt": { + "target": "com.amazonaws.networkmonitor#Iso8601Timestamp", + "traits": { + "smithy.api#documentation": "

The time and date that the probe was last updated.

" + } + }, + "tags": { + "target": "com.amazonaws.networkmonitor#TagMap", + "traits": { + "smithy.api#documentation": "

Update tags for a probe.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.networkmonitor#ValidationException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

One of the parameters for the request is not valid.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.networkmonitor#VpcId": { + "type": "string", + "traits": { + "smithy.api#pattern": "^vpc-[a-zA-Z0-9]{8,32}$" + } + } + } +}