startBackupJob method

Future<StartBackupJobOutput> startBackupJob({
  1. required String backupVaultName,
  2. required String iamRoleArn,
  3. required String resourceArn,
  4. Map<String, String>? backupOptions,
  5. int? completeWindowMinutes,
  6. String? idempotencyToken,
  7. Lifecycle? lifecycle,
  8. Map<String, String>? recoveryPointTags,
  9. int? startWindowMinutes,
})

Starts an on-demand backup job for the specified resource.

May throw ResourceNotFoundException. May throw InvalidParameterValueException. May throw MissingParameterValueException. May throw InvalidRequestException. May throw ServiceUnavailableException. May throw LimitExceededException.

Parameter backupVaultName : The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.

Parameter iamRoleArn : Specifies the IAM role ARN used to create the target recovery point; for example, arn:aws:iam::123456789012:role/S3Access.

Parameter resourceArn : An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the resource type.

Parameter backupOptions : Specifies the backup option for a selected resource. This option is only available for Windows VSS backup jobs.

Valid values: Set to "WindowsVSS”:“enabled" to enable WindowsVSS backup option and create a VSS Windows backup. Set to “WindowsVSS”:”disabled” to create a regular backup. The WindowsVSS option is not enabled by default.

Parameter completeWindowMinutes : A value in minutes after a backup job is successfully started before it must be completed or it will be canceled by AWS Backup. This value is optional.

Parameter idempotencyToken : A customer chosen string that can be used to distinguish between calls to StartBackupJob.

Parameter lifecycle : The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. AWS Backup will transition and expire backups automatically according to the lifecycle that you define.

Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “expire after days” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.

Parameter recoveryPointTags : To help organize your resources, you can assign your own metadata to the resources that you create. Each tag is a key-value pair.

Parameter startWindowMinutes : A value in minutes after a backup is scheduled before a job will be canceled if it doesn't start successfully. This value is optional.

Implementation

Future<StartBackupJobOutput> startBackupJob({
  required String backupVaultName,
  required String iamRoleArn,
  required String resourceArn,
  Map<String, String>? backupOptions,
  int? completeWindowMinutes,
  String? idempotencyToken,
  Lifecycle? lifecycle,
  Map<String, String>? recoveryPointTags,
  int? startWindowMinutes,
}) async {
  ArgumentError.checkNotNull(backupVaultName, 'backupVaultName');
  ArgumentError.checkNotNull(iamRoleArn, 'iamRoleArn');
  ArgumentError.checkNotNull(resourceArn, 'resourceArn');
  final $payload = <String, dynamic>{
    'BackupVaultName': backupVaultName,
    'IamRoleArn': iamRoleArn,
    'ResourceArn': resourceArn,
    if (backupOptions != null) 'BackupOptions': backupOptions,
    if (completeWindowMinutes != null)
      'CompleteWindowMinutes': completeWindowMinutes,
    if (idempotencyToken != null) 'IdempotencyToken': idempotencyToken,
    if (lifecycle != null) 'Lifecycle': lifecycle,
    if (recoveryPointTags != null) 'RecoveryPointTags': recoveryPointTags,
    if (startWindowMinutes != null) 'StartWindowMinutes': startWindowMinutes,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/backup-jobs',
    exceptionFnMap: _exceptionFns,
  );
  return StartBackupJobOutput.fromJson(response);
}