You can call the CreateBackupPlan to create a DBS backup schedule.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateBackupPlan

The parameter specified by the system. Value: CreateBackupPlan.

BackupMethod String Yes logical

The method to use for backup. Valid values:

  • logical
  • physical
  • duplication
DatabaseType String Yes MySQL

The database engine that the instances run. Valid values:

  • MySQL
  • MSSQL
  • Oracle
  • MongoDB
  • Redis
InstanceClass String Yes micro

The specifications. Values:

  • micro
  • small
  • medium
  • arge
Region String No cn-hangzhou

The DBS region. Valid values:

  • cn-hangzhou: Alibaba Cloud Hangzhou
  • cn-shanghai: Alibaba Cloud Shanghai
  • cn-qingdao: Alibaba Cloud Qingdao
  • cn-beijing: Alibaba Cloud Beijing
  • cn-shenzhen: Alibaba Cloud Shenzhen
  • cn-hongkong: Public Cloud China (Hong Kong)
  • ap-southeat-1: public cloud Singapore
  • cn-hangzhou-finance: finance cloud (Hangzhou)
  • cn-shanghai-finance: finance cloud of Shanghai
  • cn-shenzhen-finance: finance cloud Shenzhen
Period String No Year

The unit of the subscription period. Valid values:

  • Year: subscription on a yearly basis
  • Month: subscription on a monthly basis
UsedTime Integer Optional 1

The duration of the new instance if the new instance uses subscription billing. Valid values:

  • If the value of the Period parameter is Year, the value of the UsedTime parameter ranges from 1 to 9.
  • If the value of the Period parameter is Month, the value of the UsedTime parameter ranges from 1 to 11.
PayType String No Postpaid

The payment method. Valid values:

  • Postpaid: pay-as-you-go
  • prepay: Subscription
Note Default value: prepay. Currently, only the BackupMethod for duplication supports postpay.
DatabaseRegion String No cn-hangzhou

The region of the database.

Note This parameter is required when the PayType parameter is set to postpay.
StorageRegion String No cn-hangzhou

Storage region

Note This parameter is required when the PayType parameter is set to postpay.
InstanceType String No rds

The type of the database instance. Valid values:

  • RDS
  • PolarDB
  • DDS
  • Kvstore
  • Other
    Note When the PayType parameter is set to postpay, this parameter is required.
StorageType String No None

This parameter is not available.

FromApp String No OpenApi

Specifies the request source. The default value is OpenApi and cannot be changed.

RegionId String No cn-hangzhou

The region ID. You can call DescribeRegions query.

ClientToken String No KJSAHKJFHKJSHFKASHFKJADFHKDJSLH

The client token that is used to ensure the idempotence of the request.

Response parameters

Parameter Type Example Description
BackupPlanId String dbs1hvb0wwweusfa

The ID of the backup plan.

ErrCode String Param.NotFound

The error code.

ErrMessage String The specified parameter %s value is not valid.

The error message.

HttpStatusCode Integer 200

HTTP status code.

OrderId String 2056157***

The ID of the order.

RequestId String D6E068C3-25BC-455A-85FE-45F0B22ECB1F

The ID of the request.

Success Boolean true

Indicates whether the request succeeded.

Examples

Sample requests

http(s)://dbs-api.cn-hangzhou.aliyuncs.com/? Action=CreateBackupPlan
&BackupMethod=logical
&DatabaseType=MySQL
&InstanceClass=micro
&<Common request parameters>

Sample success responses

XML format

<CreateBackupPlanReponse>
  <RequestId>D6E068C3-25BC-455A-85FE-45F0B22ECB1F</RequestId>
  <HttpStatusCode>200</HttpStatusCode>
  <BackupPlanId>dbs1h****usfa</BackupPlanId>
  <OrderId>2056157****</OrderId>
  <Success>true</Success>
</CreateBackupPlanReponse>

JSON format

{
    "RequestId": "D6E068C3-25BC-455A-85FE-45F0B22ECB1F",
    "HttpStatusCode": 200,
    "BackupPlanId": "dbs1h****usfa",
    "OrderId": "2056157****",
    "Success": true
}

Error codes

For a list of error codes, visit the API Error Center.