Skip to content

start_restore_job async

start_restore_job(
    recovery_point_arn: ARN,
    metadata: Metadata,
    *,
    config_overrides: Optional[AsyncBackupClientConfig] = None,
    iam_role_arn: Optional[IAMRoleArn] = None,
    idempotency_token: Optional[string] = None,
    resource_type: Optional[ResourceType] = None,
    copy_source_tags_to_restored_resource: Optional[Boolean2] = None,
) -> StartRestoreJobOutput

Recovers the saved resource identified by an Amazon Resource Name (ARN).

Parameters:

  • recovery_point_arn (ARN) –

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

  • metadata (Metadata) –

    A set of metadata key-value pairs.

    You can get configuration metadata about a resource at the time it was backed up by calling GetRecoveryPointRestoreMetadata. However, values in addition to those provided by GetRecoveryPointRestoreMetadata might be required to restore a resource. For example, you might need to provide a new resource name if the original already exists.

    For more information about the metadata for each resource, see the following:

  • iam_role_arn (Optional[IAMRoleArn], default: None ) –

    The Amazon Resource Name (ARN) of the IAM role that Backup uses to create the target resource; 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 StartRestoreJob. Retrying a successful request with the same idempotency token results in a success message with no action taken.

  • resource_type (Optional[ResourceType], default: None ) –

    Starts a job to restore a recovery point for one of the following resources:

    • Aurora - Amazon Aurora

    • DocumentDB - Amazon DocumentDB

    • CloudFormation - CloudFormation

    • DynamoDB - Amazon DynamoDB

    • EBS - Amazon Elastic Block Store

    • EC2 - Amazon Elastic Compute Cloud

    • EFS - Amazon Elastic File System

    • EKS - Amazon Elastic Kubernetes Service

    • FSx - Amazon FSx

    • Neptune - Amazon Neptune

    • RDS - Amazon Relational Database Service

    • Redshift - Amazon Redshift

    • Storage Gateway - Storage Gateway

    • S3 - Amazon Simple Storage Service

    • Timestream - Amazon Timestream

    • VirtualMachine - Virtual machines

  • copy_source_tags_to_restored_resource (Optional[Boolean2], default: None ) –

    This is an optional parameter. If this equals True, tags included in the backup will be copied to the restored resource.

    This can only be applied to backups created through Backup.

Raises:

Source code in docs_src/capo_backup/_services/async_backup.py
async def start_restore_job(
    self,
    recovery_point_arn: "capo_backup.types.arn.ARN",
    metadata: "capo_backup.types.metadata.Metadata",
    *,
    config_overrides: Optional[AsyncBackupClientConfig] = None,
    iam_role_arn: Optional["capo_backup.types.iam_role_arn.IAMRoleArn"] = None,
    idempotency_token: Optional["capo_backup.types.string.string"] = None,
    resource_type: Optional["capo_backup.types.resource_type.ResourceType"] = None,
    copy_source_tags_to_restored_resource: Optional[
        "capo_backup.types.boolean2.Boolean2"
    ] = None,
) -> "capo_backup.types.start_restore_job_output.StartRestoreJobOutput":
    """<p>Recovers the saved resource identified by an Amazon Resource Name (ARN).</p>

    Args:
        recovery_point_arn: <p>An ARN that uniquely identifies a recovery point; for example, <code>arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45</code>.</p>
        metadata: <p>A set of metadata key-value pairs.</p> <p>You can get configuration metadata about a resource at the time it was backed up by calling <code>GetRecoveryPointRestoreMetadata</code>. However, values in addition to those provided by <code>GetRecoveryPointRestoreMetadata</code> might be required to restore a resource. For example, you might need to provide a new resource name if the original already exists.</p> <p>For more information about the metadata for each resource, see the following:</p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/restoring-aur.html#aur-restore-cli">Metadata for Amazon Aurora</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/restoring-docdb.html#docdb-restore-cli">Metadata for Amazon DocumentDB</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/restore-application-stacks.html#restoring-cfn-cli">Metadata for CloudFormation</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/restoring-dynamodb.html#ddb-restore-cli">Metadata for Amazon DynamoDB</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/restoring-ebs.html#ebs-restore-cli"> Metadata for Amazon EBS</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/restoring-ec2.html#restoring-ec2-cli">Metadata for Amazon EC2</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/restoring-efs.html#efs-restore-cli">Metadata for Amazon EFS</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/restoring-eks.html#eks-restore-backup-section">Metadata for Amazon EKS</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/restoring-fsx.html#fsx-restore-cli">Metadata for Amazon FSx</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/restoring-nep.html#nep-restore-cli">Metadata for Amazon Neptune</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/restoring-rds.html#rds-restore-cli">Metadata for Amazon RDS</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/redshift-restores.html#redshift-restore-api">Metadata for Amazon Redshift</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/restoring-storage-gateway.html#restoring-sgw-cli">Metadata for Storage Gateway</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/restoring-s3.html#s3-restore-cli">Metadata for Amazon S3</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/timestream-restore.html#timestream-restore-api">Metadata for Amazon Timestream</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/restoring-vm.html#vm-restore-cli">Metadata for virtual machines</a> </p> </li> </ul>
        iam_role_arn: <p>The Amazon Resource Name (ARN) of the IAM role that Backup uses to create the target resource; 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>StartRestoreJob</code>. Retrying a successful request with the same idempotency token results in a success message with no action taken.</p>
        resource_type: <p>Starts a job to restore a recovery point for one of the following resources:</p> <ul> <li> <p> <code>Aurora</code> - Amazon Aurora</p> </li> <li> <p> <code>DocumentDB</code> - Amazon DocumentDB</p> </li> <li> <p> <code>CloudFormation</code> - CloudFormation</p> </li> <li> <p> <code>DynamoDB</code> - Amazon DynamoDB</p> </li> <li> <p> <code>EBS</code> - Amazon Elastic Block Store</p> </li> <li> <p> <code>EC2</code> - Amazon Elastic Compute Cloud</p> </li> <li> <p> <code>EFS</code> - Amazon Elastic File System</p> </li> <li> <p> <code>EKS</code> - Amazon Elastic Kubernetes Service</p> </li> <li> <p> <code>FSx</code> - Amazon FSx</p> </li> <li> <p> <code>Neptune</code> - Amazon Neptune</p> </li> <li> <p> <code>RDS</code> - Amazon Relational Database Service</p> </li> <li> <p> <code>Redshift</code> - Amazon Redshift</p> </li> <li> <p> <code>Storage Gateway</code> - Storage Gateway</p> </li> <li> <p> <code>S3</code> - Amazon Simple Storage Service</p> </li> <li> <p> <code>Timestream</code> - Amazon Timestream</p> </li> <li> <p> <code>VirtualMachine</code> - Virtual machines</p> </li> </ul>
        copy_source_tags_to_restored_resource: <p>This is an optional parameter. If this equals <code>True</code>, tags included in the backup will be copied to the restored resource.</p> <p>This can only be applied to backups created through Backup.</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.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_restore_job_input.StartRestoreJobInput]",
    ) -> AsyncOperationResponse[
        "capo_backup.types.start_restore_job_output.StartRestoreJobOutput"
    ]:
        import capo_backup._operations.cryo_controller_user_manager.start_restore_job

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

    def _redact_input(
        input_: "capo_backup.types.start_restore_job_input.StartRestoreJobInput",
    ) -> dict[str, Any]:
        import capo_backup.types.start_restore_job_input

        return capo_backup.types.start_restore_job_input.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("StartRestoreJob", redact_input=_redact_input),
    )
    input_: capo_backup.types.start_restore_job_input.StartRestoreJobInput = {
        "recovery_point_arn": recovery_point_arn,
        "metadata": metadata,
    }
    if iam_role_arn is not None:
        input_["iam_role_arn"] = iam_role_arn
    if idempotency_token is None:
        idempotency_token = str(uuid.uuid4())
    input_["idempotency_token"] = idempotency_token
    if resource_type is not None:
        input_["resource_type"] = resource_type
    if copy_source_tags_to_restored_resource is not None:
        input_["copy_source_tags_to_restored_resource"] = (
            copy_source_tags_to_restored_resource
        )

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