All Products
Search
Document Center

Database Backup:CreateBackupPlan

更新時間:Nov 14, 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

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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:CreateBackupPlancreate
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionstringNo

The ID of the region in which you want to store the backup data. You can query the supported regions of Database Backup (DBS) by calling the DescribeRegions operation.

Note For more information, see Endpoints .
cn-hangzhou
InstanceClassstringYes

The type of the backup schedule. Valid values:

  • micro
  • small
  • medium
  • large
  • xlarge
Note A backup schedule type with higher specifications offers higher backup and restoration performance. For more information, see Select a backup schedule type.
micro
DatabaseTypestringYes

The type of the source database. Valid values:

  • MySQL
  • MSSQL
  • Oracle
  • MariaDB
  • PostgreSQL
  • 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 period. Valid values:

  • If Period is set to Year, the valid values of UsedTime range from 1 to 5.
  • If Period is set to Month, the valid values of UsedTime range 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 source database instance. Valid values:

  • RDS: ApsaraDB RDS.
  • PolarDB: PolarDB.
  • DDS: ApsaraDB for MongoDB.
  • Kvstore: ApsaraDB for Redis.
  • Other: Database connected by using an IP address and a port number.
  • dg: Self-managed database that has no public IP address or port number and is connected over Database Gateway.
Note If PayType is set to postpay, this parameter is required.
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

The ID of the resource group.

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

HTTP status codeError codeError message
403Request.ForbiddenHave no Permissions

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

Change history

Change timeSummary of changesOperation
No change history