-
Notifications
You must be signed in to change notification settings - Fork 579
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-docdb): This release adds Global Cluster Failover capabil…
…ity which enables you to change your global cluster's primary AWS region, the region that serves writes, during a regional outage. Performing a failover action preserves your Global Cluster setup.
- Loading branch information
awstools
committed
Aug 15, 2024
1 parent
2e20e95
commit 62c6973
Showing
8 changed files
with
400 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
clients/client-docdb/src/commands/FailoverGlobalClusterCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
// 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 { DocDBClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DocDBClient"; | ||
import { commonParams } from "../endpoint/EndpointParameters"; | ||
import { FailoverGlobalClusterMessage, FailoverGlobalClusterResult } from "../models/models_0"; | ||
import { de_FailoverGlobalClusterCommand, se_FailoverGlobalClusterCommand } from "../protocols/Aws_query"; | ||
|
||
/** | ||
* @public | ||
*/ | ||
export type { __MetadataBearer }; | ||
export { $Command }; | ||
/** | ||
* @public | ||
* | ||
* The input for {@link FailoverGlobalClusterCommand}. | ||
*/ | ||
export interface FailoverGlobalClusterCommandInput extends FailoverGlobalClusterMessage {} | ||
/** | ||
* @public | ||
* | ||
* The output of {@link FailoverGlobalClusterCommand}. | ||
*/ | ||
export interface FailoverGlobalClusterCommandOutput extends FailoverGlobalClusterResult, __MetadataBearer {} | ||
|
||
/** | ||
* <p>Promotes the specified secondary DB cluster to be the primary DB cluster in the global cluster when failing over a global cluster occurs.</p> | ||
* <p>Use this operation to respond to an unplanned event, such as a regional disaster in the primary region. | ||
* Failing over can result in a loss of write transaction data that wasn't replicated to the chosen secondary before the failover event occurred. | ||
* However, the recovery process that promotes a DB instance on the chosen seconday DB cluster to be the primary writer DB instance guarantees that the data is in a transactionally consistent state.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { DocDBClient, FailoverGlobalClusterCommand } from "@aws-sdk/client-docdb"; // ES Modules import | ||
* // const { DocDBClient, FailoverGlobalClusterCommand } = require("@aws-sdk/client-docdb"); // CommonJS import | ||
* const client = new DocDBClient(config); | ||
* const input = { // FailoverGlobalClusterMessage | ||
* GlobalClusterIdentifier: "STRING_VALUE", // required | ||
* TargetDbClusterIdentifier: "STRING_VALUE", // required | ||
* AllowDataLoss: true || false, | ||
* Switchover: true || false, | ||
* }; | ||
* const command = new FailoverGlobalClusterCommand(input); | ||
* const response = await client.send(command); | ||
* // { // FailoverGlobalClusterResult | ||
* // GlobalCluster: { // GlobalCluster | ||
* // GlobalClusterIdentifier: "STRING_VALUE", | ||
* // GlobalClusterResourceId: "STRING_VALUE", | ||
* // GlobalClusterArn: "STRING_VALUE", | ||
* // Status: "STRING_VALUE", | ||
* // Engine: "STRING_VALUE", | ||
* // EngineVersion: "STRING_VALUE", | ||
* // DatabaseName: "STRING_VALUE", | ||
* // StorageEncrypted: true || false, | ||
* // DeletionProtection: true || false, | ||
* // GlobalClusterMembers: [ // GlobalClusterMemberList | ||
* // { // GlobalClusterMember | ||
* // DBClusterArn: "STRING_VALUE", | ||
* // Readers: [ // ReadersArnList | ||
* // "STRING_VALUE", | ||
* // ], | ||
* // IsWriter: true || false, | ||
* // }, | ||
* // ], | ||
* // }, | ||
* // }; | ||
* | ||
* ``` | ||
* | ||
* @param FailoverGlobalClusterCommandInput - {@link FailoverGlobalClusterCommandInput} | ||
* @returns {@link FailoverGlobalClusterCommandOutput} | ||
* @see {@link FailoverGlobalClusterCommandInput} for command's `input` shape. | ||
* @see {@link FailoverGlobalClusterCommandOutput} for command's `response` shape. | ||
* @see {@link DocDBClientResolvedConfig | config} for DocDBClient's `config` shape. | ||
* | ||
* @throws {@link DBClusterNotFoundFault} (client fault) | ||
* <p> | ||
* <code>DBClusterIdentifier</code> doesn't refer to an existing cluster. </p> | ||
* | ||
* @throws {@link GlobalClusterNotFoundFault} (client fault) | ||
* <p>The <code>GlobalClusterIdentifier</code> doesn't refer to an existing global cluster.</p> | ||
* | ||
* @throws {@link InvalidDBClusterStateFault} (client fault) | ||
* <p>The cluster isn't in a valid state.</p> | ||
* | ||
* @throws {@link InvalidGlobalClusterStateFault} (client fault) | ||
* <p>The requested operation can't be performed while the cluster is in this state.</p> | ||
* | ||
* @throws {@link DocDBServiceException} | ||
* <p>Base exception class for all service exceptions from DocDB service.</p> | ||
* | ||
* @public | ||
*/ | ||
export class FailoverGlobalClusterCommand extends $Command | ||
.classBuilder< | ||
FailoverGlobalClusterCommandInput, | ||
FailoverGlobalClusterCommandOutput, | ||
DocDBClientResolvedConfig, | ||
ServiceInputTypes, | ||
ServiceOutputTypes | ||
>() | ||
.ep({ | ||
...commonParams, | ||
}) | ||
.m(function (this: any, Command: any, cs: any, config: DocDBClientResolvedConfig, o: any) { | ||
return [ | ||
getSerdePlugin(config, this.serialize, this.deserialize), | ||
getEndpointPlugin(config, Command.getEndpointParameterInstructions()), | ||
]; | ||
}) | ||
.s("AmazonRDSv19", "FailoverGlobalCluster", {}) | ||
.n("DocDBClient", "FailoverGlobalClusterCommand") | ||
.f(void 0, void 0) | ||
.ser(se_FailoverGlobalClusterCommand) | ||
.de(de_FailoverGlobalClusterCommand) | ||
.build() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.