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
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
charging_mode |
Yes |
Integer |
Billing mode. The options are as follows: 0: yearly/monthly; 1: pay-per-use; 2: one-off. |
|
cloud_service_type |
Yes |
String |
Cloud service type |
|
composite_product_id |
No |
String |
Package ID |
|
discount_id |
No |
String |
Discount ID |
|
is_auto_renew |
No |
Integer |
Auto-renewal |
|
period_num |
Yes |
Integer |
Subscription periods |
|
period_type |
Yes |
Integer |
Subscription period type. The options are as follows: 2: month; 3: year. |
|
product_infos |
Yes |
Array of ProductInfoBean objects |
Product information list |
|
promotion_activity_id |
No |
String |
Promotion ID |
|
promotion_info |
No |
String |
Promotion information |
|
region_id |
Yes |
String |
ID of the region where the current project is, for example, xx-xx-1. |
|
zone |
Yes |
String |
Country/Region |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
all_resource_names |
No |
Array of strings |
Resource list |
|
cloud_service_type |
Yes |
String |
Cloud service type |
|
display_id |
No |
String |
Display ID |
|
product_id |
Yes |
String |
Product ID |
|
product_spec_desc |
No |
String |
Product specification description |
|
resource_name |
No |
String |
Resource name |
|
resource_size |
Yes |
Integer |
Number of databases supported by the product or the number of OBS scans supported by the product |
|
resource_size_measure_id |
Yes |
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. |
|
resource_spec_code |
Yes |
String |
Product code |
|
resource_type |
Yes |
String |
Resource type |
|
usage_factor |
No |
String |
Coefficient in use |
|
usage_measure_id |
No |
Integer |
Capacity measurement ID in use |
|
usage_value |
No |
Double |
Value in use |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
order_id |
String |
Order ID |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error Code |
|
error_msg |
String |
Error Message |
Example Requests
Purchase the hws.service.type.sdg cloud service instance for two months for the xxxxxxxxxxxx project in China. This product supports the scanning of XX database or OBS instances.
POST /v1/{project_id}/period/order
{
"charging_mode" : 0,
"cloud_service_type" : "hws.service.type.sdg",
"is_auto_renew" : 0,
"period_num" : 1,
"period_type" : 2,
"region_id" : "xxxxxxxxxxxx",
"zone" : "CH",
"product_infos" : [ {
"cloud_service_type" : "hws.service.type.sdg",
"product_id" : "xxxxxxxxxxxx",
"resource_size" : 30,
"resource_size_measure_id" : 30,
"resource_spec_code" : "base_professional",
"resource_type" : "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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.