Updated on 2022-12-29 GMT+08:00

Instance Ordering

Function

This API is used to place an order based on the billing mode and billing period.

URI

POST /v1/{project_id}/period/order

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

chargingMode

No

Integer

Billing mode. The options are as follows: 0: yearly/monthly; 1: pay-per-use; 2: one-off.

cloudServiceType

No

String

Cloud service type

compositeProductId

No

String

Package ID

discountId

No

String

Discount ID

isAutoRenew

No

Integer

Auto-renewal

periodNum

No

Integer

Subscription periods

periodType

No

Integer

Subscription period type. The options are as follows: 2: month; 3: year.

productInfos

No

Array of ProductInfoBean objects

Product information list

promotionActivityId

No

String

Promotion ID

promotionInfo

No

String

Promotion information

regionId

No

String

ID of the region where the current project is, for example, xx-xx-1.

zone

No

String

Country/Region

Table 3 ProductInfoBean

Parameter

Mandatory

Type

Description

allResourceNames

No

Array of strings

Resource list

cloudServiceType

No

String

Cloud service type

displayId

No

String

Display ID

productId

No

String

Product ID

productSpecDesc

No

String

Product specification description

resourceName

No

String

Resource name

resourceSize

No

Integer

Number of databases supported by the product or the number of OBS scans supported by the product

resourceSizeMeasureId

No

Integer

Resource capacity measurement ID. The example values are as follows: 15: mbps (used when bandwidth is purchased), 17: gb (used when EVS disks are purchased), 14: number/time.

resourceSpecCode

No

String

Product code

resourceType

No

String

Resource type

usageFactor

No

String

Coefficient in use

usageMeasureId

No

Integer

Capacity measurement ID in use

usageValue

No

Double

Value in use

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_msg

String

Error Message

Example Requests

Order an instance using the parameters in the request body.

POST /v1/{project_id}/period/order

{
  "chargingMode" : 0,
  "cloudServiceType" : "hws.service.type.sdg",
  "isAutoRenew" : 0,
  "periodNum" : 1,
  "periodType" : 2,
  "regionId" : "xxxxxxxxxxxx",
  "zone" : "CH",
  "productInfos" : [ {
    "cloudServiceType" : "hws.service.type.sdg",
    "productId" : "xxxxxxxxxxxx",
    "resourceSize" : "xx",
    "resourceSizeMeasureId" : "xx",
    "resourceSpecCode" : "base_professional",
    "resourceType" : "hws.resource.type.dsc.base"
  } ]
}

Example Responses

Status code: 200

OK

{
  "order_id" : "xxxxxxxxxxxx"
}

Status code: 400

Invalid request.

{
  "error_code" : "dsc.40000011",
  "error_msg" : "Invalid parameter"
}

Status Codes

Status Code

Description

200

OK

400

Invalid request.

Error Codes

See Error Codes.