Skip to content

Commit

Permalink
feat(client-rds): Added support for deleted clusters PiTR.
Browse files Browse the repository at this point in the history
  • Loading branch information
awstools committed Aug 1, 2023
1 parent 913c968 commit ee7aaf6
Show file tree
Hide file tree
Showing 22 changed files with 1,639 additions and 370 deletions.
16 changes: 16 additions & 0 deletions clients/client-rds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,14 @@ DeleteDBCluster

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rds/classes/deletedbclustercommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rds/interfaces/deletedbclustercommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rds/interfaces/deletedbclustercommandoutput.html)

</details>
<details>
<summary>
DeleteDBClusterAutomatedBackup
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rds/classes/deletedbclusterautomatedbackupcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rds/interfaces/deletedbclusterautomatedbackupcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rds/interfaces/deletedbclusterautomatedbackupcommandoutput.html)

</details>
<details>
<summary>
Expand Down Expand Up @@ -663,6 +671,14 @@ DescribeCertificates

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rds/classes/describecertificatescommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rds/interfaces/describecertificatescommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rds/interfaces/describecertificatescommandoutput.html)

</details>
<details>
<summary>
DescribeDBClusterAutomatedBackups
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rds/classes/describedbclusterautomatedbackupscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rds/interfaces/describedbclusterautomatedbackupscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rds/interfaces/describedbclusterautomatedbackupscommandoutput.html)

</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 @@ -162,6 +162,11 @@ import {
DeleteCustomDBEngineVersionCommandInput,
DeleteCustomDBEngineVersionCommandOutput,
} from "./commands/DeleteCustomDBEngineVersionCommand";
import {
DeleteDBClusterAutomatedBackupCommand,
DeleteDBClusterAutomatedBackupCommandInput,
DeleteDBClusterAutomatedBackupCommandOutput,
} from "./commands/DeleteDBClusterAutomatedBackupCommand";
import {
DeleteDBClusterCommand,
DeleteDBClusterCommandInput,
Expand Down Expand Up @@ -257,6 +262,11 @@ import {
DescribeCertificatesCommandInput,
DescribeCertificatesCommandOutput,
} from "./commands/DescribeCertificatesCommand";
import {
DescribeDBClusterAutomatedBackupsCommand,
DescribeDBClusterAutomatedBackupsCommandInput,
DescribeDBClusterAutomatedBackupsCommandOutput,
} from "./commands/DescribeDBClusterAutomatedBackupsCommand";
import {
DescribeDBClusterBacktracksCommand,
DescribeDBClusterBacktracksCommandInput,
Expand Down Expand Up @@ -743,6 +753,7 @@ const commands = {
DeleteBlueGreenDeploymentCommand,
DeleteCustomDBEngineVersionCommand,
DeleteDBClusterCommand,
DeleteDBClusterAutomatedBackupCommand,
DeleteDBClusterEndpointCommand,
DeleteDBClusterParameterGroupCommand,
DeleteDBClusterSnapshotCommand,
Expand All @@ -761,6 +772,7 @@ const commands = {
DescribeAccountAttributesCommand,
DescribeBlueGreenDeploymentsCommand,
DescribeCertificatesCommand,
DescribeDBClusterAutomatedBackupsCommand,
DescribeDBClusterBacktracksCommand,
DescribeDBClusterEndpointsCommand,
DescribeDBClusterParameterGroupsCommand,
Expand Down Expand Up @@ -1397,6 +1409,23 @@ export interface RDS {
cb: (err: any, data?: DeleteDBClusterCommandOutput) => void
): void;

/**
* @see {@link DeleteDBClusterAutomatedBackupCommand}
*/
deleteDBClusterAutomatedBackup(
args: DeleteDBClusterAutomatedBackupCommandInput,
options?: __HttpHandlerOptions
): Promise<DeleteDBClusterAutomatedBackupCommandOutput>;
deleteDBClusterAutomatedBackup(
args: DeleteDBClusterAutomatedBackupCommandInput,
cb: (err: any, data?: DeleteDBClusterAutomatedBackupCommandOutput) => void
): void;
deleteDBClusterAutomatedBackup(
args: DeleteDBClusterAutomatedBackupCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DeleteDBClusterAutomatedBackupCommandOutput) => void
): void;

/**
* @see {@link DeleteDBClusterEndpointCommand}
*/
Expand Down Expand Up @@ -1697,6 +1726,23 @@ export interface RDS {
cb: (err: any, data?: DescribeCertificatesCommandOutput) => void
): void;

/**
* @see {@link DescribeDBClusterAutomatedBackupsCommand}
*/
describeDBClusterAutomatedBackups(
args: DescribeDBClusterAutomatedBackupsCommandInput,
options?: __HttpHandlerOptions
): Promise<DescribeDBClusterAutomatedBackupsCommandOutput>;
describeDBClusterAutomatedBackups(
args: DescribeDBClusterAutomatedBackupsCommandInput,
cb: (err: any, data?: DescribeDBClusterAutomatedBackupsCommandOutput) => void
): void;
describeDBClusterAutomatedBackups(
args: DescribeDBClusterAutomatedBackupsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DescribeDBClusterAutomatedBackupsCommandOutput) => void
): void;

/**
* @see {@link DescribeDBClusterBacktracksCommand}
*/
Expand Down
12 changes: 12 additions & 0 deletions clients/client-rds/src/RDSClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ import {
DeleteCustomDBEngineVersionCommandInput,
DeleteCustomDBEngineVersionCommandOutput,
} from "./commands/DeleteCustomDBEngineVersionCommand";
import {
DeleteDBClusterAutomatedBackupCommandInput,
DeleteDBClusterAutomatedBackupCommandOutput,
} from "./commands/DeleteDBClusterAutomatedBackupCommand";
import { DeleteDBClusterCommandInput, DeleteDBClusterCommandOutput } from "./commands/DeleteDBClusterCommand";
import {
DeleteDBClusterEndpointCommandInput,
Expand Down Expand Up @@ -205,6 +209,10 @@ import {
DescribeCertificatesCommandInput,
DescribeCertificatesCommandOutput,
} from "./commands/DescribeCertificatesCommand";
import {
DescribeDBClusterAutomatedBackupsCommandInput,
DescribeDBClusterAutomatedBackupsCommandOutput,
} from "./commands/DescribeDBClusterAutomatedBackupsCommand";
import {
DescribeDBClusterBacktracksCommandInput,
DescribeDBClusterBacktracksCommandOutput,
Expand Down Expand Up @@ -551,6 +559,7 @@ export type ServiceInputTypes =
| CreateOptionGroupCommandInput
| DeleteBlueGreenDeploymentCommandInput
| DeleteCustomDBEngineVersionCommandInput
| DeleteDBClusterAutomatedBackupCommandInput
| DeleteDBClusterCommandInput
| DeleteDBClusterEndpointCommandInput
| DeleteDBClusterParameterGroupCommandInput
Expand All @@ -570,6 +579,7 @@ export type ServiceInputTypes =
| DescribeAccountAttributesCommandInput
| DescribeBlueGreenDeploymentsCommandInput
| DescribeCertificatesCommandInput
| DescribeDBClusterAutomatedBackupsCommandInput
| DescribeDBClusterBacktracksCommandInput
| DescribeDBClusterEndpointsCommandInput
| DescribeDBClusterParameterGroupsCommandInput
Expand Down Expand Up @@ -697,6 +707,7 @@ export type ServiceOutputTypes =
| CreateOptionGroupCommandOutput
| DeleteBlueGreenDeploymentCommandOutput
| DeleteCustomDBEngineVersionCommandOutput
| DeleteDBClusterAutomatedBackupCommandOutput
| DeleteDBClusterCommandOutput
| DeleteDBClusterEndpointCommandOutput
| DeleteDBClusterParameterGroupCommandOutput
Expand All @@ -716,6 +727,7 @@ export type ServiceOutputTypes =
| DescribeAccountAttributesCommandOutput
| DescribeBlueGreenDeploymentsCommandOutput
| DescribeCertificatesCommandOutput
| DescribeDBClusterAutomatedBackupsCommandOutput
| DescribeDBClusterBacktracksCommandOutput
| DescribeDBClusterEndpointsCommandOutput
| DescribeDBClusterParameterGroupsCommandOutput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export interface CopyDBClusterSnapshotCommandOutput extends CopyDBClusterSnapsho
* // ],
* // DBSystemId: "STRING_VALUE",
* // StorageType: "STRING_VALUE",
* // DbClusterResourceId: "STRING_VALUE",
* // },
* // };
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export interface CreateDBClusterSnapshotCommandOutput extends CreateDBClusterSna
* // ],
* // DBSystemId: "STRING_VALUE",
* // StorageType: "STRING_VALUE",
* // DbClusterResourceId: "STRING_VALUE",
* // },
* // };
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
// 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,
} from "@smithy/types";

import { DeleteDBClusterAutomatedBackupMessage, DeleteDBClusterAutomatedBackupResult } from "../models/models_0";
import {
de_DeleteDBClusterAutomatedBackupCommand,
se_DeleteDBClusterAutomatedBackupCommand,
} from "../protocols/Aws_query";
import { RDSClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RDSClient";

/**
* @public
*/
export { __MetadataBearer, $Command };
/**
* @public
*
* The input for {@link DeleteDBClusterAutomatedBackupCommand}.
*/
export interface DeleteDBClusterAutomatedBackupCommandInput extends DeleteDBClusterAutomatedBackupMessage {}
/**
* @public
*
* The output of {@link DeleteDBClusterAutomatedBackupCommand}.
*/
export interface DeleteDBClusterAutomatedBackupCommandOutput
extends DeleteDBClusterAutomatedBackupResult,
__MetadataBearer {}

/**
* @public
* <p>Deletes automated backups using the <code>DbClusterResourceId</code> value of the source DB cluster or the Amazon
* Resource Name (ARN) of the automated backups.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { RDSClient, DeleteDBClusterAutomatedBackupCommand } from "@aws-sdk/client-rds"; // ES Modules import
* // const { RDSClient, DeleteDBClusterAutomatedBackupCommand } = require("@aws-sdk/client-rds"); // CommonJS import
* const client = new RDSClient(config);
* const input = { // DeleteDBClusterAutomatedBackupMessage
* DbClusterResourceId: "STRING_VALUE", // required
* };
* const command = new DeleteDBClusterAutomatedBackupCommand(input);
* const response = await client.send(command);
* // { // DeleteDBClusterAutomatedBackupResult
* // DBClusterAutomatedBackup: { // DBClusterAutomatedBackup
* // Engine: "STRING_VALUE",
* // VpcId: "STRING_VALUE",
* // DBClusterAutomatedBackupsArn: "STRING_VALUE",
* // DBClusterIdentifier: "STRING_VALUE",
* // RestoreWindow: { // RestoreWindow
* // EarliestTime: new Date("TIMESTAMP"),
* // LatestTime: new Date("TIMESTAMP"),
* // },
* // MasterUsername: "STRING_VALUE",
* // DbClusterResourceId: "STRING_VALUE",
* // Region: "STRING_VALUE",
* // LicenseModel: "STRING_VALUE",
* // Status: "STRING_VALUE",
* // IAMDatabaseAuthenticationEnabled: true || false,
* // ClusterCreateTime: new Date("TIMESTAMP"),
* // StorageEncrypted: true || false,
* // AllocatedStorage: Number("int"),
* // EngineVersion: "STRING_VALUE",
* // DBClusterArn: "STRING_VALUE",
* // BackupRetentionPeriod: Number("int"),
* // EngineMode: "STRING_VALUE",
* // AvailabilityZones: [ // AvailabilityZones
* // "STRING_VALUE",
* // ],
* // Port: Number("int"),
* // KmsKeyId: "STRING_VALUE",
* // StorageType: "STRING_VALUE",
* // Iops: Number("int"),
* // },
* // };
*
* ```
*
* @param DeleteDBClusterAutomatedBackupCommandInput - {@link DeleteDBClusterAutomatedBackupCommandInput}
* @returns {@link DeleteDBClusterAutomatedBackupCommandOutput}
* @see {@link DeleteDBClusterAutomatedBackupCommandInput} for command's `input` shape.
* @see {@link DeleteDBClusterAutomatedBackupCommandOutput} for command's `response` shape.
* @see {@link RDSClientResolvedConfig | config} for RDSClient's `config` shape.
*
* @throws {@link DBClusterAutomatedBackupNotFoundFault} (client fault)
* <p>No automated backup for this DB cluster was found.</p>
*
* @throws {@link InvalidDBClusterAutomatedBackupStateFault} (client fault)
* <p>The automated backup is in an invalid state.
* For example, this automated backup is associated with an active cluster.</p>
*
* @throws {@link RDSServiceException}
* <p>Base exception class for all service exceptions from RDS service.</p>
*
*/
export class DeleteDBClusterAutomatedBackupCommand extends $Command<
DeleteDBClusterAutomatedBackupCommandInput,
DeleteDBClusterAutomatedBackupCommandOutput,
RDSClientResolvedConfig
> {
// 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" },
};
}

/**
* @public
*/
constructor(readonly input: DeleteDBClusterAutomatedBackupCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

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

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

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

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

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

// Start section: command_body_extra
// End section: command_body_extra
}
5 changes: 5 additions & 0 deletions clients/client-rds/src/commands/DeleteDBClusterCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export interface DeleteDBClusterCommandOutput extends DeleteDBClusterResult, __M
* DBClusterIdentifier: "STRING_VALUE", // required
* SkipFinalSnapshot: true || false,
* FinalDBSnapshotIdentifier: "STRING_VALUE",
* DeleteAutomatedBackups: true || false,
* };
* const command = new DeleteDBClusterCommand(input);
* const response = await client.send(command);
Expand Down Expand Up @@ -225,6 +226,10 @@ export interface DeleteDBClusterCommandOutput extends DeleteDBClusterResult, __M
* @see {@link DeleteDBClusterCommandOutput} for command's `response` shape.
* @see {@link RDSClientResolvedConfig | config} for RDSClient's `config` shape.
*
* @throws {@link DBClusterAutomatedBackupQuotaExceededFault} (client fault)
* <p>The quota for retained automated backups was exceeded. This prevents you from retaining any additional automated
* backups. The retained automated backups quota is the same as your DB cluster quota.</p>
*
* @throws {@link DBClusterNotFoundFault} (client fault)
* <p>
* <code>DBClusterIdentifier</code> doesn't refer to an existing DB cluster.</p>
Expand Down
Loading

0 comments on commit ee7aaf6

Please sign in to comment.