Modify the source URI and host rewrite
| Name | Description |
|---|---|
*domain-nameString | the domain whoes need query config |
| Name | Description |
|---|---|
*originRulesRewritesList | Return path rewrite configuration
|
dataIdLong | Add a grid type identifier to represent a specific group of configurations when a customer has multiple groups of configurations. Note: Add grid type identifier: data-id, each group configuration corresponds to a data-id: a. If the customer has passed data-id, specify that modifying one group of configuration items content does not require modifying other group configuration content does not need to be included; B. If the customer enters multiple groups of configuration, some of them have data-id, some have not. If there is transmission, the expression of data-id is used to modify a specific group of configurations, but no expression of data-id is used to add a new group of configurations on the original basis; C. If no data-id is transmitted to the customer, it means that the original configuration is completely covered by this configuration; D. If no configuration parameters are transmitted to the customer, only the domain name and the second level are transmitted. Label, which indicates that clearing this interface corresponds to all configuration of domain name secondary service. (c, D content is consistent with the current solution); e, a gird tag can not be empty, if there is no specific configuration item, then data-id must be filled in, and the value is the actual data-id, indicating the value of clearing this data-id corresponding configuration item; |
*pathPatternString | The URL matching mode supports regularization. If all matches are made, the input can be configured as:.* |
pathPatternHttpString | The protocol of URL matching mode, which is used with path-pattern, is supported by adding parameters: default is empty, blank is default is to support HTTP and HTTPS protocol before URL matching mode path is needed at the same time; Http: URL matches pattern path with HTTP protocol Https: URL matches pattern path with HTTPS protocol Ignore: URL matching mode path without protocol |
exceptPathPatternString | Exceptional URL matching pattern in the same format as path pattern |
exceptPathPatternHttpString | Exceptional URL matching mode protocol, which is used in conjunction with except-path-pattern; participation support: default is empty, blank is default is required to support both HTTP and HTTPS protocol before URL matching mode path; Http: URL matches pattern path with HTTP protocol. Https: URL matches pattern path with HTTPS protocol. Ignore: URL matching mode path without protocol. |
ignoreLetterCaseString | Ignore case or not: the allowable values are true and false, and the default is Ignore |
originInfoString | Back-source information, you can enter IP or domain name. That is, customer source IP or domain name |
*priorityString | Represents the priority execution order of the customer's multi-group redirected content. The bigger the number, the higher the priority. |
originHostString | Back source host,that support to enter domain names; Example: The backsource host of domain name A configures domain name B. When the A domain name requests the source, the requested URL uses the B domain name instead of the A domain name. |
beforeRewritedUriString | Pre-rewrite uri. That is, the original request URI for user access. Support regular configuration |
afterRewritedUriString | The rewritten uri, the request URI configured before-rewrited-uri, is retrieved with the rewritten uri. Rewrite the source path. Support regular configuration |
| Name | Description |
|---|---|
codeString | Error code. It pops up when the HTTPStatus is not 202, and shows the revoking error type of the current request. |
messageString | Response message, and shows as success when it succeeds. |
dataString | Response data. |
| Error code(code) | Description(message) | HTTP status | Semantic |
|---|---|---|---|
| 0 | Success | 202 | Success |
| 26938005 | Parameter format error | 400 | Parameter format error |
| 26938017 | Request body object transformation exception | 400 | Request body object transformation exception |
| 26938018 | Request header format is not supported | 400 | Request header format is not supported |
| 26932001 | Domain name not found | 404 | Domain name not found |
| 26932002 | Domain name does not belong to the customer | 400 | Domain name does not belong to the customer |
| 26933001 | Error DataId | 400 | Error DataId |
| 26935001 | No XXXX configuration items are planned for the package | 400 | No XXXX configuration items are planned for the package |
| 26939999 | System internal anomaly | 500 | System internal anomaly |
#!/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/originrulesrewrites/123344" \
-X "PUT" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-d '{
"originRulesRewrites":[
{
"dataId":"1222",
"pathPattern":".*",
"pathPatternHttp":"http",
"exceptPathPattern":"",
"exceptPathPatternHttp":"",
"ignoreLetterCase":"true",
"originInfo":"127.0.0.1",
"priority":5,
"originHost":"b.example.com",
"beforeRewritedUri":"",
"afterRewritedUri":""
}
]
}'HTTP/1.1 202 Accept
Date: Sun, 05 May 2019 09:08:53 GMT
Content-Type: application/json;charset=utf-8
x-cnc-request-id: 83bbebc7-2c95-47d7
{
"code":"0",
"message":"success",
“data":""
}