Skip to content

start_copy_job async

start_copy_job(
    recovery_point_arn: ARN,
    source_backup_vault_name: BackupVaultName,
    destination_backup_vault_arn: ARN,
    iam_role_arn: IAMRoleArn,
    *,
    config_overrides: Optional[AsyncBackupClientConfig] = None,
    idempotency_token: Optional[string] = None,
    lifecycle: Optional[Lifecycle] = None,
) -> StartCopyJobOutput

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.

Parameters:

  • recovery_point_arn (ARN) –

    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.

  • source_backup_vault_name (BackupVaultName) –

    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.

  • destination_backup_vault_arn (ARN) –

    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.

  • iam_role_arn (IAMRoleArn) –

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

  • idempotency_token (Optional[string], default: None ) –

    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.

Raises:

Source code in docs_src/capo_backup/_services/async_backup.py
async def start_copy_job(
    self,
    recovery_point_arn: "capo_backup.types.arn.ARN",
    source_backup_vault_name: "capo_backup.types.backup_vault_name.BackupVaultName",
    destination_backup_vault_arn: "capo_backup.types.arn.ARN",
    iam_role_arn: "capo_backup.types.iam_role_arn.IAMRoleArn",
    *,
    config_overrides: Optional[AsyncBackupClientConfig] = None,
    idempotency_token: Optional["capo_backup.types.string.string"] = None,
    lifecycle: Optional["capo_backup.types.lifecycle.Lifecycle"] = None,
) -> "capo_backup.types.start_copy_job_output.StartCopyJobOutput":
    """<p>Starts a job to create a one-time copy of the specified resource.</p> <p>Does not support continuous backups.</p> <p>See <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/recov-point-create-a-copy.html#backup-copy-retry">Copy job retry</a> for information on how Backup retries copy job operations.</p>

    Args:
        recovery_point_arn: <p>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. </p>
        source_backup_vault_name: <p>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.</p>
        destination_backup_vault_arn: <p>An Amazon Resource Name (ARN) that uniquely identifies a destination backup vault to copy to; for example, <code>arn:aws:backup:us-east-1:123456789012:backup-vault:aBackupVault</code>.</p>
        iam_role_arn: <p>Specifies the IAM role ARN used to copy the target recovery point; for example, <code>arn:aws:iam::123456789012:role/S3Access</code>.</p>
        idempotency_token: <p>A customer-chosen string that you can use to distinguish between otherwise identical calls to <code>StartCopyJob</code>. Retrying a successful request with the same idempotency token results in a success message with no action taken.</p>

    Raises:
        capo_backup.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>Indicates that something is wrong with a parameter's value. For example, the value is out of range.</p>
        capo_backup.errors.invalid_request_exception.InvalidRequestException: <p>Indicates that something is wrong with the input to the request. For example, a parameter is of the wrong type.</p>
        capo_backup.errors.limit_exceeded_exception.LimitExceededException: <p>A limit in the request has been exceeded; for example, a maximum number of items allowed in a request.</p>
        capo_backup.errors.missing_parameter_value_exception.MissingParameterValueException: <p>Indicates that a required parameter is missing.</p>
        capo_backup.errors.resource_not_found_exception.ResourceNotFoundException: <p>A resource that is required for the action doesn't exist.</p>
        capo_backup.errors.service_unavailable_exception.ServiceUnavailableException: <p>The request failed due to a temporary failure of the server.</p>
        capo_backup.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_backup.types.start_copy_job_input.StartCopyJobInput]",
    ) -> AsyncOperationResponse[
        "capo_backup.types.start_copy_job_output.StartCopyJobOutput"
    ]:
        import capo_backup._operations.cryo_controller_user_manager.start_copy_job

        (
            output,
            http_response,
        ) = await capo_backup._operations.cryo_controller_user_manager.start_copy_job.async_start_copy_job(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartCopyJob")
    )
    input_: capo_backup.types.start_copy_job_input.StartCopyJobInput = {
        "recovery_point_arn": recovery_point_arn,
        "source_backup_vault_name": source_backup_vault_name,
        "destination_backup_vault_arn": destination_backup_vault_arn,
        "iam_role_arn": iam_role_arn,
    }
    if idempotency_token is None:
        idempotency_token = str(uuid.uuid4())
    input_["idempotency_token"] = idempotency_token
    if lifecycle is not None:
        input_["lifecycle"] = lifecycle

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output