Modify the configurations of the specified accelerated domain name.
Name | Description |
---|---|
*domainString | The domain you are going to modify, it can be domain id or domain name. |
Name | Description |
---|---|
versionString | The current version is 1.0.0. |
service-areasString | The acceleration area of the acceleration domain, if the resource coverage needs to be limited according to the area, the acceleration area needs to be specified. When no acceleration area is specified, we will provide acceleration services with optimal resource coverage according to the service area opened by the customer. Multiple regions are separated by semicolons, and the supported regions are as follows: cn (Mainland China), am (Americas), emea (Europe, Middle East, Africa), apac (Asia-Pacific region). |
cname-labelString | If you need to share a CNAME between domains, you can use this parameter. This parameter is a unique label for a public CNAME. Domains with the same cname-label will have the same CNAME.
Note:
1. Domains with the same cname-label have the same coverage.
2. Constraints of sharing a CNAME: consistent service-type, consistent certificate-id (if there is a certificate), consistent service-areas
3. Multiple http domains can share a CNAME, multiple sni https domains can share a CNAME too.
4. When a cname-label is used by a single domain, then the domain can be canceled acceleration. While a cname-label using by more then one domains, they can not be canceled acceleration.
5. Support the purpose of modifying cname by modifying cname-label. ) |
commentString | Remarks, up to 1000 characters |
cache-hostString | Cache file HOST.
Cache rules for caching HOST domain names and accelerated domain names must be consistent. |
header-of-clientipString | Pass the response header of client IP. The optional values areCdn-Src-Ip and X-Forwarded-For. The default value isCdn-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 address, which can be an IP or domain name.
1. Multiple IPs are supported, separated by semicolons.
2. Only one domain name is allowed. IP and domain name cannot exist at the same time.
3. The length cannot exceed 500 characters.
4. The number of IPs cannot exceed 15.
|
adv-origin-configsObject | |
detect-urlString | The advanced origin monitoring url, and requests |
detect-periodString | Advanced source monitoring period, and the unit is in seconds, optional as an integer greater than or equal to 0, 0 means no monitoring |
adv-origin-configList | adv-origin-config |
master-ipsString | The advanced source mainly returns the source IP. Multiple IPs are separated by a semicolon ';', and the returned source IP cannot be repeated. |
backup-ipsString | Advanced source backup source IP, multiple IPs are separated by semicolon ';', and the returned source IP cannot be duplicated. |
default-origin-host-headerString | The Origin HOST for changing the HOST field in the return source HTTP request header. It should be domain name or IP format. For domain name, each segement separated by a dot, does not exceed 62 characters, the total length should not exceed 128 characters. |
origin-portString | Origin port. |
live-configObject | Live domain configuration, used to set the push and pull domain of live streaming. |
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 | A matching push domain name is used to set up a current domain name corresponding to the live streaming domain name. When the stream-type is pull, the source station IP and the supporting current domain name are at least one empty; when stream-type is push, it does not need to be introduced. |
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, and the optional values are true and false, true means using this certificate, false means not using the certificate. |
use-for-sniString | Use sni certificate, and the optional values are true and false, true means using sni certificate, false means using shared certificate (not supported) |
ssl-certificate-idString | Certificate ID, and it is the certificate ID returned by the system after the new certificate is successfully added. |
cache-behaviorsList | Cache policy settings are for setting cache rules for accelerated domain names |
path-patternString | The url matching mode supports fuzzy regularization. The optional values are?: /(a|b)/*.(jpg|bmp|png|gif) and other regular contents. If you want to modify the caching rules, this item is required. |
priorityString | Indicates the priority of a configuration, the larger the value, the higher the priority. |
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. |
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. |
ignore-cache-controlString | Ignore that 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 is set by the client. |
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 | Livestream domain settings. Publish point, support multiple, do not pass the system by default to generate a publishing point uri for [/] |
Name | Description |
---|---|
codeString | Error code occurs when HTTP Status is not 202, indicating the error type of the current request calls. |
messageString | Response information, demonstrates success when it is successful. |
Error code(code) | Description(message) | HTTP status | Semantic |
---|---|---|---|
InvalidParameter | The request has null config with null data-id, please remove it. | 400 | The request has null config with null data-id, please remove it. |
InternalError | We encountered an internal error. Please try again. | 500 | Internal errors such as server exceptions, data acquisition failures, etc. |
MalformedXML | The XML you provided was not well-formed or did not validate against our published schema. | 400 | The XML provided is incorrect or irregular |
NoSuchDomain | The specified domain does not exist. | 404 | The specified domain name does not exist |
Forbidden | The domain is being deleted | 403 | Domain name deleted |
ConfigError | Renaming the domain is not permitted. | 400 | Domain name change is not allowed |
ConfigError | The service type cannot be changed. | 400 | Domain name type is not allowed to be changed |
ConfigError | The config form id cannot be changed. | 400 | No change to configuration sheet template ID is allowed |
ConfigError | The suit does not match the suit associated with the value of cname-label. | 409 | Specified Configuration does not match Specified Shared Level 1 Domain Name |
InvalidOrigin | {"$domainName":{"$xmlTag":"$msg"}} | 400 | Error in domain name attribute value |
InvalidOrigin | Origin domain and accelerated domain can not be the same. | 400 | origin domain names and accelerated domain names cannot be the same |
InvalidOrigin | The origin IP or hostname is invalid. | 400 | Illegal return ip/domain name |
InvalidOrigin | {"$domainName":{"src-ip":"Duplicate source ip or source domain name."}} | 400 | IP duplication |
InvalidOrigin | {"$domainName":{"src-host":"Not in suit."}} | 400 | Package does not plan to return to source requests HOST |
InvalidOrigin | {"$domainName":{"src-host":"Error source host."}} | 400 | HoST configuration error for backsource request |
InvalidOrigin | Can not change advanced source ip or source domain name. | 400 | Can't modify the advanced source of domain name |
CustomizedCnameError | Customized CNAME error. | 409 | Customized CNAME error. |
ConfigVersionOutOfDate | The specified version is out of date. | 409 | The version you provided has expired |
CnameError | CNAME cancel. | 400 | Cname Error |
ConfigFormNotExists | The configuration does not exist. | 400 | Error in domain name service area entry parsing |
NO_DOMAIN_2_UPDATE | No domain to update. | 400 | Configuration does not exist |
DOMAIN_NOT_USE_SSL | The domain $domainName does not use ssl. | 400 | Configuration does not exist domain names without associated certificates |
NOT_SUPPORT_CERTIFICATE_CONFIG | use ssl must all or no | 400 | Certificates must be used or cancelled at the same time |
NOT_SUPPORT_CERTIFICATE_CONFIG | use ssl type useForSni is diff | 400 | Certificate types are inconsistent |
NOT_SUPPORT_CERTIFICATE_CONFIG | use ssl type useForSni is {$type}, but certId to more | 400 | Traditional (Sni) certificates are used, but multiple certificates are used |
NOT_SUPPORT_CERTIFICATE_CONFIG | use tra but cnameLabel certId and use certId diff | 400 | Traditional certificates are used, but the certificates corresponding to cnamelabel are inconsistent with the certificates used |
NO_AVAILABLE_HTTPS_SERVICE_FORM | No available https serviceForm to switch from http serviceForm [testForm] to https serviceForm. | 400 | There is no available httpps service order to switch |
NO_AVAILABLE_HTTPS_SERVICE_FORM | Product Line is limited for http serviceForm [testForm]. | 400 | The product line of the current service order is not within the scope of allowing switching HTTPS service orders |
NO_AVAILABLE_HTTPS_SERVICE_FORM | No suitId for http serviceForm [testForm] | 400 | There is no package ID in the current service list |
NO_AVAILABLE_HTTPS_SERVICE_FORM | IsUseSsl not all used for domains in the same configForm. | 400 | All domain names under the same configuration must use certificates at the same time. |
APPG_NAME_EMPTY | The appGroupName is empty. | 400 | Application Service Group Check Failed (Application Service Group Name is Empty) |
APPG_NOT_SUPPORT_HTTPS_8_API | The appGroup does not support HTTPS by API. | 400 | Application Service Group failed to check (Application Service Group does not open HTTPS self-service) |
APPG_NOT_SUPPORT_HTTPS | The appGroup does not support HTTPS. | 400 | Application Service Group failed to check (Application Service Group does not open HTTPS self-service) |
SERVICE_TYPE_NOT_USE_SNI_SSL | The domain service type can't use sni ssl. | 400 | Domain name configuration cannot use SNI certificates |
SUIT_HAS_NOT_CONFIG_CERTIFICATE_SERVICE | The suit belong to serviceForm does not have a certificate service. | 400 | The service list is of HTTPS type, but the package does not have a certificate-related secondary service. |
ERROR_CONFIG_PARAM | {"$configXmlTag":"$msg"}orWrong delete data id $dataIdorWrong data id $dataId | 400 | Configuration Single Configuration Item Error |
CONFIG_NOT_OWN_DOMAIN_NAME | Can not deal with domain name [{$name}]. | 400 | Cannot process the domain name |
DUPLICATE_DOMAIN_NAME | Can not operate 2 domain with the same name. | 400 | Domain name duplication in entry |
#!/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/api/domain/a1.example.com" \ -X "PUT" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json" \ -H "Content-Type:application/json" \ -d '{ "comment": "my comment here", "origin-config": { "origin-ips": "1.1.1.0", "default-origin-host-header": "a.example.com" }, "ssl":{ "use-ssl":"", "use-for-sni":"", "ssl-certificate-id":"" }, "cache-behaviors": [{ "path-pattern": "/jpg", "ignore-cache-control": "true", "cache-ttl": "1800", "cache-unit": "s" }] "header-of-clientip":"X-Forwarded-For" }'
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 x-cnc-deploy-version:1420084740000 {"message":"success"}