Skip to content

Commit

Permalink
feat(client-outposts): This release adds a new API called ListAssets …
Browse files Browse the repository at this point in the history
…to the Outposts SDK, which lists the hardware assets in an Outpost.
  • Loading branch information
awstools committed May 2, 2022
1 parent 329a23a commit e04ca4d
Show file tree
Hide file tree
Showing 15 changed files with 715 additions and 15 deletions.
41 changes: 36 additions & 5 deletions clients/client-outposts/src/Outposts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
GetSiteAddressCommandOutput,
} from "./commands/GetSiteAddressCommand";
import { GetSiteCommand, GetSiteCommandInput, GetSiteCommandOutput } from "./commands/GetSiteCommand";
import { ListAssetsCommand, ListAssetsCommandInput, ListAssetsCommandOutput } from "./commands/ListAssetsCommand";
import {
ListCatalogItemsCommand,
ListCatalogItemsCommandInput,
Expand Down Expand Up @@ -339,7 +340,7 @@ export class Outposts extends OutpostsClient {
}

/**
* <p>Lists the instance types for the specified Outpost.</p>
* <p>Gets the instance types for the specified Outpost.</p>
*/
public getOutpostInstanceTypes(
args: GetOutpostInstanceTypesCommandInput,
Expand Down Expand Up @@ -433,7 +434,37 @@ export class Outposts extends OutpostsClient {
}

/**
* <p>Use to create a list of every item in the catalog. Add filters to your request to return a
* <p>
* Lists the hardware assets in an Outpost. If you are using Dedicated Hosts on
* Amazon Web Services Outposts, you can filter your request by host ID to return a list of hardware
* assets that allocate resources for Dedicated Hosts.
* </p>
*/
public listAssets(args: ListAssetsCommandInput, options?: __HttpHandlerOptions): Promise<ListAssetsCommandOutput>;
public listAssets(args: ListAssetsCommandInput, cb: (err: any, data?: ListAssetsCommandOutput) => void): void;
public listAssets(
args: ListAssetsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListAssetsCommandOutput) => void
): void;
public listAssets(
args: ListAssetsCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListAssetsCommandOutput) => void),
cb?: (err: any, data?: ListAssetsCommandOutput) => void
): Promise<ListAssetsCommandOutput> | void {
const command = new ListAssetsCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Lists the items in the catalog. Add filters to your request to return a
* more specific list of results. Use filters to match an item class, storage
* option, or EC2 family. </p>
* <p>If you specify multiple filters, the filters are joined with an <code>AND</code>, and
Expand Down Expand Up @@ -469,7 +500,7 @@ export class Outposts extends OutpostsClient {
}

/**
* <p>Create a list of the Outpost orders for your Amazon Web Services account. You can filter your request by Outpost to
* <p>Lists the Outpost orders for your Amazon Web Services account. You can filter your request by Outpost to
* return a more specific list of results. </p>
*/
public listOrders(args: ListOrdersCommandInput, options?: __HttpHandlerOptions): Promise<ListOrdersCommandOutput>;
Expand All @@ -496,7 +527,7 @@ export class Outposts extends OutpostsClient {
}

/**
* <p>Create a list of the Outposts for your Amazon Web Services account. Add filters to your request to return
* <p>Lists the Outposts for your Amazon Web Services account. Add filters to your request to return
* a more specific list of results. Use filters to match an Outpost lifecycle status,
* Availability Zone (<code>us-east-1a</code>), and AZ ID (<code>use1-az1</code>). </p>
*
Expand Down Expand Up @@ -530,7 +561,7 @@ export class Outposts extends OutpostsClient {
}

/**
* <p>Create a list of the Outpost sites for your Amazon Web Services account. Add operating address filters to your request to
* <p>Lists the Outpost sites for your Amazon Web Services account. Add operating address filters to your request to
* return a more specific list of results. Use filters to match site city, country code, or state/region of the
* operating address. </p>
*
Expand Down
3 changes: 3 additions & 0 deletions clients/client-outposts/src/OutpostsClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ import {
} from "./commands/GetOutpostInstanceTypesCommand";
import { GetSiteAddressCommandInput, GetSiteAddressCommandOutput } from "./commands/GetSiteAddressCommand";
import { GetSiteCommandInput, GetSiteCommandOutput } from "./commands/GetSiteCommand";
import { ListAssetsCommandInput, ListAssetsCommandOutput } from "./commands/ListAssetsCommand";
import { ListCatalogItemsCommandInput, ListCatalogItemsCommandOutput } from "./commands/ListCatalogItemsCommand";
import { ListOrdersCommandInput, ListOrdersCommandOutput } from "./commands/ListOrdersCommand";
import { ListOutpostsCommandInput, ListOutpostsCommandOutput } from "./commands/ListOutpostsCommand";
Expand Down Expand Up @@ -98,6 +99,7 @@ export type ServiceInputTypes =
| GetOutpostInstanceTypesCommandInput
| GetSiteAddressCommandInput
| GetSiteCommandInput
| ListAssetsCommandInput
| ListCatalogItemsCommandInput
| ListOrdersCommandInput
| ListOutpostsCommandInput
Expand All @@ -123,6 +125,7 @@ export type ServiceOutputTypes =
| GetOutpostInstanceTypesCommandOutput
| GetSiteAddressCommandOutput
| GetSiteCommandOutput
| ListAssetsCommandOutput
| ListCatalogItemsCommandOutput
| ListOrdersCommandOutput
| ListOutpostsCommandOutput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface GetOutpostInstanceTypesCommandInput extends GetOutpostInstanceT
export interface GetOutpostInstanceTypesCommandOutput extends GetOutpostInstanceTypesOutput, __MetadataBearer {}

/**
* <p>Lists the instance types for the specified Outpost.</p>
* <p>Gets the instance types for the specified Outpost.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
99 changes: 99 additions & 0 deletions clients/client-outposts/src/commands/ListAssetsCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
import { Command as $Command } from "@aws-sdk/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";

import { ListAssetsInput, ListAssetsOutput } from "../models/models_0";
import { OutpostsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../OutpostsClient";
import {
deserializeAws_restJson1ListAssetsCommand,
serializeAws_restJson1ListAssetsCommand,
} from "../protocols/Aws_restJson1";

export interface ListAssetsCommandInput extends ListAssetsInput {}
export interface ListAssetsCommandOutput extends ListAssetsOutput, __MetadataBearer {}

/**
* <p>
* Lists the hardware assets in an Outpost. If you are using Dedicated Hosts on
* Amazon Web Services Outposts, you can filter your request by host ID to return a list of hardware
* assets that allocate resources for Dedicated Hosts.
* </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { OutpostsClient, ListAssetsCommand } from "@aws-sdk/client-outposts"; // ES Modules import
* // const { OutpostsClient, ListAssetsCommand } = require("@aws-sdk/client-outposts"); // CommonJS import
* const client = new OutpostsClient(config);
* const command = new ListAssetsCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link ListAssetsCommandInput} for command's `input` shape.
* @see {@link ListAssetsCommandOutput} for command's `response` shape.
* @see {@link OutpostsClientResolvedConfig | config} for OutpostsClient's `config` shape.
*
*/
export class ListAssetsCommand extends $Command<
ListAssetsCommandInput,
ListAssetsCommandOutput,
OutpostsClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

constructor(readonly input: ListAssetsCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: OutpostsClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<ListAssetsCommandInput, ListAssetsCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

const stack = clientStack.concat(this.middlewareStack);

const { logger } = configuration;
const clientName = "OutpostsClient";
const commandName = "ListAssetsCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: ListAssetsInput.filterSensitiveLog,
outputFilterSensitiveLog: ListAssetsOutput.filterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

private serialize(input: ListAssetsCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return serializeAws_restJson1ListAssetsCommand(input, context);
}

private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<ListAssetsCommandOutput> {
return deserializeAws_restJson1ListAssetsCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface ListCatalogItemsCommandInput extends ListCatalogItemsInput {}
export interface ListCatalogItemsCommandOutput extends ListCatalogItemsOutput, __MetadataBearer {}

/**
* <p>Use to create a list of every item in the catalog. Add filters to your request to return a
* <p>Lists the items in the catalog. Add filters to your request to return a
* more specific list of results. Use filters to match an item class, storage
* option, or EC2 family. </p>
* <p>If you specify multiple filters, the filters are joined with an <code>AND</code>, and
Expand Down
2 changes: 1 addition & 1 deletion clients/client-outposts/src/commands/ListOrdersCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface ListOrdersCommandInput extends ListOrdersInput {}
export interface ListOrdersCommandOutput extends ListOrdersOutput, __MetadataBearer {}

/**
* <p>Create a list of the Outpost orders for your Amazon Web Services account. You can filter your request by Outpost to
* <p>Lists the Outpost orders for your Amazon Web Services account. You can filter your request by Outpost to
* return a more specific list of results. </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface ListOutpostsCommandInput extends ListOutpostsInput {}
export interface ListOutpostsCommandOutput extends ListOutpostsOutput, __MetadataBearer {}

/**
* <p>Create a list of the Outposts for your Amazon Web Services account. Add filters to your request to return
* <p>Lists the Outposts for your Amazon Web Services account. Add filters to your request to return
* a more specific list of results. Use filters to match an Outpost lifecycle status,
* Availability Zone (<code>us-east-1a</code>), and AZ ID (<code>use1-az1</code>). </p>
*
Expand Down
2 changes: 1 addition & 1 deletion clients/client-outposts/src/commands/ListSitesCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface ListSitesCommandInput extends ListSitesInput {}
export interface ListSitesCommandOutput extends ListSitesOutput, __MetadataBearer {}

/**
* <p>Create a list of the Outpost sites for your Amazon Web Services account. Add operating address filters to your request to
* <p>Lists the Outpost sites for your Amazon Web Services account. Add operating address filters to your request to
* return a more specific list of results. Use filters to match site city, country code, or state/region of the
* operating address. </p>
*
Expand Down
1 change: 1 addition & 0 deletions clients/client-outposts/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export * from "./GetOutpostCommand";
export * from "./GetOutpostInstanceTypesCommand";
export * from "./GetSiteAddressCommand";
export * from "./GetSiteCommand";
export * from "./ListAssetsCommand";
export * from "./ListCatalogItemsCommand";
export * from "./ListOrdersCommand";
export * from "./ListOutpostsCommand";
Expand Down
Loading

0 comments on commit e04ca4d

Please sign in to comment.