Changing the Payment Mode
Function
This API is used to change the billing mode of a resource. Currently, only pay-per-use resources can be changed to yearly/monthly resources.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
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, no identity policy-based permission required for calling this API.
URI
POST /v3/{project_id}/vaults/change-charge-mode
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. Constraints N/A Range N/A Default Value N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| charging_mode | No | String | Definition Billing mode. Constraints N/A Range Currently, only pre_paid is available, indicating yearly/monthly billing. Default Value N/A |
| period_type | Yes | String | Definition Subscription term unit. Constraints This parameter is valid and mandatory only when charging_mode is pre_paid. Range Default Value N/A |
| period_num | Yes | Integer | Definition Number of subscription terms. Constraints This parameter is valid and mandatory only when charging_mode is pre_paid. Range 1–9 Default Value N/A |
| is_auto_renew | No | Boolean | Definition Whether to automatically renew the subscription upon expiration. Constraints N/A Range Default Value false |
| is_auto_pay | No | Boolean | Definition Automatic payment. Constraints N/A Range
Default Value false |
| console_url | No | String | Definition URL used to switch to the cloud service console to view information after the payment is made. Constraints This parameter is used only for manual payment. Range N/A Default Value N/A |
| vault_ids | Yes | Array of strings | Definition Vault list. For details about how to obtain the vault ID, see Querying the Vault List. Constraints N/A Range A vault ID is a UUID. The value of this parameter can contain 1 to 60 vault IDs. Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| orderId | String | Definition Resource modification order ID. Range N/A |
| retCode | Number | Definition Response code for the resource specification modification. Range N/A |
| retMsg | String | Definition Response message for the modification. Range N/A |
Example Requests
Changing the billing mode of a pay-per-use vault to yearly/monthly
POST https://{endpoint}/v3/{project_id}/vaults/change-charge-mode
{
"vault_ids" : [ "9dd8f8db-a926-440b-9af5-81b643618898" ],
"charging_mode" : "pre_paid",
"period_type" : "year",
"period_num" : 2,
"is_auto_renew" : true,
"is_auto_pay" : true,
"console_url" : "https://www.{endpoint}/v3/"
} Example Responses
Status code: 200
OK
{
"orderId" : "CS2305291628MSG5A",
"retCode" : 0,
"retMsg" : "success"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
Error Codes
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