updateKeyspace method
- required String keyspaceName,
- required ReplicationSpecification replicationSpecification,
- ClientSideTimestamps? clientSideTimestamps,
Adds a new Amazon Web Services Region to the keyspace. You can add a new
Region to a keyspace that is either a single or a multi-Region keyspace.
Amazon Keyspaces is going to replicate all tables in the keyspace to the
new Region. To successfully replicate all tables to the new Region, they
must use client-side timestamps for conflict resolution. To enable
client-side timestamps, specify clientSideTimestamps.status =
enabled when invoking the API. For more information about
client-side timestamps, see Client-side
timestamps in Amazon Keyspaces in the Amazon Keyspaces Developer
Guide.
To add a Region to a keyspace using the UpdateKeyspace API,
the IAM principal needs permissions for the following IAM actions:
-
cassandra:Alter -
cassandra:AlterMultiRegionResource -
cassandra:Create -
cassandra:CreateMultiRegionResource -
cassandra:Select -
cassandra:SelectMultiRegionResource -
cassandra:Modify -
cassandra:ModifyMultiRegionResource
-
application-autoscaling:RegisterScalableTarget -
application-autoscaling:DeregisterScalableTarget -
application-autoscaling:DescribeScalableTargets -
application-autoscaling:PutScalingPolicy -
application-autoscaling:DescribeScalingPolicies
UpdateKeyspace API, the IAM principal also needs
permissions to create a service-linked role with the following elements:
-
iam:CreateServiceLinkedRole- The action the principal can perform. -
arn:aws:iam::*:role/aws-service-role/replication.cassandra.amazonaws.com/AWSServiceRoleForKeyspacesReplication- The resource that the action can be performed on. -
iam:AWSServiceName: replication.cassandra.amazonaws.com- The only Amazon Web Services service that this role can be attached to is Amazon Keyspaces.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ValidationException.
Parameter keyspaceName :
The name of the keyspace.
Implementation
Future<UpdateKeyspaceResponse> updateKeyspace({
required String keyspaceName,
required ReplicationSpecification replicationSpecification,
ClientSideTimestamps? clientSideTimestamps,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'KeyspacesService.UpdateKeyspace'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'keyspaceName': keyspaceName,
'replicationSpecification': replicationSpecification,
if (clientSideTimestamps != null)
'clientSideTimestamps': clientSideTimestamps,
},
);
return UpdateKeyspaceResponse.fromJson(jsonResponse.body);
}