Media Acceleration VoD

AddCdnDomain

更新時間: 2026-07-29 14:47:56

When you apply the non-live-streaming acceleration service for specified domain. Content Acceleration, Dynamic Web Acceleration, Download Acceleration are supported. The newly added domains can be deployed in a fast mode after the following requirements are met service form for relevant acceleration type; and application that no manual review needed are finished. By default, manual review is required. When creating Accelerated domain inside china or outside china, the requirements are as below. 1. To create the accelerated domain inside china - The accelerated domain name MUST obtain an ICP license - Keep the core requirement of obtaining ICP certification Accelerated domain names should not contain the following information: the sale of controlled drugs and tools, unlawful remarks and information. Video-related accelerated domain names must have Audio Visual Services License; blog forums or community-related accelerated domain names must have BBS special approval qualifications. 2. To create the accelerated domain outside china - The accelerated domain name MUST use accelerate-no-china = true that indicates that the customer domain name is not accelerated in China. Note: 1. Data format: Both request and response support XML. 2. Recommended frequency: 1 times per15min.

  • リミットの詳細: · The accelerated domain name must have been filed. · Accelerated domain names must not contain the following information: sales of drugs and controlled tools, including illegal speech and information. · Video-accelerated domain names must have audiovisual licenses; blog forums or community-based accelerated domain names must have BBS special approval qualifications. · Interface requests and return results only accept xml format.
  • 単一ユーザーの使用頻度: 300/5min
  • 使用できるプロダクト: Content Acceleration,Dynamic Web Acceleration,Media Acceleration VoD,Flood Shield,Flood Shield 2.0
API認証の詳細については、以下を参照してください:API認証の概要

リクエストパラメータ

Body パラメータ

パラメータ名説明
*versionString

The current version is 1.0.0

*domain-nameString

CDN accelerated domain name. Support generic domain name, witch starts with a dot, such as: .example.com, If the domain example.com have China ICP, then the domain name xx.example.com have ICP too.

referenced-domain-nameString

The value should be an effective domain. The added domain will copy the config of this domain.

config-form-idString

Configure single template. If you want to add a new accelerated domain name with a specified configuration, you can use a specified configured template. For details, please consult the corresponding customer support staff.

accelerate-no-chinaString

The optional value is: true or false.

*contract-idString

The id of contract, such as 40015677

*item-idString

The id of product, such as 10

cname-labelString

An alias for public service cname. When you have multiple domains that need to share a cname, then you may specify a cname-label here. If domains use the same cname-label, they will share the same cname and has the same dns coverage. Note: 1. Restrictions on domains with the same cname-label: they should have the same acceleration type, certificate (if use ssl), service areas. 2. Multiple http domains can share the same cname; multiple sni https domains can share the same cname as wll. 3. When a single domain uses a cname-label, it can be cancelled acceleration; while multiple domains are not allowed to cancel acceleration for part of them.

commentString

Remarks, up to 1000 characters

header-of-clientipString

Pass the response header of client IP. The optional values are Cdn-Src-Ip, X-Forwarded-For and ori_X-Forwarded-For. The default value is Cdn-Src-Ip.

*origin-configObject

Back-to-origin policy setting, which is used to set the origin site information and the back-to-origin policy of the accelerated domain name

origin-ipsString

Origin site address, which can be an IP or a domain name.

  1. IP is separated by semicolons and multiple IPs are supported.
  2. Only one domain name can be entered. IP and domain names cannot be entered at the same time.
  3. Maximum character limit is 500.
default-origin-host-headerString

The Origin HOST for changing the HOST field in the return source HTTP request header. Note: It should be domain or IP format. For domain name format, each segement separated by a dot, does not exceed 62 characters, the total length should not exceed 128 characters.

origin-portString

Origin port, Value cannot be zero

live-configObject

Live domain configuration, used to set the livestream acceleration domain origin config. Note: In addition to the API call permission, you need to contact the dedicated customer service to apply for the corresponding API client template.

stream-typeString

The live push-pull stream type, the optional values are pull and push, pull means pull flow; push means push flow.

origin-push-hostString

The push-pull domain name is used to set the push-flow domain name corresponding to the live streaming domain name. When the stream-type is pull, at least one of the source IP address and the corresponding push-stream domain name is not empty. When the stream-type is push, Incoming.

origin-ipsString

Source station IP. When the stream-type is pull, at least one of the source station IP and the companion push stream domain name is not empty.

  1. If it is a push-pull flow package, fill in 127.0.0.1, and the system will also default to 127.0.0.1.
  2. If it is directly returning to the source, fill in the source IP of the source pull stream.
publish-pointsList

Livestream domain settings. Set the publishing point of the live push-pull domain. note:

  1. The pull stream and the corresponding push stream domain must be configured with the same publishing point.
  2. If you are not going to modify the publishing point, please do not pass this param.
  3. The publishing point adopts the overlay update. Each time you modify, you need to submit all the publishing points. You cannot submit only the parts that need to be modified.
uriString

Publish point, support multiple, multiple values separated by ||,do not pass the system by default to generate a publishing point uri for slash /

sslObject

SSL settings, to bind a certificate with the accelerated domain. You can use the interface [AddCertificate] to upload your certificates. If you want to modify a certificate, please use the interface: [UpdateCertificate]

use-sslString

Use a certificate, the optional values are true and false, true means to use the certificate, false means not to use the certificate

use-for-sniString

Use sni certificate, the optional values are true and false, true means use sni certificate, false means use shared certificate (not supported)

ssl-certificate-idInteger

Use sni certificate, the optional values are true and false, true means use sni certificate, false means use shared certificate (not supported)

auto-add-certificateString

Auto add certificate when value is 1.

control-group-nameString

Control group name, specifies which control group the domain will be added to.If a sub-account does not specify a service group, it will be added under the main account by default, which may result in a lack of permission to query.

http-code-cache-rulesList

Status Code Caching Rule Configuration, parent node

  1. When you need to set status code caching rules, this must be filled in.
http-codesList

Configure HTTP status code, parent node

cache-ttlString

Define the caching time of the specified status code in units s, 0 to indicate no caching

websocket-switchObject

Open or close websocket function, parent node, you can set <websocketSwitch/> to clear this configuration. Scope of application: wsa, web pages

is-open-websocketString

Whether to turn on the websocket function, the allowable values are true and false, default false

rewrite-rule-settingsList

redirection function note:

  1. Define a set of internal redirected content. If there is internal redirected content, this field is required.
after-valueString

Configuration item: new url Indicates the protocol method after rewriting, such as: http://$1

file-typeString

gif png bmp jpeg jpg html htm shtml mp3 wma flv mp4 wmv zip exe rar css txt ico js swf m3u8 xml f4m bootstarp ts

custom-file-typeString

Matching condition: Custom file type, please separate them by semicolon.

operators-areaString

Region

ignore-letter-caseString

Ignore case, the optional value is true or false, true means to ignore case; false means not to ignore case; When adding a new configuration item, the default is not true. If the client passes a null value: such as <ignore-letter-case></ignore-letter-case>, the configuration is cleared.

exceptional-operators-areaString

Exceptional region

exceptional-requestString

Exceptional Request Method

path-patternString

The url matching mode supports fuzzy regularization. If all matches, the input parameters can be configured as:

custom-patternString

Matching conditions: specify common types, optional values are all or homepage 1. all: all files 2. homepage: home page

request-wayString

Request Method

priorityString

Indicates the priority execution order of multiple sets of redirected content by the customer. The higher the number, the higher the priority. When adding a new configuration item, the default is 10

uaString

UA

directoryString

directory

exception-request-headerString

Matching condition: Exception request header

exceptional-uaString

Exceptional UA

request-headerString

Matching condition: Request header

except-path-patternString

Exceptional url matching mode, except for certain URLs: such as abc.jpg, no content redirection Customer reference: ^https?://[^/]+/.*.m3u8

before-valueString

Configuration item: old url Indicates the protocol mode before rewriting (that is, the object that needs to be rewritten), such as: ^https://([^/]+/.*)

http2-settingObject

Http2.0 settings, used to enable or disable http2.0, parent node.

enable-http2String

Enable http2.0. The optional values are true and false. If it is empty, the default value is false. True means http2.0 is on; false means http2.0 is off.

back-to-origin-protocolString

Back-to-origin protocol, the optional value is http1.1: Use the HTTP1.1 protocol version to back to source. if not filled, use it as default. follow-request: Same as client request protocol http2.0: Use the HTTP2.0 protocol. version to back to source.

back-to-origin-rewrite-ruleObject

Back to origin rewrite rule.

protocolString

The specified protocol is either http or https.

portString

If the protocol is http, the default is 80. If the protocol is https, the default is 443

header-modify-rulesList

Http header settings note:

  1. indicating that you need to set the http header, this field is required
path-patternString

The url matching mode supports fuzzy regularization. If all matches, the input parameters can be configured as:

except-path-patternString

Exception url matching pattern, support regular. Example:

custom-patternString

Matching conditions: specify common types, optional values are all or homepage. 1. all: all files 2. homepage: home page

file-typeString

Matching conditions: file type, please separate by semicolon, optional values: gif png bmp jpeg jpg html htm shtml mp3 wma flv mp4 wmv zip exe rar css txt ico js swf m3u8 xml f4m bootstarp ts.

custom-file-typeString

Matching condition: Custom file type, separate by semicolon.

directoryString

Directory

specify-urlString

Matching Condition: Specify URL. The input parameter does not support the URI format starting with http(s)://

request-methodString

The matching request method, the optional values are: GET, POST, PUT, HEAD, DELETE, OPTIONS, separate by semicolons.

header-directionString

The control direction of the http header, the optional value is cache2visitor/cache2origin/visitor2cache/origin2cache, single-select. Cache2origin refers to the source direction---corresponding to the configuration item return source request; Cache2visitor refers to the direction of the client back - the corresponding configuration item returns to the client response; Visitor2cache refers to receiving client requests Origin2cache refers to the receiving source response

actionString

The control type of the http header supports the addition and deletion of the http header value. The optional value is add|set|delete, which is single-selected. Corresponding to the header-name and header-value parameters.

  1. Add: add a header
  2. Set: modify the header value
  3. Delete: delete the header Note: priority is delete > set > add
allow-regexpString

Http header regular match, optional value: true / false. True: indicates that the value of the header-name is handled as a regular match. False: indicates that the value of the header-name is processed according to the actual parameters, and no regular match is made. Do not pass the default is false

header-nameString

Http header name, add or modify the http header, only one is allowed; delete the http header to allow multiple entries, separated by a semicolon ';'. Note: The operation of the special http header is limited, and the http header and operation type of the operation are allowed. This item is required and cannot be empty When the action is add: indicates that the header-name header is added. When the action is set: modify the header-name header When the action is delete: delete the header-name header

header-valueString

The value corresponding to the HTTP header field, for example: mytest.example.com Note:

  1. When the action is add or set, the input parameter must be passed a value
  2. When the action is delete, the input parameter is not passed Support to get the value of specified variable by keyword, such as client IP, including: Key words: meaning

#timestamp: current time, timestamp as 1559124945 #request-host: host in the request header #request-url: request url, which contains the full path of the protocol domain name, etc., such as http://aaa.aa.com/a.html #request-uri: request uri, relative path format, such as /index.html #origin- IP: return source IP #cache-ip: edge node IP #server-ip: external service IP #client-ip: client IP, or visitor IP #response-header{XXX} : get the value in the response header, such as #response-header{etag}, get the etag value in response-header #header{XXX} : to get the value in the HTTP header of the request, such as #header{user-agent}, is to get the user-agent value in the header #cookie{XXX} : get the value in the cookie, such as #cookie{account}, is to get the value of the account set in the cookie

header-value-oldString

The original value corresponding to the HTTP header field

request-headerString

Match request header, header values support regular, header and header values separated by Spaces, e.g. : Range bytes=[0-9]{9,}

priorityString

Indicates the priority of execution order for multiple sets of configurations. A higher number indicates higher priority. If no parameters are passed, the default value is 10 and cannot be cleared.

except-file-typeString

Exception file type.

except-directoryString

Exception directory.

except-request-methodString

Exception request method.

except-request-headerString

Exception request header.

overrideString

HTTP Header Override Option, Values: true/false/.Empty string true: If the specified header already exists, the original header will be overwritten. If the header does not exist, a new header will be added. false: If the specified header already exists, the original header remains unchanged. If the header does not exist, a new header will be added. Empty string: indicating to clear the configuration Note: This override operation only applies to the cache2origin and cache2visitor directions.

cache-behaviorsList

Cache time configuration note:

  1. When you need to cancel the cache time configuration setting, you can pass in the empty node <cache-time-behaviors></cache-time-behaviors>.
  2. When it is required to set the cache time configuration, this item is required.
path-patternString

The url matching mode supports fuzzy regularization. If all matches, the input parameters can be configured as: *

except-path-patternString

Exceptional url matching mode, except for some URLs: such as abc.jpg, do not do anti-theft chain function E.g: ^https?://[^/]+/.*.m3u8

custom-patternString

Specify common types: Select the domain name that requires the cache to be all files or the home page. : E.g: All: all files Homepage: homepage

file-typeString

File Type: Specify the file type for cache settings. File types include: gif png bmp jpeg jpg html htm shtml mp3 wma flv mp4 wmv zip exe rar css txt ico js swf If you need all types, pass all directly. Multiples are separated by semicolons, and all and specific file types cannot be configured at the same time.

custom-file-typeString

Custom file type: Fill in the appropriate identifiable file type according to your needs outside of the specified file type. Can be used with file-type. If the file-type is also configured, the actual file type is the sum of the two parameters.

specify-url-patternString

Specify URL cache: Specify url according to requirements for cache INS format does not support URI format with http(s)://

directoryString

Directory: Specify the directory cache. Enter a legal directory format. Multiple separated by semicolons

cache-ttlString

Cache Time: Set the time corresponding to the cache object. Input Parameters format: integer, set to 0 if no cache is used. There is no upper limit on the cache time rule. The time is set attuned to the customer's own needs. If the customer feels that some of the files does not change frequently, then the setting is longer. For example, the text class js, css, html, etc. can be set shorter, the picture, video and audio classes can be set longer (because the cache time will be replaced by the new file due to the file heat algorithm, the suggestion is that the length should not exceed one month)If you want to modify the caching rules, this item is required.

ignore-cache-controlString

Ignore the source station does not cache the header. The optional values are true and false, which are used to ignore the two configurations of cache-control in the request header (private, no-cache) and the Authorization set by the client. The ture indicates that the source station's settings for the three are ignored. Enables resources to be cached on the service node in the form of cache-control: public, and then our nodes can cache this type of resource and provide acceleration services. False means that when the source station sets cache-control: private, cache-control: no-cache for a resource or specifies to cache according to authorization, our service node will not cache such files.

is-respect-serverString

Respect the server: Accelerate whether to prioritize the source cache time. Optional values: true and false True: indicates that the server is time-first False: The cache time of the CDN configuration takes precedence.

ignore-letter-caseString

Ignore case, the optional value is true or false, true means to ignore case; false means not to ignore case; When adding a new configuration item, the default is not true.

reload-manageString

Reload processing rules, optional: ignore or if-modified-since If-modified-since: indicates that you want to convert to if-modified-since Ignore: means to ignore client refresh

priorityString

Indicates the priority execution order of multiple sets of redirected content by the customer. The higher the number, the higher the priority. When adding a new configuration item, the default is 10

ignore-authentication-headerString

You can set it 'true' to cache ignoring the http header 'Authentication'. If it is empty, the header is not ignored by default.

uaString

UA

exception-uaString

Exceptional UA

uri-match-patternString

Specify URI match pattern. E.g: exact: exact match parameter-ignoring: parameter ignoring match

cache-unitString

Cache Time unit: Set the time unit corresponding to the cache object: such as s, m, h, d. If no unit is entered, the default is seconds.

origin-rules-rewritesList

Return path rewrite configuration

  1. When you need to set the rewrite configuration of the backsource path, this must be filled in
path-patternString

The URL matching mode supports regularization. If all matches are made, the input can be configured as:.*

path-pattern-httpString

The protocol of URL matching mode, which is used with path-pattern, is supported by adding parameters: default is empty, blank is default is to support HTTP and HTTPS protocol before URL matching mode path is needed at the same time;

Http: URL matches pattern path with HTTP protocol

Https: URL matches pattern path with HTTPS protocol

Ignore: URL matching mode path without protocol

except-path-patternString

Exceptional URL matching pattern in the same format as path pattern

except-path-pattern-httpString

Exceptional URL matching mode protocol, which is used in conjunction with except-path-pattern; participation support: default is empty, blank is default is required to support both HTTP and HTTPS protocol before URL matching mode path;

Http: URL matches pattern path with HTTP protocol. Https: URL matches pattern path with HTTPS protocol. Ignore: URL matching mode path without protocol.

ignore-letter-caseString

Ignore case or not: the allowable values are true and false, and the default is Ignore

origin-infoString

Back-source information, you can enter IP or domain name. That is, customer source IP or domain name

priorityString

Represents the priority execution order of the customer's multi-group redirected content. The bigger the number, the higher the priority.

origin-hostString

Back source host,that support to enter domain names; Example: The backsource host of domain name A configures domain name B. When the A domain name requests the source, the requested URL uses the B domain name instead of the A domain name.

before-rewrited-uriString

Pre-rewrite uri. That is, the original request URI for user access. Support regular configuration

after-rewrited-uriString

The rewritten uri, the request URI configured before-rewrited-uri, is retrieved with the rewritten uri. Rewrite the source path. Support regular configuration

change-serversList

Change servers configuration, parent tag

  1. This must be filled when the hotlinking configuration of streaming media needs to be set
target-serverString

If it is a universal domain name, set it to a universal domain name, for example,.56.com.

resource-group-idString

Resource group id, a numeric string, for example, '19672066263443386'.

レスポンスパラメータ

レスポンスヘッダ

パラメータ名説明
x-cnc-request-idString

Uniquely identified id for querying tasks per request (for all API)

locationString

The URL used to access the domain information, where domain-id is the unique token generated by our cloud platform for the domain name and whose value is a string.

cnameString

The name of the service domain automatically generated by system.

Body パラメータ

パラメータ名説明
codeString

Request result code

messageString

Response information, when success is successful

エラーコード

エラーコード(code)説明(message)HTTPステータスコード意味
MalformedXML

The XML provided is incorrect or incompatible with the rules

400The XML provided is incorrect or incompatible with the rules
InternalError

Internal errors such as server exception, data acquisition failure, etc.

500Internal errors such as server exception, data acquisition failure, etc.
DomainAlreadyExists

The added domain name has already existed.

409The added domain name has already existed.
ConfigError

Invalid domain name

400Invalid domain name
ICPNotFound

The domain name you provided does not have a record number.

400The domain name you provided does not have a record number.
InvalidOrigin

No source ip or source domain name is provided.

400No source ip or source domain name is provided.
InvalidOrigin

The returned source domain and the accelerated domain name cannot be the same

400The returned source domain and the accelerated domain name cannot be the same
InvalidOrigin

The source ip/domain name is invalid.

400The source ip/domain name is invalid.
InvalidOrigin

Returned source ip is repeated

400Returned source ip is repeated
CustomizedCnameError

Customer sharing a level 1 error

409Customer sharing a level 1 error
ConfigFormNotExists

Configuration does not exist

400Configuration does not exist
CnameError

Shared first level error

409Shared first level error
CnameError

The common level belongs to multiple configuration order templates.

400The common level belongs to multiple configuration order templates.
InvalidOrigin

Domain name attribute value is incorrect

400Domain name attribute value is incorrect
InvalidOrigin

No certificate id is passed when using the certificate

400No certificate id is passed when using the certificate
ConfigError

No corresponding service order

400No corresponding service order
ConfigError

The external acceleration type of the parameter is empty

400The external acceleration type of the parameter is empty
ConfigError

Cannot find the configuration list of the domain name

400Cannot find the configuration list of the domain name
ConfigError

Cannot find the service form for the domain name

400Cannot find the service form for the domain name
ConfigError

The specified configuration does not match the specified shared primary domain name.

409The specified configuration does not match the specified shared primary domain name.
ConfigError

The specified acceleration type does not match the specified shared first-level domain name.

400The specified acceleration type does not match the specified shared first-level domain name.
NoSuchConfigTemplet

The configuration template does not exist.

404The configuration template does not exist.
NO_AVAILABLE_CONFIG

Cannot find a suitable ticket based on the type of acceleration

400Cannot find a suitable ticket based on the type of acceleration
PARSE_PARAM_ERROR

Input parameter parsing error

400Input parameter parsing error
NULL_DOMAIN_NAME

Domain name is empty

400Domain name is empty
STAGING_SUIT_ERROR

Package is not found

400Package is not found
SUIT_HAS_NOT_CONFIG_CERTIFICATE_SERVICE

The service order is of the https type, but the related service does not have the relevant secondary service for configuring the certificate.

400The service order is of the https type, but the related service does not have the relevant secondary service for configuring the certificate.
ERROR_CONFIG_PARAM

Configuring single configuration item error

400Configuring single configuration item error
MAIN_DOMAIN_NAME_EXIST

Primary domain already exists

400Primary domain already exists
InvalidControlGroupName

Invalid Control Group Name

400Invalid Control Group Name

入力例

JSON
XML
JSON FOR LIVE-PUSH
JSON FOR LIVE-PULL
XML FOR LIVE-PUSH
XML FOR LIVE-PULL
JSON
リクエスト例
コピー コピー完了
#!/bin/bash
username="example_username"
apiKey='example_apiKey'
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://{@apiDomain}/cdnw/api/domain" \
-X "POST" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-d '{
  "version": "1.0.0",
  "domain-name": "www.example.com",
  "contract-id": "40012086",
  "item-id": "10",
  "control-group-name": "ShareResourceFor_example",
  "origin-config":{
        "origin-ips":"1.1.1.0"
    },
    "referenced-domain-name":"aaa.linlytest.com",
    "ssl":{
         "use-ssl":"true",
         "ssl-certificate-id":"certificate ID"
    }
}'
レスポンス例
コピー コピー完了
HTTP/1.1 202 Accepted
Date: Fri, 17 May 2017 06:33:26 GMT
Content-Type: application/xml;charset=utf-8
x-cnc-request-id:c54cbbb4-19fe-407a-930c-3988b62ed2fd
Location:https://{@apiDomain}/api/domain/1234567
cname: 7nt6mrh7sdkslj.cdn30.com
{"message":"success"}