GET
/rules Retrieve firewall rules
Returns a list of firewall rules with pagination and filtering options.
Parameters
| Name | Type | In | Description |
|---|---|---|---|
page | integer | query | Page number for pagination |
filter | string | query | Filter string to search for specific rules |
limit | integer | query | Number of rules to return per page |
Response
200
dataobjectlimitintegerrulesarraytotalintegerpageintegerCurrent page number
successbooleanRequest
curl -X GET "https://shield.royalehosting.net/api/v2/rules" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-organization-id: YOUR_ORG_ID"Request
const response = await fetch("https://shield.royalehosting.net/api/v2/rules", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"x-organization-id": "YOUR_ORG_ID",
},
});
const data = await response.json();Request
import requests
response = requests.get(
"https://shield.royalehosting.net/api/v2/rules",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"x-organization-id": "YOUR_ORG_ID",
}
)
print(response.json())Response
{
"data": {
"limit": 15,
"rules": [
{
"id": 123,
"destination": "1.1.1.1/32",
"action": "permit",
"note": "Example Rule",
"protocol": 17,
"source": "1.1.1.1/32",
"order": 11,
"disabled": false,
"last_rule_update": "2024-08-25T21:39:57.5+02:00",
"src_port_type": "eq",
"dst_port_type": "eq",
"matched_packets": 238428,
"group_id": 0,
"updated_at": "2024-08-25T21:39:37.439+02:00"
}
],
"total": 5,
"page": 0
},
"success": true
}