Help Center/ Database Security Service/ API Reference/ API/ Audit Instance/ Creating an Audit Instance in Yearly/Monthly Billing Mode
Updated on 2025-06-19 GMT+08:00

Creating an Audit Instance in Yearly/Monthly Billing Mode

Function

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

Calling Method

For details, see Calling APIs.

URI

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

Table 1 URI parameter

Parameter

Mandatory

Parameter Type

Description

project_id

Yes

String

Project ID.

Request Parameter

Table 2 Request header parameter

Parameter

Mandatory

Parameter Type

Description

X-Auth-Token

Yes

String

User token. The token can be queried by calling the IAM API. (The token is the value of X-Subject-Token in the response header.)

Table 3 Request body parameter

Parameter

Mandatory

Parameter Type

Description

name

Yes

String

Instance name. The options are as follows:

  • A name must contain 1 to 64 characters including digits, letters, underscores (_), and hyphens (-),

flavor_ref

Yes

String

Specifies the ID of the specifications used by the ECS.

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

No

String

Specifies the ID of the enterprise project Mandatory for interconnecting with EPS.

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

Indicates the remarks.

region

Yes

String

ID of the region where the ECS is located.

cloud_service_type

Yes

String

Service type:

  • hws.service.type.dbss

charging_mode

Yes

Integer

Billing mode:

  • 0: yearly/monthly
  • 1: pay-per-use

period_type

Yes

Integer

Subscription period type. The value can be:

  • 0: day
  • 1: week
  • 2: month
  • 3: year
  • 4: hour
  • 5: absolute time

period_num

Yes

Integer

Number of subscription periods

subscription_num

Yes

Integer

Number of subscriptions.

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

  • 1: automatic renewal
  • 0: no
Table 4 nics

Parameter

Mandatory

Parameter Type

Description

subnet_id

Yes

String

ID of the subnet on which the NIC works.

ip_address

No

String

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

Table 5 security_groups

Parameter

Mandatory

Parameter 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

Parameter Type

Description

product_id

Yes

String

Product ID.

cloud_service_type

Yes

String

Service Type:

  • hws.service.type.dbss

resource_type

Yes

String

Resource type:

  • hws.resource.type.dbss

resource_spec_code

Yes

String

Resource specifications: - dbss.bypassaudit.low-dbss.bypassaudit.medium-dbss.bypassaudit.high

product_spec_desc

No

String

Product specification description, including the host name, specifications, VPC, and subnet. JSON string format: {"specDesc":{"zh-cn":{" Host name ":"value1"," Specification ":"value2"," VPC ":"value3"," Subnet ":"value4"},"en-us":{"Instance Name":"value1","Edition":"value2","VPC":"value3","Subnet":"value4"}}}

Table 7 KeyValueBean

Parameter

Mandatory

Parameter Type

Description

key

Yes

String

Tag key.

value

No

String

Value

Response Parameters

Status code: 200

Table 8 Response body parameter

Parameter

Parameter Type

Description

description

String

Description

code

String

Returned code

order_id

String

Specifies an order ID.

Status code: 400

Table 9 Response body parameter

Parameter

Parameter Type

Description

error

Object

Error message.

Table 10 ErrorDetail

Parameter

Parameter Type

Description

error_code

String

Error code

error_msg

String

Error message

Status code: 403

Table 11 Response body parameters

Parameter

Parameter Type

Description

error

Object

Error message.

Table 12 ErrorDetail

Parameter

Parameter Type

Description

error_code

String

Error code

error_msg

String

Error message

Status code: 500

Table 13 Response body parameter

Parameter

Parameter Type

Description

error

Object

Error message.

Table 14 ErrorDetail

Parameter

Parameter Type

Description

error_code

String

Error code

error_msg

String

Error message

Example request

/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" : "xx-xx",
  "comment" : "",
  "region" : "xx-xx",
  "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-xxxxxxx-0--0",
    "cloud_service_type" : "hws.service.type.dbss",
    "resource_type" : "hws.resource.type.dbss",
    "resource_spec_code" : "dbss.bypassaudit.low",
    "product_spec_desc" : "{\"specDesc\":{\"zh-cn\":{},\"en-us\":{\"instance Name\":\"DBSS-test\",\"VPC\":\"default_vpc\",\"Subnet\":\"subnet-af32\"}}}"
  } ],
  "promotion_info" : "",
  "enterprise_project_id" : "0",
  "tags" : [ {
    "key" : "key_test",
    "value" : "1"
  } ]
}

Response Examples

Status code: 200

Success

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

Status code: 400

Failed

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

Status Code

Status Code

Description

200

Success

400

Failed

403

Authentication failed.

500

Server error.

Error Codes

For details, see Error Codes.