UpdateCdnDomain

Update time: 2024-04-17 14:15:52

Modify the configurations of the specified accelerated domain name.

  • Limit Description: · 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.
  • Single user trigger frequency: 300/5min
  • Applicable Products: Media Acceleration Live Broadcast,Content Acceleration,Dynamic Web Acceleration,Media Acceleration,Flood Shield,Flood Shield 2.0

Request

Path Params

NameDescription
*domainString
The domain you are going to modify, it can be domain id or domain name.

Body Params

NameDescription
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 through the url. If the response is neither 2** nor 3** response, it is considered that the primary source ip is faulty, and is used at this time.
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 [/]

Response

Body Params

NameDescription
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

Error code(code)Description(message)HTTP statusSemantic
InvalidParameterThe request has null config with null data-id, please remove it.400The request has null config with null data-id, please remove it.
InternalErrorWe encountered an internal error. Please try again.500Internal errors such as server exceptions, data acquisition failures, etc.
MalformedXMLThe XML you provided was not well-formed or did not validate against our   published schema.400The XML provided is incorrect or irregular
NoSuchDomainThe specified domain does not exist.404The specified domain name does not exist
ForbiddenThe domain is being deleted403Domain name deleted
ConfigErrorRenaming the domain is not permitted.400Domain name change is not allowed
ConfigErrorThe service type cannot be changed.400Domain name type is not allowed to be changed
ConfigErrorThe config form id cannot be changed.400No change to configuration sheet template ID is allowed
ConfigErrorThe suit does not match the suit associated with the value of cname-label.409Specified Configuration does not match Specified Shared Level 1 Domain Name
InvalidOrigin{"$domainName":{"$xmlTag":"$msg"}}400Error in domain name attribute value
InvalidOriginOrigin domain and accelerated domain can not be the same.400origin domain names and accelerated domain names cannot be the same
InvalidOriginThe origin IP or hostname is invalid.400Illegal return ip/domain name
InvalidOrigin{"$domainName":{"src-ip":"Duplicate source ip or source domain name."}}400IP duplication
InvalidOrigin{"$domainName":{"src-host":"Not in suit."}}400Package does not plan to return to source requests HOST
InvalidOrigin{"$domainName":{"src-host":"Error source host."}}400HoST configuration error for backsource request
InvalidOriginCan not change advanced source ip or source domain name.400Can't modify the advanced source of domain name
CustomizedCnameErrorCustomized CNAME error.409Customized CNAME error.
ConfigVersionOutOfDateThe specified version is out of date.409The version you provided has expired
CnameErrorCNAME cancel.400Cname Error
ConfigFormNotExistsThe configuration does not exist.400Error in domain name service area entry parsing
NO_DOMAIN_2_UPDATENo domain to update.400Configuration does not exist
DOMAIN_NOT_USE_SSLThe domain $domainName does not use ssl.400Configuration does not exist domain names without associated certificates
NOT_SUPPORT_CERTIFICATE_CONFIGuse ssl must all or no400Certificates must be used or cancelled at the same time
NOT_SUPPORT_CERTIFICATE_CONFIGuse ssl type useForSni is diff400Certificate types are inconsistent
NOT_SUPPORT_CERTIFICATE_CONFIGuse ssl type useForSni is {$type}, but certId to more400Traditional (Sni) certificates are used, but multiple certificates are used
NOT_SUPPORT_CERTIFICATE_CONFIGuse tra but cnameLabel certId and use certId diff400Traditional certificates are used, but the certificates corresponding to cnamelabel are inconsistent with the certificates used
NO_AVAILABLE_HTTPS_SERVICE_FORMNo available https serviceForm to switch from http serviceForm [testForm] to   https serviceForm.400There is no available httpps service order to switch
NO_AVAILABLE_HTTPS_SERVICE_FORMProduct Line is limited for http serviceForm [testForm].400The product line of the current service order is not within the scope of allowing switching HTTPS service orders
NO_AVAILABLE_HTTPS_SERVICE_FORMNo suitId for http serviceForm [testForm]400There is no package ID in the current service list
NO_AVAILABLE_HTTPS_SERVICE_FORMIsUseSsl not all used for domains in the same configForm.400All domain names under the same configuration must use certificates at the same time.
APPG_NAME_EMPTYThe appGroupName is empty.400Application Service Group Check Failed (Application Service Group Name is Empty)
APPG_NOT_SUPPORT_HTTPS_8_APIThe appGroup does not support HTTPS by API.400Application Service Group failed to check (Application Service Group does not open HTTPS self-service)
APPG_NOT_SUPPORT_HTTPSThe appGroup does not support HTTPS.400Application Service Group failed to check (Application Service Group does not open HTTPS self-service)
SERVICE_TYPE_NOT_USE_SNI_SSLThe domain service type can't use sni ssl.400Domain name configuration cannot use SNI certificates
SUIT_HAS_NOT_CONFIG_CERTIFICATE_SERVICEThe suit belong to serviceForm does not have a certificate service.400The 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 $dataId400Configuration Single Configuration Item Error
CONFIG_NOT_OWN_DOMAIN_NAMECan not deal with domain name [{$name}].400Cannot process the domain name
DUPLICATE_DOMAIN_NAMECan not operate 2 domain with the same name.400Domain name duplication in entry

Example

JSON
XML
JSON
Request example
Copy Copy success
#!/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"
}'
Response example
Copy Copy success
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"}
Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!