• Relational Database Service

rds
  1. Help Center
  2. Relational Database Service
  3. API Reference
  4. API v1
  5. Backup and Restoration
  6. Setting an Automated Backup Policy

Setting an Automated Backup Policy

Function

This API is used to set an automated backup policy.

URI

  • URI format

    PATH: /rds/{versionId}/{project_id}/instances/{instanceId}/backups/policy

    Method: PUT

  • Parameter description
    Table 1 Parameter description

    Name

    Mandatory

    Description

    versionId

    Yes

    Specifies the API version. It is case-sensitive and the value is v1.

    project_id

    Yes

    Specifies the project ID of a tenant in a region.

    instanceId

    Yes

    Specifies the primary DB instance ID.

Request

  • Parameter description
    Table 2 Parameter description

    Name

    Mandatory

    Type

    Description

    policy

    Yes

    Dictionary data structure. For details, see Table 3.

    Specifies the backup policy objects, including the backup retention period (days) and backup start time.

    Table 3 policy field data structure description

    Name

    Mandatory

    Type

    Description

    keepday

    Yes

    Int

    Specifies the number of days to retain the generated backup files.

    The value range is from 0 to 732. If this parameter is set to 0, the automated backup policy is not set.

    starttime

    Yes

    String

    Indicates the backup start time that has been set.

    Valid value:

    The value cannot be empty. The format can be hh:mm:ss or hh:mm and must be valid. The time is in the UTC format.

  • Request example
    {
      "policy": {
      "keepday": 7,
      "starttime": "00:00:00"
     }
    }

Normal Response

{}

Abnormal Response

For details, see Abnormal Request Results.