List Firewall Rules for Virtual Machine
Retrieve a comprehensive inventory of network security policies configured for a specific virtual machine instance.
HTTP Request
GET
{API_URL}/virtual-machines/{id}/firewall-rules
Path Parameters
Parameter | Requirement | Type | Description |
---|---|---|---|
id | Required | string | Target virtual machine's unique identifier |
Query Parameters
Parameter | Requirement | Type | Description |
---|---|---|---|
limit | Optional | int | Maximum number of records to return |
offset | Optional | int | Number of records to skip for pagination |
sortField | Optional | string | Field identifier for result ordering |
sortOrder | Optional | string | Sort direction: desc or asc |
Response Structure
status boolean
Operation result indicator. Returns true
for successful execution, false
when encountering an error.
message string
Descriptive response indicating the outcome of the rule retrieval request.
total int
Aggregate count of available records.
data object
Collection of implemented firewall rules with detailed configurations.
Rule attributes include:
direction
: Traffic flow direction (inbound
oroutbound
)protocol
: Network protocol specification (tcp
,udp
,icmp
)ethertype
: IP protocol version (IPv4
orIPv6
)remote_ip_prefix
: Allowed IP range in CIDR notationport_range_min
: Lower bound of permitted port range (1-65535)port_range_max
: Upper bound of permitted port range (1-65535)description
: Administrative annotation
Implementation Example
Request
bash
curl -X GET '{API_URL}virtual-machines/{id}/firewall-rules' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'refresh-token: {REFRESH_TOKEN}' \
-H 'Content-Type: application/json'
Response
json
{
"status": true,
"message": "Firewall rules retrieved successfully",
"data": [
{
"id": "67714175e19f11c9cb6a6149",
"direction": "inbound",
"ethertype": "IPv4",
"protocol": "tcp",
"port_range_min": 80,
"port_range_max": 80,
"remote_ip_prefix": "0.0.0.0/0",
"created_at": 1735192903,
"description": "HTTP"
},
{
"id": "67714175e19f11c9cb6a614b",
"direction": "inbound",
"ethertype": "IPv4",
"protocol": "tcp",
"port_range_min": 22,
"port_range_max": 22,
"remote_ip_prefix": "0.0.0.0/0",
"created_at": 1735475632,
"description": ""
},
{
"id": "67714175e19f11c9cb6a614d",
"direction": "outbound",
"ethertype": "IPv4",
"protocol": "any",
"port_range_min": 1,
"port_range_max": 65535,
"remote_ip_prefix": "0.0.0.0/0",
"created_at": 1735475573,
"description": ""
},
{
"id": "67714175e19f11c9cb6a614f",
"direction": "outbound",
"ethertype": "IPv6",
"protocol": "any",
"port_range_min": 1,
"port_range_max": 65535,
"remote_ip_prefix": "0.0.0.0/0",
"created_at": 1735475573,
"description": ""
}
]
}