Skip to main content

List Firewalls

GET https://infrahub-api.nexgencloud.com/v1/core/firewalls

Retrieves a list of existing firewalls and their details, including the firewall rules they contain and information about the virtual machines to which they are attached.


Query string parameters


search string or integer  optional

Search for the name or ID of the firewall to retrieve it.


environment string or integer  optional

Filter resources by name or ID of the environment.


page integer  optional

The page number to retrieve firewalls from.


pageSize integer  optional

Specify the number of firewalls to return per page.


Attributes


status boolean

Indicates the success or failure of the request to list firewalls. true, indicates success, while false indicates error.


message string

A message confirming the status of the request to list firewalls.


firewalls array of objects

Returns as array of firewall objects, containing details on existing firewalls and the VMs to which they are attached.

For descriptions of the fields within the firewall object returned in response to your request, please refer to the documentation here.


Example request
curl -X GET "https://infrahub-api.nexgencloud.com/v1/core/firewalls" \
-H "accept: application/json"\
-H "api_key: YOUR API KEY"
Response
{
"status": true,
"message": "Getting firewalls success",
"firewalls": [
{
"id": 10,
"name": "firewall",
"description": "test firewall",
"environment": {
"id": 1281,
"name": "testenv1",
"region": "NORWAY-1"
},
"status": "SUCCESS",
"created_at": "2024-01-17T11:09:33",
"rules": [
{
"id": 36660,
"direction": "egress",
"protocol": "any",
"port_range_min": 1,
"port_range_max": 65535,
"ethertype": "IPv6",
"remote_ip_prefix": "0.0.0.0/0",
"status": "SUCCESS",
"created_at": "2024-01-17T11:09:37"
},
{...}
],
"attachments": [
{
"id": 1,
"status": "SUCCESS",
"vm": {
"id": 1,
"name": "example-vm",
"flavor": "s",
"environment": "test-env",
"status": "HIBERNATED",
"created_at": "1970-01-01T00:00:00.000Z"
},
"created_at": "1970-01-01T00:00:00.000Z"
}
]
}
]
}

Returns


This response returns the status of the request to list firewalls, a message describing the status, and the firewalls object containing details about your existing firewalls and the virtual machines to which they are attached.


Back to top