Help Center/ Content Delivery Network/ API Reference/ API/ Domain Name Operations/ Copying Domain Configurations to New Domains
Updated on 2025-11-27 GMT+08:00

Copying Domain Configurations to New Domains

Function

This API is used to copy the configuration of an existing domain name to a new domain name.

  • You have enabled CDN.

  • If the service area of a domain name includes the Chinese mainland, the domain name must have been licensed by the Ministry of Industry and Information Technology (MIIT).

  • A single tenant can call this API 20 times per minute.

Calling Method

For details, see Calling APIs.

URI

POST /v1.0/cdn/configuration/domains/duplicate

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token, which 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 2 Request body parameters

Parameter

Mandatory

Type

Description

reference_domain_name

Yes

String

Definition

Existing domain name whose configuration is copied to the new domain name.

Constraints

The domain name must have been added to CDN.

Range

N/A

Default Value

N/A

domain_name

Yes

String

Definition

Domain name to be added to the CDN console for acceleration.

NOTE:
Adding a wildcard domain name automatically enables CDN acceleration for all associated secondary domain names.

Constraints

An acceleration domain name must be unique.

Range

  • A domain name can contain up to 200 characters.

  • A domain name can contain only letters, digits, hyphens (-), and periods (.). It cannot start or end with a hyphen or period.

  • Wildcard characters (*) are supported. A wildcard domain name must start with a wildcard character (*).

  • Each domain name label (for example, *** in ***.***.com) can contain up to 63 characters.

Default Value

N/A

Response Parameters

Status code: 204

Successful response.

Status code: 400

Table 3 Response body parameters

Parameter

Type

Description

error

ErrMsg object

Error code and error message.

Table 4 ErrMsg

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

POST https://cdn.myhuaweicloud.com/v1.0/cdn/configuration/domains/duplicate

{
  "reference_domain_name" : "www.example1.com",
  "domain_name" : "www.example2.com"
}

Example Responses

None

Status Codes

Status Code

Description

204

Successful response.

400

Error response.

Error Codes

See Error Codes.