Updated on 2024-01-15 GMT+08:00

Creating an Audit Instance in Yearly/Monthly Billing Mode

Function

This API is used to Creating an audit instance in yearly/monthly billing mode.

URI

POST /v2/{project_id}/dbss/audit/charge/period/order

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-type

Yes

String

The fixed value of this parameter is application/json;charset=UTF-8, which cannot be changed.

X-Auth-Token

Yes

String

User token

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

flavor_ref

Yes

String

Specifies the ID of the specifications used by the ECS.

name

Yes

String

ECS name. Value range: Enter a maximum of 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. If the number of ECSs to be created is greater than 1, the length cannot exceed 59 characters.

vpc_id

Yes

String

VPC ID

availability_zone

Yes

String

Availability zone to which the ECS belongs. (Primary and secondary AZs are separated by commas. Example: az1.dc1,az2.dc2)

enterprise_project_id

Yes

String

Enterprise project ID.

nics

Yes

Array of nics objects

NIC of the ECS.

security_groups

Yes

Array of security_groups objects

Information about the security group to which the ECS belongs.

comment

No

String

Remarks

region

Yes

String

ID of the region where the ECS is located.

cloud_service_type

Yes

String

Service type. Default value: hws.service.type.dbss

charging_mode

Yes

Integer

Billing mode: 0: yearly/monthly 1: pay-per-use

period_type

Yes

Integer

Subscription period type: 0: day 1: week 2: month t3: year 4: hour 5: absolute time

period_num

Yes

Integer

Subscription period

subscription_num

Yes

Integer

Subscription quantity. Only one set of DBSS can be subscribed to.

product_infos

Yes

Array of product_infos objects

Product list

tags

No

Array of KeyValueBean objects

Resource tag

promotion_info

No

String

Discount information

is_auto_renew

No

Integer

Auto-renewal: The value 1 indicates auto-renewal is enabled, and the value 0 indicates auto-renewal is disabled.

Table 4 nics

Parameter

Mandatory

Type

Description

subnet_id

Yes

String

Subnet ID of the NIC.

ip_address

No

String

Specifies the IP address. If the value of this parameter is left blank or is set to an empty string, the IP address is automatically assigned.

Table 5 security_groups

Parameter

Mandatory

Type

Description

id

Yes

String

Specifies the ID of the security group corresponding to the ECS. This ID takes effect for the NIC configured on the ECS.

Table 6 product_infos

Parameter

Mandatory

Type

Description

product_id

Yes

String

Product ID

cloud_service_type

Yes

String

Service type. Default value: hws.service.type.dbss

resource_type

Yes

String

Resource type. Default value: hws.resource.type.dbss

resource_spec_code

Yes

String

Resource specifications.dbss.bypassaudit.low, dbss.bypassaudit.medium, dbss.bypassaudit.high

product_spec_desc

Yes

String

Product specification description.

Table 7 KeyValueBean

Parameter

Mandatory

Type

Description

key

Yes

String

Key

value

Yes

String

Value

Response Parameters

Status code: 200

Table 8 Response body parameters

Parameter

Type

Description

description

String

Description

code

String

Return code

order_id

String

Order ID

Status code: 400

Table 9 Response body parameters

Parameter

Type

Description

error

Object

Error message.

Table 10 ErrorDetail

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error information.

Status code: 403

Table 11 Response body parameters

Parameter

Type

Description

error

Object

Error message.

Table 12 ErrorDetail

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error information.

Status code: 500

Table 13 Response body parameters

Parameter

Type

Description

error

Object

Error message.

Table 14 ErrorDetail

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error information.

Example Requests

/v2/{project_id}/dbss/audit/charge/period/order

{
  "flavor_ref" : "st6.xlarge.4",
  "name" : "DBSS-acc3",
  "vpc_id" : "4c035747-f77b-4c6d-b23b-cb3a2b96c7e6",
  "availability_zone" : "region-north-7c",
  "comment" : "",
  "region" : "region-north-7",
  "nics" : [ {
    "subnet_id" : "6201dcf2-1374-43ec-ae8b-78b4081572d3"
  } ],
  "security_groups" : [ {
    "id" : "04088976-9c63-4e6b-9070-84e6a30c782b"
  } ],
  "cloud_service_type" : "hws.service.type.dbss",
  "charging_mode" : 0,
  "period_type" : 2,
  "period_num" : 1,
  "subscription_num" : 1,
  "is_auto_renew" : 0,
  "product_infos" : [ {
    "product_id" : "00301-225396-0--0",
    "cloud_service_type" : "hws.service.type.dbss",
    "resource_type" : "hws.resource.type.dbss",
    "resource_spec_code" : "dbss.bypassaudit.low",
    "product_spec_desc" : "test"
  } ],
  "promotion_info" : "",
  "enterprise_project_id" : "0",
  "tags" : [ {
    "key" : "key_test",
    "value" : "1"
  } ]
}

Example Responses

Status code: 200

Success

{
  "description" : " Success",
  "code" : "0",
  "order_id" : "CS1710190909OGQIS"
}

Status code: 400

Failure

{
  "error" : {
    "error_code" : "DBSS.XXXX",
    "error_msg" : "XXX"
  }
}

Status Codes

Status Code

Description

200

Success

400

Failure

403

Authentication failed.

500

Server error.

Error Codes

See Error Codes.