EditHttpCodeCache

Update time: 2026-08-14 11:19:14

Applicable Products

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

API Description

Modify http code cache configurations.

  • API URL: https://api.atomile.com/api/config/httpcodecache/*
  • Method: PUT
  • 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.

Call frequency

Single user trigger frequency: 300/5min

Request parameter(s)

Path Params

NameDescription
*domain-nameString
the domain whose config needs to be queried

Body Params

NameDescription
*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

Response parameter(s)

Body Params

NameDescription
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

Error code(code)Description(message)HTTP statusSemantic
InvalidParameterNo http-code-cache-rules was specified.\n\n400No http-code-cache-rules was specified.\n\n
InvalidParameterThe request has null config with null data-id, please remove it.400The request has null config with null data-id, please remove it.
InvalidParameterThe specified http-codes can not be blank.400The specified http-codes can not be blank.
InvalidParameterThe specified http-code can not be blank.400The specified http-code can not be blank.
InvalidParameterThe specified http-code was invalid.400The specified http-code was invalid.
InvalidParameterThe specified cache-ttl can not be blank.400The specified cache-ttl can not be blank.
InvalidParameterThe specified cache-ttl was invalid.400The specified cache-ttl was invalid.
InvalidParameterNo domain was specified.400No domain was specified.
NoSuchDomainThe specified domain does not exist.\n\n\n\n404The specified domain does not exist.\n\n\n\n
CustomerNoOwnDomaincustomer not own domain name[XXX]\n\n400customer not own domain name[XXX]\n\n
ConfigErrorCan not find effective config form by domain : [xxx]\n\n400Can not find effective config form by domain : [xxx]\n\n
ConfigErrorCan not find effective ConfServiceForm by domain : [xxx]400Can not find effective ConfServiceForm by domain : [xxx]
ConfigErrorThe config xxx does not access.400The config xxx does not access.

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/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"
}'
Response example
Copy Copy success
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"}