Development Document

Domain Details Download PDF Document

Endpoint

Request URL: domain (GET)

Endpoint Domain Name: cdn.api.baishan.com
Endpoint Version: v2

Endpoint Description

Request domain name details including Domain name ID, CNAME, Type of acceleration service, service status and basic configuration information, etc.

Notice: See the Response Header for the frequency limit. Cannot request more than 60 times per minute.

API Parameters

Notice: Please request the API token from your account team.

Request Parameters (GET)

Specify request parameters in the URL query strings, i.e. ?key1=value1&key2=value2.

ParameterData TypeRequirementDescription
domainsstringRequiredMultiple domain names (non-live streaming configuration) can be imported for query, separated by commas (,). Up to 10 domain names at a time.ie. aa.qingcdn.com, bb.qingcdn.com.This parameter also supports imported Domain ID.

Sample Request:

curl -X GET
"https://cdn.api.baishan.com/v2/domain?token=xxx&domains=aa.qingcdn.com,bb.qingcdn.com"

Sample Response

Json format.

{
    "code": 0,  //0 = Success. Other code is displayed if the request failed
    "data": [
        {
            "id": "31335",
            "domain": "aa.qingcdn.com",
            "type": "download",
            "status": "serving",
            "cname": "aa.qingcdn.com.qingcdn.com.",
            "config": {
                "cache_rule": [
                     {
                        "type": 4,
                        "time": "1",
                        "timeunit": "D",
                        "pattern": "\\.(png|jpg)",
                        "ignore_no_cache": true,
                        "ignore_query": true
                    }
                ],
                "origin": {
                    "default_master": "1.1.1.1",
                    "origin_mode": "default",
                    "ori_https": "no",
                    "port": ""  //only support domain with HTTPS configuration to inquire origin port information.
                }
            }
        },
        {
            "id": "32810",
            "domain": "bb.qingcdn.com",
            "type": "page",
            "status": "suspend",
            "cname": "bb.qingcdn.com.qingcdn.com.",
            "config": {
                "referer": {
                    "allow_empty": false,
                    "type": 1,
                    "list": [
                        "*.qingcdn.com",
                        "new.vx.qingcdn.com"
                    ]
                },
                "origin": {
                    "default_master": "133.233.133.33",
                    "default_slave": "12.13.41.21",
                    "origin_mode": "custom",
                    "ori_https": "no",
                    "port": 8080,
                    "dx_master": "133.233.133.33,11.11.11.12",  //China Telecom main source
                    "dx_slave": "12.13.41.21,11.11.11.11",     //China Telecom back-up source
                    "lt_master": "133.233.133.33,11.11.11.12",  //China Unicom main source
                    "lt_slave": "12.13.41.21,11.11.11.11",     //China Unicom back-up source
                    "yd_master": "133.233.133.33,11.11.11.11",  //China Mobile main source
                    "yd_slave": "12.13.41.21,11.11.11.12"     //Chian Mobile back-up source
                },
                "origin_host": {
                    "host": "test.qingcdn.com"
                }
            }
         }
      ]
}

Response Parameters

ParameterData TypeDescription
idstringDomain ID
domainsstringDomain name
cnamestringDomain name CNAME
typestringDomain name business type: page, download, video_demand, live_video, dynamic and other
statusstringDomain name service status: deployment, serving, deleted, suspend

Config Parameter Description

Origin Settings

ParameterData TypeDescription
default_masterstringDefault origin. Can provide up to six IPs or domain names, separated by a comma (,). For example, "133.233.133.33,133.233.22.33".
default_slavestringBackup origin. Can provide up to six IPs or domain names, separated by a comma (,). For example, "133.233.133.33,133.233.22.33". Backup origins MUST be different from the default origins.
origin_modestringSelect the protocol Baishan servers should use to contact the origin with. The values can be http, https, default, custom.
origin_mode=http: forward requests to the origins via HTTP and port 80.
origin_mode=https : forward requests to the origins via : forward HTTPS and port 443.
requests to the origins via the same protocol as the end user’s request.
origin_mode=custom: customize ori_https and port number.
ori_httpsstringSpecify whether HTTPS should be used when contacting the origin. The options are . Can only be used when.
portintSpecify the port number to use when contacting the origin. Default is port 80. Can only be used when origin_mode=custom. (0- 65535)

Origin host

ParameterData TypeDescription
hoststringSpecify what the host header should be when contacting the origin,for example,"test.qingcdn.com"

refer (referer-based hotlink protection)

ParameterData TypeDescription
typeintType of protection:
1: Blacklist,
2: Whitelist.
listarrayThe whitelist or blacklist. Multiple entries can be separated by a comma (,). Wildcard values must start with *. For example, ["*.aaa.qingcdn.com","www.qingcdn.com","*.test.com"] "*.test.com" includes any matching host headers and empty host headers.
allow_emptybooleanThe value is true by default. true= allow the connections even when the referrer header is empty, false= blocks the connections if the referrer header is empty.

cache_rule

ParameterData TypeDescription
typeintTypes of caching rules:
1: file extension,
2: directory,
3: complete path match,
4: Regular expression (RegEx).
patternstringCaching rules separated by a commas. For example,
When type=1,jpg,png,gif,
When type=2,/product/index,/test/index,/user/index,
When type=3,/index.html,/test/*.jpg,/user/get?index,
When type=4, see RegEx Explanation section below. The caching rules will be applied if an URL matches the RegEx. By default, query string is a part of the cache key, expires header is ignored, but no-cache header is prioritized and honored.] "*.test.com" includes any matching host headers and empty host headers.
timeintCaching time-to-live (TTL). Use with the timeunit parameter below. The maximum TTL is 2 years. If time=0, a no-cache rule is applied to the specified pattern.
timeunitstringUnit of the TTL value above. The unit is s (second) by default. Other options are Y,M,D,h,i,s (year, month, day, hour, minute, second).
ignore_no_cachebooleanIgnore the no-cache header from the origin. The value is off by default. Only valid when TTL>0. It can be set to on,off.
ignore_querybooleanIgnore the expires header from the origin. The value is on by default. Only valid when TTL>0. It can be set to on,off.

ip_black_list

ParameterData TypeDescription
listarrayIP blacklist with entries separated by a comma. Up to 200 entries. For example, ["1.1.1.0/24", "2.2.2.2", "3.3.3.3"]. /8, /16, and /24 CIDR blocks are supported, but no repetition is allowed.

Response Header

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
X-RateLimit-Remaining: 60 
X-RateLimit-Limit: 60   
X-RateLimit-Grad: minute  
X-Retry-After: 30   
Api-id: 31741661

HTTP Status Codes

Error CodeDescription
404Bad request URLs.
401Authorization Error: Invalid token or lack of access.
400Bad request parameters.
200Success.
5xxPlease contact your account team.
CopyRight © 2015-2022 BaishanCloud . All Rights Reserved.