Networks

These endpoints allow configuration of networks, used by Views.

Networks Endpoints

GET /servers/{server_id}/networks

List all registered networks and views in a server

Parameters:
  • server_id (string) – The id of the server to retrieve
Status Codes:
GET /servers/{server_id}/networks/{ip}/{prefixlen}

Return the view associated to the given network

Parameters:
  • server_id (string) – The id of the server to retrieve
  • ip (string) – The base address of the network
  • prefixlen (string) – The length of the network prefix
Status Codes:
PUT /servers/{server_id}/networks/{ip}/{prefixlen}

Sets the view associated to the given network

Parameters:
  • server_id (string) – The id of the server to retrieve
  • ip (string) – The base address of the network
  • prefixlen (string) – The length of the network prefix
Status Codes:

Examples

Listing all networks

GET /api/v1/servers/localhost/networks HTTP/1.1
X-API-Key: secret

Will yield a response similar to this (several headers omitted):

HTTP/1.1 200 OK
Content-Type: application/json

{"networks": [{"network":"192.168.0.0/16","view":"trusted"},{"network":"0.0.0.0/0","view":"untrusted"}]}

Listing the view of a given network

GET /api/v1/servers/localhost/networks/192.168.0.0/16 HTTP/1.1
X-API-Key: secret

Will yield a response similar to this (several headers omitted):

HTTP/1.1 200 OK
Content-Type: application/json

{"networks": [{"network":"192.168.0.0/16","view":"trusted"}]}

Setting up a network

PUT /api/v1/servers/localhost/networks/192.168.0.0/16 HTTP/1.1
X-API-Key: secret
Content-Type: application/json

{"view": "trusted"}

Will yield a response similar to this (several headers omitted):

HTTP/1.1 204 No Content