restoreFromDbBackup method

Future<RestoreFromDbBackupOutput> restoreFromDbBackup({
  1. required String dbBackupId,
  2. required String name,
  3. List<DbBackupConfiguration>? dbBackupConfigurations,
  4. ResourceDeploymentType? deploymentType,
  5. String? kmsKeyId,
  6. LogDeliveryConfiguration? logDeliveryConfiguration,
  7. MaintenanceSchedule? maintenanceSchedule,
  8. NetworkType? networkType,
  9. int? port,
  10. bool? publiclyAccessible,
  11. RestoreMode? restoreMode,
  12. DateTime? restoreToTime,
  13. Map<String, String>? tags,
  14. List<String>? vpcSecurityGroupIds,
  15. List<String>? vpcSubnetIds,
})

Restores a Timestream for InfluxDB resource from a backup. By default, a new resource is created. You can optionally restore to the same resource using the REPLACE_EXISTING restore mode.

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

Parameter dbBackupId : The identifier of the backup to restore from.

Parameter name : The name of the new resource to create from the restore. If restoring to an existing resource, the name must match the existing resource name.

Parameter dbBackupConfigurations : A list of backup configurations to apply to the restored resource.

Parameter deploymentType : Specifies the deployment type of the restored resource. Valid values are SINGLE_AZ, WITH_MULTIAZ_STANDBY, and MULTI_NODE_READ_REPLICAS.

Parameter kmsKeyId : The Amazon Web Services KMS key identifier to use for encryption of the restored resource. Can be a key ID, key ARN, alias name, or alias ARN.

Parameter logDeliveryConfiguration : Configuration for sending InfluxDB engine logs to the specified S3 bucket for the restored resource.

Parameter maintenanceSchedule : The maintenance schedule for the restored resource.

Parameter networkType : Specifies the network type of the restored resource. Valid values are IPV4 and DUAL.

Parameter port : The port number on which the restored InfluxDB resource accepts connections.

Parameter publiclyAccessible : Specifies whether the restored resource is publicly accessible.

Parameter restoreMode : Specifies whether to restore to a new resource or replace the existing resource. Valid values are NEW_RESOURCE (default) and REPLACE_EXISTING.

Parameter restoreToTime : The point in time to restore to, for continuous backups. Must be within the backup's retention window.

Parameter tags : A list of key-value pairs to associate with the restored resource.

Parameter vpcSecurityGroupIds : A list of VPC security group IDs for the restored resource. If not specified, the restored resource uses the same security groups as the backup.

Parameter vpcSubnetIds : A list of VPC subnet IDs for the restored resource. If not specified, the restored resource uses the same subnets as the backup.

Implementation

Future<RestoreFromDbBackupOutput> restoreFromDbBackup({
  required String dbBackupId,
  required String name,
  List<DbBackupConfiguration>? dbBackupConfigurations,
  ResourceDeploymentType? deploymentType,
  String? kmsKeyId,
  LogDeliveryConfiguration? logDeliveryConfiguration,
  MaintenanceSchedule? maintenanceSchedule,
  NetworkType? networkType,
  int? port,
  bool? publiclyAccessible,
  RestoreMode? restoreMode,
  DateTime? restoreToTime,
  Map<String, String>? tags,
  List<String>? vpcSecurityGroupIds,
  List<String>? vpcSubnetIds,
}) async {
  _s.validateNumRange(
    'port',
    port,
    1024,
    65535,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AmazonTimestreamInfluxDB.RestoreFromDbBackup'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'dbBackupId': dbBackupId,
      'name': name,
      if (dbBackupConfigurations != null)
        'dbBackupConfigurations': dbBackupConfigurations,
      if (deploymentType != null) 'deploymentType': deploymentType.value,
      if (kmsKeyId != null) 'kmsKeyId': kmsKeyId,
      if (logDeliveryConfiguration != null)
        'logDeliveryConfiguration': logDeliveryConfiguration,
      if (maintenanceSchedule != null)
        'maintenanceSchedule': maintenanceSchedule,
      if (networkType != null) 'networkType': networkType.value,
      if (port != null) 'port': port,
      if (publiclyAccessible != null)
        'publiclyAccessible': publiclyAccessible,
      if (restoreMode != null) 'restoreMode': restoreMode.value,
      if (restoreToTime != null)
        'restoreToTime': iso8601ToJson(restoreToTime),
      if (tags != null) 'tags': tags,
      if (vpcSecurityGroupIds != null)
        'vpcSecurityGroupIds': vpcSecurityGroupIds,
      if (vpcSubnetIds != null) 'vpcSubnetIds': vpcSubnetIds,
    },
  );

  return RestoreFromDbBackupOutput.fromJson(jsonResponse.body);
}