Updated on 2026-01-06 GMT+08:00

Creating a Domain Name

Function

This API is used to create a domain name.

Calling Method

For details, see Calling APIs.

URI

POST /v2/aad/domains

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

token

Content-Type

Yes

String

Content-Type

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

domain_name

Yes

String

Domain name

enterprise_project_id

Yes

String

Enterprise project ID. It must be the same as that of the AAD instance. You can view the enterprise project ID in Huawei Cloud EPS. The default enterprise project ID is 0.

ips

Yes

Array of strings

IP addresses of AAD instances. IP addresses of AAD instances must belong to the same enterprise project.

real_server_type

Yes

Integer

Origin server type. 0: origin server IP address. 1: origin server domain name.

port_http

Yes

Array of integers

HTTP port. This parameter and port_https cannot be both empty. You can view the HTTP ports supported by AAD on the console.

port_https

No

Array of integers

HTTPS port. This parameter and port_http cannot be both empty. You can view the HTTPS ports supported by AAD on the console.

real_server

Yes

String

Origin server. (IP address or domain names of the origin server)

overseas_type

Yes

String

Protection region. 0: regions in the Chinese mainland. 1: regions outside the Chinese mainland.

cert_name

No

String

Certificate name. It must be the name of an existing certificate.

waf_switch

No

String

0: enabled. 1: disabled.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

cname

String

CNAME address provided by AAD.

domain_id

String

Domain name ID.

Example Requests

None

Example Responses

Status code: 200

OK

{
  "domainId" : "81c8xxxxxxxxxxxxxxxx11c9",
  "cname" : "29xxxxxxxxxxxx1e.huaweisafedns.cn"
}

Status Codes

Status Code

Description

200

OK

400

Error

Error Codes

See Error Codes.