-
Notifications
You must be signed in to change notification settings - Fork 592
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-compute-optimizer): This release enables AWS Compute Opti…
…mizer to analyze and generate licensing optimization recommendations for sql server running on EC2 instances.
- Loading branch information
awstools
committed
Aug 28, 2023
1 parent
d76f6fc
commit 3a26fc7
Showing
16 changed files
with
2,372 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
206 changes: 206 additions & 0 deletions
206
clients/client-compute-optimizer/src/commands/ExportLicenseRecommendationsCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,206 @@ | ||
// smithy-typescript generated code | ||
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; | ||
import { getSerdePlugin } from "@smithy/middleware-serde"; | ||
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; | ||
import { Command as $Command } from "@smithy/smithy-client"; | ||
import { | ||
FinalizeHandlerArguments, | ||
Handler, | ||
HandlerExecutionContext, | ||
HttpHandlerOptions as __HttpHandlerOptions, | ||
MetadataBearer as __MetadataBearer, | ||
MiddlewareStack, | ||
SerdeContext as __SerdeContext, | ||
} from "@smithy/types"; | ||
|
||
import { ComputeOptimizerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ComputeOptimizerClient"; | ||
import { ExportLicenseRecommendationsRequest, ExportLicenseRecommendationsResponse } from "../models/models_0"; | ||
import { | ||
de_ExportLicenseRecommendationsCommand, | ||
se_ExportLicenseRecommendationsCommand, | ||
} from "../protocols/Aws_json1_0"; | ||
|
||
/** | ||
* @public | ||
*/ | ||
export { __MetadataBearer, $Command }; | ||
/** | ||
* @public | ||
* | ||
* The input for {@link ExportLicenseRecommendationsCommand}. | ||
*/ | ||
export interface ExportLicenseRecommendationsCommandInput extends ExportLicenseRecommendationsRequest {} | ||
/** | ||
* @public | ||
* | ||
* The output of {@link ExportLicenseRecommendationsCommand}. | ||
*/ | ||
export interface ExportLicenseRecommendationsCommandOutput | ||
extends ExportLicenseRecommendationsResponse, | ||
__MetadataBearer {} | ||
|
||
/** | ||
* @public | ||
* <p> | ||
* Export optimization recommendations for your licenses. | ||
* </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 license 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, ExportLicenseRecommendationsCommand } from "@aws-sdk/client-compute-optimizer"; // ES Modules import | ||
* // const { ComputeOptimizerClient, ExportLicenseRecommendationsCommand } = require("@aws-sdk/client-compute-optimizer"); // CommonJS import | ||
* const client = new ComputeOptimizerClient(config); | ||
* const input = { // ExportLicenseRecommendationsRequest | ||
* accountIds: [ // AccountIds | ||
* "STRING_VALUE", | ||
* ], | ||
* filters: [ // LicenseRecommendationFilters | ||
* { // LicenseRecommendationFilter | ||
* name: "Finding" || "FindingReasonCode" || "LicenseName", | ||
* values: [ // FilterValues | ||
* "STRING_VALUE", | ||
* ], | ||
* }, | ||
* ], | ||
* fieldsToExport: [ // ExportableLicenseFields | ||
* "AccountId" || "ResourceArn" || "LookbackPeriodInDays" || "LastRefreshTimestamp" || "Finding" || "FindingReasonCodes" || "CurrentLicenseConfigurationNumberOfCores" || "CurrentLicenseConfigurationInstanceType" || "CurrentLicenseConfigurationOperatingSystem" || "CurrentLicenseConfigurationLicenseName" || "CurrentLicenseConfigurationLicenseEdition" || "CurrentLicenseConfigurationLicenseModel" || "CurrentLicenseConfigurationLicenseVersion" || "CurrentLicenseConfigurationMetricsSource" || "RecommendationOptionsOperatingSystem" || "RecommendationOptionsLicenseEdition" || "RecommendationOptionsLicenseModel" || "RecommendationOptionsSavingsOpportunityPercentage" || "RecommendationOptionsEstimatedMonthlySavingsCurrency" || "RecommendationOptionsEstimatedMonthlySavingsValue" || "Tags", | ||
* ], | ||
* s3DestinationConfig: { // S3DestinationConfig | ||
* bucket: "STRING_VALUE", | ||
* keyPrefix: "STRING_VALUE", | ||
* }, | ||
* fileFormat: "Csv", | ||
* includeMemberAccounts: true || false, | ||
* }; | ||
* const command = new ExportLicenseRecommendationsCommand(input); | ||
* const response = await client.send(command); | ||
* // { // ExportLicenseRecommendationsResponse | ||
* // jobId: "STRING_VALUE", | ||
* // s3Destination: { // S3Destination | ||
* // bucket: "STRING_VALUE", | ||
* // key: "STRING_VALUE", | ||
* // metadataKey: "STRING_VALUE", | ||
* // }, | ||
* // }; | ||
* | ||
* ``` | ||
* | ||
* @param ExportLicenseRecommendationsCommandInput - {@link ExportLicenseRecommendationsCommandInput} | ||
* @returns {@link ExportLicenseRecommendationsCommandOutput} | ||
* @see {@link ExportLicenseRecommendationsCommandInput} for command's `input` shape. | ||
* @see {@link ExportLicenseRecommendationsCommandOutput} 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> | ||
* | ||
*/ | ||
export class ExportLicenseRecommendationsCommand extends $Command< | ||
ExportLicenseRecommendationsCommandInput, | ||
ExportLicenseRecommendationsCommandOutput, | ||
ComputeOptimizerClientResolvedConfig | ||
> { | ||
// 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" }, | ||
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, | ||
}; | ||
} | ||
|
||
/** | ||
* @public | ||
*/ | ||
constructor(readonly input: ExportLicenseRecommendationsCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: ComputeOptimizerClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<ExportLicenseRecommendationsCommandInput, ExportLicenseRecommendationsCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
this.middlewareStack.use( | ||
getEndpointPlugin(configuration, ExportLicenseRecommendationsCommand.getEndpointParameterInstructions()) | ||
); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "ComputeOptimizerClient"; | ||
const commandName = "ExportLicenseRecommendationsCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: (_: any) => _, | ||
outputFilterSensitiveLog: (_: any) => _, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
private serialize(input: ExportLicenseRecommendationsCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return se_ExportLicenseRecommendationsCommand(input, context); | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
private deserialize( | ||
output: __HttpResponse, | ||
context: __SerdeContext | ||
): Promise<ExportLicenseRecommendationsCommandOutput> { | ||
return de_ExportLicenseRecommendationsCommand(output, context); | ||
} | ||
|
||
// Start section: command_body_extra | ||
// End section: command_body_extra | ||
} |
Oops, something went wrong.