These endpoints allow configuration of networks, used by Views.
GET
/servers/{server_id}/networks
¶List all registered networks and views in a server
Parameters: |
|
---|---|
Status Codes: |
|
GET
/servers/{server_id}/networks/{ip}/{prefixlen}
¶Return the view associated to the given network
Parameters: |
|
---|---|
Status Codes: |
|
PUT
/servers/{server_id}/networks/{ip}/{prefixlen}
¶Sets the view associated to the given network
Parameters: |
|
---|---|
Status Codes: |
|
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"}]}
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"}]}
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