|
| 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 { ComputeOptimizerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ComputeOptimizerClient"; |
| 8 | +import { commonParams } from "../endpoint/EndpointParameters"; |
| 9 | +import { ExportIdleRecommendationsRequest, ExportIdleRecommendationsResponse } from "../models/models_0"; |
| 10 | +import { de_ExportIdleRecommendationsCommand, se_ExportIdleRecommendationsCommand } from "../protocols/Aws_json1_0"; |
| 11 | + |
| 12 | +/** |
| 13 | + * @public |
| 14 | + */ |
| 15 | +export type { __MetadataBearer }; |
| 16 | +export { $Command }; |
| 17 | +/** |
| 18 | + * @public |
| 19 | + * |
| 20 | + * The input for {@link ExportIdleRecommendationsCommand}. |
| 21 | + */ |
| 22 | +export interface ExportIdleRecommendationsCommandInput extends ExportIdleRecommendationsRequest {} |
| 23 | +/** |
| 24 | + * @public |
| 25 | + * |
| 26 | + * The output of {@link ExportIdleRecommendationsCommand}. |
| 27 | + */ |
| 28 | +export interface ExportIdleRecommendationsCommandOutput extends ExportIdleRecommendationsResponse, __MetadataBearer {} |
| 29 | + |
| 30 | +/** |
| 31 | + * <p> |
| 32 | + * Export optimization recommendations for your idle resources. |
| 33 | + * </p> |
| 34 | + * <p>Recommendations are exported in a comma-separated values (CSV) file, and its metadata |
| 35 | + * in a JavaScript Object Notation (JSON) file, to an existing Amazon Simple Storage Service (Amazon S3) bucket that you specify. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/exporting-recommendations.html">Exporting |
| 36 | + * Recommendations</a> in the <i>Compute Optimizer User |
| 37 | + * Guide</i>.</p> |
| 38 | + * <p>You can have only one idle resource export job in progress per Amazon Web Services Region.</p> |
| 39 | + * @example |
| 40 | + * Use a bare-bones client and the command you need to make an API call. |
| 41 | + * ```javascript |
| 42 | + * import { ComputeOptimizerClient, ExportIdleRecommendationsCommand } from "@aws-sdk/client-compute-optimizer"; // ES Modules import |
| 43 | + * // const { ComputeOptimizerClient, ExportIdleRecommendationsCommand } = require("@aws-sdk/client-compute-optimizer"); // CommonJS import |
| 44 | + * const client = new ComputeOptimizerClient(config); |
| 45 | + * const input = { // ExportIdleRecommendationsRequest |
| 46 | + * accountIds: [ // AccountIds |
| 47 | + * "STRING_VALUE", |
| 48 | + * ], |
| 49 | + * filters: [ // IdleRecommendationFilters |
| 50 | + * { // IdleRecommendationFilter |
| 51 | + * name: "Finding" || "ResourceType", |
| 52 | + * values: [ // FilterValues |
| 53 | + * "STRING_VALUE", |
| 54 | + * ], |
| 55 | + * }, |
| 56 | + * ], |
| 57 | + * fieldsToExport: [ // ExportableIdleFields |
| 58 | + * "AccountId" || "ResourceArn" || "ResourceId" || "ResourceType" || "LastRefreshTimestamp" || "LookbackPeriodInDays" || "SavingsOpportunity" || "SavingsOpportunityAfterDiscount" || "UtilizationMetricsCpuMaximum" || "UtilizationMetricsMemoryMaximum" || "UtilizationMetricsNetworkOutBytesPerSecondMaximum" || "UtilizationMetricsNetworkInBytesPerSecondMaximum" || "UtilizationMetricsDatabaseConnectionsMaximum" || "UtilizationMetricsEBSVolumeReadIOPSMaximum" || "UtilizationMetricsEBSVolumeWriteIOPSMaximum" || "UtilizationMetricsVolumeReadOpsPerSecondMaximum" || "UtilizationMetricsVolumeWriteOpsPerSecondMaximum" || "Finding" || "FindingDescription" || "Tags", |
| 59 | + * ], |
| 60 | + * s3DestinationConfig: { // S3DestinationConfig |
| 61 | + * bucket: "STRING_VALUE", |
| 62 | + * keyPrefix: "STRING_VALUE", |
| 63 | + * }, |
| 64 | + * fileFormat: "Csv", |
| 65 | + * includeMemberAccounts: true || false, |
| 66 | + * }; |
| 67 | + * const command = new ExportIdleRecommendationsCommand(input); |
| 68 | + * const response = await client.send(command); |
| 69 | + * // { // ExportIdleRecommendationsResponse |
| 70 | + * // jobId: "STRING_VALUE", |
| 71 | + * // s3Destination: { // S3Destination |
| 72 | + * // bucket: "STRING_VALUE", |
| 73 | + * // key: "STRING_VALUE", |
| 74 | + * // metadataKey: "STRING_VALUE", |
| 75 | + * // }, |
| 76 | + * // }; |
| 77 | + * |
| 78 | + * ``` |
| 79 | + * |
| 80 | + * @param ExportIdleRecommendationsCommandInput - {@link ExportIdleRecommendationsCommandInput} |
| 81 | + * @returns {@link ExportIdleRecommendationsCommandOutput} |
| 82 | + * @see {@link ExportIdleRecommendationsCommandInput} for command's `input` shape. |
| 83 | + * @see {@link ExportIdleRecommendationsCommandOutput} for command's `response` shape. |
| 84 | + * @see {@link ComputeOptimizerClientResolvedConfig | config} for ComputeOptimizerClient's `config` shape. |
| 85 | + * |
| 86 | + * @throws {@link AccessDeniedException} (client fault) |
| 87 | + * <p>You do not have sufficient access to perform this action.</p> |
| 88 | + * |
| 89 | + * @throws {@link InternalServerException} (server fault) |
| 90 | + * <p>An internal error has occurred. Try your call again.</p> |
| 91 | + * |
| 92 | + * @throws {@link InvalidParameterValueException} (client fault) |
| 93 | + * <p>The value supplied for the input parameter is out of range or not valid.</p> |
| 94 | + * |
| 95 | + * @throws {@link LimitExceededException} (client fault) |
| 96 | + * <p>The request exceeds a limit of the service.</p> |
| 97 | + * |
| 98 | + * @throws {@link MissingAuthenticationToken} (client fault) |
| 99 | + * <p>The request must contain either a valid (registered) Amazon Web Services access key ID |
| 100 | + * or X.509 certificate.</p> |
| 101 | + * |
| 102 | + * @throws {@link OptInRequiredException} (client fault) |
| 103 | + * <p>The account is not opted in to Compute Optimizer.</p> |
| 104 | + * |
| 105 | + * @throws {@link ServiceUnavailableException} (server fault) |
| 106 | + * <p>The request has failed due to a temporary failure of the server.</p> |
| 107 | + * |
| 108 | + * @throws {@link ThrottlingException} (client fault) |
| 109 | + * <p>The request was denied due to request throttling.</p> |
| 110 | + * |
| 111 | + * @throws {@link ComputeOptimizerServiceException} |
| 112 | + * <p>Base exception class for all service exceptions from ComputeOptimizer service.</p> |
| 113 | + * |
| 114 | + * @public |
| 115 | + */ |
| 116 | +export class ExportIdleRecommendationsCommand extends $Command |
| 117 | + .classBuilder< |
| 118 | + ExportIdleRecommendationsCommandInput, |
| 119 | + ExportIdleRecommendationsCommandOutput, |
| 120 | + ComputeOptimizerClientResolvedConfig, |
| 121 | + ServiceInputTypes, |
| 122 | + ServiceOutputTypes |
| 123 | + >() |
| 124 | + .ep(commonParams) |
| 125 | + .m(function (this: any, Command: any, cs: any, config: ComputeOptimizerClientResolvedConfig, o: any) { |
| 126 | + return [ |
| 127 | + getSerdePlugin(config, this.serialize, this.deserialize), |
| 128 | + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), |
| 129 | + ]; |
| 130 | + }) |
| 131 | + .s("ComputeOptimizerService", "ExportIdleRecommendations", {}) |
| 132 | + .n("ComputeOptimizerClient", "ExportIdleRecommendationsCommand") |
| 133 | + .f(void 0, void 0) |
| 134 | + .ser(se_ExportIdleRecommendationsCommand) |
| 135 | + .de(de_ExportIdleRecommendationsCommand) |
| 136 | + .build() { |
| 137 | + /** @internal type navigation helper, not in runtime. */ |
| 138 | + protected declare static __types: { |
| 139 | + api: { |
| 140 | + input: ExportIdleRecommendationsRequest; |
| 141 | + output: ExportIdleRecommendationsResponse; |
| 142 | + }; |
| 143 | + sdk: { |
| 144 | + input: ExportIdleRecommendationsCommandInput; |
| 145 | + output: ExportIdleRecommendationsCommandOutput; |
| 146 | + }; |
| 147 | + }; |
| 148 | +} |
0 commit comments