Help Center/ Cloud Search Service/ API Reference/ APIs/ Cluster Management/ Changing the Cluster Billing Mode from Pay-per-use to Yearly/Monthly
Updated on 2024-10-17 GMT+08:00

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

Function

This API is used to change the cluster billing mode from pay-per-use to yearly/monthly.

Debugging

You can debug this API through automatic authentication in API Explorer.

URI

POST /v1.0/{project_id}/cluster/{cluster_id}/period

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID and name, see Obtaining the Project ID and Name.

cluster_id

Yes

String

ID of the cluster that you want to change the billing mode to yearly/monthly.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

periodType

Yes

Integer

Subscription type.

  • 2: monthly

  • 3: yearly

periodNum

Yes

Integer

Subscribed periods.

  • If you selected Monthly, the value ranges from 1 to 9.

  • If you selected Yearly, the value ranges from 1 to 3.

isAutoRenew

No

Integer

Whether to automatically renew the subscription. If this parameter is not specified, the subscription is not automatically renewed.

  • 1: Auto renewal is enabled.

  • 0: Auto renewal is disabled (default).

isAutoPay

No

Integer

Indicates whether to enable automatic payment from your Huawei Cloud account. This parameter takes effect only for yearly/monthly clusters.

  • 1: Yes. (Discounts and coupons are automatically selected. The fee will be automatically deducted from your Huawei Cloud account.) If the automatic payment fails, an unpaid order will be generated, and you need to manually complete the payment. (During manual payment, you can still modify the discounts and coupons that were automatically selected.)

  • 0: No. (The customer needs to manually pay for the bill. Discounts and coupons can be used.) The default value is 0.

consoleURL

No

String

URL of the cloud service console. After the subscription is completed, this URL can be used to switch to the cloud service console page to view the information. (This parameter is used only for manual payment.)

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

orderId

String

Order ID. (The order is a new purchase.)

Example Requests

Change the cluster billing mode from pay-per-use to yearly/monthly.

{
  "periodType" : 2,
  "periodNum" : 1,
  "isAutoRenew" : 1,
  "isAutoPay" : 0,
  "consoleURL" : "https://console.xxx.huawei.com/elasticsearch-pre/?locale=zh-cn&region=xxx#/es/management/elasticsearch"
}

Example Responses

Status code: 200

Request succeeded.

{
  "orderId" : "CS2112281600EBHKR"
}

Status Codes

Status Code

Description

200

Request succeeded.

400

Invalid request.

Modify the request before retry.

403

Identity authentication failed.

The resource that the client attempts to create already exists, or the update request fails to be processed because of a conflict.

Error Codes

See Error Codes.