Updated on 2025-11-21 GMT+08:00

Adding a Domain Name Group

Function

This API is used to add a domain name group.

URI

POST /v1/{project_id}/domain-set

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID, which can be obtained by calling an API or from the console. For details, see Obtaining a Project ID.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

enterprise_project_id

No

String

Definition

Enterprise project ID. The ID is the enterprise project ID planned based on organization conditions.

Constraints

N/A

Range

N/A

Default Value

0

fw_instance_id

No

String

Definition

Firewall ID. This field has been deprecated.

Definition

N/A

Range

N/A

Default Value

N/A

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

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

Constraints

N/A

Range

N/A

Default Value

N/A

Table 4 Request body parameters

Parameter

Mandatory

Type

Description

fw_instance_id

No

String

Definition

Firewall ID, which can be obtained by referring to Obtaining a Firewall ID.

Constraints

N/A

Range

N/A

Default Value

N/A

object_id

Yes

String

Definition

Protected object ID, which is used to distinguish between Internet border protection and VPC border protection after a cloud firewall is created. You can obtain the ID by calling the API for querying firewall instances. Find the value in data.records.protect_objects.object_id (The period [.] is used to separate different levels of objects).

Constraints

If type is set to 0, object_id is the ID of the protected object at the Internet border. If type is set to 1, object_id is the ID of the protected object at the VPC border. Here, a protected object ID whose type is 1 is used. You can obtain the value of type from data.records.protect_objects.type (The period [.] is used to separate different levels of objects).

Range

N/A

Default Value

N/A

name

Yes

String

Definition

Domain group name.

Constraints

N/A

Range

N/A

Default Value

N/A

description

No

String

Definition

Domain group description.

Constraints

N/A

Range

N/A

Default Value

N/A

domain_names

Yes

Array of DomainSetInfoDto objects

Definition

Domain name information list.

Constraints

N/A

Range

N/A

Default Value

N/A

domain_set_type

No

Integer

Definition

Domain name group type.

Constraints

N/A

Range

  • 0: application domain name group

  • 1: network domain name group

Default Value

N/A

Table 5 DomainSetInfoDto

Parameter

Mandatory

Type

Description

domain_name

Yes

String

Definition

Domain name.

Constraints

N/A

Range

Domain name format. Example: www.example.com

Default Value

N/A

description

No

String

Definition

Domain name description.

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Status code: 200

Table 6 Response body parameters

Parameter

Type

Description

data

DomainSetResponseData object

Definition

Returned data for adding a domain name group.

Range

N/A

Table 7 DomainSetResponseData

Parameter

Type

Description

id

String

Definition

Domain name group ID.

Range

N/A

name

String

Definition

Domain group name.

Range

N/A

Example Requests

Add an application domain name group whose name is test, domain name is www.aaa.com, and protected object ID is fde07429-2e02-45c0-a85f-4f1cacea24d2 to the firewall 546af3f8-88e9-47f2-a205-2346d7090925 in project 9d80d070b6d44942af73c9c3d38e0429.

https://{Endpoint}/v1/9d80d070b6d44942af73c9c3d38e0429/domain-set?fw_instance_id=546af3f8-88e9-47f2-a205-2346d7090925&enterprise_project_id=default

{
  "name" : "test",
  "description" : "",
  "domain_names" : [ {
    "domain_name" : "www.aaa.com",
    "description" : ""
  } ],
  "fw_instance_id" : "546af3f8-88e9-47f2-a205-2346d7090925",
  "object_id" : "fde07429-2e02-45c0-a85f-4f1cacea24d2"
}

Example Responses

Status code: 200

OK

{
  "data" : {
    "id" : "e43db369-a863-45ed-8850-58d6b571b1ab",
    "name" : "test"
  }
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.