Updating All Rules in the Rules Engine
Function
This API is used to update all rules in the rules engine.
Calling Method
For details, see Calling APIs.
URI
POST /v1.0/cdn/configuration/domains/{domain_name}/rules/full-update
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
domain_name |
Yes |
String |
Definition Acceleration domain name. Constraints N/A Range N/A Default Value N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
rules |
Yes |
Array of CreateRuleRequest objects |
Definition Rule settings. Multiple rules can be configured. Constraints N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
Yes |
String |
Definition Rule name. Constraints N/A Range 1 to 50 characters. Default Value N/A |
|
status |
Yes |
String |
Definition Whether the rule is enabled. Constraints N/A Range Default Value N/A |
|
priority |
Yes |
Integer |
Definition Rule priority. A larger value indicates a higher priority. Constraints The priority must be unique. Range 1 to 100. Default Value N/A |
|
conditions |
Yes |
Conditions object |
Definition Conditions for triggering the rule. Constraints N/A |
|
actions |
Yes |
Array of Actions objects |
Definition Action to be executed when the rule conditions are met. Constraints N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
match |
Yes |
Match object |
Definition Rule conditions. Constraints N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
logic |
Yes |
String |
Definition Logical operator. Constraints N/A Range Default Value N/A |
|
criteria |
Yes |
Array of Criteria objects |
Definition Match condition list. Constraints N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
match_target_type |
No |
String |
Definition Match target type. Constraints N/A Range Default Value N/A |
|
match_target_name |
No |
String |
Definition Match target name. Constraints N/A Range
Default Value N/A |
|
match_type |
No |
String |
Definition Match algorithm. Constraints N/A Range contains: Any condition specified in match_pattern is matched. Default Value N/A |
|
match_pattern |
No |
Array of strings |
Definition Match content. Constraints N/A Range
Default Value N/A |
|
negate |
No |
Boolean |
Definition Whether to perform negation. This parameter is used together with match_type. For example, if negate is set to true and match_type is set to contains, the actual service logic is converted to not_contains. Constraints N/A Range Default Value false |
|
case_sensitive |
No |
Boolean |
Definition Case insensitive or not. Constraints N/A Range Default Value false |
|
logic |
No |
String |
Definition Nested condition logic operator. Constraints N/A Range Default Value N/A |
|
criteria |
No |
Array of Criteria objects |
Definition Nested condition list. Constraints N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
flexible_origin |
No |
Array of flexibleOriginsEngine objects |
Definition Advanced origin rules. CDN can pull content from different origin servers by resource type or path. Constraints Up to 20 rules. |
|
origin_request_header |
No |
Array of OriginRequestHeader objects |
Definition Rewrite the HTTP headers in request URLs during CDN PoP origin pull. Constraints |
|
http_response_header |
No |
Array of HttpResponseHeader objects |
Definition Headers returned by PoPs to clients. CDN includes them in responses to user requests for resources within that domain name. Constraints |
|
access_control |
No |
AccessControl object |
Definition Access control. Constraints N/A |
|
request_limit_rule |
No |
RequestLimitRulesEngine object |
Definition Request rate limiting. This limits the user request rate within a specific range to reduce costs and the risk of burst bandwidth. Constraints N/A |
|
origin_request_url_rewrite |
No |
Definition Origin request URL rewrite. Constraints Up to 20 rules. |
|
|
cache_rule |
No |
CacheRulesEngine object |
Definition Parameters used to control the cache TTL of origin server resources on CDN PoPs. Constraints N/A |
|
request_url_rewrite |
No |
RequestUrlRewriteEngine object |
Definition Access URL rewrite rules, which are used to redirect user requests to the URLs of cached content. Constraints N/A |
|
browser_cache_rule |
No |
BrowserCacheRulesEngine object |
Definition Browser cache TTL, during which users can obtain content directly from their browser cache (if available). Constraints N/A |
|
error_code_cache |
No |
Array of ErrorCodeCacheEngine objects |
Definition You can cache error codes returned by the origin server on CDN PoPs. When users request the same resources, CDN directly returns the error codes to the users. Constraints N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
sources_type |
Yes |
String |
Definition Origin server type. Constraints N/A Range Default Value N/A |
|
ip_or_domain |
Yes |
String |
Definition IP address or domain name of the origin server. Constraints N/A Range N/A Default Value N/A |
|
obs_bucket_type |
No |
String |
Definition OBS bucket type. Constraints Mandatory when the origin server is an OBS bucket. Range Default Value public |
|
bucket_access_key |
No |
String |
Definition Access key of the third-party bucket. Constraints Mandatory when the origin server is a third-party bucket. Range N/A Default Value N/A |
|
bucket_secret_key |
No |
String |
Definition Secret key of the third-party bucket. Constraints Mandatory when the origin server is a third-party bucket. Range N/A Default Value N/A |
|
bucket_region |
No |
String |
Definition Region of the third-party bucket. Constraints Mandatory when the origin server is a third-party bucket. Range N/A Default Value N/A |
|
bucket_name |
No |
String |
Definition Name of the third-party bucket. Constraints Mandatory when the origin server is a third-party bucket. Range N/A Default Value N/A |
|
host_name |
No |
String |
Definition Host header. Constraints N/A Range N/A Default Value Acceleration domain name. |
|
origin_protocol |
No |
String |
Definition Request protocol for CDN origin pull. Constraints N/A Range Default Value http |
|
http_port |
No |
Integer |
Definition HTTP port. Constraints N/A Range 1 to 65,535. Default Value 80 |
|
https_port |
No |
Integer |
Definition HTTPS port. Constraints N/A Range 1 to 65,535. Default Value 443 |
|
priority |
Yes |
Integer |
Definition Priority. A larger value indicates a higher priority. Constraints N/A Range 1 to 100. Default Value N/A |
|
weight |
Yes |
Integer |
Definition Weight. A larger value indicates that content is pulled from this origin server more frequently. If there are multiple origin servers with the same priority, the weight determines the proportion of content pulled from each origin server. Constraints N/A Range 1 to 100. Default Value N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
type |
Yes |
String |
Definition Access control type. Constraints N/A Range Default Value N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
limit_rate_after |
Yes |
Long |
Definition Rate limit condition.
NOTE:
For example, type=size,limit_rate_after=50 indicates that the speed is limited to the value of limit_rate_value after 50 bytes are transmitted.
Constraints N/A Range 0 to 1,073,741,824, in bytes. Default Value N/A |
|
limit_rate_value |
Yes |
Integer |
Definition Rate limit, that is, the maximum access speed after the rate limit is reached. Constraints N/A Range 0 to 104,857,600, in bit/s. Default Value N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
code |
Yes |
Integer |
Definition Error codes to cache. Constraints N/A Range Default Value N/A |
|
ttl |
Yes |
Integer |
Definition Error code cache TTL. Constraints N/A Range 0 to 31,536,000, in seconds.
NOTE:
The cache TTL of 3XX status codes ranges from 0s to 20s.
Default Value N/A |
Response Parameters
Status code: 204
Request succeeded.
None
Example Requests
POST /v1.0/cdn/configuration/domains/{domain_name}/rules/full-update
{
"rules" : [ {
"name" : "example",
"status" : "on",
"priority" : 1,
"conditions" : {
"match" : {
"logic" : "and",
"criteria" : [ {
"match_target_type" : "scheme",
"match_type" : "contains",
"match_pattern" : [ "HTTP" ],
"negate" : false,
"case_sensitive" : false
} ]
}
},
"actions" : [ {
"access_control" : {
"type" : "block"
}
} ]
} ]
}
Example Responses
None
Status Codes
|
Status Code |
Description |
|---|---|
|
204 |
Request succeeded. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot