All Products
Search
Document Center

Database Backup:CreateBackupPlan

Last Updated:Mar 03, 2024

Creates a backup schedule.

Operation description

For more information about how to create a backup schedule in the Database Backup (DBS) console, see Purchase a backup schedule.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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 keyAssociated operation
dbs:CreateBackupPlanWrite
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionstringNo

The region in which DBS is activated. Valid values:

  • cn-hangzhou: China (Hangzhou)
  • cn-shanghai: China (Shanghai)
  • cn-qingdao: China (Qingdao)
  • cn-beijing: China (Beijing)
  • cn-shenzhen: China (Shenzhen)
  • cn-hongkong: China (Hong Kong)
  • ap-southeat-1: Singapore (Singapore)
  • cn-hangzhou-finance: China East 1 Finance
  • cn-shanghai-finance: China East 2 Finance
  • cn-shenzhen-finance: China South 1 Finance
cn-hangzhou
InstanceClassstringYes

The specifications of the backup schedule. Valid values:

  • micro: basic specifications
  • small: low-end specifications
  • medium: medium-end specifications
  • large: high-end specifications
micro
DatabaseTypestringYes

The type of the database. Valid values:

  • MySQL
  • MSSQL
  • Oracle
  • MariaDB
  • PostgreSQL
  • PPAS
  • DRDS
  • MongoDB
  • Redis
MySQL
BackupMethodstringYes

The backup method of the backup schedule. Valid values:

  • logical: logical backup
  • physical: physical backup
  • duplication: dump backup
logical
PeriodstringNo

The unit of the subscription period. Valid values:

  • Year: yearly subscription
  • Month: monthly subscription
Month
UsedTimeintegerNo

The subscription duration of the backup schedule. Valid values:

  • If the Period parameter is set to Year, the value of the UsedTime parameter ranges from 1 to 9.
  • If the Period parameter is set to Month, the value of the UsedTime parameter ranges from 1 to 11.
1
PayTypestringNo

The billing method of the backup schedule. Valid values:

  • postpay: pay-as-you-go
  • prepay: subscription
Note The default value is prepay. If the BackupMethod parameter is set to duplication, postpay is supported.
prepay
DatabaseRegionstringNo

The region in which the database you want to back up resides.

Note This parameter is required if the PayType parameter is set to postpay.
cn-hangzhou
StorageRegionstringNo

The region in which you want to store the backup data.

Note This parameter is required if the PayType parameter is set to postpay.
cn-hangzhou
InstanceTypestringNo

The type of the database instance. Valid values:

  • RDS
  • PolarDB
  • DDS
  • Kvstore
  • Other: a database instance that is connected by using the IP address and port number in the IP address:Port number format
Note This parameter is required if the PayType parameter is set to postpay.
RDS
StorageTypestringNo

This parameter is unavailable.

N/A
FromAppstringNo

The source of the request. The default value is OpenAPI and cannot be changed.

OpenAPI
ClientTokenstringNo

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

KJSAHKJFHKJSHFKASHFKJADFHKDXXXX
ResourceGroupIdstringNo

Resource group ID.

rg-aekzecovzti****

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

HttpStatusCodeinteger

The HTTP status code.

200
RequestIdstring

The ID of the request.

7BCF6D62-885F-5A4A-91A1-679760E7****
ErrCodestring

The error code.

Param.NotFound
Successboolean

Indicates whether the request is successful. Valid values:

  • true: The request is successful.
  • false: The request fails.
true
ErrMessagestring

The error message.

The specified parameter %s value is not valid.
BackupPlanIdstring

The ID of the backup schedule.

dbsrhahrsu2****
OrderIdstring

The ID of the order.

21437345592****

Examples

Sample success responses

JSONformat

{
  "HttpStatusCode": 200,
  "RequestId": "7BCF6D62-885F-5A4A-91A1-679760E7****",
  "ErrCode": "Param.NotFound",
  "Success": true,
  "ErrMessage": "The specified parameter %s value is not valid.",
  "BackupPlanId": "dbsrhahrsu2****",
  "OrderId": "21437345592****"
}

Error codes

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

Change history

Change timeSummary of changesOperation
No change history