All Products
Search
Document Center

Database Backup:CreateBackupPlan

Last Updated:Nov 09, 2022

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.

Authorization information

The following table is the authorization information corresponding to the API, which can be found in the RAM permission policy statement.Action Used in the element to grant the RAM user or RAM role permission to call this API. The specific instructions are as follows:

  • 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 keyword: refers to the condition keyword defined by the cloud product itself.
  • 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.
Operateaccess levelResource typeconditional keywordAssociation operation
dbs:CreateBackupPlanWrite
  • DBS
    acs:dbs:{#regionId}:{#accountId}:backupplan/*
    without
without

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
  • 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
NoteThe 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.

NoteThis 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.

NoteThis 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
NoteThis 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****

Example

Normal return example

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 API error center.