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.
パラメータ名 | 説明 |
---|---|
*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 and 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) |
パラメータ名 | 説明 |
---|---|
http status codeInteger | 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 |
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 the My company, for example: xxxx.cdn30.com |
codeString | Request result code |
messageString | Response information, when success is successful |
エラーコード(code) | 説明(message) | HTTPステータスコード | 意味 |
---|---|---|---|
MalformedXML | The XML you provided was not well-formed or did not validate against our published schema. | 400 | The XML provided is incorrect or incompatible with the rules |
InternalError | We encountered an internal error. Please try again. | 500 | Internal errors such as server exception, data acquisition failure, etc. |
DomainAlreadyExists | The domain name you provided is already in our system. | 409 | The added domain name has already existed. |
ConfigError | The domain name is invalid. | 400 | Invalid domain name |
ICPNotFound | There is no ICP number for the domain you provided. | 400 | The domain name you provided does not have a record number. |
InvalidOrigin | Please specify at least one IP or hostname. | 400 | No source ip or source domain name is provided. |
InvalidOrigin | Origin domain and accelerated domain cannot be the same. | 400 | The returned source domain and the accelerated domain name cannot be the same |
InvalidOrigin | The origin IP or hostname is invalid. | 400 | The source ip/domain name is invalid. |
InvalidOrigin | {"$domainName":{"src-ip":"Duplicate source ip or source domain name."}} | 400 | Returned source ip is repeated |
CustomizedCnameError | Customized CNAME error. | 409 | Customer sharing a level 1 error |
ConfigFormNotExists | The configuration does not exist. | 400 | Configuration does not exist |
CnameError | CNAME error. | 409 | Shared first level error |
CnameError | The cname label has one more templet forms | 400 | The common level belongs to multiple configuration order templates. |
InvalidOrigin | {"$domainName":{"$xmlTag":"$msg"}} | 400 | Domain name attribute value is incorrect |
InvalidOrigin | {"$domainName":{"ssl":"No certificate id when use ssl."}} | 400 | No certificate id is passed when using the certificate |
ConfigError | The specified service type does not exist. | 400 | No corresponding service order |
ConfigError | parameter custSuitType is blank. | 400 | The external acceleration type of the parameter is empty |
ConfigError | can not find form id for domain: [$domainName] | 400 | Cannot find the configuration list of the domain name |
ConfigError | can not find service form for domain: [$domainName] | 400 | Cannot find the service form for the domain name |
ConfigError | The suit does not match the suit associated with the value of cname-label. | 409 | The specified configuration does not match the specified shared primary domain name. |
ConfigError | The service-type does not match the service-type associated with the value of cname-label. | 400 | The specified acceleration type does not match the specified shared first-level domain name. |
NoSuchConfigTemplet | The specified config templet does not exist. | 404 | The configuration template does not exist. |
NO_AVAILABLE_CONFIG | Can not find effective ConfServiceForm by input parameter custSuitType : [$CustSuitType] | 400 | Cannot find a suitable ticket based on the type of acceleration |
PARSE_PARAM_ERROR | Error parameter. | 400 | Input parameter parsing error |
NULL_DOMAIN_NAME | Domain name is null. | 400 | Domain name is empty |
STAGING_SUIT_ERROR | can not find any suit | 400 | Package is not found |
SUIT_HAS_NOT_CONFIG_CERTIFICATE_SERVICE | The suit belong to serviceForm does not have a certificate service. | 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 | {"$configXmlTag":"$msg"}orWrong delete data id $dataIdorWrong data id $dataId | 400 | Configuring single configuration item error |
MAIN_DOMAIN_NAME_EXIST | Main domain names exists for domain [$errDomainNames] | 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"}