All Products
Search
Document Center

Database Backup:CreateSandboxInstance

Last Updated:Apr 04, 2023

Creates a sandbox instance.

Operation Description

Before you call this operation, you must enable the sandbox feature for the database instance. For more information, see Use the emergency recovery feature of an ApsaraDB RDS for MySQL instance or Create a sandbox instance for emergency disaster recovery of a self-managed MySQL database. This operation is available only in Database Backup (DBS) API of the 2021-01-01 version.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociation operation
dbs:CreateSandboxInstanceRead
    All Resources
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
BackupPlanIdstringYes

The ID of the backup schedule. You can call the DescribeBackupPlanList operation to obtain the ID of the backup schedule.

NoteIf your instance is an ApsaraDB RDS for MySQL instance, you can configure automatic access to a data source to automatically add the instance to DBS and obtain the ID of the backup schedule.
1hxxxx8xxxxxa
SandboxInstanceNamestringNo

The custom name of the sandbox instance.

test_sandbox
VpcIdstringNo

The ID of the virtual private cloud (VPC) that is used to connect to the sandbox instance. If you want to connect to the sandbox instance by using Elastic Compute Service (ECS) instances, you must set this parameter to the VPC in which the ECS instances reside.

NoteYou can set this parameter if you want to use it in a recovery drill scenario.
vpc-bp1dxxxxxjy0xxxxx1xxp
VpcSwitchIdstringNo

The ID of the VSwitch that is used to connect to the sandbox instance.

vsw-bp1bxxxxxumxxxxxwxxx9
BackupSetIdstringNo

The ID of the backup set to be restored, which is the point in time when a snapshot was created. You can call the DescribeSandboxBackupSets operation to obtain the ID.

NoteYou need to specify only one of the BackupSetId and RestoreTime parameters.
1hxxxx8xxxxxa_20210829064228
RestoreTimestringNo

The point in time of the sandbox instance to be restored. You can call the DescribeSandboxRecoveryTime operation to view the recoverable time range. Specify the time in the format of yyyy-MM-ddTHH:mm:ssZ. The time must be in UTC.

2021-08-01T12:01:01Z
SandboxSpecificationstringNo

The specifications of the sandbox instance. Valid values:

  • MYSQL_1C_1M_SD: 1 CPU core and 1 GB of memory.
  • MYSQL_1C_2M_SD: 1 CPU core and 2 GB of memory.
  • MYSQL_2C_4M_SD: 2 CPU cores and 4 GB of memory.
  • MYSQL_2C_8M_SD: 2 CPU cores and 8 GB of memory.
  • MYSQL_4C_8M_SD: 4 CPU cores and 8 GB of memory.
  • MYSQL_4C_16M_SD: 4 CPU cores and 16 GB of memory.
  • MYSQL_8C_16M_SD: 8 CPU cores and 16 GB of memory.
  • MYSQL_8C_32M_SD: 8 CPU cores and 32 GB of memory.
NoteDifferent specifications have little impact on the recovery speed. High-specification instances provide better performance after restoration. For more information, see DBS sandbox fees.
MYSQL_1C_1M_SD
SandboxUserstringNo

The privileged account created in the sandbox instance.

  • After you specify this parameter, the system creates a privileged account in the sandbox instance. The account is granted the permissions on all databases in the instance.

The account of the source database is retained in the sandbox instance.

  • If you do not specify this parameter, the database account is the same as that of the source database.
root_test
SandboxPasswordstringNo

The password of the privileged account created in the sandbox instance.

password123
SandboxTypestringNo

The type of the sandbox instance. You can call this operation only to create an instance of the Sandbox type. After the sandbox instance is created, the MySQL endpoint of the instance is provided.

Sandbox

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

4F1888AC-1138-4995-B9FE-D2734F61****
ErrCodestring

The error code returned if the request fails.

Param.NotFound
Successstring

Indicates whether the request was successful.

true
ErrMessagestring

The error message returned if the request fails.

The specified parameter %s value is not valid.
Codestring

The error code returned if the request fails.

Param.NotFound
Messagestring

The error message returned if the request fails.

The specified parameter %s value is not valid.
Dataobject

The response parameters.

BackupPlanIdstring

The ID of the backup plan.

1hxxxx8xxxxxa
InstanceIdstring

The ID of the sandbox instance.

1jxxxxx9xxxxh

Examples

Sample success responses

JSONformat

{
  "RequestId": "4F1888AC-1138-4995-B9FE-D2734F61****",
  "ErrCode": "Param.NotFound",
  "Success": "true",
  "ErrMessage": "The specified parameter %s value is not valid.",
  "Code": "Param.NotFound",
  "Message": "The specified parameter %s value is not valid.",
  "Data": {
    "BackupPlanId": "1hxxxx8xxxxxa",
    "InstanceId": "1jxxxxx9xxxxh"
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Error codeError messageDescription
DBS.ScenesNotSupportCurrent backup plan does not support sandboxThe error message returned because the backup schedule does not support the sandbox feature.
DBS.ScenesNotSupportCurrent backup plan does not enable sandboxThe error message returned because the sandbox feature is disabled for this backup schedule.
DBS.NotExistedno valid job exist with idThe error message returned because the backup schedule does not exist.
DBS.NotExistedNo recoverable snapshotThe error message returned because no snapshots are available.
DBS.ParamInvalidThe input parameter vpcSwitchId that is mandatory for processing this request is not suppliedThe error message returned because the VPC ID is specified but the VSwitch ID is not specified.
DBS.ParamInvalidThe input parameter vpcId that is mandatory for processing this request is not suppliedThe error message returned because the VSwitch ID is specified but the VPC ID is not specified.
DBS.ParamInvalidThe specified parameter BackupSetId is invalidThe error message returned because the snapshot ID is invalid or the specified snapshot does not exist.
DBS.ParamInvalidThe input parameter BackupSetId/RestoreTime that is mandatory for processing this request is not suppliedYou must specify one of the BackupSetId and RestoreTime parameters.
DBS.ParamInvalidThe specified parameter SandboxSpecification is invalidThe error message returned because the specified SandboxSpecification parameter is invalid.
DBS.ParamInvalidThe specified parameter SandboxPassword is invalidThe error message returned because the SandboxUser parameter is specified but the specified SandboxPassword parameter is invalid. For example, the SandboxPassword parameter is not specified or the password is invalid.
DBS.ParamInvalidThe specified parameter SandboxType is invalidThe error message returned because the specified SandboxType parameter is invalid.
DBS.InternalErrorNoneThe error message returned because an internal error has occurred.