Skip to content

Commit

Permalink
feat(client-s3outposts): S3 on Outposts introduces a new API ListOutp…
Browse files Browse the repository at this point in the history
…ostsWithS3, with this API you can list all your Outposts with S3 capacity.
  • Loading branch information
awstools committed Mar 1, 2023
1 parent e0db41d commit 9b55483
Show file tree
Hide file tree
Showing 15 changed files with 1,118 additions and 1,294 deletions.
8 changes: 8 additions & 0 deletions clients/client-s3outposts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,14 @@ ListEndpoints

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-s3outposts/classes/listendpointscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-s3outposts/interfaces/listendpointscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-s3outposts/interfaces/listendpointscommandoutput.html)

</details>
<details>
<summary>
ListOutpostsWithS3
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-s3outposts/classes/listoutpostswiths3command.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-s3outposts/interfaces/listoutpostswiths3commandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-s3outposts/interfaces/listoutpostswiths3commandoutput.html)

</details>
<details>
<summary>
Expand Down
71 changes: 55 additions & 16 deletions clients/client-s3outposts/src/S3Outposts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ import {
ListEndpointsCommandInput,
ListEndpointsCommandOutput,
} from "./commands/ListEndpointsCommand";
import {
ListOutpostsWithS3Command,
ListOutpostsWithS3CommandInput,
ListOutpostsWithS3CommandOutput,
} from "./commands/ListOutpostsWithS3Command";
import {
ListSharedEndpointsCommand,
ListSharedEndpointsCommandInput,
Expand All @@ -29,12 +34,12 @@ import { S3OutpostsClient } from "./S3OutpostsClient";
export class S3Outposts extends S3OutpostsClient {
/**
* <p>Creates an endpoint and associates it with the specified Outpost.</p>
* <note>
* <note>
* <p>It can take up to 5 minutes for this action to finish.</p>
* </note>
* <p></p>
* <p>Related actions include:</p>
* <ul>
* <p></p>
* <p>Related actions include:</p>
* <ul>
* <li>
* <p>
* <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_DeleteEndpoint.html">DeleteEndpoint</a>
Expand Down Expand Up @@ -78,12 +83,12 @@ export class S3Outposts extends S3OutpostsClient {

/**
* <p>Deletes an endpoint.</p>
* <note>
* <note>
* <p>It can take up to 5 minutes for this action to finish.</p>
* </note>
* <p></p>
* <p>Related actions include:</p>
* <ul>
* <p></p>
* <p>Related actions include:</p>
* <ul>
* <li>
* <p>
* <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_CreateEndpoint.html">CreateEndpoint</a>
Expand Down Expand Up @@ -127,15 +132,15 @@ export class S3Outposts extends S3OutpostsClient {

/**
* <p>Lists endpoints associated with the specified Outpost. </p>
* <p>Related actions include:</p>
* <ul>
* <p>Related actions include:</p>
* <ul>
* <li>
* <p>
* <p>
* <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_CreateEndpoint.html">CreateEndpoint</a>
* </p>
* </li>
* <li>
* <p>
* <p>
* <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_DeleteEndpoint.html">DeleteEndpoint</a>
* </p>
* </li>
Expand Down Expand Up @@ -170,17 +175,51 @@ export class S3Outposts extends S3OutpostsClient {
}
}

/**
* <p>Lists the Outposts with S3 on Outposts capacity for your Amazon Web Services account.
* Includes S3 on Outposts that you have access to as the Outposts owner, or as a shared user
* from Resource Access Manager (RAM). </p>
*/
public listOutpostsWithS3(
args: ListOutpostsWithS3CommandInput,
options?: __HttpHandlerOptions
): Promise<ListOutpostsWithS3CommandOutput>;
public listOutpostsWithS3(
args: ListOutpostsWithS3CommandInput,
cb: (err: any, data?: ListOutpostsWithS3CommandOutput) => void
): void;
public listOutpostsWithS3(
args: ListOutpostsWithS3CommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListOutpostsWithS3CommandOutput) => void
): void;
public listOutpostsWithS3(
args: ListOutpostsWithS3CommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListOutpostsWithS3CommandOutput) => void),
cb?: (err: any, data?: ListOutpostsWithS3CommandOutput) => void
): Promise<ListOutpostsWithS3CommandOutput> | void {
const command = new ListOutpostsWithS3Command(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 all endpoints associated with an Outpost that has been shared by Amazon Web Services Resource Access Manager (RAM).</p>
* <p>Related actions include:</p>
* <ul>
* <p>Related actions include:</p>
* <ul>
* <li>
* <p>
* <p>
* <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_CreateEndpoint.html">CreateEndpoint</a>
* </p>
* </li>
* <li>
* <p>
* <p>
* <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_DeleteEndpoint.html">DeleteEndpoint</a>
* </p>
* </li>
Expand Down
3 changes: 3 additions & 0 deletions clients/client-s3outposts/src/S3OutpostsClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import {
import { CreateEndpointCommandInput, CreateEndpointCommandOutput } from "./commands/CreateEndpointCommand";
import { DeleteEndpointCommandInput, DeleteEndpointCommandOutput } from "./commands/DeleteEndpointCommand";
import { ListEndpointsCommandInput, ListEndpointsCommandOutput } from "./commands/ListEndpointsCommand";
import { ListOutpostsWithS3CommandInput, ListOutpostsWithS3CommandOutput } from "./commands/ListOutpostsWithS3Command";
import {
ListSharedEndpointsCommandInput,
ListSharedEndpointsCommandOutput,
Expand All @@ -68,12 +69,14 @@ export type ServiceInputTypes =
| CreateEndpointCommandInput
| DeleteEndpointCommandInput
| ListEndpointsCommandInput
| ListOutpostsWithS3CommandInput
| ListSharedEndpointsCommandInput;

export type ServiceOutputTypes =
| CreateEndpointCommandOutput
| DeleteEndpointCommandOutput
| ListEndpointsCommandOutput
| ListOutpostsWithS3CommandOutput
| ListSharedEndpointsCommandOutput;

export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ export interface CreateEndpointCommandOutput extends CreateEndpointResult, __Met

/**
* <p>Creates an endpoint and associates it with the specified Outpost.</p>
* <note>
* <note>
* <p>It can take up to 5 minutes for this action to finish.</p>
* </note>
* <p></p>
* <p>Related actions include:</p>
* <ul>
* <p></p>
* <p>Related actions include:</p>
* <ul>
* <li>
* <p>
* <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_DeleteEndpoint.html">DeleteEndpoint</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ export interface DeleteEndpointCommandOutput extends __MetadataBearer {}

/**
* <p>Deletes an endpoint.</p>
* <note>
* <note>
* <p>It can take up to 5 minutes for this action to finish.</p>
* </note>
* <p></p>
* <p>Related actions include:</p>
* <ul>
* <p></p>
* <p>Related actions include:</p>
* <ul>
* <li>
* <p>
* <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_CreateEndpoint.html">CreateEndpoint</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ export interface ListEndpointsCommandOutput extends ListEndpointsResult, __Metad

/**
* <p>Lists endpoints associated with the specified Outpost. </p>
* <p>Related actions include:</p>
* <ul>
* <p>Related actions include:</p>
* <ul>
* <li>
* <p>
* <p>
* <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_CreateEndpoint.html">CreateEndpoint</a>
* </p>
* </li>
* <li>
* <p>
* <p>
* <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_DeleteEndpoint.html">DeleteEndpoint</a>
* </p>
* </li>
Expand Down
122 changes: 122 additions & 0 deletions clients/client-s3outposts/src/commands/ListOutpostsWithS3Command.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
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 {
ListOutpostsWithS3Request,
ListOutpostsWithS3RequestFilterSensitiveLog,
ListOutpostsWithS3Result,
ListOutpostsWithS3ResultFilterSensitiveLog,
} from "../models/models_0";
import {
deserializeAws_restJson1ListOutpostsWithS3Command,
serializeAws_restJson1ListOutpostsWithS3Command,
} from "../protocols/Aws_restJson1";
import { S3OutpostsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../S3OutpostsClient";

/**
* The input for {@link ListOutpostsWithS3Command}.
*/
export interface ListOutpostsWithS3CommandInput extends ListOutpostsWithS3Request {}
/**
* The output of {@link ListOutpostsWithS3Command}.
*/
export interface ListOutpostsWithS3CommandOutput extends ListOutpostsWithS3Result, __MetadataBearer {}

/**
* <p>Lists the Outposts with S3 on Outposts capacity for your Amazon Web Services account.
* Includes S3 on Outposts that you have access to as the Outposts owner, or as a shared user
* from Resource Access Manager (RAM). </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { S3OutpostsClient, ListOutpostsWithS3Command } from "@aws-sdk/client-s3outposts"; // ES Modules import
* // const { S3OutpostsClient, ListOutpostsWithS3Command } = require("@aws-sdk/client-s3outposts"); // CommonJS import
* const client = new S3OutpostsClient(config);
* const command = new ListOutpostsWithS3Command(input);
* const response = await client.send(command);
* ```
*
* @see {@link ListOutpostsWithS3CommandInput} for command's `input` shape.
* @see {@link ListOutpostsWithS3CommandOutput} for command's `response` shape.
* @see {@link S3OutpostsClientResolvedConfig | config} for S3OutpostsClient's `config` shape.
*
*/
export class ListOutpostsWithS3Command extends $Command<
ListOutpostsWithS3CommandInput,
ListOutpostsWithS3CommandOutput,
S3OutpostsClientResolvedConfig
> {
// 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" },
};
}

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

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: S3OutpostsClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<ListOutpostsWithS3CommandInput, ListOutpostsWithS3CommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, ListOutpostsWithS3Command.getEndpointParameterInstructions())
);

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

const { logger } = configuration;
const clientName = "S3OutpostsClient";
const commandName = "ListOutpostsWithS3Command";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: ListOutpostsWithS3RequestFilterSensitiveLog,
outputFilterSensitiveLog: ListOutpostsWithS3ResultFilterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

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

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

// Start section: command_body_extra
// End section: command_body_extra
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ export interface ListSharedEndpointsCommandOutput extends ListSharedEndpointsRes

/**
* <p>Lists all endpoints associated with an Outpost that has been shared by Amazon Web Services Resource Access Manager (RAM).</p>
* <p>Related actions include:</p>
* <ul>
* <p>Related actions include:</p>
* <ul>
* <li>
* <p>
* <p>
* <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_CreateEndpoint.html">CreateEndpoint</a>
* </p>
* </li>
* <li>
* <p>
* <p>
* <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_DeleteEndpoint.html">DeleteEndpoint</a>
* </p>
* </li>
Expand Down
1 change: 1 addition & 0 deletions clients/client-s3outposts/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
export * from "./CreateEndpointCommand";
export * from "./DeleteEndpointCommand";
export * from "./ListEndpointsCommand";
export * from "./ListOutpostsWithS3Command";
export * from "./ListSharedEndpointsCommand";
Loading

0 comments on commit 9b55483

Please sign in to comment.