Virtual Routers
Allowed HTTP methods
Method |
Description |
|---|---|
GET |
get / list object/s |
POST |
create new object/s |
PUT |
update / modify object/s |
DELETE |
delete object/s |
Note
See RFC 2616#section-9 for more details on HTTP methods semantics
Listing
- GET /virtualrouters/
Gets the list of virtual routers to which the authenticated user has access.
- Status Codes:
200 OK – no error
Example request:
GET /api/2.0/virtualrouters/?limit=0 HTTP/1.1 Content-Type: application/json Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "meta": { "limit": 0, "offset": 0, "total_count": 1 }, "objects": [ { "owner": { "resource_uri": "/api/2.0/user/93ff48d9-b9a3-49ec-9c41-de0cc9d02c34/", "uuid": "93ff48d9-b9a3-49ec-9c41-de0cc9d02c34" }, "resource_uri": "/api/2.0/virtualrouters/13292e1f-0c3e-458d-a6d0-ed2ee2baa0b2/", "runtime": { "stats": {}, "timestamp": "1624735477" }, "state": "created", "status": "running", "type": "basic", "uuid": "13292e1f-0c3e-458d-a6d0-ed2ee2baa0b2" } ] }
Detailed listing
- GET /virtualrouters/detail/
Gets the detailed list of virtual routers to which the authenticated user has access.
- Status Codes:
200 OK – no error
Example request:
GET /api/2.0/virtualrouters/detail/?limit=0 HTTP/1.1 Content-Type: application/json Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "meta": { "limit": 0, "offset": 0, "total_count": 1 }, "objects": [ { "configuration": { "firewall": { "active": false, "policies": [], "uuid": "136256a6-4a04-4ab2-9024-01c330c56619" }, "firewall_logging": false, "lan_interface": [ { "default_gateway": "", "dhcp": false, "ip_address": "10.0.1.1/24", "ip_address_v6": "", "ip_aliases": [], "ip_range": { "from": "", "to": "" }, "ipv4_enabled": true, "ipv4_ipv6_enabled": false, "ipv6_enabled": false, "name": "LAN 1", "router_advertiser": false, "uuid": "9b183b90-84cf-46fb-b3d8-12d2e5383eae", "vlan": "68317648-0a2a-4fb4-b179-700fa4dc359d" } ], "name": "BLACK HOLE", "nat": { "active": false, "address_forwarding": [], "port_forwarding": [], "uuid": "38589c2f-035e-4616-9cca-1d93e71490d5" }, "routes": [ { "gateway": "91.92.71.129", "inet": "inet", "network": "default", "uuid": "8979c468-dd08-45d9-803a-86a9e870b8dc" } ], "type": "basic", "upstream": { "ip_config": { "default_gateway": "", "dhcp_client": false, "ip_address": "", "ip_address_v6": "", "ipv6_automatic": false, "router_ipv6_default_gateway": "", "upstream_lines": "", "vlan": "" }, "ipv4_address": "91.92.71.149", "uuid": "c0f07d61-1fd0-40a2-a808-593f5e03685e", "vpn": { "active": false, "password": "f9M0fEscA1ae52r4", "username": "dione", "vpn_type": "pptp" }, "wan_type": "internet" } }, "jobs": [ { "resource_uri": "/api/2.0/jobs/238e40d5-d1cd-42b0-8c07-41737bb77b68/", "uuid": "238e40d5-d1cd-42b0-8c07-41737bb77b68" } ], "owner": { "resource_uri": "/api/2.0/user/93ff48d9-b9a3-49ec-9c41-de0cc9d02c34/", "uuid": "93ff48d9-b9a3-49ec-9c41-de0cc9d02c34" }, "resource_uri": "/api/2.0/virtualrouters/13292e1f-0c3e-458d-a6d0-ed2ee2baa0b2/", "runtime": { "stats": {}, "timestamp": "1624735479" }, "state": "created", "status": "running", "type": "basic", "uuid": "13292e1f-0c3e-458d-a6d0-ed2ee2baa0b2" } ] }
List single virtual router
- GET /virtualrouters/{virtualrouter_uuid}/
Gets detailed information on the virtual router identified by virtualrouter_uuid.
- Status Codes:
200 OK – no error
Example request:
GET /api/2.0/virtualrouters/13292e1f-0c3e-458d-a6d0-ed2ee2baa0b2/ HTTP/1.1 Content-Type: application/json Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "configuration": { "firewall": { "active": false, "policies": [], "uuid": "136256a6-4a04-4ab2-9024-01c330c56619" }, "firewall_logging": false, "lan_interface": [ { "default_gateway": "", "dhcp": false, "ip_address": "10.0.1.1/24", "ip_address_v6": "", "ip_aliases": [], "ip_range": { "from": "", "to": "" }, "ipv4_enabled": true, "ipv4_ipv6_enabled": false, "ipv6_enabled": false, "name": "LAN 1", "router_advertiser": false, "uuid": "9b183b90-84cf-46fb-b3d8-12d2e5383eae", "vlan": "68317648-0a2a-4fb4-b179-700fa4dc359d" } ], "name": "BLACK HOLE", "nat": { "active": false, "address_forwarding": [], "port_forwarding": [], "uuid": "38589c2f-035e-4616-9cca-1d93e71490d5" }, "routes": [ { "gateway": "91.92.71.129", "inet": "inet", "network": "default", "uuid": "8979c468-dd08-45d9-803a-86a9e870b8dc" } ], "type": "basic", "upstream": { "ip_config": { "default_gateway": "", "dhcp_client": false, "ip_address": "", "ip_address_v6": "", "ipv6_automatic": false, "router_ipv6_default_gateway": "", "upstream_lines": "", "vlan": "" }, "ipv4_address": "91.92.71.149", "uuid": "c0f07d61-1fd0-40a2-a808-593f5e03685e", "vpn": { "active": false, "password": "f9M0fEscA1ae52r4", "username": "dione", "vpn_type": "pptp" }, "wan_type": "internet" } }, "jobs": [ { "resource_uri": "/api/2.0/jobs/238e40d5-d1cd-42b0-8c07-41737bb77b68/", "uuid": "238e40d5-d1cd-42b0-8c07-41737bb77b68" } ], "owner": { "resource_uri": "/api/2.0/user/93ff48d9-b9a3-49ec-9c41-de0cc9d02c34/", "uuid": "93ff48d9-b9a3-49ec-9c41-de0cc9d02c34" }, "resource_uri": "/api/2.0/virtualrouters/13292e1f-0c3e-458d-a6d0-ed2ee2baa0b2/", "runtime": { "stats": {}, "timestamp": "1624735481" }, "state": "created", "status": "running", "type": "basic", "uuid": "13292e1f-0c3e-458d-a6d0-ed2ee2baa0b2" }
Creating
- POST /virtualrouters/
Creates a new virtual router. The minimal amount of information you need to set is given below.
- Status Codes:
201 Created – object created
Minimal virtual router configuration
Example request:
POST /api/2.0/virtualrouters/ HTTP/1.1 Content-Type: application/json Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDo { "configuration": { "name": "Uninhabited Kepler 1229b", "lan_interface": [ { "ipv6_exposed": false, "name": "LAN 1", "vlan": "8f33e6b8-4c1f-4474-a2ba-9ec74e0fdc14", "ipv4_enabled": true, "ipv6_enabled": false, "ipv4_ipv6_enabled": false, "ip_address": "10.0.1.1/24", "dhcp": true, "default_gateway": "", "ip_range": { "from": "10.0.1.100", "to": "10.0.1.200" }, "ip_address_v6": "", "router_advertiser": false, "ip_aliases": [ { "value": "", "ip_address": "10.0.100.1/24" } ] } ], "upstream": { "wan_type": "internet", "vpn": { "active": true, "vpn_type": "pptp", "username": "sky", "password": "cJFeky8Er7xs30oE" }, "ip_config": { "dhcp_client": true, "vlan": "", "upstream_lines": "", "ip_address": "", "ip_address_v6": "", "default_gateway": "", "ipv6_automatic": true, "router_ipv6_default_gateway": "" } } } }Example response:
HTTP/1.1 201 CREATED Content-Type: application/json; charset=utf-8 { "objects": [ { "configuration": { "firewall": { "active": false, "policies": [], "uuid": "b1f86fac-cd16-465f-b916-4a0dfa471be0" }, "firewall_logging": false, "lan_interface": [ { "default_gateway": "", "dhcp": false, "ip_address": "10.0.1.1/24", "ip_address_v6": "", "ip_aliases": [], "ip_range": { "from": "", "to": "" }, "ipv4_enabled": true, "ipv4_ipv6_enabled": false, "ipv6_enabled": false, "name": "LAN 1", "router_advertiser": false, "uuid": "04f2dfda-02f9-4bbf-aad9-356a2f1a852a", "vlan": "8f33e6b8-4c1f-4474-a2ba-9ec74e0fdc14" } ], "load_balancing": { "active": false }, "name": "Green Asteroid", "nat": { "active": false, "address_forwarding": [], "port_forwarding": [], "uuid": "266d3a80-fa0a-4ab8-add0-c518cc52a5a9" }, "qos": { "active": false, "services": [], "uuid": "d76a8d65-0914-4e2a-a833-97212a36c521" }, "routes": [], "upstream": { "ip_config": { "default_gateway": "", "dhcp_client": false, "ip_address": "", "ip_address_v6": "", "ipv6_automatic": false, "router_ipv6_default_gateway": "", "upstream_lines": "", "vlan": "" }, "ipv4_address": "", "uuid": "83ad34a9-6b88-49ea-bcee-ba5a49dc6392", "vpn": { "active": false, "password": "2nciysxHuPD4xu55", "username": "tethys", "vpn_type": "pptp" }, "wan_type": "internet" }, "vpn": { "active": false, "tunnels": [], "uuid": "513c354f-15ba-46e8-b179-f6024e6c7a9e" } }, "owner": { "resource_uri": "/api/2.0/user/e26c5424-d8c5-4d03-b989-9cff5f1016ff/", "uuid": "e26c5424-d8c5-4d03-b989-9cff5f1016ff" }, "resource_uri": "/api/2.0/virtualrouters/89a3ec18-b22c-463f-b1c9-0c027fe148b9/", "runtime": null, "state": "stopped", "status": "stopped", "uuid": "89a3ec18-b22c-463f-b1c9-0c027fe148b9" } ] }
More complex virtual router configuration
Example request:
POST /api/2.0/virtualrouters/ HTTP/1.1 Content-Type: application/json Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop { "objects": [ { "configuration": { "firewall": { "active": true, "policies": [ { "filters": [ { "action": "DENY", "hostA": "10.0.1.21", "hostA_to_portA": true, "hostB": "10.0.1.20", "hostB_to_portB": true, "icmp_type": -1, "log": true, "order": 1, "portA": "", "portA_to_hostB": true, "portB": "22", "protocol_type": "TCP", "to_hostA": true, "to_hostB": true } ], "isActive": true, "lan_interface": "LAN 1", "order": 1, "policy_name": "Policy 1" }, { "filters": [ { "action": "DENY", "hostA": "", "hostA_to_portA": true, "hostB": "", "hostB_to_portB": true, "icmp_type": -1, "order": 1, "portA": "", "portA_to_hostB": true, "portB": "", "protocol_type": "UDP", "to_hostA": true, "to_hostB": true } ], "isActive": false, "lan_interface": "LAN 1", "order": 2, "policy_name": "Policy 2" } ] }, "lan_interface": [ { "default_gateway": "", "dhcp": true, "ip_address": "10.0.1.1/24", "ip_address_v6": "", "ip_aliases": [ { "ip_address": "10.0.10.1/24", "value": "" }, { "ip_address": "10.0.100.1/24", "value": "" } ], "ip_range": { "from": "10.0.1.100", "to": "10.0.1.200" }, "ipv4_enabled": true, "ipv4_ipv6_enabled": false, "ipv6_enabled": false, "ipv6_exposed": false, "name": "LAN 1", "router_advertiser": false, "vlan": "68317648-0a2a-4fb4-b179-700fa4dc359d" } ], "name": "Secret Teegarden b", "nat": { "active": true, "address_forwarding": [ { "local_ipv4": "10.0.0.30", "order": 1, "upstream_ipv4": "10.0.0.11" }, { "local_ipv4": "10.0.0.22", "order": 2, "upstream_ipv4": "10.0.0.21" } ], "address_forwarding_active": false, "port_forwarding": [ { "forwarding_host": "10.0.1.10", "forwarding_port": "22", "mapped_port": "2210", "order": 1, "protocol": "TCP" }, { "forwarding_host": "10.0.2.20", "forwarding_port": "22", "mapped_port": "2220", "order": 2, "protocol": "TCP" } ] }, "routes": [], "upstream": { "ip_config": { "default_gateway": "", "dhcp_client": true, "ip_address": "", "ip_address_v6": "", "ipv6_automatic": true, "router_ipv6_default_gateway": "", "upstream_lines": "", "vlan": "" }, "vpn": { "active": true, "password": "oI81clgbELbzAyp6", "username": "io", "vpn_type": "pptp" }, "wan_type": "internet" } }, "type": "basic" } ] }Example response:
HTTP/1.1 202 ACCEPTED Content-Type: application/json; charset=utf-8 { "objects": [ { "configuration": { "firewall": { "active": true, "policies": [ { "filters": [ { "action": "DENY", "hostA": "10.0.1.21", "hostA_to_portA": true, "hostB": "10.0.1.20", "hostB_to_portB": true, "icmp_type": -1, "log": true, "order": 1, "portA": "", "portB": "22", "protocol_type": "TCP", "to_hostA": true, "to_hostB": true, "uuid": "f7904898-dc95-4130-9ad8-d8cee9c32629" } ], "isActive": true, "lan_interface": "f0499ae8-32bc-45e7-998a-15631fbe73b7", "order": 1, "policy_name": "Policy 1", "uuid": "853dde97-ccfb-4153-a87e-e017732a21d1" }, { "filters": [ { "action": "DENY", "hostA": "", "hostA_to_portA": true, "hostB": "", "hostB_to_portB": true, "icmp_type": -1, "log": false, "order": 1, "portA": "", "portB": "", "protocol_type": "UDP", "to_hostA": true, "to_hostB": true, "uuid": "a830fd2c-5bf8-4e71-85f9-6459f223dc62" } ], "isActive": false, "lan_interface": "f0499ae8-32bc-45e7-998a-15631fbe73b7", "order": 2, "policy_name": "Policy 2", "uuid": "029aae69-9c8c-4bc8-8375-3fa10e03c9e9" } ], "uuid": "dd96c1f9-b384-40cc-a403-0e28ae4a6ec6" }, "firewall_logging": false, "lan_interface": [ { "default_gateway": "", "dhcp": true, "ip_address": "10.0.1.1/24", "ip_address_v6": "", "ip_aliases": [ { "ip_address": "10.0.10.1/24", "uuid": "70497718-d3e4-46e7-9326-eb9709f69a8d" }, { "ip_address": "10.0.100.1/24", "uuid": "72a04d39-d159-434d-8e9a-b372e488d6f0" } ], "ip_range": { "from": "10.0.1.100", "to": "10.0.1.200" }, "ipv4_enabled": true, "ipv4_ipv6_enabled": false, "ipv6_enabled": false, "name": "LAN 1", "router_advertiser": false, "uuid": "f0499ae8-32bc-45e7-998a-15631fbe73b7", "vlan": "68317648-0a2a-4fb4-b179-700fa4dc359d" } ], "name": "Secret Teegarden b", "nat": { "active": true, "address_forwarding": [ { "local_ipv4": "10.0.0.30", "nat": "b294caea-01ff-4426-a5da-3eb00e9c1192", "order": 1, "upstream_ipv4": "10.0.0.11", "uuid": "eeb890bb-780f-44b4-9c37-ef1b27942ac8" }, { "local_ipv4": "10.0.0.22", "nat": "b294caea-01ff-4426-a5da-3eb00e9c1192", "order": 2, "upstream_ipv4": "10.0.0.21", "uuid": "c38efd29-991a-4145-b189-f5f1aaa12ef3" } ], "port_forwarding": [ { "forwarding_host": "10.0.1.10", "forwarding_port": 22, "mapped_port": 2210, "nat": "b294caea-01ff-4426-a5da-3eb00e9c1192", "order": 1, "protocol": "TCP", "uuid": "c4777503-c96a-47ce-a171-6f849c469ab9" }, { "forwarding_host": "10.0.2.20", "forwarding_port": 22, "mapped_port": 2220, "nat": "b294caea-01ff-4426-a5da-3eb00e9c1192", "order": 2, "protocol": "TCP", "uuid": "efe133ed-bca0-48e4-b33a-cf54e0791ed1" } ], "uuid": "b294caea-01ff-4426-a5da-3eb00e9c1192" }, "routes": [ { "gateway": "91.92.71.129", "inet": "inet", "network": "default", "uuid": "76075f9a-e74b-4318-a773-59b6dff966a1" } ], "type": "basic", "upstream": { "ip_config": { "default_gateway": "", "dhcp_client": false, "ip_address": "", "ip_address_v6": "", "ipv6_automatic": false, "router_ipv6_default_gateway": "", "upstream_lines": "", "vlan": "" }, "ipv4_address": "91.92.71.136", "uuid": "1cb3e709-2d57-4ff2-9a93-32edd285940a", "vpn": { "active": true, "password": "oI81clgbELbzAyp6", "username": "io", "vpn_type": "pptp" }, "wan_type": "internet" } }, "jobs": [ { "resource_uri": "/api/2.0/jobs/15345acc-3e50-42c6-b9e1-faba70d51a00/", "uuid": "15345acc-3e50-42c6-b9e1-faba70d51a00" } ], "owner": { "resource_uri": "/api/2.0/user/93ff48d9-b9a3-49ec-9c41-de0cc9d02c34/", "uuid": "93ff48d9-b9a3-49ec-9c41-de0cc9d02c34" }, "resource_uri": "/api/2.0/virtualrouters/8a512355-cd5a-4158-8f2f-4a0165ab46f0/", "runtime": null, "state": "creating", "status": "creating", "type": "basic", "uuid": "8a512355-cd5a-4158-8f2f-4a0165ab46f0" } ] }
Editing
- PUT /virtualrouters/{uuid}/
Edits a virtual router. Note that if a virtual router is running, only the field
namecan be changed, and all other changes to the definition of a running virtual router will be ignored.- Status Codes:
200 OK – no error
Example request:
PUT /api/2.0/virtualrouters/13292e1f-0c3e-458d-a6d0-ed2ee2baa0b2/ HTTP/1.1 Content-Type: application/json Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop { "name": "BLACK HOLE" }
Example response:
HTTP/1.1 202 ACCEPTED Content-Type: application/json; charset=utf-8 { "configuration": { "firewall": { "active": false, "policies": [], "uuid": "136256a6-4a04-4ab2-9024-01c330c56619" }, "firewall_logging": false, "lan_interface": [ { "default_gateway": "", "dhcp": false, "ip_address": "10.0.1.1/24", "ip_address_v6": "", "ip_aliases": [], "ip_range": { "from": "", "to": "" }, "ipv4_enabled": true, "ipv4_ipv6_enabled": false, "ipv6_enabled": false, "name": "LAN 1", "router_advertiser": false, "uuid": "9b183b90-84cf-46fb-b3d8-12d2e5383eae", "vlan": "68317648-0a2a-4fb4-b179-700fa4dc359d" } ], "name": "BLACK HOLE", "nat": { "active": false, "address_forwarding": [], "port_forwarding": [], "uuid": "38589c2f-035e-4616-9cca-1d93e71490d5" }, "routes": [ { "gateway": "91.92.71.129", "inet": "inet", "network": "default", "uuid": "8979c468-dd08-45d9-803a-86a9e870b8dc" } ], "type": "basic", "upstream": { "ip_config": { "default_gateway": "", "dhcp_client": false, "ip_address": "", "ip_address_v6": "", "ipv6_automatic": false, "router_ipv6_default_gateway": "", "upstream_lines": "", "vlan": "" }, "ipv4_address": "91.92.71.149", "uuid": "c0f07d61-1fd0-40a2-a808-593f5e03685e", "vpn": { "active": false, "password": "f9M0fEscA1ae52r4", "username": "dione", "vpn_type": "pptp" }, "wan_type": "internet" } }, "jobs": [ { "resource_uri": "/api/2.0/jobs/238e40d5-d1cd-42b0-8c07-41737bb77b68/", "uuid": "238e40d5-d1cd-42b0-8c07-41737bb77b68" } ], "name": "BLACK HOLE", "owner": { "resource_uri": "/api/2.0/user/93ff48d9-b9a3-49ec-9c41-de0cc9d02c34/", "uuid": "93ff48d9-b9a3-49ec-9c41-de0cc9d02c34" }, "resource_uri": "/api/2.0/virtualrouters/13292e1f-0c3e-458d-a6d0-ed2ee2baa0b2/", "runtime": null, "state": "created", "status": "running", "type": "basic", "uuid": "13292e1f-0c3e-458d-a6d0-ed2ee2baa0b2" }
Deleting
Single virtual router
- DELETE /virtualrouters/{virtualrouter_uuid}/
Deletes a single virtual router identified by virtualrouter_uuid.
- Status Codes:
204 No Content – No content, object deletion started.
Example request:
DELETE /api/2.0/virtualrouters/afee4156-9867-42ab-bf0a-c5d9d5468d5e/ HTTP/1.1 Content-Type: application/json Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop
Example response:
HTTP/1.1 202 ACCEPTED Content-Type: application/json; charset=utf-8 {}
Enable Firewall
- POST /virtualrouters/{virtualrouter_uuid}/action/?do=enable_firewall
Activates the firewall feature on a virtual router identified by virtualrouter_uuid.
- Status Codes:
200 OK – no error
Example request:
POST /api/2.0/virtualrouters/13292e1f-0c3e-458d-a6d0-ed2ee2baa0b2/action/?do=enable_firewall HTTP/1.1 Content-Type: application/json Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop {}
Example response:
HTTP/1.1 202 ACCEPTED Content-Type: application/json; charset=utf-8 { "action": "enable_firewall", "job": { "resource_uri": "/api/2.0/jobs/ab62200c-8195-4af5-9413-6fec8245a31a/", "uuid": "ab62200c-8195-4af5-9413-6fec8245a31a" }, "result": "success", "uuid": "13292e1f-0c3e-458d-a6d0-ed2ee2baa0b2" }
Disable Firewall
- POST /virtualrouters/{virtualrouter_uuid}/action/?do=disable_firewall
Deactivates the firewall feature on a virtual router identified by virtualrouter_uuid. This will disable all the applied filters.
- Status Codes:
200 OK – no error
Example request:
POST /api/2.0/virtualrouters/13292e1f-0c3e-458d-a6d0-ed2ee2baa0b2/action/?do=disable_firewall HTTP/1.1 Content-Type: application/json Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop {}
Example response:
HTTP/1.1 202 ACCEPTED Content-Type: application/json; charset=utf-8 { "action": "disable_firewall", "job": { "resource_uri": "/api/2.0/jobs/06b7ebb5-c80b-4d52-bd69-133ab7656287/", "uuid": "06b7ebb5-c80b-4d52-bd69-133ab7656287" }, "result": "success", "uuid": "13292e1f-0c3e-458d-a6d0-ed2ee2baa0b2" }
Enable Firewall logging
- POST /virtualrouters/{virtualrouter_uuid}/action/?do=enable_firewall_logging
Enables firewall logging for all active filters on a virtual router identified by virtualrouter_uuid
- Status Codes:
200 OK – no error
Example request:
POST /api/2.0/virtualrouters/13292e1f-0c3e-458d-a6d0-ed2ee2baa0b2/action/?do=enable_firewall_logging HTTP/1.1 Content-Type: application/json Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop {}
Example response:
HTTP/1.1 202 ACCEPTED Content-Type: application/json; charset=utf-8 { "action": "enable_firewall_logging", "job": { "resource_uri": "/api/2.0/jobs/80a8f041-4658-46a9-817f-c454374e50b0/", "uuid": "80a8f041-4658-46a9-817f-c454374e50b0" }, "result": "success", "uuid": "13292e1f-0c3e-458d-a6d0-ed2ee2baa0b2" }
Disable Firewall logging
- POST /virtualrouters/{virtualrouter_uuid}/action/?do=disable_firewall_logging
Disables firewall logging for all the active filters on a virtual router identified by virtualrouter_uuid
- Status Codes:
200 OK – no error
Example request:
POST /api/2.0/virtualrouters/13292e1f-0c3e-458d-a6d0-ed2ee2baa0b2/action/?do=disable_firewall_logging HTTP/1.1 Content-Type: application/json Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop {}
Example response:
HTTP/1.1 202 ACCEPTED Content-Type: application/json; charset=utf-8 { "action": "disable_firewall_logging", "job": { "resource_uri": "/api/2.0/jobs/cefb857e-1d7e-41ca-9307-e73f85774487/", "uuid": "cefb857e-1d7e-41ca-9307-e73f85774487" }, "result": "success", "uuid": "13292e1f-0c3e-458d-a6d0-ed2ee2baa0b2" }
Enable NAT
- POST /virtualrouters/{virtualrouter_uuid}/action/?do=enable_nat
Activates the NAT feature on a virtual router identified by virtualrouter_uuid
- Status Codes:
200 OK – no error
Example request:
POST /api/2.0/virtualrouters/13292e1f-0c3e-458d-a6d0-ed2ee2baa0b2/action/?do=enable_nat HTTP/1.1 Content-Type: application/json Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop {}
Example response:
HTTP/1.1 202 ACCEPTED Content-Type: application/json; charset=utf-8 { "action": "enable_nat", "job": { "resource_uri": "/api/2.0/jobs/0cb8484e-92a3-4dda-970f-39c8132f1494/", "uuid": "0cb8484e-92a3-4dda-970f-39c8132f1494" }, "result": "success", "uuid": "13292e1f-0c3e-458d-a6d0-ed2ee2baa0b2" }
Disable NAT
- POST /virtualrouters/{virtualrouter_uuid}/action/?do=disable_nat
Deactivates the NAT feature on a virtual router identified by virtualrouter_uuid
- Status Codes:
200 OK – no error
Example request:
POST /api/2.0/virtualrouters/13292e1f-0c3e-458d-a6d0-ed2ee2baa0b2/action/?do=disable_nat HTTP/1.1 Content-Type: application/json Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop {}
Example response:
HTTP/1.1 202 ACCEPTED Content-Type: application/json; charset=utf-8 { "action": "disable_nat", "job": { "resource_uri": "/api/2.0/jobs/2f487d2e-8b86-48ca-9e91-3bf2cb857166/", "uuid": "2f487d2e-8b86-48ca-9e91-3bf2cb857166" }, "result": "success", "uuid": "13292e1f-0c3e-458d-a6d0-ed2ee2baa0b2" }
Enable VPN
Disable VPN
Get Log
- POST /virtualrouters/{virtualrouter_uuid}/action/?do=get_log
Get the latest log entries on a virtual router identified by vrfwfilter_uuid. Valid
log_namevalues that can be included in the query parameters are: system and firewall.- Status Codes:
200 OK – no error
Example request:
POST /api/2.0/virtualrouters/250a8bf5-e4d6-45dc-9e36-bbc0f75c41bc/action/?do=get_log&log_name=system HTTP/1.1 Content-Type: application/json Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop {}
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "meta": { "limit": 200, "log_name": "system", "offset": 0, "total_count": 3 }, "objects": [ { "datetime": "Mar 24 22:21:03", "index": 1, "message": "ec6e6f5e-5077-4e9e-9631-15ccef921b6b kernel: arp: 58:9c:fc:0f:67:4f is using my IP address 91.92.71.148 on net0!" }, { "datetime": "Mar 24 22:41:01", "index": 2, "message": "ec6e6f5e-5077-4e9e-9631-15ccef921b6b kernel: arp: 58:9c:fc:0f:9e:44 is using my IP address 91.92.71.148 on net0!" }, { "datetime": "Mar 24 23:01:02", "index": 3, "message": "ec6e6f5e-5077-4e9e-9631-15ccef921b6b kernel: arp: 58:9c:fc:05:f4:8c is using my IP address 91.92.71.148 on net0!" } ] }
Get Keys
Export key
Schema
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"allowed_detail_http_methods": [
"get",
"put",
"delete"
],
"allowed_list_http_methods": [
"get",
"put",
"delete",
"post"
],
"default_format": "application/json",
"default_limit": 20,
"fields": {
"configuration": {
"default": "No default provided.",
"fields": {},
"help_text": "vRouter configuration",
"readonly": false,
"required": true,
"type": "related"
},
"jobs": {
"default": "No default provided.",
"help_text": "Background jobs related to this resource",
"readonly": true,
"required": true,
"type": "related"
},
"owner": {
"default": null,
"help_text": "Owner of the snapshot",
"readonly": true,
"required": true,
"type": "related"
},
"resource_uri": {
"default": "No default provided.",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"readonly": true,
"required": true,
"type": "string"
},
"runtime": {
"default": "No default provided.",
"fields": {
"stats": {
"default": {},
"help_text": "Unicode string data. Ex: \"Hello World\"",
"readonly": false,
"required": true,
"type": "string"
},
"timestamp": {
"default": null,
"help_text": "UNIX timestamp of the runtime generation",
"readonly": false,
"required": true,
"type": "string"
}
},
"help_text": "Runtime information of the vRouter",
"readonly": true,
"required": false,
"type": "related"
},
"state": {
"default": null,
"help_text": "Unicode string data. Ex: \"Hello World\"",
"readonly": true,
"required": false,
"type": "string"
},
"status": {
"default": "No default provided.",
"help_text": "Status of the vRouter.",
"readonly": true,
"required": false,
"type": "string"
},
"type": {
"default": "No default provided.",
"help_text": "vRouter type",
"readonly": false,
"required": true,
"type": "string"
},
"uuid": {
"default": null,
"help_text": "UUID of the snapshot",
"readonly": true,
"required": true,
"type": "string"
}
},
"filtering": {
"name": "exact",
"name__contains": "exact",
"tag": "exact",
"uuid": "exact"
}
}
Virtual Router Features
More information about a virtual router’s features.