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.
Operation | Access level | Resource type | Condition key | Association operation |
---|---|---|---|---|
dbs:CreateSandboxInstance | Read |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
BackupPlanId | string | Yes | 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 |
SandboxInstanceName | string | No | The custom name of the sandbox instance. | test_sandbox |
VpcId | string | No | 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 |
VpcSwitchId | string | No | The ID of the VSwitch that is used to connect to the sandbox instance. | vsw-bp1bxxxxxumxxxxxwxxx9 |
BackupSetId | string | No | 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 |
RestoreTime | string | No | 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 |
SandboxSpecification | string | No | The specifications of the sandbox instance. Valid values:
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 |
SandboxUser | string | No | The privileged account created in the sandbox instance.
The account of the source database is retained in the sandbox instance.
| root_test |
SandboxPassword | string | No | The password of the privileged account created in the sandbox instance. | password123 |
SandboxType | string | No | 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
Examples
Sample success responses
JSON
format
{
"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 code | Error message | Description |
---|---|---|
DBS.ScenesNotSupport | Current backup plan does not support sandbox | The error message returned because the backup schedule does not support the sandbox feature. |
DBS.ScenesNotSupport | Current backup plan does not enable sandbox | The error message returned because the sandbox feature is disabled for this backup schedule. |
DBS.NotExisted | no valid job exist with id | The error message returned because the backup schedule does not exist. |
DBS.NotExisted | No recoverable snapshot | The error message returned because no snapshots are available. |
DBS.ParamInvalid | The input parameter vpcSwitchId that is mandatory for processing this request is not supplied | The error message returned because the VPC ID is specified but the VSwitch ID is not specified. |
DBS.ParamInvalid | The input parameter vpcId that is mandatory for processing this request is not supplied | The error message returned because the VSwitch ID is specified but the VPC ID is not specified. |
DBS.ParamInvalid | The specified parameter BackupSetId is invalid | The error message returned because the snapshot ID is invalid or the specified snapshot does not exist. |
DBS.ParamInvalid | The input parameter BackupSetId/RestoreTime that is mandatory for processing this request is not supplied | You must specify one of the BackupSetId and RestoreTime parameters. |
DBS.ParamInvalid | The specified parameter SandboxSpecification is invalid | The error message returned because the specified SandboxSpecification parameter is invalid. |
DBS.ParamInvalid | The specified parameter SandboxPassword is invalid | The 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.ParamInvalid | The specified parameter SandboxType is invalid | The error message returned because the specified SandboxType parameter is invalid. |
DBS.InternalError | None | The error message returned because an internal error has occurred. |