updateDbInstance method

Future<UpdateDbInstanceOutput> updateDbInstance({
  1. required String identifier,
  2. int? allocatedStorage,
  3. DbInstanceType? dbInstanceType,
  4. String? dbParameterGroupIdentifier,
  5. DbStorageType? dbStorageType,
  6. DeploymentType? deploymentType,
  7. LogDeliveryConfiguration? logDeliveryConfiguration,
  8. MaintenanceSchedule? maintenanceSchedule,
  9. int? port,
})

Updates a Timestream for InfluxDB DB instance.

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

Parameter identifier : The id of the DB instance.

Parameter allocatedStorage : The amount of storage to allocate for your DB storage type (in gibibytes).

Parameter dbInstanceType : The Timestream for InfluxDB DB instance type to run InfluxDB on.

Parameter dbParameterGroupIdentifier : The id of the DB parameter group to assign to your DB instance. DB parameter groups specify how the database is configured. For example, DB parameter groups can specify the limit for query concurrency.

Parameter dbStorageType : The Timestream for InfluxDB DB storage type that InfluxDB stores data on.

Parameter deploymentType : Specifies whether the DB instance will be deployed as a standalone instance or with a Multi-AZ standby for high availability.

Parameter logDeliveryConfiguration : Configuration for sending InfluxDB engine logs to send to specified S3 bucket.

Parameter maintenanceSchedule : Specifies the maintenance schedule for the DB instance, including the preferred maintenance window and timezone.

Parameter port : The port number on which InfluxDB accepts connections.

If you change the Port value, your database restarts immediately.

Valid Values: 1024-65535

Default: 8086

Constraints: The value can't be 2375-2376, 7788-7799, 8090, or 51678-51680

Implementation

Future<UpdateDbInstanceOutput> updateDbInstance({
  required String identifier,
  int? allocatedStorage,
  DbInstanceType? dbInstanceType,
  String? dbParameterGroupIdentifier,
  DbStorageType? dbStorageType,
  DeploymentType? deploymentType,
  LogDeliveryConfiguration? logDeliveryConfiguration,
  MaintenanceSchedule? maintenanceSchedule,
  int? port,
}) async {
  _s.validateNumRange(
    'allocatedStorage',
    allocatedStorage,
    20,
    15360,
  );
  _s.validateNumRange(
    'port',
    port,
    1024,
    65535,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AmazonTimestreamInfluxDB.UpdateDbInstance'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'identifier': identifier,
      if (allocatedStorage != null) 'allocatedStorage': allocatedStorage,
      if (dbInstanceType != null) 'dbInstanceType': dbInstanceType.value,
      if (dbParameterGroupIdentifier != null)
        'dbParameterGroupIdentifier': dbParameterGroupIdentifier,
      if (dbStorageType != null) 'dbStorageType': dbStorageType.value,
      if (deploymentType != null) 'deploymentType': deploymentType.value,
      if (logDeliveryConfiguration != null)
        'logDeliveryConfiguration': logDeliveryConfiguration,
      if (maintenanceSchedule != null)
        'maintenanceSchedule': maintenanceSchedule,
      if (port != null) 'port': port,
    },
  );

  return UpdateDbInstanceOutput.fromJson(jsonResponse.body);
}