Help Center/ Relational Database Service/ API Reference/ API v3 (Recommended)/ DB Instance Management/ Changing the Billing Mode from Pay-per-Use to Yearly/Monthly
Updated on 2024-11-19 GMT+08:00

Changing the Billing Mode from Pay-per-Use to Yearly/Monthly

Function

This API is used to change the billing mode of an RDS instance from pay-per-use to yearly/monthly.

  • Before calling an API, you need to understand the API in Authentication.

URI

  • URI format

    POST /v3/{project_id}/instances/{instance_id}/to-period

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Explanation:

    Project ID of a tenant in a region.

    For details about how to obtain the project ID, see Obtaining a Project ID.

    Constraints:

    N/A

    Value range:

    N/A

    Default value:

    N/A

    instance_id

    Yes

    Explanation:

    Instance ID.

    Constraints:

    N/A

    Value range:

    N/A

    Default value:

    N/A

Request

  • Parameter description
    Table 2 Parameters

    Parameter

    Mandatory

    Type

    Description

    period_type

    Yes

    String

    Explanation:

    Period type.

    Constraints:

    N/A

    Value range:

    • MONTH
    • YEAR

    Default value:

    N/A

    period_num

    Yes

    int

    Explanation:

    Number of periods.

    Constraints:

    N/A

    Value range:

    N/A

    Default value:

    N/A

    auto_pay_policy

    No

    String

    Explanation:

    Whether to enable automatic payment.

    Constraints:

    N/A

    Value range:

    • YES: Enable automatic payment.
    • NO (default): Disable automatic payment.

    Default value:

    NO

    auto_renew_policy

    No

    String

    Explanation:

    Whether to automatically renew the subscription upon expiration.

    Constraints:

    N/A

    Value range:

    • YES: Enable auto renewal.
    • NO (default): Disable auto renewal.

    Default value:

    NO

  • URI example

    POST https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/49b9dd1d6f464ba4bc91df5cbd2e52ebin03/to-period

  • Request example

    Change the billing mode of an RDS instance from pay-per-use to yearly/monthly.

    { 
       "period_type" : "MONTH",
       "period_num" : 6,
       "auto_pay_policy" : "NO",
       "auto_renew_policy" : "NO"
     }

Response

  • Normal response
    Table 3 Parameters

    Parameter

    Type

    Description

    order_id

    String

    Explanation:

    ID of the order for changing the billing mode to yearly/monthly.

    Value range:

    N/A

  • Example normal response
    { 
       "order_id" : "CS2408170728W40QZ" 
     }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Code

For details, see Error Codes.