|
| 1 | +// smithy-typescript generated code |
| 2 | +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; |
| 3 | +import { getSerdePlugin } from "@smithy/middleware-serde"; |
| 4 | +import { Command as $Command } from "@smithy/smithy-client"; |
| 5 | +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; |
| 6 | + |
| 7 | +import { CloudTrailClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CloudTrailClient"; |
| 8 | +import { commonParams } from "../endpoint/EndpointParameters"; |
| 9 | +import { ListInsightsMetricDataRequest, ListInsightsMetricDataResponse } from "../models/models_0"; |
| 10 | +import { de_ListInsightsMetricDataCommand, se_ListInsightsMetricDataCommand } from "../protocols/Aws_json1_1"; |
| 11 | + |
| 12 | +/** |
| 13 | + * @public |
| 14 | + */ |
| 15 | +export { __MetadataBearer, $Command }; |
| 16 | +/** |
| 17 | + * @public |
| 18 | + * |
| 19 | + * The input for {@link ListInsightsMetricDataCommand}. |
| 20 | + */ |
| 21 | +export interface ListInsightsMetricDataCommandInput extends ListInsightsMetricDataRequest {} |
| 22 | +/** |
| 23 | + * @public |
| 24 | + * |
| 25 | + * The output of {@link ListInsightsMetricDataCommand}. |
| 26 | + */ |
| 27 | +export interface ListInsightsMetricDataCommandOutput extends ListInsightsMetricDataResponse, __MetadataBearer {} |
| 28 | + |
| 29 | +/** |
| 30 | + * @public |
| 31 | + * <p>Returns Insights metrics data for trails that have enabled Insights. The request must include the <code>EventSource</code>, |
| 32 | + * <code>EventName</code>, and <code>InsightType</code> parameters.</p> |
| 33 | + * <p>If the <code>InsightType</code> is set to <code>ApiErrorRateInsight</code>, the request must also include the <code>ErrorCode</code> parameter.</p> |
| 34 | + * <p>The following are the available time periods for <code>ListInsightsMetricData</code>. Each cutoff is inclusive.</p> |
| 35 | + * <ul> |
| 36 | + * <li> |
| 37 | + * <p>Data points with a period of 60 seconds (1-minute) are available for 15 days.</p> |
| 38 | + * </li> |
| 39 | + * <li> |
| 40 | + * <p>Data points with a period of 300 seconds (5-minute) are available for 63 days.</p> |
| 41 | + * </li> |
| 42 | + * <li> |
| 43 | + * <p>Data points with a period of 3600 seconds (1 hour) are available for 90 days.</p> |
| 44 | + * </li> |
| 45 | + * </ul> |
| 46 | + * <p>Access to the <code>ListInsightsMetricData</code> API operation is linked to the <code>cloudtrail:LookupEvents</code> action. To use this operation, |
| 47 | + * you must have permissions to perform the <code>cloudtrail:LookupEvents</code> action.</p> |
| 48 | + * @example |
| 49 | + * Use a bare-bones client and the command you need to make an API call. |
| 50 | + * ```javascript |
| 51 | + * import { CloudTrailClient, ListInsightsMetricDataCommand } from "@aws-sdk/client-cloudtrail"; // ES Modules import |
| 52 | + * // const { CloudTrailClient, ListInsightsMetricDataCommand } = require("@aws-sdk/client-cloudtrail"); // CommonJS import |
| 53 | + * const client = new CloudTrailClient(config); |
| 54 | + * const input = { // ListInsightsMetricDataRequest |
| 55 | + * EventSource: "STRING_VALUE", // required |
| 56 | + * EventName: "STRING_VALUE", // required |
| 57 | + * InsightType: "ApiCallRateInsight" || "ApiErrorRateInsight", // required |
| 58 | + * ErrorCode: "STRING_VALUE", |
| 59 | + * StartTime: new Date("TIMESTAMP"), |
| 60 | + * EndTime: new Date("TIMESTAMP"), |
| 61 | + * Period: Number("int"), |
| 62 | + * DataType: "FillWithZeros" || "NonZeroData", |
| 63 | + * MaxResults: Number("int"), |
| 64 | + * NextToken: "STRING_VALUE", |
| 65 | + * }; |
| 66 | + * const command = new ListInsightsMetricDataCommand(input); |
| 67 | + * const response = await client.send(command); |
| 68 | + * // { // ListInsightsMetricDataResponse |
| 69 | + * // EventSource: "STRING_VALUE", |
| 70 | + * // EventName: "STRING_VALUE", |
| 71 | + * // InsightType: "ApiCallRateInsight" || "ApiErrorRateInsight", |
| 72 | + * // ErrorCode: "STRING_VALUE", |
| 73 | + * // Timestamps: [ // Timestamps |
| 74 | + * // new Date("TIMESTAMP"), |
| 75 | + * // ], |
| 76 | + * // Values: [ // InsightsMetricValues |
| 77 | + * // Number("double"), |
| 78 | + * // ], |
| 79 | + * // NextToken: "STRING_VALUE", |
| 80 | + * // }; |
| 81 | + * |
| 82 | + * ``` |
| 83 | + * |
| 84 | + * @param ListInsightsMetricDataCommandInput - {@link ListInsightsMetricDataCommandInput} |
| 85 | + * @returns {@link ListInsightsMetricDataCommandOutput} |
| 86 | + * @see {@link ListInsightsMetricDataCommandInput} for command's `input` shape. |
| 87 | + * @see {@link ListInsightsMetricDataCommandOutput} for command's `response` shape. |
| 88 | + * @see {@link CloudTrailClientResolvedConfig | config} for CloudTrailClient's `config` shape. |
| 89 | + * |
| 90 | + * @throws {@link InvalidParameterException} (client fault) |
| 91 | + * <p>The request includes a parameter that is not valid.</p> |
| 92 | + * |
| 93 | + * @throws {@link OperationNotPermittedException} (client fault) |
| 94 | + * <p>This exception is thrown when the requested operation is not permitted.</p> |
| 95 | + * |
| 96 | + * @throws {@link UnsupportedOperationException} (client fault) |
| 97 | + * <p>This exception is thrown when the requested operation is not supported.</p> |
| 98 | + * |
| 99 | + * @throws {@link CloudTrailServiceException} |
| 100 | + * <p>Base exception class for all service exceptions from CloudTrail service.</p> |
| 101 | + * |
| 102 | + */ |
| 103 | +export class ListInsightsMetricDataCommand extends $Command |
| 104 | + .classBuilder< |
| 105 | + ListInsightsMetricDataCommandInput, |
| 106 | + ListInsightsMetricDataCommandOutput, |
| 107 | + CloudTrailClientResolvedConfig, |
| 108 | + ServiceInputTypes, |
| 109 | + ServiceOutputTypes |
| 110 | + >() |
| 111 | + .ep({ |
| 112 | + ...commonParams, |
| 113 | + }) |
| 114 | + .m(function (this: any, Command: any, cs: any, config: CloudTrailClientResolvedConfig, o: any) { |
| 115 | + return [ |
| 116 | + getSerdePlugin(config, this.serialize, this.deserialize), |
| 117 | + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), |
| 118 | + ]; |
| 119 | + }) |
| 120 | + .s("CloudTrail_20131101", "ListInsightsMetricData", {}) |
| 121 | + .n("CloudTrailClient", "ListInsightsMetricDataCommand") |
| 122 | + .f(void 0, void 0) |
| 123 | + .ser(se_ListInsightsMetricDataCommand) |
| 124 | + .de(de_ListInsightsMetricDataCommand) |
| 125 | + .build() {} |
0 commit comments