failoverGlobalCluster method
Initiates the failover process for a Neptune global database.
A failover for a Neptune global database promotes one of secondary read-only DB clusters to be the primary DB cluster and demotes the primary DB cluster to being a secondary (read-only) DB cluster. In other words, the role of the current primary DB cluster and the selected target secondary DB cluster are switched. The selected secondary DB cluster assumes full read/write capabilities for the Neptune global database.
May throw DBClusterNotFoundFault.
May throw GlobalClusterNotFoundFault.
May throw InvalidDBClusterStateFault.
May throw InvalidGlobalClusterStateFault.
Parameter globalClusterIdentifier :
Identifier of the Neptune global database that should be failed over. The
identifier is the unique key assigned by the user when the Neptune global
database was created. In other words, it's the name of the global database
that you want to fail over.
Constraints: Must match the identifier of an existing Neptune global database.
Parameter targetDbClusterIdentifier :
The Amazon Resource Name (ARN) of the secondary Neptune DB cluster that
you want to promote to primary for the global database.
Parameter allowDataLoss :
Specifies whether to allow data loss for this global database cluster
operation. Allowing data loss triggers a global failover operation.
If you don't specify AllowDataLoss, the global database
cluster operation defaults to a switchover.
Constraints: Can't be specified together with the Switchover
parameter.
Parameter switchover :
Specifies whether to switch over this global database cluster.
Constraints: Can't be specified together with the
AllowDataLoss parameter.
Implementation
Future<FailoverGlobalClusterResult> failoverGlobalCluster({
required String globalClusterIdentifier,
required String targetDbClusterIdentifier,
bool? allowDataLoss,
bool? switchover,
}) async {
final $request = <String, String>{
'GlobalClusterIdentifier': globalClusterIdentifier,
'TargetDbClusterIdentifier': targetDbClusterIdentifier,
if (allowDataLoss != null) 'AllowDataLoss': allowDataLoss.toString(),
if (switchover != null) 'Switchover': switchover.toString(),
};
final $result = await _protocol.send(
$request,
action: 'FailoverGlobalCluster',
version: '2014-10-31',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
resultWrapper: 'FailoverGlobalClusterResult',
);
return FailoverGlobalClusterResult.fromXml($result);
}