startCopyJob method

Future<StartCopyJobOutput> startCopyJob({
  1. required String destinationBackupVaultArn,
  2. required String iamRoleArn,
  3. required String recoveryPointArn,
  4. required String sourceBackupVaultName,
  5. String? idempotencyToken,
  6. Lifecycle? lifecycle,
})

Starts a job to create a one-time copy of the specified resource.

Does not support continuous backups.

See Copy job retry for information on how Backup retries copy job operations.

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

Parameter destinationBackupVaultArn : An Amazon Resource Name (ARN) that uniquely identifies a destination backup vault to copy to; for example, arn:aws:backup:us-east-1:123456789012:backup-vault:aBackupVault.

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

Parameter recoveryPointArn : An ARN that uniquely identifies a recovery point to use for the copy job; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

Parameter sourceBackupVaultName : The name of a logical source container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Amazon Web Services Region where they are created.

Parameter idempotencyToken : A customer-chosen string that you can use to distinguish between otherwise identical calls to StartCopyJob. Retrying a successful request with the same idempotency token results in a success message with no action taken.

Implementation

Future<StartCopyJobOutput> startCopyJob({
  required String destinationBackupVaultArn,
  required String iamRoleArn,
  required String recoveryPointArn,
  required String sourceBackupVaultName,
  String? idempotencyToken,
  Lifecycle? lifecycle,
}) async {
  final $payload = <String, dynamic>{
    'DestinationBackupVaultArn': destinationBackupVaultArn,
    'IamRoleArn': iamRoleArn,
    'RecoveryPointArn': recoveryPointArn,
    'SourceBackupVaultName': sourceBackupVaultName,
    'IdempotencyToken': idempotencyToken ?? _s.generateIdempotencyToken(),
    if (lifecycle != null) 'Lifecycle': lifecycle,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/copy-jobs',
    exceptionFnMap: _exceptionFns,
  );
  return StartCopyJobOutput.fromJson(response);
}