Skip to content

Commit

Permalink
feat(client-compute-optimizer): This release enables AWS Compute Opti…
Browse files Browse the repository at this point in the history
…mizer to analyze and generate optimization recommendations for Amazon Aurora database instances. It also enables Compute Optimizer to identify idle Amazon EC2 instances, Amazon EBS volumes, Amazon ECS services running on Fargate, and Amazon RDS databases.
  • Loading branch information
awstools committed Nov 20, 2024
1 parent 2cc0b79 commit 15509fd
Show file tree
Hide file tree
Showing 17 changed files with 2,542 additions and 148 deletions.
16 changes: 16 additions & 0 deletions clients/client-compute-optimizer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,14 @@ ExportECSServiceRecommendations

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/compute-optimizer/command/ExportECSServiceRecommendationsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-compute-optimizer/Interface/ExportECSServiceRecommendationsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-compute-optimizer/Interface/ExportECSServiceRecommendationsCommandOutput/)

</details>
<details>
<summary>
ExportIdleRecommendations
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/compute-optimizer/command/ExportIdleRecommendationsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-compute-optimizer/Interface/ExportIdleRecommendationsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-compute-optimizer/Interface/ExportIdleRecommendationsCommandOutput/)

</details>
<details>
<summary>
Expand Down Expand Up @@ -357,6 +365,14 @@ GetEnrollmentStatusesForOrganization

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/compute-optimizer/command/GetEnrollmentStatusesForOrganizationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-compute-optimizer/Interface/GetEnrollmentStatusesForOrganizationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-compute-optimizer/Interface/GetEnrollmentStatusesForOrganizationCommandOutput/)

</details>
<details>
<summary>
GetIdleRecommendations
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/compute-optimizer/command/GetIdleRecommendationsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-compute-optimizer/Interface/GetIdleRecommendationsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-compute-optimizer/Interface/GetIdleRecommendationsCommandOutput/)

</details>
<details>
<summary>
Expand Down
47 changes: 47 additions & 0 deletions clients/client-compute-optimizer/src/ComputeOptimizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ import {
ExportECSServiceRecommendationsCommandInput,
ExportECSServiceRecommendationsCommandOutput,
} from "./commands/ExportECSServiceRecommendationsCommand";
import {
ExportIdleRecommendationsCommand,
ExportIdleRecommendationsCommandInput,
ExportIdleRecommendationsCommandOutput,
} from "./commands/ExportIdleRecommendationsCommand";
import {
ExportLambdaFunctionRecommendationsCommand,
ExportLambdaFunctionRecommendationsCommandInput,
Expand Down Expand Up @@ -92,6 +97,11 @@ import {
GetEnrollmentStatusesForOrganizationCommandInput,
GetEnrollmentStatusesForOrganizationCommandOutput,
} from "./commands/GetEnrollmentStatusesForOrganizationCommand";
import {
GetIdleRecommendationsCommand,
GetIdleRecommendationsCommandInput,
GetIdleRecommendationsCommandOutput,
} from "./commands/GetIdleRecommendationsCommand";
import {
GetLambdaFunctionRecommendationsCommand,
GetLambdaFunctionRecommendationsCommandInput,
Expand Down Expand Up @@ -141,6 +151,7 @@ const commands = {
ExportEBSVolumeRecommendationsCommand,
ExportEC2InstanceRecommendationsCommand,
ExportECSServiceRecommendationsCommand,
ExportIdleRecommendationsCommand,
ExportLambdaFunctionRecommendationsCommand,
ExportLicenseRecommendationsCommand,
ExportRDSDatabaseRecommendationsCommand,
Expand All @@ -153,6 +164,7 @@ const commands = {
GetEffectiveRecommendationPreferencesCommand,
GetEnrollmentStatusCommand,
GetEnrollmentStatusesForOrganizationCommand,
GetIdleRecommendationsCommand,
GetLambdaFunctionRecommendationsCommand,
GetLicenseRecommendationsCommand,
GetRDSDatabaseRecommendationProjectedMetricsCommand,
Expand Down Expand Up @@ -267,6 +279,23 @@ export interface ComputeOptimizer {
cb: (err: any, data?: ExportECSServiceRecommendationsCommandOutput) => void
): void;

/**
* @see {@link ExportIdleRecommendationsCommand}
*/
exportIdleRecommendations(
args: ExportIdleRecommendationsCommandInput,
options?: __HttpHandlerOptions
): Promise<ExportIdleRecommendationsCommandOutput>;
exportIdleRecommendations(
args: ExportIdleRecommendationsCommandInput,
cb: (err: any, data?: ExportIdleRecommendationsCommandOutput) => void
): void;
exportIdleRecommendations(
args: ExportIdleRecommendationsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ExportIdleRecommendationsCommandOutput) => void
): void;

/**
* @see {@link ExportLambdaFunctionRecommendationsCommand}
*/
Expand Down Expand Up @@ -477,6 +506,24 @@ export interface ComputeOptimizer {
cb: (err: any, data?: GetEnrollmentStatusesForOrganizationCommandOutput) => void
): void;

/**
* @see {@link GetIdleRecommendationsCommand}
*/
getIdleRecommendations(): Promise<GetIdleRecommendationsCommandOutput>;
getIdleRecommendations(
args: GetIdleRecommendationsCommandInput,
options?: __HttpHandlerOptions
): Promise<GetIdleRecommendationsCommandOutput>;
getIdleRecommendations(
args: GetIdleRecommendationsCommandInput,
cb: (err: any, data?: GetIdleRecommendationsCommandOutput) => void
): void;
getIdleRecommendations(
args: GetIdleRecommendationsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetIdleRecommendationsCommandOutput) => void
): void;

/**
* @see {@link GetLambdaFunctionRecommendationsCommand}
*/
Expand Down
12 changes: 12 additions & 0 deletions clients/client-compute-optimizer/src/ComputeOptimizerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ import {
ExportECSServiceRecommendationsCommandInput,
ExportECSServiceRecommendationsCommandOutput,
} from "./commands/ExportECSServiceRecommendationsCommand";
import {
ExportIdleRecommendationsCommandInput,
ExportIdleRecommendationsCommandOutput,
} from "./commands/ExportIdleRecommendationsCommand";
import {
ExportLambdaFunctionRecommendationsCommandInput,
ExportLambdaFunctionRecommendationsCommandOutput,
Expand Down Expand Up @@ -125,6 +129,10 @@ import {
GetEnrollmentStatusesForOrganizationCommandInput,
GetEnrollmentStatusesForOrganizationCommandOutput,
} from "./commands/GetEnrollmentStatusesForOrganizationCommand";
import {
GetIdleRecommendationsCommandInput,
GetIdleRecommendationsCommandOutput,
} from "./commands/GetIdleRecommendationsCommand";
import {
GetLambdaFunctionRecommendationsCommandInput,
GetLambdaFunctionRecommendationsCommandOutput,
Expand Down Expand Up @@ -178,6 +186,7 @@ export type ServiceInputTypes =
| ExportEBSVolumeRecommendationsCommandInput
| ExportEC2InstanceRecommendationsCommandInput
| ExportECSServiceRecommendationsCommandInput
| ExportIdleRecommendationsCommandInput
| ExportLambdaFunctionRecommendationsCommandInput
| ExportLicenseRecommendationsCommandInput
| ExportRDSDatabaseRecommendationsCommandInput
Expand All @@ -190,6 +199,7 @@ export type ServiceInputTypes =
| GetEffectiveRecommendationPreferencesCommandInput
| GetEnrollmentStatusCommandInput
| GetEnrollmentStatusesForOrganizationCommandInput
| GetIdleRecommendationsCommandInput
| GetLambdaFunctionRecommendationsCommandInput
| GetLicenseRecommendationsCommandInput
| GetRDSDatabaseRecommendationProjectedMetricsCommandInput
Expand All @@ -209,6 +219,7 @@ export type ServiceOutputTypes =
| ExportEBSVolumeRecommendationsCommandOutput
| ExportEC2InstanceRecommendationsCommandOutput
| ExportECSServiceRecommendationsCommandOutput
| ExportIdleRecommendationsCommandOutput
| ExportLambdaFunctionRecommendationsCommandOutput
| ExportLicenseRecommendationsCommandOutput
| ExportRDSDatabaseRecommendationsCommandOutput
Expand All @@ -221,6 +232,7 @@ export type ServiceOutputTypes =
| GetEffectiveRecommendationPreferencesCommandOutput
| GetEnrollmentStatusCommandOutput
| GetEnrollmentStatusesForOrganizationCommandOutput
| GetIdleRecommendationsCommandOutput
| GetLambdaFunctionRecommendationsCommandOutput
| GetLicenseRecommendationsCommandOutput
| GetRDSDatabaseRecommendationProjectedMetricsCommandOutput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export interface DeleteRecommendationPreferencesCommandOutput
* // const { ComputeOptimizerClient, DeleteRecommendationPreferencesCommand } = require("@aws-sdk/client-compute-optimizer"); // CommonJS import
* const client = new ComputeOptimizerClient(config);
* const input = { // DeleteRecommendationPreferencesRequest
* resourceType: "Ec2Instance" || "AutoScalingGroup" || "EbsVolume" || "LambdaFunction" || "NotApplicable" || "EcsService" || "License" || "RdsDBInstance", // required
* resourceType: "Ec2Instance" || "AutoScalingGroup" || "EbsVolume" || "LambdaFunction" || "NotApplicable" || "EcsService" || "License" || "RdsDBInstance" || "Idle", // required
* scope: { // Scope
* name: "Organization" || "AccountId" || "ResourceArn",
* value: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export interface DescribeRecommendationExportJobsCommandOutput
* // metadataKey: "STRING_VALUE",
* // },
* // },
* // resourceType: "Ec2Instance" || "AutoScalingGroup" || "EbsVolume" || "LambdaFunction" || "NotApplicable" || "EcsService" || "License" || "RdsDBInstance",
* // resourceType: "Ec2Instance" || "AutoScalingGroup" || "EbsVolume" || "LambdaFunction" || "NotApplicable" || "EcsService" || "License" || "RdsDBInstance" || "Idle",
* // status: "Queued" || "InProgress" || "Complete" || "Failed",
* // creationTimestamp: new Date("TIMESTAMP"),
* // lastUpdatedTimestamp: new Date("TIMESTAMP"),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
// smithy-typescript generated code
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { ComputeOptimizerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ComputeOptimizerClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { ExportIdleRecommendationsRequest, ExportIdleRecommendationsResponse } from "../models/models_0";
import { de_ExportIdleRecommendationsCommand, se_ExportIdleRecommendationsCommand } from "../protocols/Aws_json1_0";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link ExportIdleRecommendationsCommand}.
*/
export interface ExportIdleRecommendationsCommandInput extends ExportIdleRecommendationsRequest {}
/**
* @public
*
* The output of {@link ExportIdleRecommendationsCommand}.
*/
export interface ExportIdleRecommendationsCommandOutput extends ExportIdleRecommendationsResponse, __MetadataBearer {}

/**
* <p>
* Export optimization recommendations for your idle resources.
* </p>
* <p>Recommendations are exported in a comma-separated values (CSV) file, and its metadata
* 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
* Recommendations</a> in the <i>Compute Optimizer User
* Guide</i>.</p>
* <p>You can have only one idle resource export job in progress per Amazon Web Services Region.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { ComputeOptimizerClient, ExportIdleRecommendationsCommand } from "@aws-sdk/client-compute-optimizer"; // ES Modules import
* // const { ComputeOptimizerClient, ExportIdleRecommendationsCommand } = require("@aws-sdk/client-compute-optimizer"); // CommonJS import
* const client = new ComputeOptimizerClient(config);
* const input = { // ExportIdleRecommendationsRequest
* accountIds: [ // AccountIds
* "STRING_VALUE",
* ],
* filters: [ // IdleRecommendationFilters
* { // IdleRecommendationFilter
* name: "Finding" || "ResourceType",
* values: [ // FilterValues
* "STRING_VALUE",
* ],
* },
* ],
* fieldsToExport: [ // ExportableIdleFields
* "AccountId" || "ResourceArn" || "ResourceId" || "ResourceType" || "LastRefreshTimestamp" || "LookbackPeriodInDays" || "SavingsOpportunity" || "SavingsOpportunityAfterDiscount" || "UtilizationMetricsCpuMaximum" || "UtilizationMetricsMemoryMaximum" || "UtilizationMetricsNetworkOutBytesPerSecondMaximum" || "UtilizationMetricsNetworkInBytesPerSecondMaximum" || "UtilizationMetricsDatabaseConnectionsMaximum" || "UtilizationMetricsEBSVolumeReadIOPSMaximum" || "UtilizationMetricsEBSVolumeWriteIOPSMaximum" || "UtilizationMetricsVolumeReadOpsPerSecondMaximum" || "UtilizationMetricsVolumeWriteOpsPerSecondMaximum" || "Finding" || "FindingDescription" || "Tags",
* ],
* s3DestinationConfig: { // S3DestinationConfig
* bucket: "STRING_VALUE",
* keyPrefix: "STRING_VALUE",
* },
* fileFormat: "Csv",
* includeMemberAccounts: true || false,
* };
* const command = new ExportIdleRecommendationsCommand(input);
* const response = await client.send(command);
* // { // ExportIdleRecommendationsResponse
* // jobId: "STRING_VALUE",
* // s3Destination: { // S3Destination
* // bucket: "STRING_VALUE",
* // key: "STRING_VALUE",
* // metadataKey: "STRING_VALUE",
* // },
* // };
*
* ```
*
* @param ExportIdleRecommendationsCommandInput - {@link ExportIdleRecommendationsCommandInput}
* @returns {@link ExportIdleRecommendationsCommandOutput}
* @see {@link ExportIdleRecommendationsCommandInput} for command's `input` shape.
* @see {@link ExportIdleRecommendationsCommandOutput} for command's `response` shape.
* @see {@link ComputeOptimizerClientResolvedConfig | config} for ComputeOptimizerClient's `config` shape.
*
* @throws {@link AccessDeniedException} (client fault)
* <p>You do not have sufficient access to perform this action.</p>
*
* @throws {@link InternalServerException} (server fault)
* <p>An internal error has occurred. Try your call again.</p>
*
* @throws {@link InvalidParameterValueException} (client fault)
* <p>The value supplied for the input parameter is out of range or not valid.</p>
*
* @throws {@link LimitExceededException} (client fault)
* <p>The request exceeds a limit of the service.</p>
*
* @throws {@link MissingAuthenticationToken} (client fault)
* <p>The request must contain either a valid (registered) Amazon Web Services access key ID
* or X.509 certificate.</p>
*
* @throws {@link OptInRequiredException} (client fault)
* <p>The account is not opted in to Compute Optimizer.</p>
*
* @throws {@link ServiceUnavailableException} (server fault)
* <p>The request has failed due to a temporary failure of the server.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>The request was denied due to request throttling.</p>
*
* @throws {@link ComputeOptimizerServiceException}
* <p>Base exception class for all service exceptions from ComputeOptimizer service.</p>
*
* @public
*/
export class ExportIdleRecommendationsCommand extends $Command
.classBuilder<
ExportIdleRecommendationsCommandInput,
ExportIdleRecommendationsCommandOutput,
ComputeOptimizerClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep(commonParams)
.m(function (this: any, Command: any, cs: any, config: ComputeOptimizerClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("ComputeOptimizerService", "ExportIdleRecommendations", {})
.n("ComputeOptimizerClient", "ExportIdleRecommendationsCommand")
.f(void 0, void 0)
.ser(se_ExportIdleRecommendationsCommand)
.de(de_ExportIdleRecommendationsCommand)
.build() {
/** @internal type navigation helper, not in runtime. */
protected declare static __types: {
api: {
input: ExportIdleRecommendationsRequest;
output: ExportIdleRecommendationsResponse;
};
sdk: {
input: ExportIdleRecommendationsCommandInput;
output: ExportIdleRecommendationsCommandOutput;
};
};
}
Loading

0 comments on commit 15509fd

Please sign in to comment.