|
| 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 { commonParams } from "../endpoint/EndpointParameters"; |
| 8 | +import { SwitchoverGlobalClusterMessage, SwitchoverGlobalClusterResult } from "../models/models_0"; |
| 9 | +import { NeptuneClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../NeptuneClient"; |
| 10 | +import { de_SwitchoverGlobalClusterCommand, se_SwitchoverGlobalClusterCommand } 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 SwitchoverGlobalClusterCommand}. |
| 21 | + */ |
| 22 | +export interface SwitchoverGlobalClusterCommandInput extends SwitchoverGlobalClusterMessage {} |
| 23 | +/** |
| 24 | + * @public |
| 25 | + * |
| 26 | + * The output of {@link SwitchoverGlobalClusterCommand}. |
| 27 | + */ |
| 28 | +export interface SwitchoverGlobalClusterCommandOutput extends SwitchoverGlobalClusterResult, __MetadataBearer {} |
| 29 | + |
| 30 | +/** |
| 31 | + * <p>Switches over the specified secondary DB cluster to be the new primary DB cluster in the global |
| 32 | + * database cluster. Switchover operations were previously called "managed planned failovers."</p> |
| 33 | + * <p>Promotes the specified secondary cluster to assume full read/write capabilities and demotes the current |
| 34 | + * primary cluster to a secondary (read-only) cluster, maintaining the original replication topology. All secondary |
| 35 | + * clusters are synchronized with the primary at the beginning of the process so the new primary continues operations |
| 36 | + * for the global database without losing any data. Your database is unavailable for a short time while the primary |
| 37 | + * and selected secondary clusters are assuming their new roles.</p> |
| 38 | + * <note> |
| 39 | + * <p>This operation is intended for controlled environments, for operations such as "regional rotation" or |
| 40 | + * to fall back to the original primary after a global database failover.</p> |
| 41 | + * </note> |
| 42 | + * @example |
| 43 | + * Use a bare-bones client and the command you need to make an API call. |
| 44 | + * ```javascript |
| 45 | + * import { NeptuneClient, SwitchoverGlobalClusterCommand } from "@aws-sdk/client-neptune"; // ES Modules import |
| 46 | + * // const { NeptuneClient, SwitchoverGlobalClusterCommand } = require("@aws-sdk/client-neptune"); // CommonJS import |
| 47 | + * const client = new NeptuneClient(config); |
| 48 | + * const input = { // SwitchoverGlobalClusterMessage |
| 49 | + * GlobalClusterIdentifier: "STRING_VALUE", // required |
| 50 | + * TargetDbClusterIdentifier: "STRING_VALUE", // required |
| 51 | + * }; |
| 52 | + * const command = new SwitchoverGlobalClusterCommand(input); |
| 53 | + * const response = await client.send(command); |
| 54 | + * // { // SwitchoverGlobalClusterResult |
| 55 | + * // GlobalCluster: { // GlobalCluster |
| 56 | + * // GlobalClusterIdentifier: "STRING_VALUE", |
| 57 | + * // GlobalClusterResourceId: "STRING_VALUE", |
| 58 | + * // GlobalClusterArn: "STRING_VALUE", |
| 59 | + * // Status: "STRING_VALUE", |
| 60 | + * // Engine: "STRING_VALUE", |
| 61 | + * // EngineVersion: "STRING_VALUE", |
| 62 | + * // StorageEncrypted: true || false, |
| 63 | + * // DeletionProtection: true || false, |
| 64 | + * // GlobalClusterMembers: [ // GlobalClusterMemberList |
| 65 | + * // { // GlobalClusterMember |
| 66 | + * // DBClusterArn: "STRING_VALUE", |
| 67 | + * // Readers: [ // ReadersArnList |
| 68 | + * // "STRING_VALUE", |
| 69 | + * // ], |
| 70 | + * // IsWriter: true || false, |
| 71 | + * // }, |
| 72 | + * // ], |
| 73 | + * // FailoverState: { // FailoverState |
| 74 | + * // Status: "pending" || "failing-over" || "cancelling", |
| 75 | + * // FromDbClusterArn: "STRING_VALUE", |
| 76 | + * // ToDbClusterArn: "STRING_VALUE", |
| 77 | + * // IsDataLossAllowed: true || false, |
| 78 | + * // }, |
| 79 | + * // }, |
| 80 | + * // }; |
| 81 | + * |
| 82 | + * ``` |
| 83 | + * |
| 84 | + * @param SwitchoverGlobalClusterCommandInput - {@link SwitchoverGlobalClusterCommandInput} |
| 85 | + * @returns {@link SwitchoverGlobalClusterCommandOutput} |
| 86 | + * @see {@link SwitchoverGlobalClusterCommandInput} for command's `input` shape. |
| 87 | + * @see {@link SwitchoverGlobalClusterCommandOutput} for command's `response` shape. |
| 88 | + * @see {@link NeptuneClientResolvedConfig | config} for NeptuneClient's `config` shape. |
| 89 | + * |
| 90 | + * @throws {@link DBClusterNotFoundFault} (client fault) |
| 91 | + * <p> |
| 92 | + * <i>DBClusterIdentifier</i> does not refer to an existing DB cluster.</p> |
| 93 | + * |
| 94 | + * @throws {@link GlobalClusterNotFoundFault} (client fault) |
| 95 | + * <p>The <code>GlobalClusterIdentifier</code> doesn't refer to an existing global database cluster. </p> |
| 96 | + * |
| 97 | + * @throws {@link InvalidDBClusterStateFault} (client fault) |
| 98 | + * <p>The DB cluster is not in a valid state.</p> |
| 99 | + * |
| 100 | + * @throws {@link InvalidGlobalClusterStateFault} (client fault) |
| 101 | + * <p>The global cluster is in an invalid state and can't perform the requested operation. </p> |
| 102 | + * |
| 103 | + * @throws {@link NeptuneServiceException} |
| 104 | + * <p>Base exception class for all service exceptions from Neptune service.</p> |
| 105 | + * |
| 106 | + * |
| 107 | + * @public |
| 108 | + */ |
| 109 | +export class SwitchoverGlobalClusterCommand extends $Command |
| 110 | + .classBuilder< |
| 111 | + SwitchoverGlobalClusterCommandInput, |
| 112 | + SwitchoverGlobalClusterCommandOutput, |
| 113 | + NeptuneClientResolvedConfig, |
| 114 | + ServiceInputTypes, |
| 115 | + ServiceOutputTypes |
| 116 | + >() |
| 117 | + .ep(commonParams) |
| 118 | + .m(function (this: any, Command: any, cs: any, config: NeptuneClientResolvedConfig, o: any) { |
| 119 | + return [ |
| 120 | + getSerdePlugin(config, this.serialize, this.deserialize), |
| 121 | + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), |
| 122 | + ]; |
| 123 | + }) |
| 124 | + .s("AmazonRDSv19", "SwitchoverGlobalCluster", {}) |
| 125 | + .n("NeptuneClient", "SwitchoverGlobalClusterCommand") |
| 126 | + .f(void 0, void 0) |
| 127 | + .ser(se_SwitchoverGlobalClusterCommand) |
| 128 | + .de(de_SwitchoverGlobalClusterCommand) |
| 129 | + .build() { |
| 130 | + /** @internal type navigation helper, not in runtime. */ |
| 131 | + protected declare static __types: { |
| 132 | + api: { |
| 133 | + input: SwitchoverGlobalClusterMessage; |
| 134 | + output: SwitchoverGlobalClusterResult; |
| 135 | + }; |
| 136 | + sdk: { |
| 137 | + input: SwitchoverGlobalClusterCommandInput; |
| 138 | + output: SwitchoverGlobalClusterCommandOutput; |
| 139 | + }; |
| 140 | + }; |
| 141 | +} |
0 commit comments