Media Acceleration VoD,Media Acceleration Live Broadcast,Content Acceleration,Dynamic Web Acceleration
Modify http code cache configurations.
Single user trigger frequency: 300/5min
| Name | Description |
|---|---|
*domain-nameString | the domain whose config needs to be queried |
| Name | Description |
|---|---|
*http-code-cache-rulesList | Status Code Caching Rule Configuration, parent node
1. When you need to set status code caching rules, this must be filled in.
2. Configuration of Clear Status Code Caching Rules for |
*http-codesList | Configure HTTP status code, parent node |
*cache-ttlString | Define the caching time of the specified status code in units s, 0 to indicate no caching |
data-idLong | Data-id is to indicate a specific group configuration when the client has multiple groups of configurations. Data-id can be retrieved through a query interface. Note:
A. If data-id is passed, it means that one group of configuration items is specified to be modified, and no other group configuration items need to be modified.
B. If multiple groups of configurations are included, some of them are configured with data-id and others are not, then the expression of data-id is used to modify a specific group of configurations, and a new group of configurations is added on the original basis without the expression of data-id.
C. If the data-id is not transmitted, it means that the original configuration will be fully covered by this configuration.
D. If no configuration parameter is passed, only domain name and secondary label are passed, which means that all configuration of domain name secondary service corresponding to this interface is cleared.
E. If there is no specific configuration item in a set of configurations, the data-id must be filled in, and the value is the actual data-id, which means clearing the value of the corresponding data-id configuration item; it is not allowed that there is no specific configuration item or data-id in a set of configurations. |
descriptionString | description |
| Name | Description |
|---|---|
codeString | The error code, when HTTPStatus is not 202, indicates the type of error the current request is calling. |
messageString | Response information, when successful |
| Error code(code) | Description(message) | HTTP status | Semantic |
|---|---|---|---|
| InvalidParameter | No http-code-cache-rules was specified.\n\n | 400 | No http-code-cache-rules was specified.\n\n |
| 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. |
| InvalidParameter | The specified http-codes can not be blank. | 400 | The specified http-codes can not be blank. |
| InvalidParameter | The specified http-code can not be blank. | 400 | The specified http-code can not be blank. |
| InvalidParameter | The specified http-code was invalid. | 400 | The specified http-code was invalid. |
| InvalidParameter | The specified cache-ttl can not be blank. | 400 | The specified cache-ttl can not be blank. |
| InvalidParameter | The specified cache-ttl was invalid. | 400 | The specified cache-ttl was invalid. |
| InvalidParameter | No domain was specified. | 400 | No domain was specified. |
| NoSuchDomain | The specified domain does not exist.\n\n\n\n | 404 | The specified domain does not exist.\n\n\n\n |
| CustomerNoOwnDomain | customer not own domain name[XXX]\n\n | 400 | customer not own domain name[XXX]\n\n |
| ConfigError | Can not find effective config form by domain : [xxx]\n\n | 400 | Can not find effective config form by domain : [xxx]\n\n |
| ConfigError | Can not find effective ConfServiceForm by domain : [xxx] | 400 | Can not find effective ConfServiceForm by domain : [xxx] |
| ConfigError | The config xxx does not access. | 400 | The config xxx does not access. |
#!/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/config/httpcodecache/123344" \
-X "PUT" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-d '
{
"http-code-cache-rules":[
{"data-id":13295507,"cache-ttl":"60","http-codes":["404"]},
{"data-id":13295508,"cache-ttl":"30","http-codes":["500","501"]}],
"description":"Description"
}'HTTP/1.1 202 Accepted
Date: Sun, 05 May 2019 09:08:53 GMT
Content-Type: application/json;charset=utf-8
x-cnc-request-id: 83bbebc7-2c95-47d7
{"message":"success"}