EditDomainConfig

Update time: 2026-08-14 11:23:38

Applicable Products

Content Acceleration,Dynamic Web Acceleration,Media Acceleration VoD,Media Acceleration Live Broadcast

API Description

To modify configuration of the specified domain; both domain name and domain name ID are supported.

Call frequency

Single user trigger frequency: 300/5min

Request parameter(s)

Path Params

NameDescription
*domainString
Domain ID or domain name.

Body Params

NameDescription
versionString
Version, the current version is 1.0.0
commentString
Remarks, up to 1000 characters.
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. )
origin-configObject
Back to origin policy settings for setting source site information and return source policies for accelerated domain names
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.
default-origin-host-headerString
Back-to-origin HOST, used to change the HOST field in the back-to-origin HTTP request header. The supported formats are: ① domain name ③ ip Note: 1. Must comply with the ip/domain name format specification. If it is a domain name, the length of the domain name must be less than or equal to 128 characters.
origin-portString
Origin port.
adv-origin-configsObject
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.
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.
sslObject
SSL settings, to bind a certificate with the accelerated domain. You can use the interface [CreateCertificateV2] to upload your certificates. If you want to modify a certificate, please use the interface: [UpdateCertificateV2]
use-sslString
Use a certificate, true means to use the certificate, false means not to use the certificate
use-for-sniString
Use sni certificate, true means use sni certificate, false means use shared certificate (not supported)
ssl-certificate-idInteger
Certificate ID: The certificate ID returned by the system after successfully adding a new certificate. ssl-certificate-id can only be passed when use-ssl is true.
cache-hostString
Cache file HOST. Cache rules for caching HOST domain names and accelerated domain names must be consistent.
enable-httpdnsString
Enable httpdns settings. The optional values are true and false, true means enabled; false means off. This function is not enabled by default. If you need it, please contact the technical support to apply for this feature.
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.
live-configObject
Live domain name configuration, used to set the push flow of live acceleration domain name
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.
publish-pointsList
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 [/]
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
descriptionString
description
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.
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.
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.

Response parameter(s)

Response Header

NameDescription
x-cnc-request-idString
Uniquely labeled id for querying each requested task (for all interfaces)
x-cnc-deploy-versionString
The corresponding deployment version number of this modification

Body Params

NameDescription
codeString
Error code, which appears when HTTPStatus is not 202, represents the error type of the current request call
messageString
Response information, success when successful

Error code

Error code(code)Description(message)HTTP statusSemantic
InternalErrorServer exception. Encounter internal error including data extraction error.500Server exception. Encounter internal error including data extraction error.
NoSuchDomainDesignated domain name is not found404Designated domain name is not found
ForbiddenDomain name has been deleted403Domain name has been deleted
CustomizedCnameErrorCustomer shares level 1 error409Customer shares level 1 error
CnameErrorShare level 1 error400Share level 1 error
DomainExistsCdnAreaErrorDomain name parse error of service region409Domain name parse error of service region
ConfigFormNotExistsThe configuration does not exist.400The configuration does not exist.
PARAM_INVALIDParameter {0} is null or illegal400Parameter {0} is null or illegal
PARSE_PARAM_ERRORParameter input parse error400Parameter input parse error
NO_DOMAIN_2_UPDATEDomain name is not found when modifying its configuration400Domain name is not found when modifying its configuration
ERROR_CONFIG_PARAMConfiguration error when setting single configuration400Configuration error when setting single configuration
CONFIG_NOT_OWN_DOMAIN_NAMECan not deal with this domain name.400Can not deal with this domain name.
DUPLICATE_DOMAIN_NAMEDomain name duplicates in parameter input400Domain name duplicates in parameter input
InvalidBanUrlShielding url is not unique400Shielding url is not unique
banUrlsExcessiveShielding url is excessive403Shielding url is excessive
banUrlsExistThe shielding url already exists400The shielding url already exists
banUrlsNotExistThe shielding url you want to cancel does not exist400The shielding url you want to cancel does not exist
DOMAIN_NOT_USE_SSLThe domain name does not use the related certificate400The domain name does not use the related certificate
NO_AVAILABLE_HTTPS_SERVICE_FORMCertificate should be used for domain names in the same configuration form.400Certificate should be used for domain names in the same configuration form.
APPG_NAME_EMPTYCannot pass the checking of application group (the application group name is empty)400Cannot pass the checking of application group (the application group name is empty)
APPG_NOT_SUPPORT_HTTPS_8_APICannot pass the checking of application group (The app group does not support HTTPS by API).400Cannot pass the checking of application group (The app group does not support HTTPS by API).
APPG_NOT_SUPPORT_HTTPSCannot pass the checking of application group (The app group does not support PS).400Cannot pass the checking of application group (The app group does not support PS).
MissingBodyLack of requestor400Lack of requestor
MalformedXMLThe xml supplied is incorrect or not in order400The xml supplied is incorrect or not in order
ConfigErrorThe specified configuration does not match the specified common level domain name409The specified configuration does not match the specified common level domain name
InvalidOriginCannot modify the advanced source of a domain name400Cannot modify the advanced source of a domain name
ConfigVersionOutOfDateThe version you provide is out of date409The version you provide is out of date
AtLeastHasOneResultThe format of the live broadcast authentication right cannot be null400The format of the live broadcast authentication right cannot be null
DuplicateAuthorizeCustomParamLive Broadcast Source Authentication Variable Parameter Key Unique Checksum400Live Broadcast Source Authentication Variable Parameter Key Unique Checksum
ERROR_CONFIG_PARAM_SERVICESecondary service background check not approved400Secondary service background check not approved
NOT_SUPPORT_CERTIFICATE_CONFIGUses traditional certificates, but the certificate for cnamelabel does not match the certificate for which it is used400Uses traditional certificates, but the certificate for cnamelabel does not match the certificate for which it is used
SERVICE_TYPE_NOT_USE_SNI_SSLDomain name configuration cannot use sni certificates400Domain name configuration cannot use sni certificates
SUIT_HAS_NOT_CONFIG_CERTIFICATE_SERVICEThe service list is https-type, but there is no certificate-configured related secondary service for the suite400The service list is https-type, but there is no certificate-configured related secondary service for the suite
NOT_ALLOW_SRC_IP_AS_ACCELERATE_DOMAINThe back-to-origin domain of this domain is also another accelerated domain, which may lead to abnormal access to the accelerated domain .400The back-to-origin domain of this domain is also another accelerated domain, which may lead to abnormal access to the accelerated domain .
NOT_ALLOW_ACCELERATE_DOMAIN_AS_SRC_IPThis accelerated domain is duplicated with another back-to-origin domain, which may lead to abnormal access to the accelerated domain.\n400This accelerated domain is duplicated with another back-to-origin domain, which may lead to abnormal access to the accelerated domain.\n

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://{@apiDomain}/api/domain/123344" \
-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": "www.wss.com",
        "default-origin-host-header": "www.baidu.co121"
      },
     "ssl":{
             "use-ssl":"",
             "use-for-sni":"",
             "ssl-certificate-id":""
             },
    "back-to-origin-rewrite-rule":{
      "protocol":"http",
      "port":"80"
    },
    "description":"description"
}'
Response example
Copy Copy success
HTTP/1.1 202 Accepted
Date: Fri, 17 May 2017 06:33:26 GMT
Content-Type: application/json;charset=utf-8
x-cnc-request-id:c54cbbb4-19fe-407a-930c-3988b62ed2fd
{"message":"success"}