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.
パラメータ名 | 説明 |
---|---|
*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. |
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 / |
header-of-clientipString | Pass the response header of client IP. The optional values are Cdn-Src-Ip and X-Forwarded-For. The default value is Cdn-Src-Ip. |
auto-add-certificateString | Auto add certificate when value is 1. |
*versionString | The current version is 1.0.0 |
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] |
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) |
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) |
accelerate-no-chinaString | The optional value is: true or false. |
*item-idString | The id of product, such as 10 |
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-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. |
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. |
*contract-idString | The id of contract, such as 40015677 |
referenced-domain-nameString | The value should be an effective domain. The added domain will copy the config of this domain. |
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. |
*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-portString | Origin port, Value cannot be zero |
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-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. |
commentString | Remarks, up to 1000 characters |
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. |
パラメータ名 | 説明 |
---|---|
codeString | Request result code |
httpStatusInteger | httpstatus=202; Indicates that the new domain API was successfully invoked, and the current deployment of the new domain can be viewed using x-cnc-request-id in the header |
cnameString | The name of the service domain automatically generated by the My company, for example: xxxx.cdn30.com |
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. |
x-cnc-request-idString | Uniquely identified id for querying tasks per request (for all API) |
messageString | Response information, when success is successful |
エラーコード(code) | 説明(message) | HTTPステータスコード | 意味 |
---|---|---|---|
MalformedXML | The XML provided is incorrect or incompatible with the rules | 400 | The XML provided is incorrect or incompatible with the rules |
InternalError | Internal errors such as server exception, data acquisition failure, etc. | 500 | Internal errors such as server exception, data acquisition failure, etc. |
DomainAlreadyExists | The added domain name has already existed. | 409 | The added domain name has already existed. |
ConfigError | Invalid domain name | 400 | Invalid domain name |
ICPNotFound | The domain name you provided does not have a record number. | 400 | The domain name you provided does not have a record number. |
InvalidOrigin | No source ip or source domain name is provided. | 400 | No source ip or source domain name is provided. |
InvalidOrigin | The returned source domain and the accelerated domain name cannot be the same | 400 | The returned source domain and the accelerated domain name cannot be the same |
InvalidOrigin | The source ip/domain name is invalid. | 400 | The source ip/domain name is invalid. |
InvalidOrigin | Returned source ip is repeated | 400 | Returned source ip is repeated |
CustomizedCnameError | Customer sharing a level 1 error | 409 | Customer sharing a level 1 error |
ConfigFormNotExists | Configuration does not exist | 400 | Configuration does not exist |
CnameError | Shared first level error | 409 | Shared first level error |
CnameError | The common level belongs to multiple configuration order templates. | 400 | The common level belongs to multiple configuration order templates. |
InvalidOrigin | Domain name attribute value is incorrect | 400 | Domain name attribute value is incorrect |
InvalidOrigin | No certificate id is passed when using the certificate | 400 | No certificate id is passed when using the certificate |
ConfigError | No corresponding service order | 400 | No corresponding service order |
ConfigError | The external acceleration type of the parameter is empty | 400 | The external acceleration type of the parameter is empty |
ConfigError | Cannot find the configuration list of the domain name | 400 | Cannot find the configuration list of the domain name |
ConfigError | Cannot find the service form for the domain name | 400 | Cannot find the service form for the domain name |
ConfigError | The specified configuration does not match the specified shared primary domain name. | 409 | The 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. | 400 | The specified acceleration type does not match the specified shared first-level domain name. |
NoSuchConfigTemplet | The configuration template does not exist. | 404 | The configuration template does not exist. |
NO_AVAILABLE_CONFIG | Cannot find a suitable ticket based on the type of acceleration | 400 | Cannot find a suitable ticket based on the type of acceleration |
PARSE_PARAM_ERROR | Input parameter parsing error | 400 | Input parameter parsing error |
NULL_DOMAIN_NAME | Domain name is empty | 400 | Domain name is empty |
STAGING_SUIT_ERROR | Package is not found | 400 | Package 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. | 400 | The 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 | 400 | Configuring single configuration item error |
MAIN_DOMAIN_NAME_EXIST | Primary domain already exists | 400 | Primary domain already exists |
#!/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://api.cdnetworks.com/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",
"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://api.cdnetworks.com/api/domain/1234567
cname: 7nt6mrh7sdkslj.cdn30.com
{"message":"success"}