Baidu AI Cloud
中国站

百度智能云

CDN Abroad

Create the Domain Name Interface

Interface

This interface is used to create an accelerated domain name.

Method Path Description
POST /v2/abroad/domain/{domain} Create the acceleration domain name

Request Body

Parameter Optional Type Description
domain Required string Accelerated domain name
originConfig Required List Origin server configuration

The originConfig types are as follows:

Parameter Optional Type Description
type Required string Origin server type(IP\ | DOMAIN)
backup Required boolean Is it a standby origin server?
addr Required string Origin server address

Response code(Http Status Code)

Http Status Code Description
201 Created successfully
400 Domain name already exists, domain name check failed, lack necessary parameters, parameter value error and domain name blocked.
403 Quota is insufficient.

Response body

Parameter Type Description
status string The status returned after it was just created successfully is OPERATING.
cname string The CNAME domain name generated is accelerated by the user through acceleration domain name CNAME to the domain name

Request instance

POST /v2/abroad/domain/test.bcecdn.com HTTP/1.1 
Host: cdn.baidubce.com 
Content-Length: 76
Content-Type: application/x-www-form-urlencoded

{ 
    "originConfig":[ 
        { 
            "type": "IP", 
            "backup": false, 
            "addr": "1.1.1.1" 
        } 
    ] 
} 

Response example

HTTP/1.1 201 Created 
Server: nginx 
Date: Wed, 21 Nov 2018 07:06:44 GMT 
Content-Type: application/json; charset=utf-8 
Connection: keep-alive 
x-bce-request-id: 8eb227da-55b6-87ac-3388-7fa3df2c09e5

{ 
    "status":"OPERATING", 
    "cname":"test.bcecdn.com.g.dbydns.com" 
}
Previous
Query Interface for Ddomain Name List
Next
Enable the Acceleration Domain Name Interface