Skip to content

Commit

Permalink
feat(client-outposts): This release updates StartCapacityTask to allo…
Browse files Browse the repository at this point in the history
…w an active Outpost to be modified. It also adds a new API to list all running EC2 instances on the Outpost.
  • Loading branch information
awstools committed Nov 11, 2024
1 parent 5eded70 commit c02da55
Show file tree
Hide file tree
Showing 17 changed files with 1,448 additions and 31 deletions.
16 changes: 16 additions & 0 deletions clients/client-outposts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,14 @@ GetSiteAddress

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/outposts/command/GetSiteAddressCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-outposts/Interface/GetSiteAddressCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-outposts/Interface/GetSiteAddressCommandOutput/)

</details>
<details>
<summary>
ListAssetInstances
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/outposts/command/ListAssetInstancesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-outposts/Interface/ListAssetInstancesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-outposts/Interface/ListAssetInstancesCommandOutput/)

</details>
<details>
<summary>
Expand All @@ -342,6 +350,14 @@ ListAssets

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/outposts/command/ListAssetsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-outposts/Interface/ListAssetsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-outposts/Interface/ListAssetsCommandOutput/)

</details>
<details>
<summary>
ListBlockingInstancesForCapacityTask
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/outposts/command/ListBlockingInstancesForCapacityTaskCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-outposts/Interface/ListBlockingInstancesForCapacityTaskCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-outposts/Interface/ListBlockingInstancesForCapacityTaskCommandOutput/)

</details>
<details>
<summary>
Expand Down
46 changes: 46 additions & 0 deletions clients/client-outposts/src/Outposts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,17 @@ import {
GetSiteAddressCommandOutput,
} from "./commands/GetSiteAddressCommand";
import { GetSiteCommand, GetSiteCommandInput, GetSiteCommandOutput } from "./commands/GetSiteCommand";
import {
ListAssetInstancesCommand,
ListAssetInstancesCommandInput,
ListAssetInstancesCommandOutput,
} from "./commands/ListAssetInstancesCommand";
import { ListAssetsCommand, ListAssetsCommandInput, ListAssetsCommandOutput } from "./commands/ListAssetsCommand";
import {
ListBlockingInstancesForCapacityTaskCommand,
ListBlockingInstancesForCapacityTaskCommandInput,
ListBlockingInstancesForCapacityTaskCommandOutput,
} from "./commands/ListBlockingInstancesForCapacityTaskCommand";
import {
ListCapacityTasksCommand,
ListCapacityTasksCommandInput,
Expand Down Expand Up @@ -128,7 +138,9 @@ const commands = {
GetOutpostSupportedInstanceTypesCommand,
GetSiteCommand,
GetSiteAddressCommand,
ListAssetInstancesCommand,
ListAssetsCommand,
ListBlockingInstancesForCapacityTaskCommand,
ListCapacityTasksCommand,
ListCatalogItemsCommand,
ListOrdersCommand,
Expand Down Expand Up @@ -349,6 +361,23 @@ export interface Outposts {
cb: (err: any, data?: GetSiteAddressCommandOutput) => void
): void;

/**
* @see {@link ListAssetInstancesCommand}
*/
listAssetInstances(
args: ListAssetInstancesCommandInput,
options?: __HttpHandlerOptions
): Promise<ListAssetInstancesCommandOutput>;
listAssetInstances(
args: ListAssetInstancesCommandInput,
cb: (err: any, data?: ListAssetInstancesCommandOutput) => void
): void;
listAssetInstances(
args: ListAssetInstancesCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListAssetInstancesCommandOutput) => void
): void;

/**
* @see {@link ListAssetsCommand}
*/
Expand All @@ -360,6 +389,23 @@ export interface Outposts {
cb: (err: any, data?: ListAssetsCommandOutput) => void
): void;

/**
* @see {@link ListBlockingInstancesForCapacityTaskCommand}
*/
listBlockingInstancesForCapacityTask(
args: ListBlockingInstancesForCapacityTaskCommandInput,
options?: __HttpHandlerOptions
): Promise<ListBlockingInstancesForCapacityTaskCommandOutput>;
listBlockingInstancesForCapacityTask(
args: ListBlockingInstancesForCapacityTaskCommandInput,
cb: (err: any, data?: ListBlockingInstancesForCapacityTaskCommandOutput) => void
): void;
listBlockingInstancesForCapacityTask(
args: ListBlockingInstancesForCapacityTaskCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListBlockingInstancesForCapacityTaskCommandOutput) => void
): void;

/**
* @see {@link ListCapacityTasksCommand}
*/
Expand Down
9 changes: 9 additions & 0 deletions clients/client-outposts/src/OutpostsClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ import {
} from "./commands/GetOutpostSupportedInstanceTypesCommand";
import { GetSiteAddressCommandInput, GetSiteAddressCommandOutput } from "./commands/GetSiteAddressCommand";
import { GetSiteCommandInput, GetSiteCommandOutput } from "./commands/GetSiteCommand";
import { ListAssetInstancesCommandInput, ListAssetInstancesCommandOutput } from "./commands/ListAssetInstancesCommand";
import { ListAssetsCommandInput, ListAssetsCommandOutput } from "./commands/ListAssetsCommand";
import {
ListBlockingInstancesForCapacityTaskCommandInput,
ListBlockingInstancesForCapacityTaskCommandOutput,
} from "./commands/ListBlockingInstancesForCapacityTaskCommand";
import { ListCapacityTasksCommandInput, ListCapacityTasksCommandOutput } from "./commands/ListCapacityTasksCommand";
import { ListCatalogItemsCommandInput, ListCatalogItemsCommandOutput } from "./commands/ListCatalogItemsCommand";
import { ListOrdersCommandInput, ListOrdersCommandOutput } from "./commands/ListOrdersCommand";
Expand Down Expand Up @@ -127,7 +132,9 @@ export type ServiceInputTypes =
| GetOutpostSupportedInstanceTypesCommandInput
| GetSiteAddressCommandInput
| GetSiteCommandInput
| ListAssetInstancesCommandInput
| ListAssetsCommandInput
| ListBlockingInstancesForCapacityTaskCommandInput
| ListCapacityTasksCommandInput
| ListCatalogItemsCommandInput
| ListOrdersCommandInput
Expand Down Expand Up @@ -163,7 +170,9 @@ export type ServiceOutputTypes =
| GetOutpostSupportedInstanceTypesCommandOutput
| GetSiteAddressCommandOutput
| GetSiteCommandOutput
| ListAssetInstancesCommandOutput
| ListAssetsCommandOutput
| ListBlockingInstancesForCapacityTaskCommandOutput
| ListCapacityTasksCommandOutput
| ListCatalogItemsCommandOutput
| ListOrdersCommandOutput
Expand Down
16 changes: 14 additions & 2 deletions clients/client-outposts/src/commands/GetCapacityTaskCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,27 @@ export interface GetCapacityTaskCommandOutput extends GetCapacityTaskOutput, __M
* // Count: Number("int"), // required
* // },
* // ],
* // InstancesToExclude: { // InstancesToExclude
* // Instances: [ // InstanceIdList
* // "STRING_VALUE",
* // ],
* // AccountIds: [ // AccountIdList
* // "STRING_VALUE",
* // ],
* // Services: [ // AWSServiceNameList
* // "AWS" || "EC2" || "ELASTICACHE" || "ELB" || "RDS" || "ROUTE53",
* // ],
* // },
* // DryRun: true || false,
* // CapacityTaskStatus: "REQUESTED" || "IN_PROGRESS" || "FAILED" || "COMPLETED" || "CANCELLED",
* // CapacityTaskStatus: "REQUESTED" || "IN_PROGRESS" || "FAILED" || "COMPLETED" || "WAITING_FOR_EVACUATION" || "CANCELLATION_IN_PROGRESS" || "CANCELLED",
* // Failed: { // CapacityTaskFailure
* // Reason: "STRING_VALUE", // required
* // Type: "UNSUPPORTED_CAPACITY_CONFIGURATION",
* // Type: "UNSUPPORTED_CAPACITY_CONFIGURATION" || "UNEXPECTED_ASSET_STATE" || "BLOCKING_INSTANCES_NOT_EVACUATED" || "INTERNAL_SERVER_ERROR" || "RESOURCE_NOT_FOUND",
* // },
* // CreationDate: new Date("TIMESTAMP"),
* // CompletionDate: new Date("TIMESTAMP"),
* // LastModifiedDate: new Date("TIMESTAMP"),
* // TaskActionOnBlockingInstances: "WAIT_FOR_EVACUATION" || "FAIL_TASK",
* // };
*
* ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ export interface GetOutpostSupportedInstanceTypesCommandOutput
__MetadataBearer {}

/**
* <p>Gets the instance types that an
* Outpost can support in <code>InstanceTypeCapacity</code>. This will generally include instance types that
* are not currently configured and therefore cannot be launched with the current Outpost
* capacity configuration.</p>
* <p>Gets the instance types that an Outpost can support in <code>InstanceTypeCapacity</code>.
* This will generally include instance types that are not currently configured and therefore
* cannot be launched with the current Outpost capacity configuration.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand All @@ -45,7 +44,7 @@ export interface GetOutpostSupportedInstanceTypesCommandOutput
* const client = new OutpostsClient(config);
* const input = { // GetOutpostSupportedInstanceTypesInput
* OutpostIdentifier: "STRING_VALUE", // required
* OrderId: "STRING_VALUE", // required
* OrderId: "STRING_VALUE",
* MaxResults: Number("int"),
* NextToken: "STRING_VALUE",
* };
Expand Down
128 changes: 128 additions & 0 deletions clients/client-outposts/src/commands/ListAssetInstancesCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
// 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 { commonParams } from "../endpoint/EndpointParameters";
import { ListAssetInstancesInput, ListAssetInstancesOutput } from "../models/models_0";
import { OutpostsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../OutpostsClient";
import { de_ListAssetInstancesCommand, se_ListAssetInstancesCommand } from "../protocols/Aws_restJson1";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link ListAssetInstancesCommand}.
*/
export interface ListAssetInstancesCommandInput extends ListAssetInstancesInput {}
/**
* @public
*
* The output of {@link ListAssetInstancesCommand}.
*/
export interface ListAssetInstancesCommandOutput extends ListAssetInstancesOutput, __MetadataBearer {}

/**
* <p>A list of Amazon EC2 instances, belonging to all accounts, running on the specified Outpost.
* Does not include Amazon EBS or Amazon S3 instances.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { OutpostsClient, ListAssetInstancesCommand } from "@aws-sdk/client-outposts"; // ES Modules import
* // const { OutpostsClient, ListAssetInstancesCommand } = require("@aws-sdk/client-outposts"); // CommonJS import
* const client = new OutpostsClient(config);
* const input = { // ListAssetInstancesInput
* OutpostIdentifier: "STRING_VALUE", // required
* AssetIdFilter: [ // AssetIdList
* "STRING_VALUE",
* ],
* InstanceTypeFilter: [ // OutpostInstanceTypeList
* "STRING_VALUE",
* ],
* AccountIdFilter: [ // AccountIdList
* "STRING_VALUE",
* ],
* AwsServiceFilter: [ // AWSServiceNameList
* "AWS" || "EC2" || "ELASTICACHE" || "ELB" || "RDS" || "ROUTE53",
* ],
* MaxResults: Number("int"),
* NextToken: "STRING_VALUE",
* };
* const command = new ListAssetInstancesCommand(input);
* const response = await client.send(command);
* // { // ListAssetInstancesOutput
* // AssetInstances: [ // AssetInstanceList
* // { // AssetInstance
* // InstanceId: "STRING_VALUE",
* // InstanceType: "STRING_VALUE",
* // AssetId: "STRING_VALUE",
* // AccountId: "STRING_VALUE",
* // AwsServiceName: "AWS" || "EC2" || "ELASTICACHE" || "ELB" || "RDS" || "ROUTE53",
* // },
* // ],
* // NextToken: "STRING_VALUE",
* // };
*
* ```
*
* @param ListAssetInstancesCommandInput - {@link ListAssetInstancesCommandInput}
* @returns {@link ListAssetInstancesCommandOutput}
* @see {@link ListAssetInstancesCommandInput} for command's `input` shape.
* @see {@link ListAssetInstancesCommandOutput} for command's `response` shape.
* @see {@link OutpostsClientResolvedConfig | config} for OutpostsClient's `config` shape.
*
* @throws {@link AccessDeniedException} (client fault)
* <p>You do not have permission to perform this operation.</p>
*
* @throws {@link InternalServerException} (server fault)
* <p>An internal error has occurred.</p>
*
* @throws {@link NotFoundException} (client fault)
* <p>The specified request is not valid.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>A parameter is not valid.</p>
*
* @throws {@link OutpostsServiceException}
* <p>Base exception class for all service exceptions from Outposts service.</p>
*
* @public
*/
export class ListAssetInstancesCommand extends $Command
.classBuilder<
ListAssetInstancesCommandInput,
ListAssetInstancesCommandOutput,
OutpostsClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep(commonParams)
.m(function (this: any, Command: any, cs: any, config: OutpostsClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("OutpostsOlafService", "ListAssetInstances", {})
.n("OutpostsClient", "ListAssetInstancesCommand")
.f(void 0, void 0)
.ser(se_ListAssetInstancesCommand)
.de(de_ListAssetInstancesCommand)
.build() {
/** @internal type navigation helper, not in runtime. */
protected declare static __types: {
api: {
input: ListAssetInstancesInput;
output: ListAssetInstancesOutput;
};
sdk: {
input: ListAssetInstancesCommandInput;
output: ListAssetInstancesCommandOutput;
};
};
}
7 changes: 7 additions & 0 deletions clients/client-outposts/src/commands/ListAssetsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ export interface ListAssetsCommandOutput extends ListAssetsOutput, __MetadataBea
* // InstanceFamilies: [ // InstanceFamilies
* // "STRING_VALUE",
* // ],
* // InstanceTypeCapacities: [ // AssetInstanceCapacityList
* // { // AssetInstanceTypeCapacity
* // InstanceType: "STRING_VALUE", // required
* // Count: Number("int"), // required
* // },
* // ],
* // MaxVcpus: Number("int"),
* // },
* // AssetLocation: { // AssetLocation
* // RackElevation: Number("float"),
Expand Down
Loading

0 comments on commit c02da55

Please sign in to comment.