Changing the Billing Mode of a Node to Yearly/Monthly
Function
This API is used to change the billing mode of a node from pay-per-use to yearly/monthly.
The URL for cluster management is in the format of https://Endpoint/uri, in which uri indicates the resource path, that is, the path for API access.
To change the billing mode of a node in a pay-per-use node pool to yearly/monthly, you need to upgrade the cluster to v1.19.16-r40, v1.21.11-r0, v1.23.9-r0, v1.25.4-r0, or later.
After a node in a pay-per-use node pool is changed to a yearly/monthly node, the node does not support auto scale-in.
The billing mode of resources (EIPs) associated with the pay-per-use node may not be changed synchronously. For details, see Pay-per-Use to Yearly/Monthly.
Calling Method
For details, see Calling APIs.
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.
URI
POST /api/v3/projects/{project_id}/clusters/{cluster_id}/nodes/toperiod
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Details: Project ID. For details about how to obtain the value, see How to Obtain Parameters in the API URI. Constraints: None Options: Project IDs of the account Default value: N/A |
| cluster_id | Yes | String | Details: Cluster ID. For details about how to obtain the value, see How to Obtain Parameters in the API URI. Constraints: None Options: Cluster IDs Default value: N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Content-Type | Yes | String | Definition Type (or format) of the request body. The default value is application/json. Other values of this field will be provided for specific APIs, if any. Constraints GET requests are not validated. Default Value N/A |
| X-Auth-Token | Yes | String | Details: Requests for calling an API can be authenticated using either a token or AK/SK. If token-based authentication is used, this parameter is mandatory and must be set to a user token. For details, see Obtaining a User Token. Constraints: None Options: N/A Default value: N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| kind | No | String | Definition API type Constraints The value cannot be changed. Range N/A Default Value Node |
| apiVersion | No | String | Definition API version Constraints The value cannot be changed. Range N/A Default Value v3 |
| nodeList | Yes | Array of strings | Definition List of CCE node IDs that need to have their billing modes changed from pay-per-use to yearly/monthly. The following is an example: "nodeList": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"] Constraints N/A Range N/A Default Value N/A |
| periodOrderParam | Yes | periodOrderParam object | Definition Parameter of the order for changing the billing mode to yearly/monthly |
| includeResources | No | Array of strings | Definition List of resource types that need to have their billing modes changed to yearly/monthly. The following is an example: "includeResources": ["eip"] Constraints Only EIPs are supported. Range Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| isAutoPay | No | Boolean | Definition Whether to automatically pay for an order Constraints N/A Range Default Value false |
| isAutoRenew | No | Boolean | Definition Whether to enable auto renewal Constraints N/A Range Default Value false |
| periodNum | Yes | Integer | Definition The duration of the yearly/monthly subscription. The supported duration varies depending on the region and product specifications. In most regions, the supported duration ranges from 1 to 9 months or from 1 to 3 years. The actual supported duration is subject to the response returned by the API. Constraints N/A Range N/A Default Value N/A |
| periodType | Yes | String | Definition Billing cycle unit Constraints N/A Range Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| orderId | String | Definition Order ID returned after an order is submitted Constraints N/A Range N/A Default Value N/A |
Example Requests
Change the billing mode of a node to yearly/monthly. The billing period is one month.
POST /api/v3/projects/{project_id}/clusters/{cluster_id}/nodes/toperiod
{
"kind" : "Node",
"apiVersion" : "v3",
"nodeList" : [ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" ],
"periodOrderParam" : {
"isAutoPay" : true,
"isAutoRenew" : false,
"periodNum" : 1,
"periodType" : "month"
}
} Example Responses
Status code: 200
The order for changing the billing mode of a pay-per-use node to yearly/monthly is submitted.
{
"orderId" : "CS260XXXXX1B3NPG"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | The order for changing the billing mode of a pay-per-use node to yearly/monthly is submitted. |
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