Updated on 2025-12-02 GMT+08:00

Querying the Recycling Policy of a DB Instance

Function

This API is used to query the recycling policy of a DB instance.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    dds:instance:getBackupPolicy

    read

    -

    -

    • dds:instance:list
    • dds:backup:list

    -

URI

  • URI format

    GET /v3/{project_id}/instances/recycle-policy

  • URI example
    https://dds.cn-north-1.myhuaweicloud.com/v3/619d3e78f61b4be68bc5aa0b59edcf7b/instances/recycle-policy
    Table 1 URI parameters

    Name

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Definition

    Project ID of a tenant in a region. Obtain the project ID by following the instructions in Obtaining a Project ID.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

Request Parameters

Table 2 Request header parameters

Name

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token obtained from IAM. For details, see Authentication.

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Table 3 Response body parameters

Name

Type

Description

recycle_policy

Table 4 object

Definition

Instance recycling policy.

Range

N/A

Table 4 RecyclePolicy

Name

Type

Description

enabled

Boolean

Definition

Whether to enable the recycling policy.

Range

true: Enable the recycling policy.

retention_period_in_days

Integer

Definition

Policy retention period (1 to 7 days). The value must be a positive integer.

Range

1–7

Example Request

GET https://{endpoint}/v3/619d3e78f61b4be68bc5aa0b59edcf7b/instances/recycle-policy

Example Response

{ 
  "recycle_policy" : { 
    "enabled" : true, 
    "retention_period_in_days" : 3 
  } 
}

Status Code

For details, see Status Code.

Error Code

For details, see Error Code.