switchoverAutonomousDatabase method

Future<SwitchoverAutonomousDatabaseOutput> switchoverAutonomousDatabase({
  1. required String autonomousDatabaseId,
  2. String? peerDbArn,
})

Performs a switchover of the specified Autonomous Database to a standby peer database.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter autonomousDatabaseId : The unique identifier of the Autonomous Database to switch over.

Parameter peerDbArn : The Amazon Resource Name (ARN) of the peer Autonomous Database to switch over to.

Implementation

Future<SwitchoverAutonomousDatabaseOutput> switchoverAutonomousDatabase({
  required String autonomousDatabaseId,
  String? peerDbArn,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'Odb.SwitchoverAutonomousDatabase'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'autonomousDatabaseId': autonomousDatabaseId,
      if (peerDbArn != null) 'peerDbArn': peerDbArn,
    },
  );

  return SwitchoverAutonomousDatabaseOutput.fromJson(jsonResponse.body);
}