Skip to main content
Version: 10.1

Ruleset Resource

Description​

This resource is for manipulating individual ruleset entries in a zone. Currently rulesets map exclusively to AT61 regexes.

GET /rulesets/:ID​

Get data about the selected ruleset.

GET Parameters​

NameRequiredTypeDescriptionDefault Value
:IDYesURLThe unique numeric ID of the ruleset. 

GET Response Values​

NameTypeDescription
descriptionJSON StringA description of the applied ruleset.
protocolJSON StringThe protocol used for the ruleset. Will be one of "TCP", "UDP", or "ICMP".
applicationJSON StringThe application used by this ruleset. Currently only "regex" is supported.
portJSON NumberThe destination port to which this ruleset applies. If 0, applies to any traffic over the selected protocol.
enabledJSON BooleanWhether or not the ruleset is enabled.
ruleset_resourceJSON StringThe resource for this ruleset. Should return the resource used for the GET request.
zone_resourceJSON StringThe zone resource for the zone which is using this ruleset.
rulesJSON ArrayA list of rules in the ruleset. Current this defaults to contain a single object, containing each of the elements listed below.
fieldJSON StringThis will default to "Regex".
predicateJSON StringThis will default to "is".
valueJSON StringThis is a backslash escaped representation of the rule. Practically speaking, this will be the regex that is applied in the listed zone.
rule_resourceJSON StringThe rule resource for the individual rule object.

Example GET Request​

 GET /rulesets/118

Example GET Response​

{
"description": "Regex Name",
"protocol": "TCP",
"application": "regex",
"port": 80,
"enabled": true,
"ruleset_resource": "/rulesets/118",
"zone_resource": "/zones/2031",
"rules": [
{
"field": "Regex",
"predicate": "is",
"value": "(?i)\\x0d\\x0aUser-Agent: [^\\x0d]*WordPress[^\\x0d]*\\x0d\\x0a",
"rule_resource": "/rules/107"
}
]
}

PUT /ruleset/:ID​

Updates the given ruleset. In order to update a ruleset, it must be part of the current ruleset revision for the zone.

PUT Parameters​

NameRequiredTypeDescriptionDefault Value
:IDYesURLThe unique numeric ID of the ruleset. 
descriptionNoJSON StringA new description of the ruleset.null
protocolYesJSON StringThe protocol that the ruleset should apply to. Must be one of "TCP", "UDP", or "ICMP". 
portYesJSON NumberThe destination port to which this ruleset applies. If 0, applies to any traffic over the selected protocol. 
enabledNoJSON BooleanWhether or not the ruleset is enabled.null
rulesYesJSON ArrayA list of rules in the ruleset. Current this should contain a single object, containing each of the elements listed below. 
fieldYesJSON StringUse the default value of "Regex". 
predicateYesJSON StringUse the default value of "is". 
valueYesJSON StringUse a backslash escaped representation of the rule. Practically speaking, this will be the regex that is applied in the listed zone. 

PUT Response Values​

The response will return an updated ruleset object. Because rulesets are tracked via revision, in order to update the ruleset it must be part of the zone's current revision of rulesets, which will now include the new ruleset object instead of the old one.

Example PUT Request​

PUT /rulesets/118
 
JSON Body:
{
"data": {
"port": 80,
"protocol": "TCP",
"rules": [
{
"field": "Regex",
"predicate": "is",
"value": "(?i)\\x0d\\x0aUser-Agent: [^\\x0d]*Gigabot[^\\x0d]*\\x0d\\x0a"
}
]
}
}

Example PUT Response​

HTTP/1.1 200 OK
 
{
"description": null,
"protocol": "TCP",
"application": "regex",
"port": 80,
"enabled": null,
"ruleset_resource": "/rulesets/120",
"zone_resource": "/zones/2031",
"rules": [
{
"field": "Regex",
"predicate": "is",
"value": "(?i)\\x0d\\x0aUser-Agent: [^\\x0d]*Gigabot[^\\x0d]*\\x0d\\x0a",
"rule_resource": "/rules/108"
}
]
}

DELETE /ruleset/:ID​

Removes the ruleset. In order to be removed, the ruleset must be in the current ruleset revision of the zone it is applied to.

DELETE Parameters​

NameRequiredTypeDescriptionDefault Value
:IDYesURLThe unique numeric ID of the ruleset. 

Example DELETE Request​

DELETE /rulesets/120

Example DELETE Response​

 HTTP/1.1 200 OK