Updating Domain Names in a Protection Policy
Function
This API is used to update domain names a policy applies to.
URI
POST /v1/edgewaf/policies/{policy_id}/hosts
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
policy_id |
Yes |
String |
Protection policy ID, which can be obtained by querying the policy list (ListPolicy). |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. It can be obtained by calling the IAM API (value of X-Subject-Token in the response header). |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enterprise_project_id |
No |
String |
Obtain the enterprise project ID by calling the ListEnterpriseProject API of Enterprise Project Management Service (EPS). |
hosts |
Yes |
Array of strings |
ID of the domain name to be associated. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
id |
String |
Policy ID. |
name |
String |
Policy name. |
action |
WafPolicyAction object |
Protection action |
options |
WafPolicyOption object |
Whether a protection item is enabled in a protection policy. |
level |
Integer |
Protection level. |
full_detection |
Boolean |
Detection mode in the precise protection rule. |
robot_action |
WafPolicyAction object |
Information about anti-crawler protection with feature libraries |
bind_host |
Array of WafPolicyBindHost objects |
Basic information about the protected domain. |
timestamp |
Long |
Time a policy was created. |
extend |
Map<String,String> |
Extended field. |
Parameter |
Type |
Description |
---|---|---|
webattack |
Boolean |
Whether basic web protection is enabled. Enumeration values:
|
common |
Boolean |
Whether general check is enabled. Enumeration values:
|
bot_enable |
Boolean |
Whether full anti-crawler protection is enabled. Enumeration values:
|
crawler |
Boolean |
Whether anti-crawler protection with feature libraries is enabled. Enumeration values:
|
crawler_engine |
Boolean |
Whether the search engine is enabled. Enumeration values:
|
crawler_scanner |
Boolean |
Whether the scanner is enabled. Enumeration values:
|
crawler_script |
Boolean |
Whether the JavaScript anti-crawler is enabled. Enumeration values:
|
crawler_other |
Boolean |
Whether other crawler check is enabled. Enumeration values:
|
webshell |
Boolean |
Whether web shell detection is enabled Enumeration values:
|
cc |
Boolean |
Whether the CC attack protection rules are enabled. Enumeration values:
|
custom |
Boolean |
Whether precise protection is enabled. Enumeration values:
|
followed_action |
Boolean |
Whether known attack source detection is enabled. Enumeration values:
|
whiteblackip |
Boolean |
Whether blacklist and whitelist protection is enabled. Enumeration values:
|
geoip |
Boolean |
Whether the geolocation rule is enabled. Enumeration values:
|
ignore |
Boolean |
Whether false alarm masking is enabled. Enumeration values:
|
privacy |
Boolean |
Whether data masking is enabled. Enumeration values:
|
antitamper |
Boolean |
Whether the web tamper protection is enabled. Enumeration values:
|
antileakage |
Boolean |
Whether the information leakage prevention is enabled. Enumeration values:
|
anticrawler |
Boolean |
Whether the JavaScript anti-crawler rule is enabled. Enumeration values:
|
Parameter |
Type |
Description |
---|---|---|
category |
String |
Basic web protection action (log: record only; block: block) Enumeration values:
|
followed_action_id |
String |
Known attack source rule ID |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Domain name ID. |
hostname |
String |
Domain name. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Example Requests
Apply the policy whose ID is 1771a426afcc4e16b8636cb72c2d53e4 to the domain name whose ID is 095b60b21ac248579426f97379b3fbec.
POST https://{Endpoint}/v1/edgewaf/policies/1771a426afcc4e16b8636cb72c2d53e4/hosts { "enterprise_project_id" : 0, "hosts" : [ "095b60b21ac248579426f97379b3fbec" ] }
Example Responses
Status code: 200
Request succeeded.
{ "id" : "1771a426afcc4e16b8636cb72c2d53e4", "name" : "demo_policy", "action" : { "category" : "log" }, "options" : { "webattack" : true, "common" : true, "bot_enable" : true, "crawler" : true, "crawler_engine" : false, "crawler_scanner" : true, "crawler_script" : false, "crawler_other" : false, "webshell" : false, "cc" : true, "custom" : true, "followed_action" : false, "whiteblackip" : true, "geoip" : true, "ignore" : true, "privacy" : true, "antitamper" : true, "antileakage" : false, "anticrawler" : false }, "level" : 2, "full_detection" : false, "robot_action" : { "category" : "log" }, "bind_host" : [ { "id" : "095b60b21ac248579426f97379b3fbec", "name" : "domain_name" } ], "timestamp" : 1691478911117 }
Status Codes
Status Code |
Description |
---|---|
200 |
Request succeeded. |
400 |
Request failed. |
401 |
The token does not have required permissions. |
500 |
Internal server error. |
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