Attach a Firewall to Virtual Machines
POST https://infrahub-api.nexgencloud.com/v1/core/firewalls/{firewall_id}/update-attachments
Attaches an existing firewall to one or more virtual machines. Include the firewall ID in the path, and the IDs of the virtual machines to which it is being added in the request body, as detailed below.
Path parameters
firewall_id integer
Required
The ID of the firewall to which a firewall rule is being added.
Request body parameters
vms array of integers
Required
An array of virtual machine IDs to which the firewall is being added.
Attributes
status boolean
Indicates the result of the request to attach a firewall to one or more virtual machines. true
signifies success, while false
indicates an error.
message string
A description of the status of the request.
Example request
curl -X POST "/core/firewalls/{firewall_id}/update-attachments" \
-H "accept: application/json"\
-H "api_key: YOUR API KEY"\
-H "content-type: application/json" \
-d '{
"vms": [
0
]
}'
Response
{
"status": true,
"message": "string"
}
Returns
Returns the status of the request to attach a firewall to the specified virtual machines and a message describing the status.