-
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-cost-explorer): Adds support for backfill of cost allocat…
…ion tags, with new StartCostAllocationTagBackfill and ListCostAllocationTagBackfillHistory API.
- Loading branch information
awstools
committed
Mar 26, 2024
1 parent
fe9f83d
commit 715a001
Showing
11 changed files
with
782 additions
and
0 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
107 changes: 107 additions & 0 deletions
107
clients/client-cost-explorer/src/commands/ListCostAllocationTagBackfillHistoryCommand.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,107 @@ | ||
// 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 { CostExplorerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CostExplorerClient"; | ||
import { commonParams } from "../endpoint/EndpointParameters"; | ||
import { | ||
ListCostAllocationTagBackfillHistoryRequest, | ||
ListCostAllocationTagBackfillHistoryResponse, | ||
} from "../models/models_0"; | ||
import { | ||
de_ListCostAllocationTagBackfillHistoryCommand, | ||
se_ListCostAllocationTagBackfillHistoryCommand, | ||
} from "../protocols/Aws_json1_1"; | ||
|
||
/** | ||
* @public | ||
*/ | ||
export { __MetadataBearer, $Command }; | ||
/** | ||
* @public | ||
* | ||
* The input for {@link ListCostAllocationTagBackfillHistoryCommand}. | ||
*/ | ||
export interface ListCostAllocationTagBackfillHistoryCommandInput extends ListCostAllocationTagBackfillHistoryRequest {} | ||
/** | ||
* @public | ||
* | ||
* The output of {@link ListCostAllocationTagBackfillHistoryCommand}. | ||
*/ | ||
export interface ListCostAllocationTagBackfillHistoryCommandOutput | ||
extends ListCostAllocationTagBackfillHistoryResponse, | ||
__MetadataBearer {} | ||
|
||
/** | ||
* <p> | ||
* Retrieves a list of your historical cost allocation tag backfill requests. | ||
* </p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { CostExplorerClient, ListCostAllocationTagBackfillHistoryCommand } from "@aws-sdk/client-cost-explorer"; // ES Modules import | ||
* // const { CostExplorerClient, ListCostAllocationTagBackfillHistoryCommand } = require("@aws-sdk/client-cost-explorer"); // CommonJS import | ||
* const client = new CostExplorerClient(config); | ||
* const input = { // ListCostAllocationTagBackfillHistoryRequest | ||
* NextToken: "STRING_VALUE", | ||
* MaxResults: Number("int"), | ||
* }; | ||
* const command = new ListCostAllocationTagBackfillHistoryCommand(input); | ||
* const response = await client.send(command); | ||
* // { // ListCostAllocationTagBackfillHistoryResponse | ||
* // BackfillRequests: [ // CostAllocationTagBackfillRequestList | ||
* // { // CostAllocationTagBackfillRequest | ||
* // BackfillFrom: "STRING_VALUE", | ||
* // RequestedAt: "STRING_VALUE", | ||
* // CompletedAt: "STRING_VALUE", | ||
* // BackfillStatus: "SUCCEEDED" || "PROCESSING" || "FAILED", | ||
* // LastUpdatedAt: "STRING_VALUE", | ||
* // }, | ||
* // ], | ||
* // NextToken: "STRING_VALUE", | ||
* // }; | ||
* | ||
* ``` | ||
* | ||
* @param ListCostAllocationTagBackfillHistoryCommandInput - {@link ListCostAllocationTagBackfillHistoryCommandInput} | ||
* @returns {@link ListCostAllocationTagBackfillHistoryCommandOutput} | ||
* @see {@link ListCostAllocationTagBackfillHistoryCommandInput} for command's `input` shape. | ||
* @see {@link ListCostAllocationTagBackfillHistoryCommandOutput} for command's `response` shape. | ||
* @see {@link CostExplorerClientResolvedConfig | config} for CostExplorerClient's `config` shape. | ||
* | ||
* @throws {@link InvalidNextTokenException} (client fault) | ||
* <p>The pagination token is invalid. Try again without a pagination token.</p> | ||
* | ||
* @throws {@link LimitExceededException} (client fault) | ||
* <p>You made too many calls in a short period of time. Try again later.</p> | ||
* | ||
* @throws {@link CostExplorerServiceException} | ||
* <p>Base exception class for all service exceptions from CostExplorer service.</p> | ||
* | ||
* @public | ||
*/ | ||
export class ListCostAllocationTagBackfillHistoryCommand extends $Command | ||
.classBuilder< | ||
ListCostAllocationTagBackfillHistoryCommandInput, | ||
ListCostAllocationTagBackfillHistoryCommandOutput, | ||
CostExplorerClientResolvedConfig, | ||
ServiceInputTypes, | ||
ServiceOutputTypes | ||
>() | ||
.ep({ | ||
...commonParams, | ||
}) | ||
.m(function (this: any, Command: any, cs: any, config: CostExplorerClientResolvedConfig, o: any) { | ||
return [ | ||
getSerdePlugin(config, this.serialize, this.deserialize), | ||
getEndpointPlugin(config, Command.getEndpointParameterInstructions()), | ||
]; | ||
}) | ||
.s("AWSInsightsIndexService", "ListCostAllocationTagBackfillHistory", {}) | ||
.n("CostExplorerClient", "ListCostAllocationTagBackfillHistoryCommand") | ||
.f(void 0, void 0) | ||
.ser(se_ListCostAllocationTagBackfillHistoryCommand) | ||
.de(de_ListCostAllocationTagBackfillHistoryCommand) | ||
.build() {} |
103 changes: 103 additions & 0 deletions
103
clients/client-cost-explorer/src/commands/StartCostAllocationTagBackfillCommand.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,103 @@ | ||
// 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 { CostExplorerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CostExplorerClient"; | ||
import { commonParams } from "../endpoint/EndpointParameters"; | ||
import { StartCostAllocationTagBackfillRequest, StartCostAllocationTagBackfillResponse } from "../models/models_0"; | ||
import { | ||
de_StartCostAllocationTagBackfillCommand, | ||
se_StartCostAllocationTagBackfillCommand, | ||
} from "../protocols/Aws_json1_1"; | ||
|
||
/** | ||
* @public | ||
*/ | ||
export { __MetadataBearer, $Command }; | ||
/** | ||
* @public | ||
* | ||
* The input for {@link StartCostAllocationTagBackfillCommand}. | ||
*/ | ||
export interface StartCostAllocationTagBackfillCommandInput extends StartCostAllocationTagBackfillRequest {} | ||
/** | ||
* @public | ||
* | ||
* The output of {@link StartCostAllocationTagBackfillCommand}. | ||
*/ | ||
export interface StartCostAllocationTagBackfillCommandOutput | ||
extends StartCostAllocationTagBackfillResponse, | ||
__MetadataBearer {} | ||
|
||
/** | ||
* <p> | ||
* Request a cost allocation tag backfill. This will backfill the activation status (either <code>active</code> or <code>inactive</code>) for all tag keys from <code>para:BackfillFrom</code> up to the when this request is made.</p> | ||
* <p>You can request a backfill once every 24 hours. | ||
* </p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { CostExplorerClient, StartCostAllocationTagBackfillCommand } from "@aws-sdk/client-cost-explorer"; // ES Modules import | ||
* // const { CostExplorerClient, StartCostAllocationTagBackfillCommand } = require("@aws-sdk/client-cost-explorer"); // CommonJS import | ||
* const client = new CostExplorerClient(config); | ||
* const input = { // StartCostAllocationTagBackfillRequest | ||
* BackfillFrom: "STRING_VALUE", // required | ||
* }; | ||
* const command = new StartCostAllocationTagBackfillCommand(input); | ||
* const response = await client.send(command); | ||
* // { // StartCostAllocationTagBackfillResponse | ||
* // BackfillRequest: { // CostAllocationTagBackfillRequest | ||
* // BackfillFrom: "STRING_VALUE", | ||
* // RequestedAt: "STRING_VALUE", | ||
* // CompletedAt: "STRING_VALUE", | ||
* // BackfillStatus: "SUCCEEDED" || "PROCESSING" || "FAILED", | ||
* // LastUpdatedAt: "STRING_VALUE", | ||
* // }, | ||
* // }; | ||
* | ||
* ``` | ||
* | ||
* @param StartCostAllocationTagBackfillCommandInput - {@link StartCostAllocationTagBackfillCommandInput} | ||
* @returns {@link StartCostAllocationTagBackfillCommandOutput} | ||
* @see {@link StartCostAllocationTagBackfillCommandInput} for command's `input` shape. | ||
* @see {@link StartCostAllocationTagBackfillCommandOutput} for command's `response` shape. | ||
* @see {@link CostExplorerClientResolvedConfig | config} for CostExplorerClient's `config` shape. | ||
* | ||
* @throws {@link BackfillLimitExceededException} (client fault) | ||
* <p> | ||
* A request to backfill is already in progress. Once the previous request is complete, you can create another request. | ||
* </p> | ||
* | ||
* @throws {@link LimitExceededException} (client fault) | ||
* <p>You made too many calls in a short period of time. Try again later.</p> | ||
* | ||
* @throws {@link CostExplorerServiceException} | ||
* <p>Base exception class for all service exceptions from CostExplorer service.</p> | ||
* | ||
* @public | ||
*/ | ||
export class StartCostAllocationTagBackfillCommand extends $Command | ||
.classBuilder< | ||
StartCostAllocationTagBackfillCommandInput, | ||
StartCostAllocationTagBackfillCommandOutput, | ||
CostExplorerClientResolvedConfig, | ||
ServiceInputTypes, | ||
ServiceOutputTypes | ||
>() | ||
.ep({ | ||
...commonParams, | ||
}) | ||
.m(function (this: any, Command: any, cs: any, config: CostExplorerClientResolvedConfig, o: any) { | ||
return [ | ||
getSerdePlugin(config, this.serialize, this.deserialize), | ||
getEndpointPlugin(config, Command.getEndpointParameterInstructions()), | ||
]; | ||
}) | ||
.s("AWSInsightsIndexService", "StartCostAllocationTagBackfill", {}) | ||
.n("CostExplorerClient", "StartCostAllocationTagBackfillCommand") | ||
.f(void 0, void 0) | ||
.ser(se_StartCostAllocationTagBackfillCommand) | ||
.de(de_StartCostAllocationTagBackfillCommand) | ||
.build() {} |
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
Oops, something went wrong.