LayerStack API

Choose a category from the left to browse the available API commands.

Firewalls


Firewalls

Firewalls is the entity that handles firewall operations to a cloud server. Currently only assigning and unassigning a firewall are supported by our API. Creation of firewall and editing firewall rules should be done in our LayerPanel.

Endpoints Summary

Endpoint (Click to read full specification) Method Description
/firewalls/assign/object/$vm_object_id POST assign firewall(s) to an object (cloud server).
/firewalls/unassign/object/$vm_object_id POST unassign firewall(s) from an object (cloud server).
/firewalls/object/$vm_object_id GET get firewall list from an object (cloud server).

Assign Firewalls to a Cloud Server

Request: POST /firewalls/assign/object/$vm_object_id where $vm_object_id is the object id of the cloud server.

Name Type Description
firewalls array ids of firewall to be assigned. ID of firewall can be obtained from Firewall Details page in LayerPanel.

Sample Payload:

{"firewalls":[{"id":143}, {"id":144}]}

Unassign Firewalls from a Cloud Server

Request: POST /firewalls/unassign/object/$vm_object_id where $vm_object_id is the object id of the cloud server.

Name Type Description
firewalls array ids of firewall to be assigned. ID of firewall can be obtained from Firewall Details page in LayerPanel.

Sample Payload:

{"firewalls":[{"id":153}, {"id":154}]}

Get Firewalls List of a Cloud Server

Request: GET /firewalls/object/$vm_object_id where $vm_object_id is the object id of the cloud server.