createCustomRule
Create a custom rule. See [eCDN Custom Rules](https://developer.salesforce.com/docs/commerce/commerce-api/guide/cdn-zones-custom-rules.html).
Operation ID: createCustomRulePOST
https://{shortCode}.api.commercecloud.salesforce.com/cdn/zones/v1/organizations/{organizationId}/zones/{zoneId}/firewall-custom/rules
Request
curl "https://{shortCode}.api.commercecloud.salesforce.com/cdn/zones/v1/organizations/{organizationId}/zones/{zoneId}/firewall-custom/rules" \
-X POST \
-H "content-type: application/json" \
-d '{
"description": "Block traffic for malformed URL requests",
"expression": "(http.request.uri.path matches \"^/path1/.*\")",
"actions": [
"block"
],
"enabled": false,
"position": {
"before": "2c0fc9fa937b11eaa1b71c4d701ab86e"
}
}'
Security
URI parameters
shortCode
string
Required
Default value:
shortCode
zoneId
string
Required
organizationId
string
Required
An identifier for the organization the request is being made by
Minimum characters:
1
Maximum characters:
32
f_ecom_zzxy_prd
Body
Media type:
application/json
{
"description": "Block traffic for malformed URL requests",
"expression": "(http.request.uri.path matches \"^/path1/.*\")",
"actions": [
"block"
],
"enabled": false,
"position": {
"before": "2c0fc9fa937b11eaa1b71c4d701ab86e"
}
}
description
string
Required
A description of the custom rule.
Block traffic for malformed URL requests
expression
string
Required
The expression that determines the custom rule's behavior.
(http.request.uri.path matches \"^/path1/.*\")
actions
array of string
Required
The action(s) applied by the custom rule.
[
null
]
enabled
boolean
Whether or not the custom rule is enabled.
true
position
object
Used to specify the position of a rule.
Responses
Successfully created the custom rule requested by the caller.
{
"data": {
"ruleId": "ffffe61cf25e4ec49c34b029ff3060f7",
"description": "Block traffic for malformed URL requests",
"expression": "(http.request.uri.path matches \"^/path1/.*\")",
"actions": [
"block"
],
"lastUpdated": "2022-12-14T21:25:22.329194Z",
"enabled": false
}
}
Body
Media type:
application/json
data
object
Required
A custom rule.