updateGlobalTableSettings method

Future<UpdateGlobalTableSettingsOutput> updateGlobalTableSettings({
  1. required String globalTableName,
  2. BillingMode? globalTableBillingMode,
  3. List<GlobalTableGlobalSecondaryIndexSettingsUpdate>? globalTableGlobalSecondaryIndexSettingsUpdate,
  4. AutoScalingSettingsUpdate? globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate,
  5. int? globalTableProvisionedWriteCapacityUnits,
  6. List<ReplicaSettingsUpdate>? replicaSettingsUpdate,
})

Updates settings for a global table.

To determine which version you're using, see Determining the global table version you are using. To update existing global tables from version 2017.11.29 (Legacy) to version 2019.11.21 (Current), see Upgrading global tables.

May throw GlobalTableNotFoundException. May throw IndexNotFoundException. May throw InternalServerError. May throw InvalidEndpointException. May throw LimitExceededException. May throw ReplicaNotFoundException. May throw ResourceInUseException.

Parameter globalTableName : The name of the global table

Parameter globalTableBillingMode : The billing mode of the global table. If GlobalTableBillingMode is not specified, the global table defaults to PROVISIONED capacity billing mode.

  • PROVISIONED - We recommend using PROVISIONED for predictable workloads. PROVISIONED sets the billing mode to Provisioned capacity mode.
  • PAY_PER_REQUEST - We recommend using PAY_PER_REQUEST for unpredictable workloads. PAY_PER_REQUEST sets the billing mode to On-demand capacity mode.

Parameter globalTableGlobalSecondaryIndexSettingsUpdate : Represents the settings of a global secondary index for a global table that will be modified.

Parameter globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate : Auto scaling settings for managing provisioned write capacity for the global table.

Parameter globalTableProvisionedWriteCapacityUnits : The maximum number of writes consumed per second before DynamoDB returns a ThrottlingException.

Parameter replicaSettingsUpdate : Represents the settings for a global table in a Region that will be modified.

Implementation

Future<UpdateGlobalTableSettingsOutput> updateGlobalTableSettings({
  required String globalTableName,
  BillingMode? globalTableBillingMode,
  List<GlobalTableGlobalSecondaryIndexSettingsUpdate>?
      globalTableGlobalSecondaryIndexSettingsUpdate,
  AutoScalingSettingsUpdate?
      globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate,
  int? globalTableProvisionedWriteCapacityUnits,
  List<ReplicaSettingsUpdate>? replicaSettingsUpdate,
}) async {
  _s.validateNumRange(
    'globalTableProvisionedWriteCapacityUnits',
    globalTableProvisionedWriteCapacityUnits,
    1,
    1152921504606846976,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'DynamoDB_20120810.UpdateGlobalTableSettings'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'GlobalTableName': globalTableName,
      if (globalTableBillingMode != null)
        'GlobalTableBillingMode': globalTableBillingMode.value,
      if (globalTableGlobalSecondaryIndexSettingsUpdate != null)
        'GlobalTableGlobalSecondaryIndexSettingsUpdate':
            globalTableGlobalSecondaryIndexSettingsUpdate,
      if (globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate !=
          null)
        'GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate':
            globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate,
      if (globalTableProvisionedWriteCapacityUnits != null)
        'GlobalTableProvisionedWriteCapacityUnits':
            globalTableProvisionedWriteCapacityUnits,
      if (replicaSettingsUpdate != null)
        'ReplicaSettingsUpdate': replicaSettingsUpdate,
    },
  );

  return UpdateGlobalTableSettingsOutput.fromJson(jsonResponse.body);
}