diff --git a/clients/client-internetmonitor/.gitignore b/clients/client-internetmonitor/.gitignore new file mode 100644 index 000000000000..54f14c9aef25 --- /dev/null +++ b/clients/client-internetmonitor/.gitignore @@ -0,0 +1,9 @@ +/node_modules/ +/build/ +/coverage/ +/docs/ +/dist-* +*.tsbuildinfo +*.tgz +*.log +package-lock.json diff --git a/clients/client-internetmonitor/LICENSE b/clients/client-internetmonitor/LICENSE new file mode 100644 index 000000000000..5001cd317c44 --- /dev/null +++ b/clients/client-internetmonitor/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-internetmonitor/README.md b/clients/client-internetmonitor/README.md new file mode 100644 index 000000000000..45807f3baa1c --- /dev/null +++ b/clients/client-internetmonitor/README.md @@ -0,0 +1,215 @@ + + +# @aws-sdk/client-internetmonitor + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-internetmonitor/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-internetmonitor) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-internetmonitor.svg)](https://www.npmjs.com/package/@aws-sdk/client-internetmonitor) + +## Description + +AWS SDK for JavaScript InternetMonitor Client for Node.js, Browser and React Native. + +

Amazon CloudWatch Internet Monitor provides visibility into how internet issues impact the performance and availability between your applications hosted on Amazon Web Services and your end +users, reducing the time it takes for you to diagnose these issues, from days to minutes. You can explore internet measurements for different time frames +and at different geographic granularities, and quickly visualize the impact of issues, and then take action to improve your end users' experience, for +example, by switching to other Amazon Web Services services or rerouting traffic to your workload through differentAmazon Web Services Regions.

+

If the issue is caused by the Amazon Web Services network, you'll automatically receive an Amazon Web Services Health Dashboard notification with the steps that Amazon Web Services is taking +to mitigate the problem. To support integrating health information for geographies and networks specific to your application, Internet Monitor delivers measurements +to CloudWatch Logs and CloudWatch Metrics. Internet Monitor also sends health events to Amazon EventBridge, so you can set up notifications. Internet Monitor monitors internet connectivity +for your application through Amazon Virtual Private Clouds (VPCs), Amazon CloudFront distributions, and Amazon WorkSpaces directories.

+

To use Internet Monitor, you create a monitor and add resources to it, Virtual Private Clouds (VPCs), Amazon CloudFront distributions, or WorkSpaces +directories that show where your application's internet traffic is. Internet Monitor then provides internet measurements from Amazon Web Services that are specific to the locations +and networks that communicate with your application. For more information, see Using Amazon CloudWatch Internet Monitor in the Amazon CloudWatch User Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-internetmonitor +using your favorite package manager: + +- `npm install @aws-sdk/client-internetmonitor` +- `yarn add @aws-sdk/client-internetmonitor` +- `pnpm add @aws-sdk/client-internetmonitor` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `InternetMonitorClient` and +the commands you need, for example `CreateMonitorCommand`: + +```js +// ES5 example +const { InternetMonitorClient, CreateMonitorCommand } = require("@aws-sdk/client-internetmonitor"); +``` + +```ts +// ES6+ example +import { InternetMonitorClient, CreateMonitorCommand } from "@aws-sdk/client-internetmonitor"; +``` + +### 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 InternetMonitorClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateMonitorCommand(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-internetmonitor"; +const client = new AWS.InternetMonitor({ region: "REGION" }); + +// async/await. +try { + const data = await client.createMonitor(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createMonitor(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createMonitor(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-internetmonitor` 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. diff --git a/clients/client-internetmonitor/package.json b/clients/client-internetmonitor/package.json new file mode 100644 index 000000000000..385bee77ed57 --- /dev/null +++ b/clients/client-internetmonitor/package.json @@ -0,0 +1,104 @@ +{ + "name": "@aws-sdk/client-internetmonitor", + "description": "AWS SDK for JavaScript Internetmonitor 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:docs": "typedoc", + "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", + "generate:client": "node ../../scripts/generate-clients/single-service --solo internetmonitor" + }, + "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/config-resolver": "*", + "@aws-sdk/credential-provider-node": "*", + "@aws-sdk/fetch-http-handler": "*", + "@aws-sdk/hash-node": "*", + "@aws-sdk/invalid-dependency": "*", + "@aws-sdk/middleware-content-length": "*", + "@aws-sdk/middleware-endpoint": "*", + "@aws-sdk/middleware-host-header": "*", + "@aws-sdk/middleware-logger": "*", + "@aws-sdk/middleware-recursion-detection": "*", + "@aws-sdk/middleware-retry": "*", + "@aws-sdk/middleware-serde": "*", + "@aws-sdk/middleware-signing": "*", + "@aws-sdk/middleware-stack": "*", + "@aws-sdk/middleware-user-agent": "*", + "@aws-sdk/node-config-provider": "*", + "@aws-sdk/node-http-handler": "*", + "@aws-sdk/protocol-http": "*", + "@aws-sdk/smithy-client": "*", + "@aws-sdk/types": "*", + "@aws-sdk/url-parser": "*", + "@aws-sdk/util-base64": "*", + "@aws-sdk/util-body-length-browser": "*", + "@aws-sdk/util-body-length-node": "*", + "@aws-sdk/util-defaults-mode-browser": "*", + "@aws-sdk/util-defaults-mode-node": "*", + "@aws-sdk/util-endpoints": "*", + "@aws-sdk/util-retry": "*", + "@aws-sdk/util-user-agent-browser": "*", + "@aws-sdk/util-user-agent-node": "*", + "@aws-sdk/util-utf8": "*", + "tslib": "^2.3.1", + "uuid": "^8.3.2" + }, + "devDependencies": { + "@aws-sdk/service-client-documentation-generator": "*", + "@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", + "typedoc": "0.19.2", + "typescript": "~4.6.2" + }, + "overrides": { + "typedoc": { + "typescript": "~4.6.2" + } + }, + "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-internetmonitor", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "clients/client-internetmonitor" + } +} diff --git a/clients/client-internetmonitor/src/InternetMonitor.ts b/clients/client-internetmonitor/src/InternetMonitor.ts new file mode 100644 index 000000000000..3c7a12802fbe --- /dev/null +++ b/clients/client-internetmonitor/src/InternetMonitor.ts @@ -0,0 +1,380 @@ +// smithy-typescript generated code +import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types"; + +import { + CreateMonitorCommand, + CreateMonitorCommandInput, + CreateMonitorCommandOutput, +} from "./commands/CreateMonitorCommand"; +import { + DeleteMonitorCommand, + DeleteMonitorCommandInput, + DeleteMonitorCommandOutput, +} from "./commands/DeleteMonitorCommand"; +import { + GetHealthEventCommand, + GetHealthEventCommandInput, + GetHealthEventCommandOutput, +} from "./commands/GetHealthEventCommand"; +import { GetMonitorCommand, GetMonitorCommandInput, GetMonitorCommandOutput } from "./commands/GetMonitorCommand"; +import { + ListHealthEventsCommand, + ListHealthEventsCommandInput, + ListHealthEventsCommandOutput, +} from "./commands/ListHealthEventsCommand"; +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 { InternetMonitorClient } from "./InternetMonitorClient"; + +/** + *

Amazon CloudWatch Internet Monitor provides visibility into how internet issues impact the performance and availability between your applications hosted on Amazon Web Services and your end + * users, reducing the time it takes for you to diagnose these issues, from days to minutes. You can explore internet measurements for different time frames + * and at different geographic granularities, and quickly visualize the impact of issues, and then take action to improve your end users' experience, for + * example, by switching to other Amazon Web Services services or rerouting traffic to your workload through differentAmazon Web Services Regions.

+ *

If the issue is caused by the Amazon Web Services network, you'll automatically receive an Amazon Web Services Health Dashboard notification with the steps that Amazon Web Services is taking + * to mitigate the problem. To support integrating health information for geographies and networks specific to your application, Internet Monitor delivers measurements + * to CloudWatch Logs and CloudWatch Metrics. Internet Monitor also sends health events to Amazon EventBridge, so you can set up notifications. Internet Monitor monitors internet connectivity + * for your application through Amazon Virtual Private Clouds (VPCs), Amazon CloudFront distributions, and Amazon WorkSpaces directories.

+ *

To use Internet Monitor, you create a monitor and add resources to it, Virtual Private Clouds (VPCs), Amazon CloudFront distributions, or WorkSpaces + * directories that show where your application's internet traffic is. Internet Monitor then provides internet measurements from Amazon Web Services that are specific to the locations + * and networks that communicate with your application. For more information, see Using Amazon CloudWatch Internet Monitor in the Amazon CloudWatch User Guide.

+ */ +export class InternetMonitor extends InternetMonitorClient { + /** + *

Creates a monitor in Amazon CloudWatch Internet Monitor. A monitor is built based on information from the application resources that you add: Virtual Private Clouds (VPCs), + * Amazon CloudFront distributions, and WorkSpaces directories.

+ *

After you create a monitor, you can view the internet performance for your application, scoped to a location, as well as any health events that are + * impairing traffic. Internet Monitor can also diagnose whether the impairment is on the Amazon Web Services network or is an issue with an internet service provider (ISP).

+ */ + public createMonitor( + args: CreateMonitorCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public createMonitor( + args: CreateMonitorCommandInput, + cb: (err: any, data?: CreateMonitorCommandOutput) => void + ): void; + public createMonitor( + args: CreateMonitorCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateMonitorCommandOutput) => void + ): void; + public createMonitor( + args: CreateMonitorCommandInput, + optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: CreateMonitorCommandOutput) => void), + cb?: (err: any, data?: CreateMonitorCommandOutput) => void + ): Promise | void { + const command = new CreateMonitorCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + *

Deletes a monitor in Amazon CloudWatch Internet Monitor.

+ */ + public deleteMonitor( + args: DeleteMonitorCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public deleteMonitor( + args: DeleteMonitorCommandInput, + cb: (err: any, data?: DeleteMonitorCommandOutput) => void + ): void; + public deleteMonitor( + args: DeleteMonitorCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteMonitorCommandOutput) => void + ): void; + public deleteMonitor( + args: DeleteMonitorCommandInput, + optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DeleteMonitorCommandOutput) => void), + cb?: (err: any, data?: DeleteMonitorCommandOutput) => void + ): Promise | void { + const command = new DeleteMonitorCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + *

Gets information the Amazon CloudWatch Internet Monitor has created and stored about a health event for a specified monitor. This information includes the impacted locations, + * and all of the information related to the event by location.

+ *

The information returned includes the performance, availability, and round-trip time impact, information about the network providers, the event type, + * and so on.

+ *

Information rolled up at the global traffic level is also returned, including the impact type and total traffic impact.

+ */ + public getHealthEvent( + args: GetHealthEventCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public getHealthEvent( + args: GetHealthEventCommandInput, + cb: (err: any, data?: GetHealthEventCommandOutput) => void + ): void; + public getHealthEvent( + args: GetHealthEventCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetHealthEventCommandOutput) => void + ): void; + public getHealthEvent( + args: GetHealthEventCommandInput, + optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetHealthEventCommandOutput) => void), + cb?: (err: any, data?: GetHealthEventCommandOutput) => void + ): Promise | void { + const command = new GetHealthEventCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + *

Gets information about a monitor in Amazon CloudWatch Internet Monitor based on a monitor name. The information returned includes the Amazon Resource Name (ARN), create time, + * modified time, resources included in the monitor, and status information.

+ */ + public getMonitor(args: GetMonitorCommandInput, options?: __HttpHandlerOptions): Promise; + public getMonitor(args: GetMonitorCommandInput, cb: (err: any, data?: GetMonitorCommandOutput) => void): void; + public getMonitor( + args: GetMonitorCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetMonitorCommandOutput) => void + ): void; + public getMonitor( + args: GetMonitorCommandInput, + optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetMonitorCommandOutput) => void), + cb?: (err: any, data?: GetMonitorCommandOutput) => void + ): Promise | void { + const command = new GetMonitorCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + *

Lists all health events for a monitor in Amazon CloudWatch Internet Monitor. Returns all information for health events including the client location information the network + * cause and status, event start and end time, percentage of total traffic impacted, and status.

+ * + *

Health events that have start times during the time frame that is requested are not included in the list of health events.

+ *
+ */ + public listHealthEvents( + args: ListHealthEventsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public listHealthEvents( + args: ListHealthEventsCommandInput, + cb: (err: any, data?: ListHealthEventsCommandOutput) => void + ): void; + public listHealthEvents( + args: ListHealthEventsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListHealthEventsCommandOutput) => void + ): void; + public listHealthEvents( + args: ListHealthEventsCommandInput, + optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListHealthEventsCommandOutput) => void), + cb?: (err: any, data?: ListHealthEventsCommandOutput) => void + ): Promise | void { + const command = new ListHealthEventsCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + *

Lists all of your monitors for Amazon CloudWatch Internet Monitor and their statuses, along with the Amazon Resource Name (ARN) and name of each monitor.

+ */ + public listMonitors( + args: ListMonitorsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public listMonitors(args: ListMonitorsCommandInput, cb: (err: any, data?: ListMonitorsCommandOutput) => void): void; + public listMonitors( + args: ListMonitorsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListMonitorsCommandOutput) => void + ): void; + public listMonitors( + args: ListMonitorsCommandInput, + optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListMonitorsCommandOutput) => void), + cb?: (err: any, data?: ListMonitorsCommandOutput) => void + ): Promise | void { + const command = new ListMonitorsCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + *

Lists the tags for a resource. Tags are supported only for monitors in Amazon CloudWatch Internet Monitor.

+ */ + public listTagsForResource( + args: ListTagsForResourceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public listTagsForResource( + args: ListTagsForResourceCommandInput, + cb: (err: any, data?: ListTagsForResourceCommandOutput) => void + ): void; + public listTagsForResource( + args: ListTagsForResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListTagsForResourceCommandOutput) => void + ): void; + public listTagsForResource( + args: ListTagsForResourceCommandInput, + optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListTagsForResourceCommandOutput) => void), + cb?: (err: any, data?: ListTagsForResourceCommandOutput) => void + ): Promise | void { + const command = new ListTagsForResourceCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + *

Adds a tag to a resource. Tags are supported only for monitors in Amazon CloudWatch Internet Monitor. You can add a maximum of 50 tags in Internet Monitor.

+ *

A minimum of one tag is required for this call. It returns an error if you use the TagResource request with 0 tags.

+ */ + public tagResource(args: TagResourceCommandInput, options?: __HttpHandlerOptions): Promise; + public tagResource(args: TagResourceCommandInput, cb: (err: any, data?: TagResourceCommandOutput) => void): void; + public tagResource( + args: TagResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: TagResourceCommandOutput) => void + ): void; + public tagResource( + args: TagResourceCommandInput, + optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: TagResourceCommandOutput) => void), + cb?: (err: any, data?: TagResourceCommandOutput) => void + ): Promise | void { + const command = new TagResourceCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + *

Removes a tag from a resource.

+ */ + public untagResource( + args: UntagResourceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public untagResource( + args: UntagResourceCommandInput, + cb: (err: any, data?: UntagResourceCommandOutput) => void + ): void; + public untagResource( + args: UntagResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UntagResourceCommandOutput) => void + ): void; + public untagResource( + args: UntagResourceCommandInput, + optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UntagResourceCommandOutput) => void), + cb?: (err: any, data?: UntagResourceCommandOutput) => void + ): Promise | void { + const command = new UntagResourceCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + *

Updates a monitor. You can update a monitor to add or remove resources, or to change the status of the monitor. You can't change the name of a + * monitor.

+ */ + public updateMonitor( + args: UpdateMonitorCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public updateMonitor( + args: UpdateMonitorCommandInput, + cb: (err: any, data?: UpdateMonitorCommandOutput) => void + ): void; + public updateMonitor( + args: UpdateMonitorCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateMonitorCommandOutput) => void + ): void; + public updateMonitor( + args: UpdateMonitorCommandInput, + optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateMonitorCommandOutput) => void), + cb?: (err: any, data?: UpdateMonitorCommandOutput) => void + ): Promise | void { + const command = new UpdateMonitorCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } +} diff --git a/clients/client-internetmonitor/src/InternetMonitorClient.ts b/clients/client-internetmonitor/src/InternetMonitorClient.ts new file mode 100644 index 000000000000..6fd1f5db30a9 --- /dev/null +++ b/clients/client-internetmonitor/src/InternetMonitorClient.ts @@ -0,0 +1,298 @@ +// smithy-typescript generated code +import { RegionInputConfig, RegionResolvedConfig, resolveRegionConfig } from "@aws-sdk/config-resolver"; +import { getContentLengthPlugin } from "@aws-sdk/middleware-content-length"; +import { EndpointInputConfig, EndpointResolvedConfig, resolveEndpointConfig } from "@aws-sdk/middleware-endpoint"; +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 { getRetryPlugin, resolveRetryConfig, RetryInputConfig, RetryResolvedConfig } from "@aws-sdk/middleware-retry"; +import { + AwsAuthInputConfig, + AwsAuthResolvedConfig, + getAwsAuthPlugin, + resolveAwsAuthConfig, +} from "@aws-sdk/middleware-signing"; +import { + getUserAgentPlugin, + resolveUserAgentConfig, + UserAgentInputConfig, + UserAgentResolvedConfig, +} from "@aws-sdk/middleware-user-agent"; +import { HttpHandler as __HttpHandler } from "@aws-sdk/protocol-http"; +import { + Client as __Client, + DefaultsMode as __DefaultsMode, + SmithyConfiguration as __SmithyConfiguration, + SmithyResolvedConfiguration as __SmithyResolvedConfiguration, +} from "@aws-sdk/smithy-client"; +import { + BodyLengthCalculator as __BodyLengthCalculator, + Checksum as __Checksum, + ChecksumConstructor as __ChecksumConstructor, + Credentials as __Credentials, + Decoder as __Decoder, + Encoder as __Encoder, + EndpointV2 as __EndpointV2, + Hash as __Hash, + HashConstructor as __HashConstructor, + HttpHandlerOptions as __HttpHandlerOptions, + Logger as __Logger, + Provider as __Provider, + Provider, + StreamCollector as __StreamCollector, + UrlParser as __UrlParser, + UserAgent as __UserAgent, +} from "@aws-sdk/types"; + +import { CreateMonitorCommandInput, CreateMonitorCommandOutput } from "./commands/CreateMonitorCommand"; +import { DeleteMonitorCommandInput, DeleteMonitorCommandOutput } from "./commands/DeleteMonitorCommand"; +import { GetHealthEventCommandInput, GetHealthEventCommandOutput } from "./commands/GetHealthEventCommand"; +import { GetMonitorCommandInput, GetMonitorCommandOutput } from "./commands/GetMonitorCommand"; +import { ListHealthEventsCommandInput, ListHealthEventsCommandOutput } from "./commands/ListHealthEventsCommand"; +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 { + ClientInputEndpointParameters, + ClientResolvedEndpointParameters, + EndpointParameters, + resolveClientEndpointParameters, +} from "./endpoint/EndpointParameters"; +import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig"; + +export type ServiceInputTypes = + | CreateMonitorCommandInput + | DeleteMonitorCommandInput + | GetHealthEventCommandInput + | GetMonitorCommandInput + | ListHealthEventsCommandInput + | ListMonitorsCommandInput + | ListTagsForResourceCommandInput + | TagResourceCommandInput + | UntagResourceCommandInput + | UpdateMonitorCommandInput; + +export type ServiceOutputTypes = + | CreateMonitorCommandOutput + | DeleteMonitorCommandOutput + | GetHealthEventCommandOutput + | GetMonitorCommandOutput + | ListHealthEventsCommandOutput + | ListMonitorsCommandOutput + | ListTagsForResourceCommandOutput + | TagResourceCommandOutput + | UntagResourceCommandOutput + | UpdateMonitorCommandOutput; + +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 __Checksum} 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 dyanamically 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. + */ + retryMode?: string | __Provider; + + /** + * Optional logger for logging debug/info/warn/error. + */ + logger?: __Logger; + + /** + * The {@link __DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK. + */ + defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>; +} + +type InternetMonitorClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & + ClientDefaults & + RegionInputConfig & + EndpointInputConfig & + RetryInputConfig & + HostHeaderInputConfig & + AwsAuthInputConfig & + UserAgentInputConfig & + ClientInputEndpointParameters; +/** + * The configuration interface of InternetMonitorClient class constructor that set the region, credentials and other options. + */ +export interface InternetMonitorClientConfig extends InternetMonitorClientConfigType {} + +type InternetMonitorClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & + Required & + RegionResolvedConfig & + EndpointResolvedConfig & + RetryResolvedConfig & + HostHeaderResolvedConfig & + AwsAuthResolvedConfig & + UserAgentResolvedConfig & + ClientResolvedEndpointParameters; +/** + * The resolved configuration interface of InternetMonitorClient class. This is resolved and normalized from the {@link InternetMonitorClientConfig | constructor configuration interface}. + */ +export interface InternetMonitorClientResolvedConfig extends InternetMonitorClientResolvedConfigType {} + +/** + *

Amazon CloudWatch Internet Monitor provides visibility into how internet issues impact the performance and availability between your applications hosted on Amazon Web Services and your end + * users, reducing the time it takes for you to diagnose these issues, from days to minutes. You can explore internet measurements for different time frames + * and at different geographic granularities, and quickly visualize the impact of issues, and then take action to improve your end users' experience, for + * example, by switching to other Amazon Web Services services or rerouting traffic to your workload through differentAmazon Web Services Regions.

+ *

If the issue is caused by the Amazon Web Services network, you'll automatically receive an Amazon Web Services Health Dashboard notification with the steps that Amazon Web Services is taking + * to mitigate the problem. To support integrating health information for geographies and networks specific to your application, Internet Monitor delivers measurements + * to CloudWatch Logs and CloudWatch Metrics. Internet Monitor also sends health events to Amazon EventBridge, so you can set up notifications. Internet Monitor monitors internet connectivity + * for your application through Amazon Virtual Private Clouds (VPCs), Amazon CloudFront distributions, and Amazon WorkSpaces directories.

+ *

To use Internet Monitor, you create a monitor and add resources to it, Virtual Private Clouds (VPCs), Amazon CloudFront distributions, or WorkSpaces + * directories that show where your application's internet traffic is. Internet Monitor then provides internet measurements from Amazon Web Services that are specific to the locations + * and networks that communicate with your application. For more information, see Using Amazon CloudWatch Internet Monitor in the Amazon CloudWatch User Guide.

+ */ +export class InternetMonitorClient extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + InternetMonitorClientResolvedConfig +> { + /** + * The resolved configuration of InternetMonitorClient class. This is resolved and normalized from the {@link InternetMonitorClientConfig | constructor configuration interface}. + */ + readonly config: InternetMonitorClientResolvedConfig; + + constructor(configuration: InternetMonitorClientConfig) { + 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); + super(_config_7); + this.config = _config_7; + 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-internetmonitor/src/commands/CreateMonitorCommand.ts b/clients/client-internetmonitor/src/commands/CreateMonitorCommand.ts new file mode 100644 index 000000000000..f72d431c51f1 --- /dev/null +++ b/clients/client-internetmonitor/src/commands/CreateMonitorCommand.ts @@ -0,0 +1,114 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, +} from "@aws-sdk/types"; + +import { InternetMonitorClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../InternetMonitorClient"; +import { + CreateMonitorInput, + CreateMonitorInputFilterSensitiveLog, + CreateMonitorOutput, + CreateMonitorOutputFilterSensitiveLog, +} from "../models/models_0"; +import { + deserializeAws_restJson1CreateMonitorCommand, + serializeAws_restJson1CreateMonitorCommand, +} from "../protocols/Aws_restJson1"; + +export interface CreateMonitorCommandInput extends CreateMonitorInput {} +export interface CreateMonitorCommandOutput extends CreateMonitorOutput, __MetadataBearer {} + +/** + *

Creates a monitor in Amazon CloudWatch Internet Monitor. A monitor is built based on information from the application resources that you add: Virtual Private Clouds (VPCs), + * Amazon CloudFront distributions, and WorkSpaces directories.

+ *

After you create a monitor, you can view the internet performance for your application, scoped to a location, as well as any health events that are + * impairing traffic. Internet Monitor can also diagnose whether the impairment is on the Amazon Web Services network or is an issue with an internet service provider (ISP).

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { InternetMonitorClient, CreateMonitorCommand } from "@aws-sdk/client-internetmonitor"; // ES Modules import + * // const { InternetMonitorClient, CreateMonitorCommand } = require("@aws-sdk/client-internetmonitor"); // CommonJS import + * const client = new InternetMonitorClient(config); + * const command = new CreateMonitorCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link CreateMonitorCommandInput} for command's `input` shape. + * @see {@link CreateMonitorCommandOutput} for command's `response` shape. + * @see {@link InternetMonitorClientResolvedConfig | config} for InternetMonitorClient's `config` shape. + * + */ +export class CreateMonitorCommand extends $Command< + CreateMonitorCommandInput, + CreateMonitorCommandOutput, + InternetMonitorClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + }; + } + + constructor(readonly input: CreateMonitorCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: InternetMonitorClientResolvedConfig, + 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 = "InternetMonitorClient"; + const commandName = "CreateMonitorCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: CreateMonitorInputFilterSensitiveLog, + outputFilterSensitiveLog: CreateMonitorOutputFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize(input: CreateMonitorCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return serializeAws_restJson1CreateMonitorCommand(input, context); + } + + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return deserializeAws_restJson1CreateMonitorCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-internetmonitor/src/commands/DeleteMonitorCommand.ts b/clients/client-internetmonitor/src/commands/DeleteMonitorCommand.ts new file mode 100644 index 000000000000..7e2081a94295 --- /dev/null +++ b/clients/client-internetmonitor/src/commands/DeleteMonitorCommand.ts @@ -0,0 +1,111 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, +} from "@aws-sdk/types"; + +import { InternetMonitorClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../InternetMonitorClient"; +import { + DeleteMonitorInput, + DeleteMonitorInputFilterSensitiveLog, + DeleteMonitorOutput, + DeleteMonitorOutputFilterSensitiveLog, +} from "../models/models_0"; +import { + deserializeAws_restJson1DeleteMonitorCommand, + serializeAws_restJson1DeleteMonitorCommand, +} from "../protocols/Aws_restJson1"; + +export interface DeleteMonitorCommandInput extends DeleteMonitorInput {} +export interface DeleteMonitorCommandOutput extends DeleteMonitorOutput, __MetadataBearer {} + +/** + *

Deletes a monitor in Amazon CloudWatch Internet Monitor.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { InternetMonitorClient, DeleteMonitorCommand } from "@aws-sdk/client-internetmonitor"; // ES Modules import + * // const { InternetMonitorClient, DeleteMonitorCommand } = require("@aws-sdk/client-internetmonitor"); // CommonJS import + * const client = new InternetMonitorClient(config); + * const command = new DeleteMonitorCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link DeleteMonitorCommandInput} for command's `input` shape. + * @see {@link DeleteMonitorCommandOutput} for command's `response` shape. + * @see {@link InternetMonitorClientResolvedConfig | config} for InternetMonitorClient's `config` shape. + * + */ +export class DeleteMonitorCommand extends $Command< + DeleteMonitorCommandInput, + DeleteMonitorCommandOutput, + InternetMonitorClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + }; + } + + constructor(readonly input: DeleteMonitorCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: InternetMonitorClientResolvedConfig, + 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 = "InternetMonitorClient"; + const commandName = "DeleteMonitorCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: DeleteMonitorInputFilterSensitiveLog, + outputFilterSensitiveLog: DeleteMonitorOutputFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize(input: DeleteMonitorCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return serializeAws_restJson1DeleteMonitorCommand(input, context); + } + + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return deserializeAws_restJson1DeleteMonitorCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-internetmonitor/src/commands/GetHealthEventCommand.ts b/clients/client-internetmonitor/src/commands/GetHealthEventCommand.ts new file mode 100644 index 000000000000..d0da7a005456 --- /dev/null +++ b/clients/client-internetmonitor/src/commands/GetHealthEventCommand.ts @@ -0,0 +1,117 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, +} from "@aws-sdk/types"; + +import { InternetMonitorClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../InternetMonitorClient"; +import { + GetHealthEventInput, + GetHealthEventInputFilterSensitiveLog, + GetHealthEventOutput, + GetHealthEventOutputFilterSensitiveLog, +} from "../models/models_0"; +import { + deserializeAws_restJson1GetHealthEventCommand, + serializeAws_restJson1GetHealthEventCommand, +} from "../protocols/Aws_restJson1"; + +export interface GetHealthEventCommandInput extends GetHealthEventInput {} +export interface GetHealthEventCommandOutput extends GetHealthEventOutput, __MetadataBearer {} + +/** + *

Gets information the Amazon CloudWatch Internet Monitor has created and stored about a health event for a specified monitor. This information includes the impacted locations, + * and all of the information related to the event by location.

+ *

The information returned includes the performance, availability, and round-trip time impact, information about the network providers, the event type, + * and so on.

+ *

Information rolled up at the global traffic level is also returned, including the impact type and total traffic impact.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { InternetMonitorClient, GetHealthEventCommand } from "@aws-sdk/client-internetmonitor"; // ES Modules import + * // const { InternetMonitorClient, GetHealthEventCommand } = require("@aws-sdk/client-internetmonitor"); // CommonJS import + * const client = new InternetMonitorClient(config); + * const command = new GetHealthEventCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link GetHealthEventCommandInput} for command's `input` shape. + * @see {@link GetHealthEventCommandOutput} for command's `response` shape. + * @see {@link InternetMonitorClientResolvedConfig | config} for InternetMonitorClient's `config` shape. + * + */ +export class GetHealthEventCommand extends $Command< + GetHealthEventCommandInput, + GetHealthEventCommandOutput, + InternetMonitorClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + }; + } + + constructor(readonly input: GetHealthEventCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: InternetMonitorClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, GetHealthEventCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "InternetMonitorClient"; + const commandName = "GetHealthEventCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: GetHealthEventInputFilterSensitiveLog, + outputFilterSensitiveLog: GetHealthEventOutputFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize(input: GetHealthEventCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return serializeAws_restJson1GetHealthEventCommand(input, context); + } + + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return deserializeAws_restJson1GetHealthEventCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-internetmonitor/src/commands/GetMonitorCommand.ts b/clients/client-internetmonitor/src/commands/GetMonitorCommand.ts new file mode 100644 index 000000000000..01fb9d430837 --- /dev/null +++ b/clients/client-internetmonitor/src/commands/GetMonitorCommand.ts @@ -0,0 +1,112 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, +} from "@aws-sdk/types"; + +import { InternetMonitorClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../InternetMonitorClient"; +import { + GetMonitorInput, + GetMonitorInputFilterSensitiveLog, + GetMonitorOutput, + GetMonitorOutputFilterSensitiveLog, +} from "../models/models_0"; +import { + deserializeAws_restJson1GetMonitorCommand, + serializeAws_restJson1GetMonitorCommand, +} from "../protocols/Aws_restJson1"; + +export interface GetMonitorCommandInput extends GetMonitorInput {} +export interface GetMonitorCommandOutput extends GetMonitorOutput, __MetadataBearer {} + +/** + *

Gets information about a monitor in Amazon CloudWatch Internet Monitor based on a monitor name. The information returned includes the Amazon Resource Name (ARN), create time, + * modified time, resources included in the monitor, and status information.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { InternetMonitorClient, GetMonitorCommand } from "@aws-sdk/client-internetmonitor"; // ES Modules import + * // const { InternetMonitorClient, GetMonitorCommand } = require("@aws-sdk/client-internetmonitor"); // CommonJS import + * const client = new InternetMonitorClient(config); + * const command = new GetMonitorCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link GetMonitorCommandInput} for command's `input` shape. + * @see {@link GetMonitorCommandOutput} for command's `response` shape. + * @see {@link InternetMonitorClientResolvedConfig | config} for InternetMonitorClient's `config` shape. + * + */ +export class GetMonitorCommand extends $Command< + GetMonitorCommandInput, + GetMonitorCommandOutput, + InternetMonitorClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + }; + } + + constructor(readonly input: GetMonitorCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: InternetMonitorClientResolvedConfig, + 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 = "InternetMonitorClient"; + const commandName = "GetMonitorCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: GetMonitorInputFilterSensitiveLog, + outputFilterSensitiveLog: GetMonitorOutputFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize(input: GetMonitorCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return serializeAws_restJson1GetMonitorCommand(input, context); + } + + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return deserializeAws_restJson1GetMonitorCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-internetmonitor/src/commands/ListHealthEventsCommand.ts b/clients/client-internetmonitor/src/commands/ListHealthEventsCommand.ts new file mode 100644 index 000000000000..5fa46590d5cd --- /dev/null +++ b/clients/client-internetmonitor/src/commands/ListHealthEventsCommand.ts @@ -0,0 +1,117 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, +} from "@aws-sdk/types"; + +import { InternetMonitorClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../InternetMonitorClient"; +import { + ListHealthEventsInput, + ListHealthEventsInputFilterSensitiveLog, + ListHealthEventsOutput, + ListHealthEventsOutputFilterSensitiveLog, +} from "../models/models_0"; +import { + deserializeAws_restJson1ListHealthEventsCommand, + serializeAws_restJson1ListHealthEventsCommand, +} from "../protocols/Aws_restJson1"; + +export interface ListHealthEventsCommandInput extends ListHealthEventsInput {} +export interface ListHealthEventsCommandOutput extends ListHealthEventsOutput, __MetadataBearer {} + +/** + *

Lists all health events for a monitor in Amazon CloudWatch Internet Monitor. Returns all information for health events including the client location information the network + * cause and status, event start and end time, percentage of total traffic impacted, and status.

+ * + *

Health events that have start times during the time frame that is requested are not included in the list of health events.

+ *
+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { InternetMonitorClient, ListHealthEventsCommand } from "@aws-sdk/client-internetmonitor"; // ES Modules import + * // const { InternetMonitorClient, ListHealthEventsCommand } = require("@aws-sdk/client-internetmonitor"); // CommonJS import + * const client = new InternetMonitorClient(config); + * const command = new ListHealthEventsCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link ListHealthEventsCommandInput} for command's `input` shape. + * @see {@link ListHealthEventsCommandOutput} for command's `response` shape. + * @see {@link InternetMonitorClientResolvedConfig | config} for InternetMonitorClient's `config` shape. + * + */ +export class ListHealthEventsCommand extends $Command< + ListHealthEventsCommandInput, + ListHealthEventsCommandOutput, + InternetMonitorClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + }; + } + + constructor(readonly input: ListHealthEventsCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: InternetMonitorClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, ListHealthEventsCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "InternetMonitorClient"; + const commandName = "ListHealthEventsCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: ListHealthEventsInputFilterSensitiveLog, + outputFilterSensitiveLog: ListHealthEventsOutputFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize(input: ListHealthEventsCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return serializeAws_restJson1ListHealthEventsCommand(input, context); + } + + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return deserializeAws_restJson1ListHealthEventsCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-internetmonitor/src/commands/ListMonitorsCommand.ts b/clients/client-internetmonitor/src/commands/ListMonitorsCommand.ts new file mode 100644 index 000000000000..0d1ecc06c56e --- /dev/null +++ b/clients/client-internetmonitor/src/commands/ListMonitorsCommand.ts @@ -0,0 +1,111 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, +} from "@aws-sdk/types"; + +import { InternetMonitorClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../InternetMonitorClient"; +import { + ListMonitorsInput, + ListMonitorsInputFilterSensitiveLog, + ListMonitorsOutput, + ListMonitorsOutputFilterSensitiveLog, +} from "../models/models_0"; +import { + deserializeAws_restJson1ListMonitorsCommand, + serializeAws_restJson1ListMonitorsCommand, +} from "../protocols/Aws_restJson1"; + +export interface ListMonitorsCommandInput extends ListMonitorsInput {} +export interface ListMonitorsCommandOutput extends ListMonitorsOutput, __MetadataBearer {} + +/** + *

Lists all of your monitors for Amazon CloudWatch Internet Monitor and their statuses, along with the Amazon Resource Name (ARN) and name of each monitor.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { InternetMonitorClient, ListMonitorsCommand } from "@aws-sdk/client-internetmonitor"; // ES Modules import + * // const { InternetMonitorClient, ListMonitorsCommand } = require("@aws-sdk/client-internetmonitor"); // CommonJS import + * const client = new InternetMonitorClient(config); + * const command = new ListMonitorsCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link ListMonitorsCommandInput} for command's `input` shape. + * @see {@link ListMonitorsCommandOutput} for command's `response` shape. + * @see {@link InternetMonitorClientResolvedConfig | config} for InternetMonitorClient's `config` shape. + * + */ +export class ListMonitorsCommand extends $Command< + ListMonitorsCommandInput, + ListMonitorsCommandOutput, + InternetMonitorClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + }; + } + + constructor(readonly input: ListMonitorsCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: InternetMonitorClientResolvedConfig, + 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 = "InternetMonitorClient"; + const commandName = "ListMonitorsCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: ListMonitorsInputFilterSensitiveLog, + outputFilterSensitiveLog: ListMonitorsOutputFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize(input: ListMonitorsCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return serializeAws_restJson1ListMonitorsCommand(input, context); + } + + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return deserializeAws_restJson1ListMonitorsCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-internetmonitor/src/commands/ListTagsForResourceCommand.ts b/clients/client-internetmonitor/src/commands/ListTagsForResourceCommand.ts new file mode 100644 index 000000000000..88ee90b5b36a --- /dev/null +++ b/clients/client-internetmonitor/src/commands/ListTagsForResourceCommand.ts @@ -0,0 +1,113 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, +} from "@aws-sdk/types"; + +import { InternetMonitorClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../InternetMonitorClient"; +import { + ListTagsForResourceInput, + ListTagsForResourceInputFilterSensitiveLog, + ListTagsForResourceOutput, + ListTagsForResourceOutputFilterSensitiveLog, +} from "../models/models_0"; +import { + deserializeAws_restJson1ListTagsForResourceCommand, + serializeAws_restJson1ListTagsForResourceCommand, +} from "../protocols/Aws_restJson1"; + +export interface ListTagsForResourceCommandInput extends ListTagsForResourceInput {} +export interface ListTagsForResourceCommandOutput extends ListTagsForResourceOutput, __MetadataBearer {} + +/** + *

Lists the tags for a resource. Tags are supported only for monitors in Amazon CloudWatch Internet Monitor.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { InternetMonitorClient, ListTagsForResourceCommand } from "@aws-sdk/client-internetmonitor"; // ES Modules import + * // const { InternetMonitorClient, ListTagsForResourceCommand } = require("@aws-sdk/client-internetmonitor"); // CommonJS import + * const client = new InternetMonitorClient(config); + * const command = new ListTagsForResourceCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link ListTagsForResourceCommandInput} for command's `input` shape. + * @see {@link ListTagsForResourceCommandOutput} for command's `response` shape. + * @see {@link InternetMonitorClientResolvedConfig | config} for InternetMonitorClient's `config` shape. + * + */ +export class ListTagsForResourceCommand extends $Command< + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, + InternetMonitorClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + }; + } + + constructor(readonly input: ListTagsForResourceCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: InternetMonitorClientResolvedConfig, + 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 = "InternetMonitorClient"; + const commandName = "ListTagsForResourceCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: ListTagsForResourceInputFilterSensitiveLog, + outputFilterSensitiveLog: ListTagsForResourceOutputFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize(input: ListTagsForResourceCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return serializeAws_restJson1ListTagsForResourceCommand(input, context); + } + + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return deserializeAws_restJson1ListTagsForResourceCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-internetmonitor/src/commands/TagResourceCommand.ts b/clients/client-internetmonitor/src/commands/TagResourceCommand.ts new file mode 100644 index 000000000000..c393d444f5b9 --- /dev/null +++ b/clients/client-internetmonitor/src/commands/TagResourceCommand.ts @@ -0,0 +1,112 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, +} from "@aws-sdk/types"; + +import { InternetMonitorClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../InternetMonitorClient"; +import { + TagResourceInput, + TagResourceInputFilterSensitiveLog, + TagResourceOutput, + TagResourceOutputFilterSensitiveLog, +} from "../models/models_0"; +import { + deserializeAws_restJson1TagResourceCommand, + serializeAws_restJson1TagResourceCommand, +} from "../protocols/Aws_restJson1"; + +export interface TagResourceCommandInput extends TagResourceInput {} +export interface TagResourceCommandOutput extends TagResourceOutput, __MetadataBearer {} + +/** + *

Adds a tag to a resource. Tags are supported only for monitors in Amazon CloudWatch Internet Monitor. You can add a maximum of 50 tags in Internet Monitor.

+ *

A minimum of one tag is required for this call. It returns an error if you use the TagResource request with 0 tags.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { InternetMonitorClient, TagResourceCommand } from "@aws-sdk/client-internetmonitor"; // ES Modules import + * // const { InternetMonitorClient, TagResourceCommand } = require("@aws-sdk/client-internetmonitor"); // CommonJS import + * const client = new InternetMonitorClient(config); + * const command = new TagResourceCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link TagResourceCommandInput} for command's `input` shape. + * @see {@link TagResourceCommandOutput} for command's `response` shape. + * @see {@link InternetMonitorClientResolvedConfig | config} for InternetMonitorClient's `config` shape. + * + */ +export class TagResourceCommand extends $Command< + TagResourceCommandInput, + TagResourceCommandOutput, + InternetMonitorClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + }; + } + + constructor(readonly input: TagResourceCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: InternetMonitorClientResolvedConfig, + 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 = "InternetMonitorClient"; + const commandName = "TagResourceCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: TagResourceInputFilterSensitiveLog, + outputFilterSensitiveLog: TagResourceOutputFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize(input: TagResourceCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return serializeAws_restJson1TagResourceCommand(input, context); + } + + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return deserializeAws_restJson1TagResourceCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-internetmonitor/src/commands/UntagResourceCommand.ts b/clients/client-internetmonitor/src/commands/UntagResourceCommand.ts new file mode 100644 index 000000000000..14b8b959b02b --- /dev/null +++ b/clients/client-internetmonitor/src/commands/UntagResourceCommand.ts @@ -0,0 +1,111 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, +} from "@aws-sdk/types"; + +import { InternetMonitorClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../InternetMonitorClient"; +import { + UntagResourceInput, + UntagResourceInputFilterSensitiveLog, + UntagResourceOutput, + UntagResourceOutputFilterSensitiveLog, +} from "../models/models_0"; +import { + deserializeAws_restJson1UntagResourceCommand, + serializeAws_restJson1UntagResourceCommand, +} from "../protocols/Aws_restJson1"; + +export interface UntagResourceCommandInput extends UntagResourceInput {} +export interface UntagResourceCommandOutput extends UntagResourceOutput, __MetadataBearer {} + +/** + *

Removes a tag from a resource.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { InternetMonitorClient, UntagResourceCommand } from "@aws-sdk/client-internetmonitor"; // ES Modules import + * // const { InternetMonitorClient, UntagResourceCommand } = require("@aws-sdk/client-internetmonitor"); // CommonJS import + * const client = new InternetMonitorClient(config); + * const command = new UntagResourceCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link UntagResourceCommandInput} for command's `input` shape. + * @see {@link UntagResourceCommandOutput} for command's `response` shape. + * @see {@link InternetMonitorClientResolvedConfig | config} for InternetMonitorClient's `config` shape. + * + */ +export class UntagResourceCommand extends $Command< + UntagResourceCommandInput, + UntagResourceCommandOutput, + InternetMonitorClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + }; + } + + constructor(readonly input: UntagResourceCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: InternetMonitorClientResolvedConfig, + 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 = "InternetMonitorClient"; + const commandName = "UntagResourceCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: UntagResourceInputFilterSensitiveLog, + outputFilterSensitiveLog: UntagResourceOutputFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize(input: UntagResourceCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return serializeAws_restJson1UntagResourceCommand(input, context); + } + + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return deserializeAws_restJson1UntagResourceCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-internetmonitor/src/commands/UpdateMonitorCommand.ts b/clients/client-internetmonitor/src/commands/UpdateMonitorCommand.ts new file mode 100644 index 000000000000..d36f2c939712 --- /dev/null +++ b/clients/client-internetmonitor/src/commands/UpdateMonitorCommand.ts @@ -0,0 +1,112 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, +} from "@aws-sdk/types"; + +import { InternetMonitorClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../InternetMonitorClient"; +import { + UpdateMonitorInput, + UpdateMonitorInputFilterSensitiveLog, + UpdateMonitorOutput, + UpdateMonitorOutputFilterSensitiveLog, +} from "../models/models_0"; +import { + deserializeAws_restJson1UpdateMonitorCommand, + serializeAws_restJson1UpdateMonitorCommand, +} from "../protocols/Aws_restJson1"; + +export interface UpdateMonitorCommandInput extends UpdateMonitorInput {} +export interface UpdateMonitorCommandOutput extends UpdateMonitorOutput, __MetadataBearer {} + +/** + *

Updates a monitor. You can update a monitor to add or remove resources, or to change the status of the monitor. You can't change the name of a + * monitor.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { InternetMonitorClient, UpdateMonitorCommand } from "@aws-sdk/client-internetmonitor"; // ES Modules import + * // const { InternetMonitorClient, UpdateMonitorCommand } = require("@aws-sdk/client-internetmonitor"); // CommonJS import + * const client = new InternetMonitorClient(config); + * const command = new UpdateMonitorCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link UpdateMonitorCommandInput} for command's `input` shape. + * @see {@link UpdateMonitorCommandOutput} for command's `response` shape. + * @see {@link InternetMonitorClientResolvedConfig | config} for InternetMonitorClient's `config` shape. + * + */ +export class UpdateMonitorCommand extends $Command< + UpdateMonitorCommandInput, + UpdateMonitorCommandOutput, + InternetMonitorClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + }; + } + + constructor(readonly input: UpdateMonitorCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: InternetMonitorClientResolvedConfig, + 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 = "InternetMonitorClient"; + const commandName = "UpdateMonitorCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: UpdateMonitorInputFilterSensitiveLog, + outputFilterSensitiveLog: UpdateMonitorOutputFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize(input: UpdateMonitorCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return serializeAws_restJson1UpdateMonitorCommand(input, context); + } + + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return deserializeAws_restJson1UpdateMonitorCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-internetmonitor/src/commands/index.ts b/clients/client-internetmonitor/src/commands/index.ts new file mode 100644 index 000000000000..dc85bc223ded --- /dev/null +++ b/clients/client-internetmonitor/src/commands/index.ts @@ -0,0 +1,11 @@ +// smithy-typescript generated code +export * from "./CreateMonitorCommand"; +export * from "./DeleteMonitorCommand"; +export * from "./GetHealthEventCommand"; +export * from "./GetMonitorCommand"; +export * from "./ListHealthEventsCommand"; +export * from "./ListMonitorsCommand"; +export * from "./ListTagsForResourceCommand"; +export * from "./TagResourceCommand"; +export * from "./UntagResourceCommand"; +export * from "./UpdateMonitorCommand"; diff --git a/clients/client-internetmonitor/src/endpoint/EndpointParameters.ts b/clients/client-internetmonitor/src/endpoint/EndpointParameters.ts new file mode 100644 index 000000000000..bc5aa22e333c --- /dev/null +++ b/clients/client-internetmonitor/src/endpoint/EndpointParameters.ts @@ -0,0 +1,28 @@ +// smithy-typescript generated code +import { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from "@aws-sdk/types"; + +export interface ClientInputEndpointParameters { + region?: string | 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, + useFipsEndpoint: options.useFipsEndpoint ?? false, + defaultSigningName: "internetmonitor", + }; +}; + +export interface EndpointParameters extends __EndpointParameters { + Region?: string; + UseFIPS?: boolean; + Endpoint?: string; +} diff --git a/clients/client-internetmonitor/src/endpoint/endpointResolver.ts b/clients/client-internetmonitor/src/endpoint/endpointResolver.ts new file mode 100644 index 000000000000..4a70bb06b40a --- /dev/null +++ b/clients/client-internetmonitor/src/endpoint/endpointResolver.ts @@ -0,0 +1,16 @@ +// smithy-typescript generated code +import { EndpointV2, Logger } from "@aws-sdk/types"; +import { EndpointParams, resolveEndpoint } from "@aws-sdk/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-internetmonitor/src/endpoint/ruleset.ts b/clients/client-internetmonitor/src/endpoint/ruleset.ts new file mode 100644 index 000000000000..0af7f0995d27 --- /dev/null +++ b/clients/client-internetmonitor/src/endpoint/ruleset.ts @@ -0,0 +1,29 @@ +// @ts-nocheck +// generated code, do not edit +import { RuleSetObject } from "@aws-sdk/util-endpoints"; + +/* This file is compressed. Log this object + or see "smithy.rules#endpointRuleSet" + in codegen/sdk-codegen/aws-models/internetmonitor.json */ + +const r="argv", +s="ref"; +const a=false, +b=true, +c="isSet", +d="tree", +e="booleanEquals", +f="error", +g="endpoint", +h="PartitionResult", +i="getAttr", +j={"required":false,"type":"String"}, +k={[s]:"Endpoint"}, +l={}, +m={[s]:h}, +n={[f]:"FIPS is enabled but this partition does not support FIPS","type":f}, +o=[{"fn":e,[r]:[{[s]:"UseFIPS"},true]}], +p=[{[s]:"Region"}], +q=[{"fn":e,[r]:[true,{"fn":i,[r]:[m,"supportsFIPS"]}]}]; +const _data={version:"1.0",parameters:{Region:j,UseFIPS:{required:b,default:a,type:"Boolean"},Endpoint:j},rules:[{conditions:[{fn:c,[r]:[k]}],type:d,rules:[{conditions:o,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:f},{endpoint:{url:k,properties:l,headers:l},type:g}]},{type:d,rules:[{conditions:[{fn:c,[r]:p}],type:d,rules:[{conditions:[{fn:"aws.partition",[r]:p,assign:h}],type:d,rules:[{type:d,rules:[{conditions:[{fn:e,[r]:[b,{fn:i,[r]:[m,"supportsDualStack"]}]}],type:d,rules:[{conditions:o,type:d,rules:[{conditions:q,type:d,rules:[{endpoint:{url:"https://internetmonitor-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:g}]},n]},{endpoint:{url:"https://internetmonitor.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:g}]},{type:d,rules:[{conditions:o,type:d,rules:[{conditions:q,type:d,rules:[{type:d,rules:[{endpoint:{url:"https://internetmonitor-fips.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:g}]}]},n]},{type:d,rules:[{endpoint:{url:"https://internetmonitor.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:g}]}]}]}]}]},{error:"Invalid Configuration: Missing Region",type:f}]}]}; +export const ruleSet: RuleSetObject = _data; diff --git a/clients/client-internetmonitor/src/index.ts b/clients/client-internetmonitor/src/index.ts new file mode 100644 index 000000000000..794f67456e9e --- /dev/null +++ b/clients/client-internetmonitor/src/index.ts @@ -0,0 +1,8 @@ +export * from "./InternetMonitor"; +// smithy-typescript generated code +export * from "./InternetMonitorClient"; +export * from "./commands"; +export * from "./models"; +export * from "./pagination"; + +export { InternetMonitorServiceException } from "./models/InternetMonitorServiceException"; diff --git a/clients/client-internetmonitor/src/models/InternetMonitorServiceException.ts b/clients/client-internetmonitor/src/models/InternetMonitorServiceException.ts new file mode 100644 index 000000000000..4f3005b797df --- /dev/null +++ b/clients/client-internetmonitor/src/models/InternetMonitorServiceException.ts @@ -0,0 +1,18 @@ +// smithy-typescript generated code +import { + ServiceException as __ServiceException, + ServiceExceptionOptions as __ServiceExceptionOptions, +} from "@aws-sdk/smithy-client"; + +/** + * Base exception class for all service exceptions from InternetMonitor service. + */ +export class InternetMonitorServiceException extends __ServiceException { + /** + * @internal + */ + constructor(options: __ServiceExceptionOptions) { + super(options); + Object.setPrototypeOf(this, InternetMonitorServiceException.prototype); + } +} diff --git a/clients/client-internetmonitor/src/models/index.ts b/clients/client-internetmonitor/src/models/index.ts new file mode 100644 index 000000000000..9eaceb12865f --- /dev/null +++ b/clients/client-internetmonitor/src/models/index.ts @@ -0,0 +1,2 @@ +// smithy-typescript generated code +export * from "./models_0"; diff --git a/clients/client-internetmonitor/src/models/models_0.ts b/clients/client-internetmonitor/src/models/models_0.ts new file mode 100644 index 000000000000..2a223bfa9b5e --- /dev/null +++ b/clients/client-internetmonitor/src/models/models_0.ts @@ -0,0 +1,1133 @@ +// smithy-typescript generated code +import { ExceptionOptionType as __ExceptionOptionType } from "@aws-sdk/smithy-client"; + +import { InternetMonitorServiceException as __BaseException } from "./InternetMonitorServiceException"; + +/** + *

You don't have sufficient permission 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); + } +} + +/** + *

Measurements about the availability for your application on the internet, calculated by Amazon CloudWatch Internet Monitor. Amazon Web Services has substantial historical data about internet + * performance and availability between Amazon Web Services services and different network providers and geographies. By applying statistical analysis to the data, Internet Monitor + * can detect when the performance and availability for your application has dropped, compared to an estimated baseline that's already calculated. To make it + * easier to see those drops, we report that information to you in the form of health scores: a performance score and an availability score.

+ *

Availability in Internet Monitor represents the estimated percentage of traffic that is not seeing an availability drop. For example, an availability score of 99% + * for an end user and service location pair is equivalent to 1% of the traffic experiencing an availability drop for that pair.

+ *

For more information, see How Internet Monitor calculates performance and availability + * scores in the Amazon CloudWatch Internet Monitor section of the Amazon CloudWatch User Guide.

+ */ +export interface AvailabilityMeasurement { + /** + *

Experience scores, or health scores are calculated for different geographic and network provider combinations (that is, different granularities) and + * also summed into global scores. If you view performance or availability scores without filtering for any specific geography or service provider, Amazon CloudWatch Internet Monitor + * provides global health scores.

+ *

The Amazon CloudWatch Internet Monitor chapter in the CloudWatch User Guide includes detailed information about how Internet Monitor calculates health scores, including performance and + * availability scores, and when it creates and resolves health events. For more information, see How Amazon Web Services calculates performance and + * availability scores in the Amazon CloudWatch Internet Monitor section of the CloudWatch User Guide.

+ */ + ExperienceScore?: number; + + /** + *

The percentage of impact caused by a health event for total traffic globally.

+ *

For information about how Internet Monitor calculates impact, see Inside Internet Monitor in the Amazon CloudWatch Internet Monitor section of the Amazon CloudWatch User + * Guide.

+ */ + PercentOfTotalTrafficImpacted?: number; + + /** + *

The percentage of impact caused by a health event for client location traffic globally.

+ *

For information about how Internet Monitor calculates impact, see Inside Internet Monitor in the Amazon CloudWatch Internet Monitor section of the Amazon CloudWatch User + * Guide.

+ */ + PercentOfClientLocationImpacted?: number; +} + +/** + *

A bad request was received.

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

The requested resource is in use.

+ */ +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); + } +} + +export interface CreateMonitorInput { + /** + *

The name of the monitor.

+ */ + MonitorName: string | undefined; + + /** + *

The resources to include in a monitor, which you provide as a set of Amazon Resource Names (ARNs).

+ *

You can add a combination of Amazon Virtual Private Clouds (VPCs) and Amazon CloudFront distributions, or you can add Amazon WorkSpaces directories. You can't add all three types of + * resources.

+ * + *

If you add only VPC resources, at least one VPC must have an Internet Gateway attached to it, to make sure that it has internet connectivity.

+ *
+ */ + Resources?: string[]; + + /** + *

A unique, case-sensitive string of up to 64 ASCII characters that you specify to make an idempotent API request. Don't reuse the same client token for + * other API requests.

+ */ + ClientToken?: string; + + /** + *

The tags for a monitor. You can add a maximum of 50 tags in Internet Monitor.

+ */ + Tags?: Record; + + /** + *

The maximum number of city-network combinations (that is, combinations of a city location and network, such as an ISP) to be monitored + * for your resources.

+ */ + MaxCityNetworksToMonitor: number | undefined; +} + +export enum MonitorConfigState { + ACTIVE = "ACTIVE", + ERROR = "ERROR", + INACTIVE = "INACTIVE", + PENDING = "PENDING", +} + +export interface CreateMonitorOutput { + /** + *

The Amazon Resource Name (ARN) of the monitor.

+ */ + Arn: string | undefined; + + /** + *

The status of a monitor.

+ */ + Status: MonitorConfigState | string | undefined; +} + +/** + *

An internal error occurred.

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

The request exceeded a service quota.

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

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

Invalid request.

+ */ +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); + } +} + +export interface DeleteMonitorInput { + /** + *

The name of the monitor to delete.

+ */ + MonitorName: string | undefined; +} + +export interface DeleteMonitorOutput {} + +export interface GetHealthEventInput { + /** + *

The name of the monitor.

+ */ + MonitorName: string | undefined; + + /** + *

The internally generated identifier of a health event. Because EventID contains the forward slash (“/”) character, you must + * URL-encode the EventID field in the request URL.

+ */ + EventId: string | undefined; +} + +/** + *

An internet service provider (ISP) or network in Amazon CloudWatch Internet Monitor.

+ */ +export interface Network { + /** + *

The internet provider name or network name.

+ */ + ASName: string | undefined; + + /** + *

The Autonomous System Number (ASN) of the internet provider or network.

+ */ + ASNumber: number | undefined; +} + +export enum TriangulationEventType { + AWS = "AWS", + INTERNET = "Internet", +} + +/** + *

Information about the network impairment for a specific network measured by Amazon CloudWatch Internet Monitor.

+ */ +export interface NetworkImpairment { + /** + *

The networks that could be impacted by a network impairment event.

+ */ + Networks: Network[] | undefined; + + /** + *

The combination of the Autonomous System Number (ASN) of the network and the name of the network.

+ */ + AsPath: Network[] | undefined; + + /** + *

Type of network impairment.

+ */ + NetworkEventType: TriangulationEventType | string | undefined; +} + +/** + *

Round-trip time (RTT) is how long it takes for a request from the user to return a response to the user. Amazon CloudWatch Internet Monitor calculates RTT at different + * percentiles: p50, p90, and p95.

+ */ +export interface RoundTripTime { + /** + *

RTT at the 50th percentile (p50).

+ */ + P50?: number; + + /** + *

RTT at the 90th percentile (p90).

+ */ + P90?: number; + + /** + *

RTT at the 95th percentile (p95).

+ */ + P95?: number; +} + +/** + *

Measurements about the performance for your application on the internet calculated by Amazon CloudWatch Internet Monitor. Amazon Web Services has substantial historical data about internet + * performance and availability between Amazon Web Services services and different network providers and geographies. By applying statistical analysis to the data, Internet Monitor + * can detect when the performance and availability for your application has dropped, compared to an estimated baseline that's already calculated. To make it + * easier to see those drops, we report that information to you in the form of health scores: a performance score and an availability score.

+ *

Performance in Internet Monitor represents the estimated percentage of traffic that is not seeing a performance drop. For example, a performance score of 99% for + * an end user and service location pair is equivalent to 1% of the traffic experiencing a performance drop for that pair.

+ *

For more information, see How Internet Monitor calculates performance and availability + * scores in the Amazon CloudWatch Internet Monitor section of the Amazon CloudWatch User Guide.

+ */ +export interface PerformanceMeasurement { + /** + *

Experience scores, or health scores, are calculated for different geographic and network provider combinations (that is, different granularities) and + * also totaled into global scores. If you view performance or availability scores without filtering for any specific geography or service provider, Amazon CloudWatch Internet Monitor + * provides global health scores.

+ *

The Amazon CloudWatch Internet Monitor chapter in the CloudWatch User Guide includes detailed information about how Internet Monitor calculates health scores, including performance and + * availability scores, and when it creates and resolves health events. For more information, see How Amazon Web Services calculates performance and + * availability scores in the Amazon CloudWatch Internet Monitor section of the CloudWatch User Guide.

+ */ + ExperienceScore?: number; + + /** + *

How much performance impact was caused by a health event for total traffic globally. For performance, this is the percentage of how much latency + * increased during the event compared to typical performance for your application traffic globally.

+ *

For more information, see When Amazon Web Services creates and resolves health + * events in the Amazon CloudWatch Internet Monitor section of the CloudWatch User Guide.

+ */ + PercentOfTotalTrafficImpacted?: number; + + /** + *

How much performance impact was caused by a health event at a client location. For performance, this is the percentage of how much latency increased + * during the event compared to typical performance for traffic, from this client location to an Amazon Web Services location, using a specific client network.

+ *

For more information, see When Amazon Web Services creates and resolves health + * events in the Amazon CloudWatch Internet Monitor section of the CloudWatch User Guide.

+ */ + PercentOfClientLocationImpacted?: number; + + /** + *

This is the percentage of how much round-trip time increased during the event compared to typical round-trip time for your application for traffic.

+ *

For more information, see When Amazon Web Services creates and resolves health + * events in the Amazon CloudWatch Internet Monitor section of the CloudWatch User Guide.

+ */ + RoundTripTime?: RoundTripTime; +} + +/** + *

Internet health includes measurements calculated by Amazon CloudWatch Internet Monitor about the performance and availability for your application on the internet. Amazon Web Services has + * substantial historical data about internet performance and availability between Amazon Web Services services and different network providers and geographies. By + * applying statistical analysis to the data, Internet Monitor can detect when the performance and availability for your application has dropped, compared to an + * estimated baseline that's already calculated. To make it easier to see those drops, we report that information to you in the form of health scores: a + * performance score and an availability score.

+ */ +export interface InternetHealth { + /** + *

Availability in Internet Monitor represents the estimated percentage of traffic that is not seeing an availability drop. For example, an availability score of 99% + * for an end user and service location pair is equivalent to 1% of the traffic experiencing an availability drop for that pair.

+ *

For more information, see How Internet Monitor calculates performance and availability + * scores in the Amazon CloudWatch Internet Monitor section of the Amazon CloudWatch User Guide.

+ */ + Availability?: AvailabilityMeasurement; + + /** + *

Performance in Internet Monitor represents the estimated percentage of traffic that is not seeing a performance drop. For example, a performance score of 99% for + * an end user and service location pair is equivalent to 1% of the traffic experiencing a performance drop for that pair.

+ *

For more information, see How Internet Monitor calculates performance and availability + * scores in the Amazon CloudWatch Internet Monitor section of the Amazon CloudWatch User Guide.

+ */ + Performance?: PerformanceMeasurement; +} + +export enum HealthEventStatus { + ACTIVE = "ACTIVE", + RESOLVED = "RESOLVED", +} + +/** + *

Information about a location impacted by a health event in Amazon CloudWatch Internet Monitor.

+ *

Geographic regions are hierarchically categorized into country, subdivision, + * metro and city geographic granularities. The geographic region is identified based + * on the IP address used at the client locations.

+ */ +export interface ImpactedLocation { + /** + *

The name of the network at an impacted location.

+ */ + ASName: string | undefined; + + /** + *

The Autonomous System Number (ASN) of the network at an impacted location.

+ */ + ASNumber: number | undefined; + + /** + *

The name of the country where the health event is located.

+ */ + Country: string | undefined; + + /** + *

The subdivision location where the health event is located. The subdivision usually maps to + * states in most countries (including the United States). For United Kingdom, it maps to a country (England, + * Scotland, Wales) or province (Northern Ireland).

+ */ + Subdivision?: string; + + /** + *

The metro area where the health event is located.

+ *

Metro indicates a metropolitan region in the United States, such as the region around New York City. + * In non-US countries, this is a second-level subdivision. For example, in the United Kingdom, it could be + * a county, a London borough, a unitary authority, council area, and so on.

+ */ + Metro?: string; + + /** + *

The name of the city where the health event is located.

+ */ + City?: string; + + /** + *

The latitude where the health event is located.

+ */ + Latitude?: number; + + /** + *

The longitude where the health event is located.

+ */ + Longitude?: number; + + /** + *

The country code where the health event is located. The ISO 3166-2 codes for the + * country is provided, when available.

+ */ + CountryCode?: string; + + /** + *

The subdivision code where the health event is located. The ISO 3166-2 codes for + * country subdivisions is provided, when available.

+ */ + SubdivisionCode?: string; + + /** + *

The service location where the health event is located.

+ */ + ServiceLocation?: string; + + /** + *

The status of the health event at an impacted location.

+ */ + Status: HealthEventStatus | string | undefined; + + /** + *

The cause of the impairment. There are two types of network impairments: Amazon Web Services network issues + * or internet issues. Internet issues are typically a problem with a network provider, like an internet service provider (ISP).

+ */ + CausedBy?: NetworkImpairment; + + /** + *

The calculated health at a specific location.

+ */ + InternetHealth?: InternetHealth; +} + +export enum HealthEventImpactType { + AVAILABILITY = "AVAILABILITY", + PERFORMANCE = "PERFORMANCE", +} + +export interface GetHealthEventOutput { + /** + *

The Amazon Resource Name (ARN) of the event.

+ */ + EventArn: string | undefined; + + /** + *

The internally generated identifier of a health event.

+ */ + EventId: string | undefined; + + /** + *

The time when a health event started.

+ */ + StartedAt: Date | undefined; + + /** + *

The time when a health event was resolved. If the health event is still active, the end time is not set.

+ */ + EndedAt?: Date; + + /** + *

The time when a health event was created.

+ */ + CreatedAt?: Date; + + /** + *

The time when a health event was last updated or recalculated.

+ */ + LastUpdatedAt: Date | undefined; + + /** + *

The locations affected by a health event.

+ */ + ImpactedLocations: ImpactedLocation[] | undefined; + + /** + *

The status of a health event.

+ */ + Status: HealthEventStatus | string | undefined; + + /** + *

The impact on total traffic that a health event has.

+ */ + PercentOfTotalTrafficImpacted?: number; + + /** + *

The type of impairment of a specific health event.

+ */ + ImpactType: HealthEventImpactType | string | undefined; +} + +export interface GetMonitorInput { + /** + *

The name of the monitor.

+ */ + MonitorName: string | undefined; +} + +export enum MonitorProcessingStatusCode { + COLLECTING_DATA = "COLLECTING_DATA", + FAULT_ACCESS_CLOUDWATCH = "FAULT_ACCESS_CLOUDWATCH", + FAULT_SERVICE = "FAULT_SERVICE", + INACTIVE = "INACTIVE", + INSUFFICIENT_DATA = "INSUFFICIENT_DATA", + OK = "OK", +} + +export interface GetMonitorOutput { + /** + *

The name of the monitor.

+ */ + MonitorName: string | undefined; + + /** + *

The Amazon Resource Name (ARN) of the monitor.

+ */ + MonitorArn: string | undefined; + + /** + *

The resources that have been added for the monitor. Resources are listed by their Amazon Resource Names (ARNs).

+ */ + Resources: string[] | undefined; + + /** + *

The status of the monitor.

+ */ + Status: MonitorConfigState | string | undefined; + + /** + *

The time when the monitor was created.

+ */ + CreatedAt: Date | undefined; + + /** + *

The last time that the monitor was modified.

+ */ + ModifiedAt: Date | undefined; + + /** + *

The health of the data processing for the monitor.

+ */ + ProcessingStatus?: MonitorProcessingStatusCode | string; + + /** + *

Additional information about the health of the data processing for the monitor.

+ */ + ProcessingStatusInfo?: string; + + /** + *

The tags that have been added to monitor.

+ */ + Tags?: Record; + + /** + *

The maximum number of city-network combinations (that is, combinations of a city location and network, such as an ISP) to be monitored + * for your resources.

+ */ + MaxCityNetworksToMonitor: number | undefined; +} + +/** + *

Information about a health event created in a monitor in Amazon CloudWatch Internet Monitor.

+ */ +export interface HealthEvent { + /** + *

The Amazon Resource Name (ARN) of the event.

+ */ + EventArn: string | undefined; + + /** + *

The internally generated identifier of a specific network traffic impairment health event.

+ */ + EventId: string | undefined; + + /** + *

When a health event started.

+ */ + StartedAt: Date | undefined; + + /** + *

The time when a health event ended. If the health event is still active, then the end time is not set.

+ */ + EndedAt?: Date; + + /** + *

When the health event was created.

+ */ + CreatedAt?: Date; + + /** + *

When the health event was last updated.

+ */ + LastUpdatedAt: Date | undefined; + + /** + *

The locations impacted by the health event.

+ */ + ImpactedLocations: ImpactedLocation[] | undefined; + + /** + *

Health event list member.

+ */ + Status: HealthEventStatus | string | undefined; + + /** + *

The impact on global traffic monitored by this monitor for this health event.

+ */ + PercentOfTotalTrafficImpacted?: number; + + /** + *

The type of impairment for a health event.

+ */ + ImpactType: HealthEventImpactType | string | undefined; +} + +export interface ListHealthEventsInput { + /** + *

The name of the monitor.

+ */ + MonitorName: string | undefined; + + /** + *

The time when a health event started.

+ */ + StartTime?: Date; + + /** + *

The time when a health event ended. If the health event is still ongoing, then the end time is not set.

+ */ + EndTime?: Date; + + /** + *

The token for the next set of results. You receive this token from a previous call.

+ */ + NextToken?: string; + + /** + *

The number of health event objects that you want to return with this call.

+ */ + MaxResults?: number; + + /** + *

The status of a health event.

+ */ + EventStatus?: HealthEventStatus | string; +} + +export interface ListHealthEventsOutput { + /** + *

A list of health events.

+ */ + HealthEvents: HealthEvent[] | undefined; + + /** + *

The token for the next set of results. You receive this token from a previous call.

+ */ + NextToken?: string; +} + +/** + *

There was an internal server error.

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

The Amazon Resource Name (ARN) for a resource.

+ */ + ResourceArn: string | undefined; +} + +export interface ListTagsForResourceOutput { + /** + *

Tags for a resource.

+ */ + Tags?: Record; +} + +/** + *

The request specifies something that doesn't exist.

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

There were too many requests.

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

The token for the next set of results. You receive this token from a previous call.

+ */ + NextToken?: string; + + /** + *

The number of monitor objects that you want to return with this call.

+ */ + MaxResults?: number; + + /** + *

The status of a monitor. This includes the status of the data processing for the monitor and the status of the monitor itself.

+ *

For information about the statuses for a monitor, see + * Monitor.

+ */ + MonitorStatus?: string; +} + +/** + *

The description of and information about a monitor in Amazon CloudWatch Internet Monitor.

+ */ +export interface Monitor { + /** + *

The name of the monitor.

+ */ + MonitorName: string | undefined; + + /** + *

The Amazon Resource Name (ARN) of the monitor.

+ */ + MonitorArn: string | undefined; + + /** + *

The status of a monitor.

+ */ + Status: MonitorConfigState | string | undefined; + + /** + *

The health of data processing for the monitor.

+ */ + ProcessingStatus?: MonitorProcessingStatusCode | string; +} + +export interface ListMonitorsOutput { + /** + *

A list of monitors.

+ */ + Monitors: Monitor[] | undefined; + + /** + *

The token for the next set of results. You receive this token from a previous call.

+ */ + NextToken?: string; +} + +/** + *

The request specifies a resource that doesn't 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); + } +} + +export interface UpdateMonitorInput { + /** + *

The name of the monitor.

+ */ + MonitorName: string | undefined; + + /** + *

The resources to include in a monitor, which you provide as a set of Amazon Resource Names (ARNs).

+ *

You can add a combination of Amazon Virtual Private Clouds (VPCs) and Amazon CloudFront distributions, or you can add Amazon WorkSpaces directories. You can't add all three types of + * resources.

+ * + *

If you add only VPC resources, at least one VPC must have an Internet Gateway attached to it, to make sure that it has internet + * connectivity.

+ *
+ */ + ResourcesToAdd?: string[]; + + /** + *

The resources to remove from a monitor, which you provide as a set of Amazon Resource Names (ARNs).

+ */ + ResourcesToRemove?: string[]; + + /** + *

The status for a monitor. The accepted values for Status with the UpdateMonitor API call are the following: ACTIVE and + * INACTIVE. The following values are not accepted: PENDING, and ERROR.

+ */ + Status?: MonitorConfigState | string; + + /** + *

A unique, case-sensitive string of up to 64 ASCII characters that you specify to make an idempotent API request. You should not reuse the same client + * token for other API requests.

+ */ + ClientToken?: string; + + /** + *

The maximum number of city-network combinations (that is, combinations of a city location and network, such as an ISP) to be monitored + * for your resources.

+ */ + MaxCityNetworksToMonitor?: number; +} + +export interface UpdateMonitorOutput { + /** + *

The Amazon Resource Name (ARN) of the monitor.

+ */ + MonitorArn: string | undefined; + + /** + *

The status of a monitor.

+ */ + Status: MonitorConfigState | string | undefined; +} + +export interface TagResourceInput { + /** + *

The Amazon Resource Name (ARN) for a tag that you add to a resource. Tags are supported only for monitors in Amazon CloudWatch Internet Monitor.

+ */ + ResourceArn: string | undefined; + + /** + *

Tags that you add to a resource. You can add a maximum of 50 tags in Internet Monitor.

+ */ + Tags: Record | undefined; +} + +export interface TagResourceOutput {} + +export interface UntagResourceInput { + /** + *

The Amazon Resource Name (ARN) for a tag you remove a resource from.

+ */ + ResourceArn: string | undefined; + + /** + *

Tag keys that you remove from a resource.

+ */ + TagKeys: string[] | undefined; +} + +export interface UntagResourceOutput {} + +/** + * @internal + */ +export const AvailabilityMeasurementFilterSensitiveLog = (obj: AvailabilityMeasurement): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const CreateMonitorInputFilterSensitiveLog = (obj: CreateMonitorInput): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const CreateMonitorOutputFilterSensitiveLog = (obj: CreateMonitorOutput): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const DeleteMonitorInputFilterSensitiveLog = (obj: DeleteMonitorInput): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const DeleteMonitorOutputFilterSensitiveLog = (obj: DeleteMonitorOutput): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const GetHealthEventInputFilterSensitiveLog = (obj: GetHealthEventInput): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const NetworkFilterSensitiveLog = (obj: Network): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const NetworkImpairmentFilterSensitiveLog = (obj: NetworkImpairment): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const RoundTripTimeFilterSensitiveLog = (obj: RoundTripTime): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const PerformanceMeasurementFilterSensitiveLog = (obj: PerformanceMeasurement): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const InternetHealthFilterSensitiveLog = (obj: InternetHealth): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const ImpactedLocationFilterSensitiveLog = (obj: ImpactedLocation): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const GetHealthEventOutputFilterSensitiveLog = (obj: GetHealthEventOutput): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const GetMonitorInputFilterSensitiveLog = (obj: GetMonitorInput): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const GetMonitorOutputFilterSensitiveLog = (obj: GetMonitorOutput): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const HealthEventFilterSensitiveLog = (obj: HealthEvent): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const ListHealthEventsInputFilterSensitiveLog = (obj: ListHealthEventsInput): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const ListHealthEventsOutputFilterSensitiveLog = (obj: ListHealthEventsOutput): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const ListTagsForResourceInputFilterSensitiveLog = (obj: ListTagsForResourceInput): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const ListTagsForResourceOutputFilterSensitiveLog = (obj: ListTagsForResourceOutput): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const ListMonitorsInputFilterSensitiveLog = (obj: ListMonitorsInput): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const MonitorFilterSensitiveLog = (obj: Monitor): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const ListMonitorsOutputFilterSensitiveLog = (obj: ListMonitorsOutput): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const UpdateMonitorInputFilterSensitiveLog = (obj: UpdateMonitorInput): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const UpdateMonitorOutputFilterSensitiveLog = (obj: UpdateMonitorOutput): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const TagResourceInputFilterSensitiveLog = (obj: TagResourceInput): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const TagResourceOutputFilterSensitiveLog = (obj: TagResourceOutput): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const UntagResourceInputFilterSensitiveLog = (obj: UntagResourceInput): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const UntagResourceOutputFilterSensitiveLog = (obj: UntagResourceOutput): any => ({ + ...obj, +}); diff --git a/clients/client-internetmonitor/src/pagination/Interfaces.ts b/clients/client-internetmonitor/src/pagination/Interfaces.ts new file mode 100644 index 000000000000..dbd5c9079c08 --- /dev/null +++ b/clients/client-internetmonitor/src/pagination/Interfaces.ts @@ -0,0 +1,9 @@ +// smithy-typescript generated code +import { PaginationConfiguration } from "@aws-sdk/types"; + +import { InternetMonitor } from "../InternetMonitor"; +import { InternetMonitorClient } from "../InternetMonitorClient"; + +export interface InternetMonitorPaginationConfiguration extends PaginationConfiguration { + client: InternetMonitor | InternetMonitorClient; +} diff --git a/clients/client-internetmonitor/src/pagination/ListHealthEventsPaginator.ts b/clients/client-internetmonitor/src/pagination/ListHealthEventsPaginator.ts new file mode 100644 index 000000000000..37ce0fd9da2c --- /dev/null +++ b/clients/client-internetmonitor/src/pagination/ListHealthEventsPaginator.ts @@ -0,0 +1,61 @@ +// smithy-typescript generated code +import { Paginator } from "@aws-sdk/types"; + +import { + ListHealthEventsCommand, + ListHealthEventsCommandInput, + ListHealthEventsCommandOutput, +} from "../commands/ListHealthEventsCommand"; +import { InternetMonitor } from "../InternetMonitor"; +import { InternetMonitorClient } from "../InternetMonitorClient"; +import { InternetMonitorPaginationConfiguration } from "./Interfaces"; + +/** + * @private + */ +const makePagedClientRequest = async ( + client: InternetMonitorClient, + input: ListHealthEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListHealthEventsCommand(input), ...args); +}; +/** + * @private + */ +const makePagedRequest = async ( + client: InternetMonitor, + input: ListHealthEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listHealthEvents(input, ...args); +}; +export async function* paginateListHealthEvents( + config: InternetMonitorPaginationConfiguration, + input: ListHealthEventsCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.NextToken + let token: typeof input.NextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListHealthEventsCommandOutput; + while (hasNext) { + input.NextToken = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof InternetMonitor) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof InternetMonitorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected InternetMonitor | InternetMonitorClient"); + } + yield page; + const prevToken = token; + token = page.NextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-internetmonitor/src/pagination/ListMonitorsPaginator.ts b/clients/client-internetmonitor/src/pagination/ListMonitorsPaginator.ts new file mode 100644 index 000000000000..274a5a1d5870 --- /dev/null +++ b/clients/client-internetmonitor/src/pagination/ListMonitorsPaginator.ts @@ -0,0 +1,61 @@ +// smithy-typescript generated code +import { Paginator } from "@aws-sdk/types"; + +import { + ListMonitorsCommand, + ListMonitorsCommandInput, + ListMonitorsCommandOutput, +} from "../commands/ListMonitorsCommand"; +import { InternetMonitor } from "../InternetMonitor"; +import { InternetMonitorClient } from "../InternetMonitorClient"; +import { InternetMonitorPaginationConfiguration } from "./Interfaces"; + +/** + * @private + */ +const makePagedClientRequest = async ( + client: InternetMonitorClient, + input: ListMonitorsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListMonitorsCommand(input), ...args); +}; +/** + * @private + */ +const makePagedRequest = async ( + client: InternetMonitor, + input: ListMonitorsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listMonitors(input, ...args); +}; +export async function* paginateListMonitors( + config: InternetMonitorPaginationConfiguration, + input: ListMonitorsCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.NextToken + let token: typeof input.NextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListMonitorsCommandOutput; + while (hasNext) { + input.NextToken = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof InternetMonitor) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof InternetMonitorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected InternetMonitor | InternetMonitorClient"); + } + yield page; + const prevToken = token; + token = page.NextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-internetmonitor/src/pagination/index.ts b/clients/client-internetmonitor/src/pagination/index.ts new file mode 100644 index 000000000000..c52791e68f5d --- /dev/null +++ b/clients/client-internetmonitor/src/pagination/index.ts @@ -0,0 +1,4 @@ +// smithy-typescript generated code +export * from "./Interfaces"; +export * from "./ListHealthEventsPaginator"; +export * from "./ListMonitorsPaginator"; diff --git a/clients/client-internetmonitor/src/protocols/Aws_restJson1.ts b/clients/client-internetmonitor/src/protocols/Aws_restJson1.ts new file mode 100644 index 000000000000..bedf68db221d --- /dev/null +++ b/clients/client-internetmonitor/src/protocols/Aws_restJson1.ts @@ -0,0 +1,1351 @@ +// smithy-typescript generated code +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; +import { + decorateServiceException as __decorateServiceException, + expectInt32 as __expectInt32, + expectLong as __expectLong, + expectNonNull as __expectNonNull, + expectObject as __expectObject, + expectString as __expectString, + extendedEncodeURIComponent as __extendedEncodeURIComponent, + limitedParseDouble as __limitedParseDouble, + map as __map, + parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, + resolvedPath as __resolvedPath, + throwDefaultError, +} from "@aws-sdk/smithy-client"; +import { + Endpoint as __Endpoint, + ResponseMetadata as __ResponseMetadata, + SerdeContext as __SerdeContext, +} from "@aws-sdk/types"; +import { v4 as generateIdempotencyToken } from "uuid"; + +import { CreateMonitorCommandInput, CreateMonitorCommandOutput } from "../commands/CreateMonitorCommand"; +import { DeleteMonitorCommandInput, DeleteMonitorCommandOutput } from "../commands/DeleteMonitorCommand"; +import { GetHealthEventCommandInput, GetHealthEventCommandOutput } from "../commands/GetHealthEventCommand"; +import { GetMonitorCommandInput, GetMonitorCommandOutput } from "../commands/GetMonitorCommand"; +import { ListHealthEventsCommandInput, ListHealthEventsCommandOutput } from "../commands/ListHealthEventsCommand"; +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 { InternetMonitorServiceException as __BaseException } from "../models/InternetMonitorServiceException"; +import { + AccessDeniedException, + AvailabilityMeasurement, + BadRequestException, + ConflictException, + HealthEvent, + ImpactedLocation, + InternalServerErrorException, + InternalServerException, + InternetHealth, + LimitExceededException, + Monitor, + Network, + NetworkImpairment, + NotFoundException, + PerformanceMeasurement, + ResourceNotFoundException, + RoundTripTime, + ThrottlingException, + TooManyRequestsException, + ValidationException, +} from "../models/models_0"; + +export const serializeAws_restJson1CreateMonitorCommand = async ( + input: CreateMonitorCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v20210603/Monitors"; + let body: any; + body = JSON.stringify({ + ClientToken: input.ClientToken ?? generateIdempotencyToken(), + ...(input.MaxCityNetworksToMonitor != null && { MaxCityNetworksToMonitor: input.MaxCityNetworksToMonitor }), + ...(input.MonitorName != null && { MonitorName: input.MonitorName }), + ...(input.Resources != null && { Resources: serializeAws_restJson1SetOfARNs(input.Resources, context) }), + ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + }); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + +export const serializeAws_restJson1DeleteMonitorCommand = async ( + input: DeleteMonitorCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v20210603/Monitors/{MonitorName}"; + resolvedPath = __resolvedPath(resolvedPath, input, "MonitorName", () => input.MonitorName!, "{MonitorName}", false); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "DELETE", + headers, + path: resolvedPath, + body, + }); +}; + +export const serializeAws_restJson1GetHealthEventCommand = async ( + input: GetHealthEventCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/v20210603/Monitors/{MonitorName}/HealthEvents/{EventId}"; + resolvedPath = __resolvedPath(resolvedPath, input, "MonitorName", () => input.MonitorName!, "{MonitorName}", false); + resolvedPath = __resolvedPath(resolvedPath, input, "EventId", () => input.EventId!, "{EventId}", false); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + body, + }); +}; + +export const serializeAws_restJson1GetMonitorCommand = async ( + input: GetMonitorCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v20210603/Monitors/{MonitorName}"; + resolvedPath = __resolvedPath(resolvedPath, input, "MonitorName", () => input.MonitorName!, "{MonitorName}", false); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + body, + }); +}; + +export const serializeAws_restJson1ListHealthEventsCommand = async ( + input: ListHealthEventsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/v20210603/Monitors/{MonitorName}/HealthEvents"; + resolvedPath = __resolvedPath(resolvedPath, input, "MonitorName", () => input.MonitorName!, "{MonitorName}", false); + const query: any = map({ + StartTime: [ + () => input.StartTime !== void 0, + () => (input.StartTime!.toISOString().split(".")[0] + "Z").toString(), + ], + EndTime: [() => input.EndTime !== void 0, () => (input.EndTime!.toISOString().split(".")[0] + "Z").toString()], + NextToken: [, input.NextToken!], + MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults!.toString()], + EventStatus: [, input.EventStatus!], + }); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + query, + body, + }); +}; + +export const serializeAws_restJson1ListMonitorsCommand = async ( + input: ListMonitorsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v20210603/Monitors"; + const query: any = map({ + NextToken: [, input.NextToken!], + MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults!.toString()], + MonitorStatus: [, input.MonitorStatus!], + }); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + query, + body, + }); +}; + +export const serializeAws_restJson1ListTagsForResourceCommand = async ( + input: ListTagsForResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}"; + resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn!, "{ResourceArn}", false); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + body, + }); +}; + +export const serializeAws_restJson1TagResourceCommand = async ( + input: TagResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}"; + resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn!, "{ResourceArn}", false); + let body: any; + body = JSON.stringify({ + ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }), + }); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + +export const serializeAws_restJson1UntagResourceCommand = async ( + input: UntagResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}"; + resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn!, "{ResourceArn}", false); + const query: any = map({ + tagKeys: [ + __expectNonNull(input.TagKeys, `TagKeys`) != null, + () => (input.TagKeys! || []).map((_entry) => _entry as any), + ], + }); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "DELETE", + headers, + path: resolvedPath, + query, + body, + }); +}; + +export const serializeAws_restJson1UpdateMonitorCommand = async ( + input: UpdateMonitorCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v20210603/Monitors/{MonitorName}"; + resolvedPath = __resolvedPath(resolvedPath, input, "MonitorName", () => input.MonitorName!, "{MonitorName}", false); + let body: any; + body = JSON.stringify({ + ClientToken: input.ClientToken ?? generateIdempotencyToken(), + ...(input.MaxCityNetworksToMonitor != null && { MaxCityNetworksToMonitor: input.MaxCityNetworksToMonitor }), + ...(input.ResourcesToAdd != null && { + ResourcesToAdd: serializeAws_restJson1SetOfARNs(input.ResourcesToAdd, context), + }), + ...(input.ResourcesToRemove != null && { + ResourcesToRemove: serializeAws_restJson1SetOfARNs(input.ResourcesToRemove, context), + }), + ...(input.Status != null && { Status: input.Status }), + }); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "PATCH", + headers, + path: resolvedPath, + body, + }); +}; + +export const deserializeAws_restJson1CreateMonitorCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return deserializeAws_restJson1CreateMonitorCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.Arn != null) { + contents.Arn = __expectString(data.Arn); + } + if (data.Status != null) { + contents.Status = __expectString(data.Status); + } + return contents; +}; + +const deserializeAws_restJson1CreateMonitorCommandError = 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.internetmonitor#AccessDeniedException": + throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.internetmonitor#ConflictException": + throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.internetmonitor#InternalServerException": + throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.internetmonitor#LimitExceededException": + throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.internetmonitor#ThrottlingException": + throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.internetmonitor#ValidationException": + throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; + +export const deserializeAws_restJson1DeleteMonitorCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return deserializeAws_restJson1DeleteMonitorCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +const deserializeAws_restJson1DeleteMonitorCommandError = 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.internetmonitor#AccessDeniedException": + throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.internetmonitor#InternalServerException": + throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.internetmonitor#ThrottlingException": + throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.internetmonitor#ValidationException": + throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; + +export const deserializeAws_restJson1GetHealthEventCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return deserializeAws_restJson1GetHealthEventCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.CreatedAt != null) { + contents.CreatedAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.CreatedAt)); + } + if (data.EndedAt != null) { + contents.EndedAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.EndedAt)); + } + if (data.EventArn != null) { + contents.EventArn = __expectString(data.EventArn); + } + if (data.EventId != null) { + contents.EventId = __expectString(data.EventId); + } + if (data.ImpactType != null) { + contents.ImpactType = __expectString(data.ImpactType); + } + if (data.ImpactedLocations != null) { + contents.ImpactedLocations = deserializeAws_restJson1ImpactedLocationsList(data.ImpactedLocations, context); + } + if (data.LastUpdatedAt != null) { + contents.LastUpdatedAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.LastUpdatedAt)); + } + if (data.PercentOfTotalTrafficImpacted != null) { + contents.PercentOfTotalTrafficImpacted = __limitedParseDouble(data.PercentOfTotalTrafficImpacted); + } + if (data.StartedAt != null) { + contents.StartedAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.StartedAt)); + } + if (data.Status != null) { + contents.Status = __expectString(data.Status); + } + return contents; +}; + +const deserializeAws_restJson1GetHealthEventCommandError = 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.internetmonitor#AccessDeniedException": + throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.internetmonitor#InternalServerException": + throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.internetmonitor#ThrottlingException": + throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.internetmonitor#ValidationException": + throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; + +export const deserializeAws_restJson1GetMonitorCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return deserializeAws_restJson1GetMonitorCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.CreatedAt != null) { + contents.CreatedAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.CreatedAt)); + } + if (data.MaxCityNetworksToMonitor != null) { + contents.MaxCityNetworksToMonitor = __expectInt32(data.MaxCityNetworksToMonitor); + } + if (data.ModifiedAt != null) { + contents.ModifiedAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.ModifiedAt)); + } + if (data.MonitorArn != null) { + contents.MonitorArn = __expectString(data.MonitorArn); + } + if (data.MonitorName != null) { + contents.MonitorName = __expectString(data.MonitorName); + } + if (data.ProcessingStatus != null) { + contents.ProcessingStatus = __expectString(data.ProcessingStatus); + } + if (data.ProcessingStatusInfo != null) { + contents.ProcessingStatusInfo = __expectString(data.ProcessingStatusInfo); + } + if (data.Resources != null) { + contents.Resources = deserializeAws_restJson1SetOfARNs(data.Resources, context); + } + if (data.Status != null) { + contents.Status = __expectString(data.Status); + } + if (data.Tags != null) { + contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context); + } + return contents; +}; + +const deserializeAws_restJson1GetMonitorCommandError = 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.internetmonitor#AccessDeniedException": + throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.internetmonitor#InternalServerException": + throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.internetmonitor#ThrottlingException": + throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.internetmonitor#ValidationException": + throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; + +export const deserializeAws_restJson1ListHealthEventsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return deserializeAws_restJson1ListHealthEventsCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.HealthEvents != null) { + contents.HealthEvents = deserializeAws_restJson1HealthEventList(data.HealthEvents, context); + } + if (data.NextToken != null) { + contents.NextToken = __expectString(data.NextToken); + } + return contents; +}; + +const deserializeAws_restJson1ListHealthEventsCommandError = 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.internetmonitor#AccessDeniedException": + throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.internetmonitor#InternalServerException": + throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.internetmonitor#ThrottlingException": + throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.internetmonitor#ValidationException": + throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; + +export const deserializeAws_restJson1ListMonitorsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return deserializeAws_restJson1ListMonitorsCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.Monitors != null) { + contents.Monitors = deserializeAws_restJson1MonitorList(data.Monitors, context); + } + if (data.NextToken != null) { + contents.NextToken = __expectString(data.NextToken); + } + return contents; +}; + +const deserializeAws_restJson1ListMonitorsCommandError = 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.internetmonitor#AccessDeniedException": + throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.internetmonitor#InternalServerException": + throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.internetmonitor#ThrottlingException": + throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.internetmonitor#ValidationException": + throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; + +export const deserializeAws_restJson1ListTagsForResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return deserializeAws_restJson1ListTagsForResourceCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.Tags != null) { + contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context); + } + return contents; +}; + +const deserializeAws_restJson1ListTagsForResourceCommandError = 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.internetmonitor#AccessDeniedException": + throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context); + case "BadRequestException": + case "com.amazonaws.internetmonitor#BadRequestException": + throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context); + case "InternalServerErrorException": + case "com.amazonaws.internetmonitor#InternalServerErrorException": + throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context); + case "NotFoundException": + case "com.amazonaws.internetmonitor#NotFoundException": + throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.internetmonitor#TooManyRequestsException": + throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; + +export const deserializeAws_restJson1TagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return deserializeAws_restJson1TagResourceCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +const deserializeAws_restJson1TagResourceCommandError = 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.internetmonitor#AccessDeniedException": + throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context); + case "BadRequestException": + case "com.amazonaws.internetmonitor#BadRequestException": + throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context); + case "InternalServerErrorException": + case "com.amazonaws.internetmonitor#InternalServerErrorException": + throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context); + case "NotFoundException": + case "com.amazonaws.internetmonitor#NotFoundException": + throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.internetmonitor#TooManyRequestsException": + throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; + +export const deserializeAws_restJson1UntagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return deserializeAws_restJson1UntagResourceCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +const deserializeAws_restJson1UntagResourceCommandError = 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.internetmonitor#AccessDeniedException": + throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context); + case "BadRequestException": + case "com.amazonaws.internetmonitor#BadRequestException": + throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context); + case "InternalServerErrorException": + case "com.amazonaws.internetmonitor#InternalServerErrorException": + throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context); + case "NotFoundException": + case "com.amazonaws.internetmonitor#NotFoundException": + throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.internetmonitor#TooManyRequestsException": + throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; + +export const deserializeAws_restJson1UpdateMonitorCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return deserializeAws_restJson1UpdateMonitorCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.MonitorArn != null) { + contents.MonitorArn = __expectString(data.MonitorArn); + } + if (data.Status != null) { + contents.Status = __expectString(data.Status); + } + return contents; +}; + +const deserializeAws_restJson1UpdateMonitorCommandError = 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.internetmonitor#AccessDeniedException": + throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.internetmonitor#InternalServerException": + throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.internetmonitor#LimitExceededException": + throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.internetmonitor#ResourceNotFoundException": + throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.internetmonitor#ThrottlingException": + throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.internetmonitor#ValidationException": + throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; + +const map = __map; +const deserializeAws_restJson1AccessDeniedExceptionResponse = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + if (data.message != null) { + contents.message = __expectString(data.message); + } + const exception = new AccessDeniedException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +const deserializeAws_restJson1BadRequestExceptionResponse = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + if (data.message != null) { + contents.message = __expectString(data.message); + } + const exception = new BadRequestException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +const deserializeAws_restJson1ConflictExceptionResponse = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + if (data.message != null) { + contents.message = __expectString(data.message); + } + const exception = new ConflictException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +const deserializeAws_restJson1InternalServerErrorExceptionResponse = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + if (data.message != null) { + contents.message = __expectString(data.message); + } + const exception = new InternalServerErrorException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +const deserializeAws_restJson1InternalServerExceptionResponse = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + if (data.message != null) { + contents.message = __expectString(data.message); + } + const exception = new InternalServerException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +const deserializeAws_restJson1LimitExceededExceptionResponse = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + if (data.message != null) { + contents.message = __expectString(data.message); + } + const exception = new LimitExceededException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +const deserializeAws_restJson1NotFoundExceptionResponse = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + if (data.message != null) { + contents.message = __expectString(data.message); + } + const exception = new NotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + if (data.message != null) { + contents.message = __expectString(data.message); + } + const exception = new ResourceNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +const deserializeAws_restJson1ThrottlingExceptionResponse = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + if (data.message != null) { + contents.message = __expectString(data.message); + } + const exception = new ThrottlingException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +const deserializeAws_restJson1TooManyRequestsExceptionResponse = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + if (data.message != null) { + contents.message = __expectString(data.message); + } + const exception = new TooManyRequestsException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +const deserializeAws_restJson1ValidationExceptionResponse = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + if (data.message != null) { + contents.message = __expectString(data.message); + } + const exception = new ValidationException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +const serializeAws_restJson1SetOfARNs = (input: string[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return entry; + }); +}; + +const serializeAws_restJson1TagMap = (input: Record, context: __SerdeContext): any => { + return Object.entries(input).reduce((acc: Record, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + acc[key] = value; + return acc; + }, {}); +}; + +const deserializeAws_restJson1AvailabilityMeasurement = ( + output: any, + context: __SerdeContext +): AvailabilityMeasurement => { + return { + ExperienceScore: __limitedParseDouble(output.ExperienceScore), + PercentOfClientLocationImpacted: __limitedParseDouble(output.PercentOfClientLocationImpacted), + PercentOfTotalTrafficImpacted: __limitedParseDouble(output.PercentOfTotalTrafficImpacted), + } as any; +}; + +const deserializeAws_restJson1HealthEvent = (output: any, context: __SerdeContext): HealthEvent => { + return { + CreatedAt: + output.CreatedAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.CreatedAt)) : undefined, + EndedAt: output.EndedAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.EndedAt)) : undefined, + EventArn: __expectString(output.EventArn), + EventId: __expectString(output.EventId), + ImpactType: __expectString(output.ImpactType), + ImpactedLocations: + output.ImpactedLocations != null + ? deserializeAws_restJson1ImpactedLocationsList(output.ImpactedLocations, context) + : undefined, + LastUpdatedAt: + output.LastUpdatedAt != null + ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.LastUpdatedAt)) + : undefined, + PercentOfTotalTrafficImpacted: __limitedParseDouble(output.PercentOfTotalTrafficImpacted), + StartedAt: + output.StartedAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.StartedAt)) : undefined, + Status: __expectString(output.Status), + } as any; +}; + +const deserializeAws_restJson1HealthEventList = (output: any, context: __SerdeContext): HealthEvent[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1HealthEvent(entry, context); + }); + return retVal; +}; + +const deserializeAws_restJson1ImpactedLocation = (output: any, context: __SerdeContext): ImpactedLocation => { + return { + ASName: __expectString(output.ASName), + ASNumber: __expectLong(output.ASNumber), + CausedBy: output.CausedBy != null ? deserializeAws_restJson1NetworkImpairment(output.CausedBy, context) : undefined, + City: __expectString(output.City), + Country: __expectString(output.Country), + CountryCode: __expectString(output.CountryCode), + InternetHealth: + output.InternetHealth != null + ? deserializeAws_restJson1InternetHealth(output.InternetHealth, context) + : undefined, + Latitude: __limitedParseDouble(output.Latitude), + Longitude: __limitedParseDouble(output.Longitude), + Metro: __expectString(output.Metro), + ServiceLocation: __expectString(output.ServiceLocation), + Status: __expectString(output.Status), + Subdivision: __expectString(output.Subdivision), + SubdivisionCode: __expectString(output.SubdivisionCode), + } as any; +}; + +const deserializeAws_restJson1ImpactedLocationsList = (output: any, context: __SerdeContext): ImpactedLocation[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ImpactedLocation(entry, context); + }); + return retVal; +}; + +const deserializeAws_restJson1InternetHealth = (output: any, context: __SerdeContext): InternetHealth => { + return { + Availability: + output.Availability != null + ? deserializeAws_restJson1AvailabilityMeasurement(output.Availability, context) + : undefined, + Performance: + output.Performance != null + ? deserializeAws_restJson1PerformanceMeasurement(output.Performance, context) + : undefined, + } as any; +}; + +const deserializeAws_restJson1Monitor = (output: any, context: __SerdeContext): Monitor => { + return { + MonitorArn: __expectString(output.MonitorArn), + MonitorName: __expectString(output.MonitorName), + ProcessingStatus: __expectString(output.ProcessingStatus), + Status: __expectString(output.Status), + } as any; +}; + +const deserializeAws_restJson1MonitorList = (output: any, context: __SerdeContext): Monitor[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Monitor(entry, context); + }); + return retVal; +}; + +const deserializeAws_restJson1Network = (output: any, context: __SerdeContext): Network => { + return { + ASName: __expectString(output.ASName), + ASNumber: __expectLong(output.ASNumber), + } as any; +}; + +const deserializeAws_restJson1NetworkImpairment = (output: any, context: __SerdeContext): NetworkImpairment => { + return { + AsPath: output.AsPath != null ? deserializeAws_restJson1NetworkList(output.AsPath, context) : undefined, + NetworkEventType: __expectString(output.NetworkEventType), + Networks: output.Networks != null ? deserializeAws_restJson1NetworkList(output.Networks, context) : undefined, + } as any; +}; + +const deserializeAws_restJson1NetworkList = (output: any, context: __SerdeContext): Network[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1Network(entry, context); + }); + return retVal; +}; + +const deserializeAws_restJson1PerformanceMeasurement = ( + output: any, + context: __SerdeContext +): PerformanceMeasurement => { + return { + ExperienceScore: __limitedParseDouble(output.ExperienceScore), + PercentOfClientLocationImpacted: __limitedParseDouble(output.PercentOfClientLocationImpacted), + PercentOfTotalTrafficImpacted: __limitedParseDouble(output.PercentOfTotalTrafficImpacted), + RoundTripTime: + output.RoundTripTime != null ? deserializeAws_restJson1RoundTripTime(output.RoundTripTime, context) : undefined, + } as any; +}; + +const deserializeAws_restJson1RoundTripTime = (output: any, context: __SerdeContext): RoundTripTime => { + return { + P50: __limitedParseDouble(output.P50), + P90: __limitedParseDouble(output.P90), + P95: __limitedParseDouble(output.P95), + } as any; +}; + +const deserializeAws_restJson1SetOfARNs = (output: any, context: __SerdeContext): string[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return __expectString(entry) as any; + }); + return retVal; +}; + +const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): Record => { + return Object.entries(output).reduce((acc: Record, [key, value]: [string, any]) => { + if (value === null) { + return acc; + } + acc[key] = __expectString(value) as any; + return acc; + }, {}); +}; + +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"], +}); + +// Collect low-level response body stream to Uint8Array. +const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { + if (streamBody instanceof Uint8Array) { + return Promise.resolve(streamBody); + } + return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); +}; + +// 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 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-internetmonitor/src/runtimeConfig.browser.ts b/clients/client-internetmonitor/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..b071c00746d6 --- /dev/null +++ b/clients/client-internetmonitor/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 { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@aws-sdk/config-resolver"; +import { FetchHttpHandler as RequestHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/util-retry"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { InternetMonitorClientConfig } from "./InternetMonitorClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client"; +import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: InternetMonitorClientConfig) => { + 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-internetmonitor/src/runtimeConfig.native.ts b/clients/client-internetmonitor/src/runtimeConfig.native.ts new file mode 100644 index 000000000000..a9c012338230 --- /dev/null +++ b/clients/client-internetmonitor/src/runtimeConfig.native.ts @@ -0,0 +1,18 @@ +// smithy-typescript generated code +import { Sha256 } from "@aws-crypto/sha256-js"; + +import { InternetMonitorClientConfig } from "./InternetMonitorClient"; +import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: InternetMonitorClientConfig) => { + const browserDefaults = getBrowserRuntimeConfig(config); + return { + ...browserDefaults, + ...config, + runtime: "react-native", + sha256: config?.sha256 ?? Sha256, + }; +}; diff --git a/clients/client-internetmonitor/src/runtimeConfig.shared.ts b/clients/client-internetmonitor/src/runtimeConfig.shared.ts new file mode 100644 index 000000000000..bdf68f90d86d --- /dev/null +++ b/clients/client-internetmonitor/src/runtimeConfig.shared.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { NoOpLogger } from "@aws-sdk/smithy-client"; +import { parseUrl } from "@aws-sdk/url-parser"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8"; + +import { defaultEndpointResolver } from "./endpoint/endpointResolver"; +import { InternetMonitorClientConfig } from "./InternetMonitorClient"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: InternetMonitorClientConfig) => ({ + apiVersion: "2021-06-03", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? defaultEndpointResolver, + logger: config?.logger ?? new NoOpLogger(), + serviceId: config?.serviceId ?? "InternetMonitor", + urlParser: config?.urlParser ?? parseUrl, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, +}); diff --git a/clients/client-internetmonitor/src/runtimeConfig.ts b/clients/client-internetmonitor/src/runtimeConfig.ts new file mode 100644 index 000000000000..e0784047a715 --- /dev/null +++ b/clients/client-internetmonitor/src/runtimeConfig.ts @@ -0,0 +1,59 @@ +// 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 { + NODE_REGION_CONFIG_FILE_OPTIONS, + NODE_REGION_CONFIG_OPTIONS, + NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, + NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, +} from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler as RequestHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { DEFAULT_RETRY_MODE } from "@aws-sdk/util-retry"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { InternetMonitorClientConfig } from "./InternetMonitorClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client"; +import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-node"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: InternetMonitorClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + 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-internetmonitor/tsconfig.cjs.json b/clients/client-internetmonitor/tsconfig.cjs.json new file mode 100644 index 000000000000..3567d85ba846 --- /dev/null +++ b/clients/client-internetmonitor/tsconfig.cjs.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "outDir": "dist-cjs" + } +} diff --git a/clients/client-internetmonitor/tsconfig.es.json b/clients/client-internetmonitor/tsconfig.es.json new file mode 100644 index 000000000000..809f57bde65e --- /dev/null +++ b/clients/client-internetmonitor/tsconfig.es.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "lib": ["dom"], + "module": "esnext", + "outDir": "dist-es" + } +} diff --git a/clients/client-internetmonitor/tsconfig.json b/clients/client-internetmonitor/tsconfig.json new file mode 100644 index 000000000000..344909de2128 --- /dev/null +++ b/clients/client-internetmonitor/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-internetmonitor/tsconfig.types.json b/clients/client-internetmonitor/tsconfig.types.json new file mode 100644 index 000000000000..4c3dfa7b3d25 --- /dev/null +++ b/clients/client-internetmonitor/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/clients/client-internetmonitor/typedoc.json b/clients/client-internetmonitor/typedoc.json new file mode 100644 index 000000000000..1b5cb0146719 --- /dev/null +++ b/clients/client-internetmonitor/typedoc.json @@ -0,0 +1,3 @@ +{ + "extends": "../../typedoc.client.json" +} diff --git a/codegen/sdk-codegen/aws-models/internetmonitor.json b/codegen/sdk-codegen/aws-models/internetmonitor.json new file mode 100644 index 000000000000..89fd1f5849bb --- /dev/null +++ b/codegen/sdk-codegen/aws-models/internetmonitor.json @@ -0,0 +1,2152 @@ +{ + "smithy": "2.0", + "shapes": { + "com.amazonaws.internetmonitor#AccessDeniedException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

You don't have sufficient permission to perform this action.

", + "smithy.api#error": "client", + "smithy.api#httpError": 403 + } + }, + "com.amazonaws.internetmonitor#Arn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 20, + "max": 2048 + }, + "smithy.api#pattern": "^arn:.*" + } + }, + "com.amazonaws.internetmonitor#AvailabilityMeasurement": { + "type": "structure", + "members": { + "ExperienceScore": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "

Experience scores, or health scores are calculated for different geographic and network provider combinations (that is, different granularities) and\n\t\t\talso summed into global scores. If you view performance or availability scores without filtering for any specific geography or service provider, Amazon CloudWatch Internet Monitor\n\t\t\tprovides global health scores.

\n

The Amazon CloudWatch Internet Monitor chapter in the CloudWatch User Guide includes detailed information about how Internet Monitor calculates health scores, including performance and\n\t\t\tavailability scores, and when it creates and resolves health events. For more information, see How Amazon Web Services calculates performance and\n\t\t\t\tavailability scores in the Amazon CloudWatch Internet Monitor section of the CloudWatch User Guide.

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

The percentage of impact caused by a health event for total traffic globally.

\n

For information about how Internet Monitor calculates impact, see Inside Internet Monitor in the Amazon CloudWatch Internet Monitor section of the Amazon CloudWatch User\n\t\t\tGuide.

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

The percentage of impact caused by a health event for client location traffic globally.

\n

For information about how Internet Monitor calculates impact, see Inside Internet Monitor in the Amazon CloudWatch Internet Monitor section of the Amazon CloudWatch User\n\t\t\tGuide.

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

Measurements about the availability for your application on the internet, calculated by Amazon CloudWatch Internet Monitor. Amazon Web Services has substantial historical data about internet\n\t\t\tperformance and availability between Amazon Web Services services and different network providers and geographies. By applying statistical analysis to the data, Internet Monitor\n\t\t\tcan detect when the performance and availability for your application has dropped, compared to an estimated baseline that's already calculated. To make it\n\t\t\teasier to see those drops, we report that information to you in the form of health scores: a performance score and an availability score.

\n

Availability in Internet Monitor represents the estimated percentage of traffic that is not seeing an availability drop. For example, an availability score of 99%\n\t\t\tfor an end user and service location pair is equivalent to 1% of the traffic experiencing an availability drop for that pair.

\n

For more information, see How Internet Monitor calculates performance and availability\n\t\t\t\tscores in the Amazon CloudWatch Internet Monitor section of the Amazon CloudWatch User Guide.

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

A bad request was received.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.internetmonitor#ConflictException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

The requested resource is in use.

", + "smithy.api#error": "client", + "smithy.api#httpError": 409 + } + }, + "com.amazonaws.internetmonitor#CreateMonitor": { + "type": "operation", + "input": { + "target": "com.amazonaws.internetmonitor#CreateMonitorInput" + }, + "output": { + "target": "com.amazonaws.internetmonitor#CreateMonitorOutput" + }, + "errors": [ + { + "target": "com.amazonaws.internetmonitor#AccessDeniedException" + }, + { + "target": "com.amazonaws.internetmonitor#ConflictException" + }, + { + "target": "com.amazonaws.internetmonitor#InternalServerException" + }, + { + "target": "com.amazonaws.internetmonitor#LimitExceededException" + }, + { + "target": "com.amazonaws.internetmonitor#ThrottlingException" + }, + { + "target": "com.amazonaws.internetmonitor#ValidationException" + } + ], + "traits": { + "aws.iam#conditionKeys": ["aws:RequestTag/${TagKey}", "aws:TagKeys"], + "smithy.api#documentation": "

Creates a monitor in Amazon CloudWatch Internet Monitor. A monitor is built based on information from the application resources that you add: Virtual Private Clouds (VPCs),\n\t\t\tAmazon CloudFront distributions, and WorkSpaces directories.

\n

After you create a monitor, you can view the internet performance for your application, scoped to a location, as well as any health events that are\n\t\t\timpairing traffic. Internet Monitor can also diagnose whether the impairment is on the Amazon Web Services network or is an issue with an internet service provider (ISP).

", + "smithy.api#http": { + "uri": "/v20210603/Monitors", + "method": "POST" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.internetmonitor#CreateMonitorInput": { + "type": "structure", + "members": { + "MonitorName": { + "target": "com.amazonaws.internetmonitor#ResourceName", + "traits": { + "smithy.api#documentation": "

The name of the monitor.

", + "smithy.api#required": {} + } + }, + "Resources": { + "target": "com.amazonaws.internetmonitor#SetOfARNs", + "traits": { + "smithy.api#documentation": "

The resources to include in a monitor, which you provide as a set of Amazon Resource Names (ARNs).

\n

You can add a combination of Amazon Virtual Private Clouds (VPCs) and Amazon CloudFront distributions, or you can add Amazon WorkSpaces directories. You can't add all three types of\n\t\t\tresources.

\n \n

If you add only VPC resources, at least one VPC must have an Internet Gateway attached to it, to make sure that it has internet connectivity.

\n
" + } + }, + "ClientToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A unique, case-sensitive string of up to 64 ASCII characters that you specify to make an idempotent API request. Don't reuse the same client token for\n\t\t\tother API requests.

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

The tags for a monitor. You can add a maximum of 50 tags in Internet Monitor.

" + } + }, + "MaxCityNetworksToMonitor": { + "target": "com.amazonaws.internetmonitor#MaxCityNetworksToMonitor", + "traits": { + "smithy.api#default": 0, + "smithy.api#documentation": "

The maximum number of city-network combinations (that is, combinations of a city location and network, such as an ISP) to be monitored \n\t\t\tfor your resources.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.internetmonitor#CreateMonitorOutput": { + "type": "structure", + "members": { + "Arn": { + "target": "com.amazonaws.internetmonitor#MonitorArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the monitor.

", + "smithy.api#required": {} + } + }, + "Status": { + "target": "com.amazonaws.internetmonitor#MonitorConfigState", + "traits": { + "smithy.api#documentation": "

The status of a monitor.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.internetmonitor#DeleteMonitor": { + "type": "operation", + "input": { + "target": "com.amazonaws.internetmonitor#DeleteMonitorInput" + }, + "output": { + "target": "com.amazonaws.internetmonitor#DeleteMonitorOutput" + }, + "errors": [ + { + "target": "com.amazonaws.internetmonitor#AccessDeniedException" + }, + { + "target": "com.amazonaws.internetmonitor#InternalServerException" + }, + { + "target": "com.amazonaws.internetmonitor#ThrottlingException" + }, + { + "target": "com.amazonaws.internetmonitor#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes a monitor in Amazon CloudWatch Internet Monitor.

", + "smithy.api#http": { + "uri": "/v20210603/Monitors/{MonitorName}", + "method": "DELETE" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.internetmonitor#DeleteMonitorInput": { + "type": "structure", + "members": { + "MonitorName": { + "target": "com.amazonaws.internetmonitor#ResourceName", + "traits": { + "smithy.api#documentation": "

The name of the monitor to delete.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.internetmonitor#DeleteMonitorOutput": { + "type": "structure", + "members": {} + }, + "com.amazonaws.internetmonitor#GetHealthEvent": { + "type": "operation", + "input": { + "target": "com.amazonaws.internetmonitor#GetHealthEventInput" + }, + "output": { + "target": "com.amazonaws.internetmonitor#GetHealthEventOutput" + }, + "errors": [ + { + "target": "com.amazonaws.internetmonitor#AccessDeniedException" + }, + { + "target": "com.amazonaws.internetmonitor#InternalServerException" + }, + { + "target": "com.amazonaws.internetmonitor#ThrottlingException" + }, + { + "target": "com.amazonaws.internetmonitor#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Gets information the Amazon CloudWatch Internet Monitor has created and stored about a health event for a specified monitor. This information includes the impacted locations,\n\t\t\tand all of the information related to the event by location.

\n

The information returned includes the performance, availability, and round-trip time impact, information about the network providers, the event type,\n\t\t\tand so on.

\n

Information rolled up at the global traffic level is also returned, including the impact type and total traffic impact.

", + "smithy.api#http": { + "uri": "/v20210603/Monitors/{MonitorName}/HealthEvents/{EventId}", + "method": "GET" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.internetmonitor#GetHealthEventInput": { + "type": "structure", + "members": { + "MonitorName": { + "target": "com.amazonaws.internetmonitor#ResourceName", + "traits": { + "smithy.api#documentation": "

The name of the monitor.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "EventId": { + "target": "com.amazonaws.internetmonitor#HealthEventName", + "traits": { + "smithy.api#documentation": "

The internally generated identifier of a health event. Because EventID contains the forward slash (“/”) character, you must \n\t\t\tURL-encode the EventID field in the request URL.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.internetmonitor#GetHealthEventOutput": { + "type": "structure", + "members": { + "EventArn": { + "target": "com.amazonaws.internetmonitor#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the event.

", + "smithy.api#required": {} + } + }, + "EventId": { + "target": "com.amazonaws.internetmonitor#HealthEventName", + "traits": { + "smithy.api#documentation": "

The internally generated identifier of a health event.

", + "smithy.api#required": {} + } + }, + "StartedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

The time when a health event started.

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "date-time" + } + }, + "EndedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

The time when a health event was resolved. If the health event is still active, the end time is not set.

", + "smithy.api#timestampFormat": "date-time" + } + }, + "CreatedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

The time when a health event was created.

", + "smithy.api#timestampFormat": "date-time" + } + }, + "LastUpdatedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

The time when a health event was last updated or recalculated.

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "date-time" + } + }, + "ImpactedLocations": { + "target": "com.amazonaws.internetmonitor#ImpactedLocationsList", + "traits": { + "smithy.api#documentation": "

The locations affected by a health event.

", + "smithy.api#required": {} + } + }, + "Status": { + "target": "com.amazonaws.internetmonitor#HealthEventStatus", + "traits": { + "smithy.api#documentation": "

The status of a health event.

", + "smithy.api#required": {} + } + }, + "PercentOfTotalTrafficImpacted": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "

The impact on total traffic that a health event has.

" + } + }, + "ImpactType": { + "target": "com.amazonaws.internetmonitor#HealthEventImpactType", + "traits": { + "smithy.api#documentation": "

The type of impairment of a specific health event.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.internetmonitor#GetMonitor": { + "type": "operation", + "input": { + "target": "com.amazonaws.internetmonitor#GetMonitorInput" + }, + "output": { + "target": "com.amazonaws.internetmonitor#GetMonitorOutput" + }, + "errors": [ + { + "target": "com.amazonaws.internetmonitor#AccessDeniedException" + }, + { + "target": "com.amazonaws.internetmonitor#InternalServerException" + }, + { + "target": "com.amazonaws.internetmonitor#ThrottlingException" + }, + { + "target": "com.amazonaws.internetmonitor#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Gets information about a monitor in Amazon CloudWatch Internet Monitor based on a monitor name. The information returned includes the Amazon Resource Name (ARN), create time,\n\t\t\tmodified time, resources included in the monitor, and status information.

", + "smithy.api#http": { + "uri": "/v20210603/Monitors/{MonitorName}", + "method": "GET" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.internetmonitor#GetMonitorInput": { + "type": "structure", + "members": { + "MonitorName": { + "target": "com.amazonaws.internetmonitor#ResourceName", + "traits": { + "smithy.api#documentation": "

The name of the monitor.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.internetmonitor#GetMonitorOutput": { + "type": "structure", + "members": { + "MonitorName": { + "target": "com.amazonaws.internetmonitor#ResourceName", + "traits": { + "smithy.api#documentation": "

The name of the monitor.

", + "smithy.api#required": {} + } + }, + "MonitorArn": { + "target": "com.amazonaws.internetmonitor#MonitorArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the monitor.

", + "smithy.api#required": {} + } + }, + "Resources": { + "target": "com.amazonaws.internetmonitor#SetOfARNs", + "traits": { + "smithy.api#documentation": "

The resources that have been added for the monitor. Resources are listed by their Amazon Resource Names (ARNs).

", + "smithy.api#required": {} + } + }, + "Status": { + "target": "com.amazonaws.internetmonitor#MonitorConfigState", + "traits": { + "smithy.api#documentation": "

The status of the monitor.

", + "smithy.api#required": {} + } + }, + "CreatedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

The time when the monitor was created.

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "date-time" + } + }, + "ModifiedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

The last time that the monitor was modified.

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "date-time" + } + }, + "ProcessingStatus": { + "target": "com.amazonaws.internetmonitor#MonitorProcessingStatusCode", + "traits": { + "smithy.api#documentation": "

The health of the data processing for the monitor.

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

Additional information about the health of the data processing for the monitor.

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

The tags that have been added to monitor.

" + } + }, + "MaxCityNetworksToMonitor": { + "target": "com.amazonaws.internetmonitor#MaxCityNetworksToMonitor", + "traits": { + "smithy.api#default": 0, + "smithy.api#documentation": "

The maximum number of city-network combinations (that is, combinations of a city location and network, such as an ISP) to be monitored \n\t\t\tfor your resources.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.internetmonitor#HealthEvent": { + "type": "structure", + "members": { + "EventArn": { + "target": "com.amazonaws.internetmonitor#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the event.

", + "smithy.api#required": {} + } + }, + "EventId": { + "target": "com.amazonaws.internetmonitor#HealthEventName", + "traits": { + "smithy.api#documentation": "

The internally generated identifier of a specific network traffic impairment health event.

", + "smithy.api#required": {} + } + }, + "StartedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

When a health event started.

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "date-time" + } + }, + "EndedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

The time when a health event ended. If the health event is still active, then the end time is not set.

", + "smithy.api#timestampFormat": "date-time" + } + }, + "CreatedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

When the health event was created.

", + "smithy.api#timestampFormat": "date-time" + } + }, + "LastUpdatedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

When the health event was last updated.

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "date-time" + } + }, + "ImpactedLocations": { + "target": "com.amazonaws.internetmonitor#ImpactedLocationsList", + "traits": { + "smithy.api#documentation": "

The locations impacted by the health event.

", + "smithy.api#required": {} + } + }, + "Status": { + "target": "com.amazonaws.internetmonitor#HealthEventStatus", + "traits": { + "smithy.api#documentation": "

Health event list member.

", + "smithy.api#required": {} + } + }, + "PercentOfTotalTrafficImpacted": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "

The impact on global traffic monitored by this monitor for this health event.

" + } + }, + "ImpactType": { + "target": "com.amazonaws.internetmonitor#HealthEventImpactType", + "traits": { + "smithy.api#documentation": "

The type of impairment for a health event.

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

Information about a health event created in a monitor in Amazon CloudWatch Internet Monitor.

" + } + }, + "com.amazonaws.internetmonitor#HealthEventImpactType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "AVAILABILITY", + "name": "AVAILABILITY" + }, + { + "value": "PERFORMANCE", + "name": "PERFORMANCE" + } + ] + } + }, + "com.amazonaws.internetmonitor#HealthEventList": { + "type": "list", + "member": { + "target": "com.amazonaws.internetmonitor#HealthEvent" + } + }, + "com.amazonaws.internetmonitor#HealthEventName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 255 + }, + "smithy.api#pattern": "^[a-zA-Z0-9/_.-]+$" + } + }, + "com.amazonaws.internetmonitor#HealthEventResource": { + "type": "resource", + "identifiers": { + "MonitorName": { + "target": "com.amazonaws.internetmonitor#ResourceName" + }, + "EventId": { + "target": "com.amazonaws.internetmonitor#HealthEventName" + } + }, + "read": { + "target": "com.amazonaws.internetmonitor#GetHealthEvent" + }, + "list": { + "target": "com.amazonaws.internetmonitor#ListHealthEvents" + }, + "traits": { + "aws.api#arn": { + "template": "monitor/{MonitorName}/health-event/{EventId}" + }, + "aws.iam#disableConditionKeyInference": {} + } + }, + "com.amazonaws.internetmonitor#HealthEventStatus": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "ACTIVE", + "name": "ACTIVE" + }, + { + "value": "RESOLVED", + "name": "RESOLVED" + } + ] + } + }, + "com.amazonaws.internetmonitor#ImpactedLocation": { + "type": "structure", + "members": { + "ASName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the network at an impacted location.

", + "smithy.api#required": {} + } + }, + "ASNumber": { + "target": "smithy.api#Long", + "traits": { + "smithy.api#documentation": "

The Autonomous System Number (ASN) of the network at an impacted location.

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

The name of the country where the health event is located.

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

The subdivision location where the health event is located. The subdivision usually maps to \n\t\t\t\tstates in most countries (including the United States). For United Kingdom, it maps to a country (England, \n\t\t\t\tScotland, Wales) or province (Northern Ireland).

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

The metro area where the health event is located.

\n

Metro indicates a metropolitan region in the United States, such as the region around New York City.\n \t\tIn non-US countries, this is a second-level subdivision. For example, in the United Kingdom, it could be\n \t\ta county, a London borough, a unitary authority, council area, and so on.

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

The name of the city where the health event is located.

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

The latitude where the health event is located.

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

The longitude where the health event is located.

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

The country code where the health event is located. The ISO 3166-2 codes for the\n \t\tcountry is provided, when available.

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

The subdivision code where the health event is located. The ISO 3166-2 codes for \n\t\t\tcountry subdivisions is provided, when available.

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

The service location where the health event is located.

" + } + }, + "Status": { + "target": "com.amazonaws.internetmonitor#HealthEventStatus", + "traits": { + "smithy.api#documentation": "

The status of the health event at an impacted location.

", + "smithy.api#required": {} + } + }, + "CausedBy": { + "target": "com.amazonaws.internetmonitor#NetworkImpairment", + "traits": { + "smithy.api#documentation": "

The cause of the impairment. There are two types of network impairments: Amazon Web Services network issues\n \tor internet issues. Internet issues are typically a problem with a network provider, like an internet service provider (ISP).

" + } + }, + "InternetHealth": { + "target": "com.amazonaws.internetmonitor#InternetHealth", + "traits": { + "smithy.api#documentation": "

The calculated health at a specific location.

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

Information about a location impacted by a health event in Amazon CloudWatch Internet Monitor.

\n

Geographic regions are hierarchically categorized into country, subdivision, \n \t\tmetro and city geographic granularities. The geographic region is identified based \n \t\ton the IP address used at the client locations.

" + } + }, + "com.amazonaws.internetmonitor#ImpactedLocationsList": { + "type": "list", + "member": { + "target": "com.amazonaws.internetmonitor#ImpactedLocation" + } + }, + "com.amazonaws.internetmonitor#InternalServerErrorException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

There was an internal server error.

", + "smithy.api#error": "server", + "smithy.api#httpError": 500, + "smithy.api#retryable": {} + } + }, + "com.amazonaws.internetmonitor#InternalServerException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

An internal error occurred.

", + "smithy.api#error": "server", + "smithy.api#httpError": 500, + "smithy.api#retryable": {} + } + }, + "com.amazonaws.internetmonitor#InternetHealth": { + "type": "structure", + "members": { + "Availability": { + "target": "com.amazonaws.internetmonitor#AvailabilityMeasurement", + "traits": { + "smithy.api#documentation": "

Availability in Internet Monitor represents the estimated percentage of traffic that is not seeing an availability drop. For example, an availability score of 99%\n\t\t\tfor an end user and service location pair is equivalent to 1% of the traffic experiencing an availability drop for that pair.

\n

For more information, see How Internet Monitor calculates performance and availability\n\t\t\t\tscores in the Amazon CloudWatch Internet Monitor section of the Amazon CloudWatch User Guide.

" + } + }, + "Performance": { + "target": "com.amazonaws.internetmonitor#PerformanceMeasurement", + "traits": { + "smithy.api#documentation": "

Performance in Internet Monitor represents the estimated percentage of traffic that is not seeing a performance drop. For example, a performance score of 99% for\n\t\t\tan end user and service location pair is equivalent to 1% of the traffic experiencing a performance drop for that pair.

\n

For more information, see How Internet Monitor calculates performance and availability\n\t\t\t\tscores in the Amazon CloudWatch Internet Monitor section of the Amazon CloudWatch User Guide.

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

Internet health includes measurements calculated by Amazon CloudWatch Internet Monitor about the performance and availability for your application on the internet. Amazon Web Services has\n\t\t\tsubstantial historical data about internet performance and availability between Amazon Web Services services and different network providers and geographies. By\n\t\t\tapplying statistical analysis to the data, Internet Monitor can detect when the performance and availability for your application has dropped, compared to an\n\t\t\testimated baseline that's already calculated. To make it easier to see those drops, we report that information to you in the form of health scores: a\n\t\t\tperformance score and an availability score.

" + } + }, + "com.amazonaws.internetmonitor#InternetMonitor20210603": { + "type": "service", + "version": "2021-06-03", + "operations": [ + { + "target": "com.amazonaws.internetmonitor#ListTagsForResource" + }, + { + "target": "com.amazonaws.internetmonitor#TagResource" + }, + { + "target": "com.amazonaws.internetmonitor#UntagResource" + } + ], + "resources": [ + { + "target": "com.amazonaws.internetmonitor#MonitorResource" + } + ], + "traits": { + "aws.api#service": { + "sdkId": "InternetMonitor", + "arnNamespace": "internetmonitor", + "cloudFormationName": "InternetMonitor", + "cloudTrailEventSource": "internetmonitor.amazonaws.com" + }, + "aws.auth#sigv4": { + "name": "internetmonitor" + }, + "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 Internet Monitor provides visibility into how internet issues impact the performance and availability between your applications hosted on Amazon Web Services and your end\n\t\t\tusers, reducing the time it takes for you to diagnose these issues, from days to minutes. You can explore internet measurements for different time frames\n\t\t\tand at different geographic granularities, and quickly visualize the impact of issues, and then take action to improve your end users' experience, for\n\t\t\texample, by switching to other Amazon Web Services services or rerouting traffic to your workload through differentAmazon Web Services Regions.

\n

If the issue is caused by the Amazon Web Services network, you'll automatically receive an Amazon Web Services Health Dashboard notification with the steps that Amazon Web Services is taking\n\t\t\tto mitigate the problem. To support integrating health information for geographies and networks specific to your application, Internet Monitor delivers measurements\n\t\t\tto CloudWatch Logs and CloudWatch Metrics. Internet Monitor also sends health events to Amazon EventBridge, so you can set up notifications. Internet Monitor monitors internet connectivity\n\t\t\tfor your application through Amazon Virtual Private Clouds (VPCs), Amazon CloudFront distributions, and Amazon WorkSpaces directories.

\n

To use Internet Monitor, you create a monitor and add resources to it, Virtual Private Clouds (VPCs), Amazon CloudFront distributions, or WorkSpaces\n\t\t\tdirectories that show where your application's internet traffic is. Internet Monitor then provides internet measurements from Amazon Web Services that are specific to the locations\n\t\t\tand networks that communicate with your application. For more information, see Using Amazon CloudWatch Internet Monitor in the Amazon CloudWatch User Guide.

", + "smithy.api#title": "Amazon CloudWatch Internet 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" + }, + "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" + } + ] + } + ], + "type": "tree", + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + } + ], + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error" + }, + { + "conditions": [], + "endpoint": { + "url": { + "ref": "Endpoint" + }, + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ] + }, + { + "conditions": [], + "type": "tree", + "rules": [ + { + "conditions": [ + { + "fn": "isSet", + "argv": [ + { + "ref": "Region" + } + ] + } + ], + "type": "tree", + "rules": [ + { + "conditions": [ + { + "fn": "aws.partition", + "argv": [ + { + "ref": "Region" + } + ], + "assign": "PartitionResult" + } + ], + "type": "tree", + "rules": [ + { + "conditions": [], + "type": "tree", + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsDualStack" + ] + } + ] + } + ], + "type": "tree", + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + } + ], + "type": "tree", + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + } + ] + } + ], + "type": "tree", + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://internetmonitor-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ] + }, + { + "conditions": [], + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error" + } + ] + }, + { + "conditions": [], + "endpoint": { + "url": "https://internetmonitor.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ] + }, + { + "conditions": [], + "type": "tree", + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + } + ], + "type": "tree", + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + } + ] + } + ], + "type": "tree", + "rules": [ + { + "conditions": [], + "type": "tree", + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://internetmonitor-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ] + } + ] + }, + { + "conditions": [], + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error" + } + ] + }, + { + "conditions": [], + "type": "tree", + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://internetmonitor.{Region}.{PartitionResult#dnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "conditions": [], + "error": "Invalid Configuration: Missing Region", + "type": "error" + } + ] + } + ] + }, + "smithy.rules#endpointTests": { + "testCases": [ + { + "documentation": "For region us-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://internetmonitor-fips.us-east-1.api.aws" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": true + } + }, + { + "documentation": "For region us-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://internetmonitor.us-east-1.api.aws" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false + } + }, + { + "documentation": "For region cn-north-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://internetmonitor-fips.cn-north-1.api.amazonwebservices.com.cn" + } + }, + "params": { + "Region": "cn-north-1", + "UseFIPS": true + } + }, + { + "documentation": "For region cn-north-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://internetmonitor.cn-north-1.api.amazonwebservices.com.cn" + } + }, + "params": { + "Region": "cn-north-1", + "UseFIPS": false + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://internetmonitor-fips.us-gov-east-1.api.aws" + } + }, + "params": { + "Region": "us-gov-east-1", + "UseFIPS": true + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://internetmonitor.us-gov-east-1.api.aws" + } + }, + "params": { + "Region": "us-gov-east-1", + "UseFIPS": 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, + "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, + "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, + "Endpoint": "https://example.com" + } + } + ], + "version": "1.0" + } + } + }, + "com.amazonaws.internetmonitor#LimitExceededException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

The request exceeded a service quota.

", + "smithy.api#error": "client", + "smithy.api#httpError": 403 + } + }, + "com.amazonaws.internetmonitor#ListHealthEvents": { + "type": "operation", + "input": { + "target": "com.amazonaws.internetmonitor#ListHealthEventsInput" + }, + "output": { + "target": "com.amazonaws.internetmonitor#ListHealthEventsOutput" + }, + "errors": [ + { + "target": "com.amazonaws.internetmonitor#AccessDeniedException" + }, + { + "target": "com.amazonaws.internetmonitor#InternalServerException" + }, + { + "target": "com.amazonaws.internetmonitor#ThrottlingException" + }, + { + "target": "com.amazonaws.internetmonitor#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Lists all health events for a monitor in Amazon CloudWatch Internet Monitor. Returns all information for health events including the client location information the network\n\t\t\tcause and status, event start and end time, percentage of total traffic impacted, and status.

\n \n

Health events that have start times during the time frame that is requested are not included in the list of health events.

\n
", + "smithy.api#http": { + "uri": "/v20210603/Monitors/{MonitorName}/HealthEvents", + "method": "GET" + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults", + "items": "HealthEvents" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.internetmonitor#ListHealthEventsInput": { + "type": "structure", + "members": { + "MonitorName": { + "target": "com.amazonaws.internetmonitor#ResourceName", + "traits": { + "smithy.api#documentation": "

The name of the monitor.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "StartTime": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

The time when a health event started.

", + "smithy.api#httpQuery": "StartTime", + "smithy.api#timestampFormat": "date-time" + } + }, + "EndTime": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

The time when a health event ended. If the health event is still ongoing, then the end time is not set.

", + "smithy.api#httpQuery": "EndTime", + "smithy.api#timestampFormat": "date-time" + } + }, + "NextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The token for the next set of results. You receive this token from a previous call.

", + "smithy.api#httpQuery": "NextToken" + } + }, + "MaxResults": { + "target": "com.amazonaws.internetmonitor#MaxResults", + "traits": { + "smithy.api#default": 0, + "smithy.api#documentation": "

The number of health event objects that you want to return with this call.

", + "smithy.api#httpQuery": "MaxResults" + } + }, + "EventStatus": { + "target": "com.amazonaws.internetmonitor#HealthEventStatus", + "traits": { + "smithy.api#documentation": "

The status of a health event.

", + "smithy.api#httpQuery": "EventStatus" + } + } + } + }, + "com.amazonaws.internetmonitor#ListHealthEventsOutput": { + "type": "structure", + "members": { + "HealthEvents": { + "target": "com.amazonaws.internetmonitor#HealthEventList", + "traits": { + "smithy.api#documentation": "

A list of health events.

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

The token for the next set of results. You receive this token from a previous call.

" + } + } + } + }, + "com.amazonaws.internetmonitor#ListMonitors": { + "type": "operation", + "input": { + "target": "com.amazonaws.internetmonitor#ListMonitorsInput" + }, + "output": { + "target": "com.amazonaws.internetmonitor#ListMonitorsOutput" + }, + "errors": [ + { + "target": "com.amazonaws.internetmonitor#AccessDeniedException" + }, + { + "target": "com.amazonaws.internetmonitor#InternalServerException" + }, + { + "target": "com.amazonaws.internetmonitor#ThrottlingException" + }, + { + "target": "com.amazonaws.internetmonitor#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Lists all of your monitors for Amazon CloudWatch Internet Monitor and their statuses, along with the Amazon Resource Name (ARN) and name of each monitor.

", + "smithy.api#http": { + "uri": "/v20210603/Monitors", + "method": "GET" + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults", + "items": "Monitors" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.internetmonitor#ListMonitorsInput": { + "type": "structure", + "members": { + "NextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The token for the next set of results. You receive this token from a previous call.

", + "smithy.api#httpQuery": "NextToken" + } + }, + "MaxResults": { + "target": "com.amazonaws.internetmonitor#MaxResults", + "traits": { + "smithy.api#default": 0, + "smithy.api#documentation": "

The number of monitor objects that you want to return with this call.

", + "smithy.api#httpQuery": "MaxResults" + } + }, + "MonitorStatus": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The status of a monitor. This includes the status of the data processing for the monitor and the status of the monitor itself.

\n

For information about the statuses for a monitor, see \n\t\t\t\tMonitor.

", + "smithy.api#httpQuery": "MonitorStatus" + } + } + } + }, + "com.amazonaws.internetmonitor#ListMonitorsOutput": { + "type": "structure", + "members": { + "Monitors": { + "target": "com.amazonaws.internetmonitor#MonitorList", + "traits": { + "smithy.api#documentation": "

A list of monitors.

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

The token for the next set of results. You receive this token from a previous call.

" + } + } + } + }, + "com.amazonaws.internetmonitor#ListTagsForResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.internetmonitor#ListTagsForResourceInput" + }, + "output": { + "target": "com.amazonaws.internetmonitor#ListTagsForResourceOutput" + }, + "errors": [ + { + "target": "com.amazonaws.internetmonitor#AccessDeniedException" + }, + { + "target": "com.amazonaws.internetmonitor#BadRequestException" + }, + { + "target": "com.amazonaws.internetmonitor#InternalServerErrorException" + }, + { + "target": "com.amazonaws.internetmonitor#NotFoundException" + }, + { + "target": "com.amazonaws.internetmonitor#TooManyRequestsException" + } + ], + "traits": { + "smithy.api#documentation": "

Lists the tags for a resource. Tags are supported only for monitors in Amazon CloudWatch Internet Monitor.

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

The Amazon Resource Name (ARN) for a resource.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#references": [ + { + "resource": "com.amazonaws.internetmonitor#MonitorResource", + "ids": { + "MonitorName": "ResourceArn" + } + } + ] + } + }, + "com.amazonaws.internetmonitor#ListTagsForResourceOutput": { + "type": "structure", + "members": { + "Tags": { + "target": "com.amazonaws.internetmonitor#TagMap", + "traits": { + "smithy.api#documentation": "

Tags for a resource.

" + } + } + } + }, + "com.amazonaws.internetmonitor#MaxCityNetworksToMonitor": { + "type": "integer", + "traits": { + "smithy.api#default": 0, + "smithy.api#range": { + "min": 1, + "max": 500000 + } + } + }, + "com.amazonaws.internetmonitor#MaxResults": { + "type": "integer", + "traits": { + "smithy.api#default": 0, + "smithy.api#range": { + "min": 1, + "max": 25 + } + } + }, + "com.amazonaws.internetmonitor#Monitor": { + "type": "structure", + "members": { + "MonitorName": { + "target": "com.amazonaws.internetmonitor#ResourceName", + "traits": { + "smithy.api#documentation": "

The name of the monitor.

", + "smithy.api#required": {} + } + }, + "MonitorArn": { + "target": "com.amazonaws.internetmonitor#MonitorArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the monitor.

", + "smithy.api#required": {} + } + }, + "Status": { + "target": "com.amazonaws.internetmonitor#MonitorConfigState", + "traits": { + "smithy.api#documentation": "

The status of a monitor.

", + "smithy.api#required": {} + } + }, + "ProcessingStatus": { + "target": "com.amazonaws.internetmonitor#MonitorProcessingStatusCode", + "traits": { + "smithy.api#documentation": "

The health of data processing for the monitor.

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

The description of and information about a monitor in Amazon CloudWatch Internet Monitor.

" + } + }, + "com.amazonaws.internetmonitor#MonitorArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 20, + "max": 512 + }, + "smithy.api#pattern": "^arn:.*" + } + }, + "com.amazonaws.internetmonitor#MonitorConfigState": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "PENDING", + "name": "PENDING" + }, + { + "value": "ACTIVE", + "name": "ACTIVE" + }, + { + "value": "INACTIVE", + "name": "INACTIVE" + }, + { + "value": "ERROR", + "name": "ERROR" + } + ] + } + }, + "com.amazonaws.internetmonitor#MonitorList": { + "type": "list", + "member": { + "target": "com.amazonaws.internetmonitor#Monitor" + } + }, + "com.amazonaws.internetmonitor#MonitorProcessingStatusCode": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "OK", + "name": "OK" + }, + { + "value": "INACTIVE", + "name": "INACTIVE" + }, + { + "value": "COLLECTING_DATA", + "name": "COLLECTING_DATA" + }, + { + "value": "INSUFFICIENT_DATA", + "name": "INSUFFICIENT_DATA" + }, + { + "value": "FAULT_SERVICE", + "name": "FAULT_SERVICE" + }, + { + "value": "FAULT_ACCESS_CLOUDWATCH", + "name": "FAULT_ACCESS_CLOUDWATCH" + } + ] + } + }, + "com.amazonaws.internetmonitor#MonitorResource": { + "type": "resource", + "identifiers": { + "MonitorName": { + "target": "com.amazonaws.internetmonitor#ResourceName" + } + }, + "put": { + "target": "com.amazonaws.internetmonitor#CreateMonitor" + }, + "read": { + "target": "com.amazonaws.internetmonitor#GetMonitor" + }, + "update": { + "target": "com.amazonaws.internetmonitor#UpdateMonitor" + }, + "delete": { + "target": "com.amazonaws.internetmonitor#DeleteMonitor" + }, + "list": { + "target": "com.amazonaws.internetmonitor#ListMonitors" + }, + "resources": [ + { + "target": "com.amazonaws.internetmonitor#HealthEventResource" + } + ], + "traits": { + "aws.api#arn": { + "template": "monitor/{MonitorName}" + }, + "aws.cloudformation#cfnResource": { + "name": "Monitor" + }, + "aws.iam#conditionKeys": ["aws:ResourceTag/${TagKey}"], + "aws.iam#disableConditionKeyInference": {} + } + }, + "com.amazonaws.internetmonitor#Network": { + "type": "structure", + "members": { + "ASName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The internet provider name or network name.

", + "smithy.api#required": {} + } + }, + "ASNumber": { + "target": "smithy.api#Long", + "traits": { + "smithy.api#documentation": "

The Autonomous System Number (ASN) of the internet provider or network.

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

An internet service provider (ISP) or network in Amazon CloudWatch Internet Monitor.

" + } + }, + "com.amazonaws.internetmonitor#NetworkImpairment": { + "type": "structure", + "members": { + "Networks": { + "target": "com.amazonaws.internetmonitor#NetworkList", + "traits": { + "smithy.api#documentation": "

The networks that could be impacted by a network impairment event.

", + "smithy.api#required": {} + } + }, + "AsPath": { + "target": "com.amazonaws.internetmonitor#NetworkList", + "traits": { + "smithy.api#documentation": "

The combination of the Autonomous System Number (ASN) of the network and the name of the network.

", + "smithy.api#required": {} + } + }, + "NetworkEventType": { + "target": "com.amazonaws.internetmonitor#TriangulationEventType", + "traits": { + "smithy.api#documentation": "

Type of network impairment.

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

Information about the network impairment for a specific network measured by Amazon CloudWatch Internet Monitor.

" + } + }, + "com.amazonaws.internetmonitor#NetworkList": { + "type": "list", + "member": { + "target": "com.amazonaws.internetmonitor#Network" + } + }, + "com.amazonaws.internetmonitor#NotFoundException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

The request specifies something that doesn't exist.

", + "smithy.api#error": "client", + "smithy.api#httpError": 404 + } + }, + "com.amazonaws.internetmonitor#PerformanceMeasurement": { + "type": "structure", + "members": { + "ExperienceScore": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "

Experience scores, or health scores, are calculated for different geographic and network provider combinations (that is, different granularities) and\n\t\t\talso totaled into global scores. If you view performance or availability scores without filtering for any specific geography or service provider, Amazon CloudWatch Internet Monitor\n\t\t\tprovides global health scores.

\n

The Amazon CloudWatch Internet Monitor chapter in the CloudWatch User Guide includes detailed information about how Internet Monitor calculates health scores, including performance and\n\t\t\tavailability scores, and when it creates and resolves health events. For more information, see How Amazon Web Services calculates performance and\n\t\t\t\tavailability scores in the Amazon CloudWatch Internet Monitor section of the CloudWatch User Guide.

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

How much performance impact was caused by a health event for total traffic globally. For performance, this is the percentage of how much latency\n\t\t\tincreased during the event compared to typical performance for your application traffic globally.

\n

For more information, see When Amazon Web Services creates and resolves health\n\t\t\t\tevents in the Amazon CloudWatch Internet Monitor section of the CloudWatch User Guide.

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

How much performance impact was caused by a health event at a client location. For performance, this is the percentage of how much latency increased\n\t\t\tduring the event compared to typical performance for traffic, from this client location to an Amazon Web Services location, using a specific client network.

\n

For more information, see When Amazon Web Services creates and resolves health\n\t\t\t\tevents in the Amazon CloudWatch Internet Monitor section of the CloudWatch User Guide.

" + } + }, + "RoundTripTime": { + "target": "com.amazonaws.internetmonitor#RoundTripTime", + "traits": { + "smithy.api#documentation": "

This is the percentage of how much round-trip time increased during the event compared to typical round-trip time for your application for traffic.

\n

For more information, see When Amazon Web Services creates and resolves health\n\t\t\t\tevents in the Amazon CloudWatch Internet Monitor section of the CloudWatch User Guide.

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

Measurements about the performance for your application on the internet calculated by Amazon CloudWatch Internet Monitor. Amazon Web Services has substantial historical data about internet\n\t\t\tperformance and availability between Amazon Web Services services and different network providers and geographies. By applying statistical analysis to the data, Internet Monitor\n\t\t\tcan detect when the performance and availability for your application has dropped, compared to an estimated baseline that's already calculated. To make it\n\t\t\teasier to see those drops, we report that information to you in the form of health scores: a performance score and an availability score.

\n

Performance in Internet Monitor represents the estimated percentage of traffic that is not seeing a performance drop. For example, a performance score of 99% for\n\t\t\tan end user and service location pair is equivalent to 1% of the traffic experiencing a performance drop for that pair.

\n

For more information, see How Internet Monitor calculates performance and availability\n\t\t\t\tscores in the Amazon CloudWatch Internet Monitor section of the Amazon CloudWatch User Guide.

" + } + }, + "com.amazonaws.internetmonitor#ResourceName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 255 + }, + "smithy.api#pattern": "^[a-zA-Z0-9_.-]+$" + } + }, + "com.amazonaws.internetmonitor#ResourceNotFoundException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

The request specifies a resource that doesn't exist.

", + "smithy.api#error": "client", + "smithy.api#httpError": 404 + } + }, + "com.amazonaws.internetmonitor#RoundTripTime": { + "type": "structure", + "members": { + "P50": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "

RTT at the 50th percentile (p50).

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

RTT at the 90th percentile (p90).

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

RTT at the 95th percentile (p95).

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

Round-trip time (RTT) is how long it takes for a request from the user to return a response to the user. Amazon CloudWatch Internet Monitor calculates RTT at different\n\t\t\tpercentiles: p50, p90, and p95.

" + } + }, + "com.amazonaws.internetmonitor#SetOfARNs": { + "type": "list", + "member": { + "target": "com.amazonaws.internetmonitor#Arn" + } + }, + "com.amazonaws.internetmonitor#TagKey": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 128 + } + } + }, + "com.amazonaws.internetmonitor#TagKeys": { + "type": "list", + "member": { + "target": "com.amazonaws.internetmonitor#TagKey" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 200 + } + } + }, + "com.amazonaws.internetmonitor#TagMap": { + "type": "map", + "key": { + "target": "com.amazonaws.internetmonitor#TagKey" + }, + "value": { + "target": "com.amazonaws.internetmonitor#TagValue" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 200 + } + } + }, + "com.amazonaws.internetmonitor#TagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.internetmonitor#TagResourceInput" + }, + "output": { + "target": "com.amazonaws.internetmonitor#TagResourceOutput" + }, + "errors": [ + { + "target": "com.amazonaws.internetmonitor#AccessDeniedException" + }, + { + "target": "com.amazonaws.internetmonitor#BadRequestException" + }, + { + "target": "com.amazonaws.internetmonitor#InternalServerErrorException" + }, + { + "target": "com.amazonaws.internetmonitor#NotFoundException" + }, + { + "target": "com.amazonaws.internetmonitor#TooManyRequestsException" + } + ], + "traits": { + "aws.iam#conditionKeys": ["aws:RequestTag/${TagKey}", "aws:TagKeys"], + "smithy.api#documentation": "

Adds a tag to a resource. Tags are supported only for monitors in Amazon CloudWatch Internet Monitor. You can add a maximum of 50 tags in Internet Monitor.

\n

A minimum of one tag is required for this call. It returns an error if you use the TagResource request with 0 tags.

", + "smithy.api#http": { + "method": "POST", + "uri": "/tags/{ResourceArn}", + "code": 204 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.internetmonitor#TagResourceInput": { + "type": "structure", + "members": { + "ResourceArn": { + "target": "com.amazonaws.internetmonitor#MonitorArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) for a tag that you add to a resource. Tags are supported only for monitors in Amazon CloudWatch Internet Monitor.

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

Tags that you add to a resource. You can add a maximum of 50 tags in Internet Monitor.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "aws.api#data": "tagging", + "smithy.api#references": [ + { + "resource": "com.amazonaws.internetmonitor#MonitorResource", + "ids": { + "MonitorName": "ResourceArn" + } + } + ] + } + }, + "com.amazonaws.internetmonitor#TagResourceOutput": { + "type": "structure", + "members": {} + }, + "com.amazonaws.internetmonitor#TagValue": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 256 + } + } + }, + "com.amazonaws.internetmonitor#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.internetmonitor#TooManyRequestsException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#documentation": "

There were too many requests.

", + "smithy.api#error": "client", + "smithy.api#httpError": 429, + "smithy.api#retryable": { + "throttling": true + } + } + }, + "com.amazonaws.internetmonitor#TriangulationEventType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "AWS", + "name": "AWS" + }, + { + "value": "Internet", + "name": "INTERNET" + } + ] + } + }, + "com.amazonaws.internetmonitor#UntagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.internetmonitor#UntagResourceInput" + }, + "output": { + "target": "com.amazonaws.internetmonitor#UntagResourceOutput" + }, + "errors": [ + { + "target": "com.amazonaws.internetmonitor#AccessDeniedException" + }, + { + "target": "com.amazonaws.internetmonitor#BadRequestException" + }, + { + "target": "com.amazonaws.internetmonitor#InternalServerErrorException" + }, + { + "target": "com.amazonaws.internetmonitor#NotFoundException" + }, + { + "target": "com.amazonaws.internetmonitor#TooManyRequestsException" + } + ], + "traits": { + "aws.iam#conditionKeys": ["aws:TagKeys"], + "smithy.api#documentation": "

Removes a tag from a resource.

", + "smithy.api#http": { + "method": "DELETE", + "uri": "/tags/{ResourceArn}", + "code": 204 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.internetmonitor#UntagResourceInput": { + "type": "structure", + "members": { + "ResourceArn": { + "target": "com.amazonaws.internetmonitor#MonitorArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) for a tag you remove a resource from.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "TagKeys": { + "target": "com.amazonaws.internetmonitor#TagKeys", + "traits": { + "smithy.api#documentation": "

Tag keys that you remove from a resource.

", + "smithy.api#httpQuery": "tagKeys", + "smithy.api#required": {} + } + } + }, + "traits": { + "aws.api#data": "tagging", + "smithy.api#references": [ + { + "resource": "com.amazonaws.internetmonitor#MonitorResource", + "ids": { + "MonitorName": "ResourceArn" + } + } + ] + } + }, + "com.amazonaws.internetmonitor#UntagResourceOutput": { + "type": "structure", + "members": {} + }, + "com.amazonaws.internetmonitor#UpdateMonitor": { + "type": "operation", + "input": { + "target": "com.amazonaws.internetmonitor#UpdateMonitorInput" + }, + "output": { + "target": "com.amazonaws.internetmonitor#UpdateMonitorOutput" + }, + "errors": [ + { + "target": "com.amazonaws.internetmonitor#AccessDeniedException" + }, + { + "target": "com.amazonaws.internetmonitor#InternalServerException" + }, + { + "target": "com.amazonaws.internetmonitor#LimitExceededException" + }, + { + "target": "com.amazonaws.internetmonitor#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.internetmonitor#ThrottlingException" + }, + { + "target": "com.amazonaws.internetmonitor#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Updates a monitor. You can update a monitor to add or remove resources, or to change the status of the monitor. You can't change the name of a\n\t\t\tmonitor.

", + "smithy.api#http": { + "uri": "/v20210603/Monitors/{MonitorName}", + "method": "PATCH" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.internetmonitor#UpdateMonitorInput": { + "type": "structure", + "members": { + "MonitorName": { + "target": "com.amazonaws.internetmonitor#ResourceName", + "traits": { + "smithy.api#documentation": "

The name of the monitor.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "ResourcesToAdd": { + "target": "com.amazonaws.internetmonitor#SetOfARNs", + "traits": { + "smithy.api#documentation": "

The resources to include in a monitor, which you provide as a set of Amazon Resource Names (ARNs).

\n

You can add a combination of Amazon Virtual Private Clouds (VPCs) and Amazon CloudFront distributions, or you can add Amazon WorkSpaces directories. You can't add all three types of\n\t\t\tresources.

\n \n

If you add only VPC resources, at least one VPC must have an Internet Gateway attached to it, to make sure that it has internet\n\t\t\tconnectivity.

\n
" + } + }, + "ResourcesToRemove": { + "target": "com.amazonaws.internetmonitor#SetOfARNs", + "traits": { + "smithy.api#documentation": "

The resources to remove from a monitor, which you provide as a set of Amazon Resource Names (ARNs).

" + } + }, + "Status": { + "target": "com.amazonaws.internetmonitor#MonitorConfigState", + "traits": { + "smithy.api#documentation": "

The status for a monitor. The accepted values for Status with the UpdateMonitor API call are the following: ACTIVE and\n\t\t\tINACTIVE. The following values are not accepted: PENDING, and ERROR.

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

A unique, case-sensitive string of up to 64 ASCII characters that you specify to make an idempotent API request. You should not reuse the same client\n\t\t\ttoken for other API requests.

", + "smithy.api#idempotencyToken": {} + } + }, + "MaxCityNetworksToMonitor": { + "target": "com.amazonaws.internetmonitor#MaxCityNetworksToMonitor", + "traits": { + "smithy.api#default": 0, + "smithy.api#documentation": "

The maximum number of city-network combinations (that is, combinations of a city location and network, such as an ISP) to be monitored \n\t\t\tfor your resources.

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

The Amazon Resource Name (ARN) of the monitor.

", + "smithy.api#required": {} + } + }, + "Status": { + "target": "com.amazonaws.internetmonitor#MonitorConfigState", + "traits": { + "smithy.api#documentation": "

The status of a monitor.

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

Invalid request.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + } + } +}