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

Creating an Audit Instance in Yearly/Monthly Billing Mode

Function

Creating an Audit Instance in Yearly/Monthly Billing Mode

URI

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

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition:

Project ID You can obtain the value by calling the IAM API for querying the project list of a specified IAM user.

** Restrictions**:

N/A

Range:

The value is subject to the return value of the IAM service interface. The value contains 32 to 64 characters.

** Default value**:

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

** Parameter description**:

User token. You can obtain the token by calling the IAM API used to query the user token. The token is the value of X-Subject-Token in the response header.

** Restrictions**:

N/A

** Value range**:

Used by the IAM service to query the user token.

** Default value**:

N/A

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Instance name Range:

  • The value can contain a maximum of 64 characters, including letters, digits, 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

Enterprise project ID. 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

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: period-based charging

  • 1: pay-per-use

period_type

Yes

Integer

Subscription period type. The value can be:

  • 0: day

  • 1: week

  • 2: month

  • 4: hour

  • 5: absolute time

-3: year

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

Yes

Integer

Auto-renewal

  • 1: automatic renewal

  • 0: no

Table 4 nics

Parameter

Mandatory

Type

Description

subnet_id

Yes

String

ID of the subnet on which the NIC works.

ip_address

No

String

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

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:

  • 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. JSON character string format: {"specDesc":{"zh-cn":{"key1":"value1"},"en-us":{"key1":"value1"}}}

Table 7 KeyValueBean

Parameter

Mandatory

Type

Description

key

Yes

String

Key

value

No

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

details

Array of DbssErrorDetail objects

PDP5 authentication exception information

encoded_authorization_message

String

PDP5 authentication exception information

error_code

String

Error Codes

error_msg

String

Error message.

Table 10 DbssErrorDetail

Parameter

Type

Description

error_code

String

Error Codes

error_msg

String

PDP5 error information

Status code: 403

Table 11 Response body parameters

Parameter

Type

Description

details

Array of DbssErrorDetail objects

PDP5 authentication exception information

encoded_authorization_message

String

PDP5 authentication exception information

error_code

String

Error Codes

error_msg

String

Error message.

Table 12 DbssErrorDetail

Parameter

Type

Description

error_code

String

Error Codes

error_msg

String

PDP5 error information

Status code: 500

Table 13 Response body parameters

Parameter

Type

Description

details

Array of DbssErrorDetail objects

PDP5 authentication exception information

encoded_authorization_message

String

PDP5 authentication exception information

error_code

String

Error Codes

error_msg

String

Error message.

Table 14 DbssErrorDetail

Parameter

Type

Description

error_code

String

Error Codes

error_msg

String

PDP5 error information

Example Requests

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

{
  "flavor_ref" : "st6.xlarge.4",
  "name" : "DBSS-acc3",
  "vpc_id" : "4c035747-f77b-4c6d-b23b-cb3a2b96c7e6",
  "availability_zone" : "cn-north-7c",
  "comment" : "",
  "region" : "cn-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-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"
  } ]
}

Example Responses

Status code: 200

Success

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

Status Codes

Status Code

Description

200

Success

400

Failed

403

Authorization failed.

500

Server error.

Error Codes

See Error Codes.