Skip to content

Commit

Permalink
feat(client-rds): This release adds support for using RDS Data API wi…
Browse files Browse the repository at this point in the history
…th Aurora PostgreSQL Serverless v2 and provisioned DB clusters.
  • Loading branch information
awstools committed Dec 21, 2023
1 parent 9a1b1c8 commit ee4406c
Show file tree
Hide file tree
Showing 10 changed files with 843 additions and 18 deletions.
16 changes: 16 additions & 0 deletions clients/client-rds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,14 @@ DescribeValidDBInstanceModifications

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rds/command/DescribeValidDBInstanceModificationsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rds/Interface/DescribeValidDBInstanceModificationsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rds/Interface/DescribeValidDBInstanceModificationsCommandOutput/)

</details>
<details>
<summary>
DisableHttpEndpoint
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rds/command/DisableHttpEndpointCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rds/Interface/DisableHttpEndpointCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rds/Interface/DisableHttpEndpointCommandOutput/)

</details>
<details>
<summary>
Expand All @@ -1039,6 +1047,14 @@ DownloadDBLogFilePortion

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rds/command/DownloadDBLogFilePortionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rds/Interface/DownloadDBLogFilePortionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rds/Interface/DownloadDBLogFilePortionCommandOutput/)

</details>
<details>
<summary>
EnableHttpEndpoint
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/rds/command/EnableHttpEndpointCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rds/Interface/EnableHttpEndpointCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-rds/Interface/EnableHttpEndpointCommandOutput/)

</details>
<details>
<summary>
Expand Down
46 changes: 46 additions & 0 deletions clients/client-rds/src/RDS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,11 +487,21 @@ import {
DescribeValidDBInstanceModificationsCommandInput,
DescribeValidDBInstanceModificationsCommandOutput,
} from "./commands/DescribeValidDBInstanceModificationsCommand";
import {
DisableHttpEndpointCommand,
DisableHttpEndpointCommandInput,
DisableHttpEndpointCommandOutput,
} from "./commands/DisableHttpEndpointCommand";
import {
DownloadDBLogFilePortionCommand,
DownloadDBLogFilePortionCommandInput,
DownloadDBLogFilePortionCommandOutput,
} from "./commands/DownloadDBLogFilePortionCommand";
import {
EnableHttpEndpointCommand,
EnableHttpEndpointCommandInput,
EnableHttpEndpointCommandOutput,
} from "./commands/EnableHttpEndpointCommand";
import {
FailoverDBClusterCommand,
FailoverDBClusterCommandInput,
Expand Down Expand Up @@ -872,7 +882,9 @@ const commands = {
DescribeSourceRegionsCommand,
DescribeTenantDatabasesCommand,
DescribeValidDBInstanceModificationsCommand,
DisableHttpEndpointCommand,
DownloadDBLogFilePortionCommand,
EnableHttpEndpointCommand,
FailoverDBClusterCommand,
FailoverGlobalClusterCommand,
ListTagsForResourceCommand,
Expand Down Expand Up @@ -2554,6 +2566,23 @@ export interface RDS {
cb: (err: any, data?: DescribeValidDBInstanceModificationsCommandOutput) => void
): void;

/**
* @see {@link DisableHttpEndpointCommand}
*/
disableHttpEndpoint(
args: DisableHttpEndpointCommandInput,
options?: __HttpHandlerOptions
): Promise<DisableHttpEndpointCommandOutput>;
disableHttpEndpoint(
args: DisableHttpEndpointCommandInput,
cb: (err: any, data?: DisableHttpEndpointCommandOutput) => void
): void;
disableHttpEndpoint(
args: DisableHttpEndpointCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DisableHttpEndpointCommandOutput) => void
): void;

/**
* @see {@link DownloadDBLogFilePortionCommand}
*/
Expand All @@ -2571,6 +2600,23 @@ export interface RDS {
cb: (err: any, data?: DownloadDBLogFilePortionCommandOutput) => void
): void;

/**
* @see {@link EnableHttpEndpointCommand}
*/
enableHttpEndpoint(
args: EnableHttpEndpointCommandInput,
options?: __HttpHandlerOptions
): Promise<EnableHttpEndpointCommandOutput>;
enableHttpEndpoint(
args: EnableHttpEndpointCommandInput,
cb: (err: any, data?: EnableHttpEndpointCommandOutput) => void
): void;
enableHttpEndpoint(
args: EnableHttpEndpointCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: EnableHttpEndpointCommandOutput) => void
): void;

/**
* @see {@link FailoverDBClusterCommand}
*/
Expand Down
9 changes: 9 additions & 0 deletions clients/client-rds/src/RDSClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,15 @@ import {
DescribeValidDBInstanceModificationsCommandInput,
DescribeValidDBInstanceModificationsCommandOutput,
} from "./commands/DescribeValidDBInstanceModificationsCommand";
import {
DisableHttpEndpointCommandInput,
DisableHttpEndpointCommandOutput,
} from "./commands/DisableHttpEndpointCommand";
import {
DownloadDBLogFilePortionCommandInput,
DownloadDBLogFilePortionCommandOutput,
} from "./commands/DownloadDBLogFilePortionCommand";
import { EnableHttpEndpointCommandInput, EnableHttpEndpointCommandOutput } from "./commands/EnableHttpEndpointCommand";
import { FailoverDBClusterCommandInput, FailoverDBClusterCommandOutput } from "./commands/FailoverDBClusterCommand";
import {
FailoverGlobalClusterCommandInput,
Expand Down Expand Up @@ -662,7 +667,9 @@ export type ServiceInputTypes =
| DescribeSourceRegionsCommandInput
| DescribeTenantDatabasesCommandInput
| DescribeValidDBInstanceModificationsCommandInput
| DisableHttpEndpointCommandInput
| DownloadDBLogFilePortionCommandInput
| EnableHttpEndpointCommandInput
| FailoverDBClusterCommandInput
| FailoverGlobalClusterCommandInput
| ListTagsForResourceCommandInput
Expand Down Expand Up @@ -821,7 +828,9 @@ export type ServiceOutputTypes =
| DescribeSourceRegionsCommandOutput
| DescribeTenantDatabasesCommandOutput
| DescribeValidDBInstanceModificationsCommandOutput
| DisableHttpEndpointCommandOutput
| DownloadDBLogFilePortionCommandOutput
| EnableHttpEndpointCommandOutput
| FailoverDBClusterCommandOutput
| FailoverGlobalClusterCommandOutput
| ListTagsForResourceCommandOutput
Expand Down
152 changes: 152 additions & 0 deletions clients/client-rds/src/commands/DisableHttpEndpointCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
// 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,
SMITHY_CONTEXT_KEY,
} from "@smithy/types";

import { DisableHttpEndpointRequest, DisableHttpEndpointResponse } from "../models/models_1";
import { de_DisableHttpEndpointCommand, se_DisableHttpEndpointCommand } from "../protocols/Aws_query";
import { RDSClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RDSClient";

/**
* @public
*/
export { __MetadataBearer, $Command };
/**
* @public
*
* The input for {@link DisableHttpEndpointCommand}.
*/
export interface DisableHttpEndpointCommandInput extends DisableHttpEndpointRequest {}
/**
* @public
*
* The output of {@link DisableHttpEndpointCommand}.
*/
export interface DisableHttpEndpointCommandOutput extends DisableHttpEndpointResponse, __MetadataBearer {}

/**
* @public
* <p>Disables the HTTP endpoint for the specified DB cluster. Disabling this endpoint disables RDS Data API.</p>
* <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html">Using RDS Data API</a> in the
* <i>Amazon Aurora User Guide</i>.</p>
* <note>
* <p>This operation applies only to Aurora PostgreSQL Serverless v2 and provisioned DB clusters. To disable the HTTP endpoint for Aurora Serverless v1 DB clusters,
* use the <code>EnableHttpEndpoint</code> parameter of the <code>ModifyDBCluster</code> operation.</p>
* </note>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { RDSClient, DisableHttpEndpointCommand } from "@aws-sdk/client-rds"; // ES Modules import
* // const { RDSClient, DisableHttpEndpointCommand } = require("@aws-sdk/client-rds"); // CommonJS import
* const client = new RDSClient(config);
* const input = { // DisableHttpEndpointRequest
* ResourceArn: "STRING_VALUE", // required
* };
* const command = new DisableHttpEndpointCommand(input);
* const response = await client.send(command);
* // { // DisableHttpEndpointResponse
* // ResourceArn: "STRING_VALUE",
* // HttpEndpointEnabled: true || false,
* // };
*
* ```
*
* @param DisableHttpEndpointCommandInput - {@link DisableHttpEndpointCommandInput}
* @returns {@link DisableHttpEndpointCommandOutput}
* @see {@link DisableHttpEndpointCommandInput} for command's `input` shape.
* @see {@link DisableHttpEndpointCommandOutput} for command's `response` shape.
* @see {@link RDSClientResolvedConfig | config} for RDSClient's `config` shape.
*
* @throws {@link InvalidResourceStateFault} (client fault)
* <p>The operation can't be performed because another operation is in progress.</p>
*
* @throws {@link ResourceNotFoundFault} (client fault)
* <p>The specified resource ID was not found.</p>
*
* @throws {@link RDSServiceException}
* <p>Base exception class for all service exceptions from RDS service.</p>
*
*/
export class DisableHttpEndpointCommand extends $Command<
DisableHttpEndpointCommandInput,
DisableHttpEndpointCommandOutput,
RDSClientResolvedConfig
> {
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: DisableHttpEndpointCommandInput) {
super();
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: RDSClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<DisableHttpEndpointCommandInput, DisableHttpEndpointCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, DisableHttpEndpointCommand.getEndpointParameterInstructions())
);

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

const { logger } = configuration;
const clientName = "RDSClient";
const commandName = "DisableHttpEndpointCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
[SMITHY_CONTEXT_KEY]: {
service: "AmazonRDSv19",
operation: "DisableHttpEndpoint",
},
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

/**
* @internal
*/
private serialize(input: DisableHttpEndpointCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return se_DisableHttpEndpointCommand(input, context);
}

/**
* @internal
*/
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<DisableHttpEndpointCommandOutput> {
return de_DisableHttpEndpointCommand(output, context);
}
}
Loading

0 comments on commit ee4406c

Please sign in to comment.