|
| 1 | +// smithy-typescript generated code |
| 2 | +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; |
| 3 | +import { getSerdePlugin } from "@smithy/middleware-serde"; |
| 4 | +import { Command as $Command } from "@smithy/smithy-client"; |
| 5 | +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; |
| 6 | + |
| 7 | +import { DocDBClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DocDBClient"; |
| 8 | +import { commonParams } from "../endpoint/EndpointParameters"; |
| 9 | +import { FailoverGlobalClusterMessage, FailoverGlobalClusterResult } from "../models/models_0"; |
| 10 | +import { de_FailoverGlobalClusterCommand, se_FailoverGlobalClusterCommand } from "../protocols/Aws_query"; |
| 11 | + |
| 12 | +/** |
| 13 | + * @public |
| 14 | + */ |
| 15 | +export type { __MetadataBearer }; |
| 16 | +export { $Command }; |
| 17 | +/** |
| 18 | + * @public |
| 19 | + * |
| 20 | + * The input for {@link FailoverGlobalClusterCommand}. |
| 21 | + */ |
| 22 | +export interface FailoverGlobalClusterCommandInput extends FailoverGlobalClusterMessage {} |
| 23 | +/** |
| 24 | + * @public |
| 25 | + * |
| 26 | + * The output of {@link FailoverGlobalClusterCommand}. |
| 27 | + */ |
| 28 | +export interface FailoverGlobalClusterCommandOutput extends FailoverGlobalClusterResult, __MetadataBearer {} |
| 29 | + |
| 30 | +/** |
| 31 | + * <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> |
| 32 | + * <p>Use this operation to respond to an unplanned event, such as a regional disaster in the primary region. |
| 33 | + * Failing over can result in a loss of write transaction data that wasn't replicated to the chosen secondary before the failover event occurred. |
| 34 | + * 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> |
| 35 | + * @example |
| 36 | + * Use a bare-bones client and the command you need to make an API call. |
| 37 | + * ```javascript |
| 38 | + * import { DocDBClient, FailoverGlobalClusterCommand } from "@aws-sdk/client-docdb"; // ES Modules import |
| 39 | + * // const { DocDBClient, FailoverGlobalClusterCommand } = require("@aws-sdk/client-docdb"); // CommonJS import |
| 40 | + * const client = new DocDBClient(config); |
| 41 | + * const input = { // FailoverGlobalClusterMessage |
| 42 | + * GlobalClusterIdentifier: "STRING_VALUE", // required |
| 43 | + * TargetDbClusterIdentifier: "STRING_VALUE", // required |
| 44 | + * AllowDataLoss: true || false, |
| 45 | + * Switchover: true || false, |
| 46 | + * }; |
| 47 | + * const command = new FailoverGlobalClusterCommand(input); |
| 48 | + * const response = await client.send(command); |
| 49 | + * // { // FailoverGlobalClusterResult |
| 50 | + * // GlobalCluster: { // GlobalCluster |
| 51 | + * // GlobalClusterIdentifier: "STRING_VALUE", |
| 52 | + * // GlobalClusterResourceId: "STRING_VALUE", |
| 53 | + * // GlobalClusterArn: "STRING_VALUE", |
| 54 | + * // Status: "STRING_VALUE", |
| 55 | + * // Engine: "STRING_VALUE", |
| 56 | + * // EngineVersion: "STRING_VALUE", |
| 57 | + * // DatabaseName: "STRING_VALUE", |
| 58 | + * // StorageEncrypted: true || false, |
| 59 | + * // DeletionProtection: true || false, |
| 60 | + * // GlobalClusterMembers: [ // GlobalClusterMemberList |
| 61 | + * // { // GlobalClusterMember |
| 62 | + * // DBClusterArn: "STRING_VALUE", |
| 63 | + * // Readers: [ // ReadersArnList |
| 64 | + * // "STRING_VALUE", |
| 65 | + * // ], |
| 66 | + * // IsWriter: true || false, |
| 67 | + * // }, |
| 68 | + * // ], |
| 69 | + * // }, |
| 70 | + * // }; |
| 71 | + * |
| 72 | + * ``` |
| 73 | + * |
| 74 | + * @param FailoverGlobalClusterCommandInput - {@link FailoverGlobalClusterCommandInput} |
| 75 | + * @returns {@link FailoverGlobalClusterCommandOutput} |
| 76 | + * @see {@link FailoverGlobalClusterCommandInput} for command's `input` shape. |
| 77 | + * @see {@link FailoverGlobalClusterCommandOutput} for command's `response` shape. |
| 78 | + * @see {@link DocDBClientResolvedConfig | config} for DocDBClient's `config` shape. |
| 79 | + * |
| 80 | + * @throws {@link DBClusterNotFoundFault} (client fault) |
| 81 | + * <p> |
| 82 | + * <code>DBClusterIdentifier</code> doesn't refer to an existing cluster. </p> |
| 83 | + * |
| 84 | + * @throws {@link GlobalClusterNotFoundFault} (client fault) |
| 85 | + * <p>The <code>GlobalClusterIdentifier</code> doesn't refer to an existing global cluster.</p> |
| 86 | + * |
| 87 | + * @throws {@link InvalidDBClusterStateFault} (client fault) |
| 88 | + * <p>The cluster isn't in a valid state.</p> |
| 89 | + * |
| 90 | + * @throws {@link InvalidGlobalClusterStateFault} (client fault) |
| 91 | + * <p>The requested operation can't be performed while the cluster is in this state.</p> |
| 92 | + * |
| 93 | + * @throws {@link DocDBServiceException} |
| 94 | + * <p>Base exception class for all service exceptions from DocDB service.</p> |
| 95 | + * |
| 96 | + * @public |
| 97 | + */ |
| 98 | +export class FailoverGlobalClusterCommand extends $Command |
| 99 | + .classBuilder< |
| 100 | + FailoverGlobalClusterCommandInput, |
| 101 | + FailoverGlobalClusterCommandOutput, |
| 102 | + DocDBClientResolvedConfig, |
| 103 | + ServiceInputTypes, |
| 104 | + ServiceOutputTypes |
| 105 | + >() |
| 106 | + .ep({ |
| 107 | + ...commonParams, |
| 108 | + }) |
| 109 | + .m(function (this: any, Command: any, cs: any, config: DocDBClientResolvedConfig, o: any) { |
| 110 | + return [ |
| 111 | + getSerdePlugin(config, this.serialize, this.deserialize), |
| 112 | + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), |
| 113 | + ]; |
| 114 | + }) |
| 115 | + .s("AmazonRDSv19", "FailoverGlobalCluster", {}) |
| 116 | + .n("DocDBClient", "FailoverGlobalClusterCommand") |
| 117 | + .f(void 0, void 0) |
| 118 | + .ser(se_FailoverGlobalClusterCommand) |
| 119 | + .de(de_FailoverGlobalClusterCommand) |
| 120 | + .build() {} |
0 commit comments