Changing the Billing Mode from Pay-per-Use to Yearly/Monthly
Function
This API is used to change the billing mode of pay-per-use instances to yearly/monthly. Before calling this API:
- Learn how to authenticate this API.
- Obtain the required region and endpoint.
Debugging
You can debug this API in API Explorer.
Authorization
Each account has all of the permissions required to call all APIs, but IAM users must have the required permissions specifically assigned.
- If you are using role/policy-based authorization, see the required permissions in Permissions and Supported Actions.
- If you are using identity policy-based authorization, the permission listed below is required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
gaussdb:instance:changeDemandToPeriod
ReadWrite
instance
-
gaussdb:instance:changeDemandToPeriod
-
URI
PUT /v3/{project_id}/instances/change-charge-mode
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Project ID of a tenant in a region. To obtain the value, see Obtaining a Project ID. Constraints N/A Range The value can contain 32 characters. Only letters and digits are allowed. Default Value N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition User token. You can obtain the token by calling the IAM API used to obtain a user token. After a response is returned, the value of X-Subject-Token in the response header is the token. Constraints N/A Range N/A Default Value N/A |
| X-Language | No | String | Definition Language. Constraints N/A Range
Default Value en-us |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| entity_ids | Yes | Array of strings | Definition IDs of instances that need to be changed to yearly/monthly billing. To obtain the value, see Querying DB Instances. Constraints N/A |
| charge_info | Yes | Object | Definition Yearly/Monthly subscription information. For details, see Table 4. Constraints N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| period_type | Yes | String | Definition Period type. Constraints N/A Range
Default Value N/A |
| period_num | Yes | Integer | Definition Number of months or years of the subscription. Constraints N/A Range
When a floating-point value is used, the value is automatically truncated to an integer. Default Value N/A |
| is_auto_renew | No | Boolean | Definition Whether to enable auto-renewal. Constraints N/A Range
Default Value false |
| is_auto_pay | No | Boolean | Definition Whether to enable automatic payment. Constraints N/A Range
Default Value false |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| order_ids | Array of strings | Definition Order IDs. |
Example Request
Changing the billing mode of an instance from pay-per-use to yearly/monthly
PUT https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3/599628f2665841b2a66fa2780fadc025/instances/change-charge-mode
{
"entity_ids": ["xxxxxxin14"],
"charge_info": {
"period_type": "month",
"period_num": 1,
"is_auto_renew": false,
"is_auto_pay": false
}
} Example Response
A yearly/monthly subscription order generated for the instance.
{
"order_ids": ["CSXXXXXXX"]
}
Status Codes
- Normal
- Abnormal
For details, see Status Codes.
Error Codes
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot