Help Center/ Cloud Bastion Host/ API Reference/ API Description/ Managing CBH Orders/ Creating a CBH Instance Subscription Order
Updated on 2023-05-16 GMT+08:00

Creating a CBH Instance Subscription Order

Function

This API is used to create a CBH Instance subscription order.

URI

POST /v1/{project_id}/cbs/period/order

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. You can obtain the project ID by referring to https://support.huaweicloud.com/intl/en-us/api-cbh/cbh_02_0020.html.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

instance_key

Yes

Integer

CBH instance ID.

cloud_service_type

Yes

String

Cloud service type. Default value: hws.service.type.cbh

region_id

Yes

String

CBH instance region ID.

charging_mode

Yes

Integer

Billing mode.

- 0: Yearly/Monthly

period_type

Yes

Integer

Subscription type

  • 2: By month.
  • 3: By year.
  • 5: Absolute required duration.

period_num

Yes

Integer

Number of subscription periods.

  • period_type is set to 2: Monthly billed. Value range: [1, 9]
  • periodType is set to 3: Yearly billed. Value range: [1, 10]
  • periodType is set to 5: Can be left blank.

product_infos

Yes

Array of ProductInfos objects

Product information

is_auto_renew

Yes

Integer

Specifies whether auto renew is enabled.

  • 1: Auto-renewal is enabled.
  • 0: Auto-renewal is disabled (default).

subscription_num

Yes

Integer

Number of subscriptions. The value is greater than 0.

Table 3 ProductInfos

Parameter

Mandatory

Type

Description

product_id

Yes

String

Product ID, which is obtained by calling the inquiry API.

cloud_service_type

Yes

String

Cloud service type. The value is fixed at hws.service.type.cbh.

resource_type

Yes

String

CBH resource type. The value is fixed at hws.resource.type.cbh.ins.

resource_spec_code

Yes

String

CBH instance specification ID. The format is "cbh.Edition.Asset specifications", for example:

  • cbh.basic.50
  • cbh.enhance.50 For more specifications, see "CBH Instance Editions" at https://support.huaweicloud.com/intl/en-us/productdesc-cbh/cbh_01_0010.html.

resource_size_measure_id

Yes

String

Resource capacity measurement ID. The options are as follows:

  • 15: Mbit/s for purchasing bandwidth.
  • 17: GB for purchase EVS disks.
  • 14: instances per time for purchasing CBH instances.

resource_size

Yes

String

Resource capacity. The default value is 1.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

order_id

String

Order ID.

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_description

String

Incorrect request parameter.

Status code: 401

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_description

String

Failed to verify the token.

Status code: 403

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_description

String

Permissions required.

Status code: 404

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_description

String

CBH instances not found.

Example Requests

{
  "instance_key" : 6946,
  "cloud_service_type" : "hws.service.type.cbh",
  "region_id" : "cn-north-4",
  "charging_mode" : 0,
  "period_type" : 2,
  "period_num" : 1,
  "product_infos" : [ {
    "product_id" : "OFFI740586375358963717",
    "cloud_service_type" : "hws.service.type.cbh",
    "resource_type" : "hws.resource.type.cbh.ins",
    "resource_spec_code" : "cbh.basic.50",
    "resource_size_measure_id" : "14",
    "resource_size" : "1"
  } ],
  "is_auto_renew" : 0,
  "subscription_num" : 1
}

Example Responses

Status code: 200

Cbh CreateInstanceOrder Success

{
  "order_id" : "CS22121916213LOXW"
}

Status Codes

Status Code

Description

200

Cbh CreateInstanceOrder Success

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

Error Codes

See Error Codes.