Networks handler allows to perform the following operations:
- get
- create
- update
- delete
Action is defined by HTTP method used for request.
Example:
Request:
GET /api/v2/ipv4networks/
Response:
[
{
"id": 2,
"address": "192.168.1.0",
"netmask": "255.255.255.0",
"gateway": ""
},
{
"id": 1,
"address": "10.0.0.0",
"netmask": "255.255.0.0",
"gateway": "10.0.254.254"
}
]
Example:
Request:
POST /api/v2/ipv4networks/
{
"address": "10.0.0.0",
"netmask": "255.255.0.0",
"gateway": "10.254.254.254"
}
Response:
HTTP/1.1 200 OK
{
"id": 1,
"address": "10.0.0.0",
"netmask": "255.255.0.0",
"gateway": "10.254.254.254"
}
Example:
Request:
PUT /api/v2/ipv4networks/
{
"id": 1,
"address": "10.0.0.0",
"netmask": "255.255.0.0",
"gateway": "10.254.254.254"
}
Response:
HTTP/1.1 200 OK
{
"address": "10.0.0.0",
"netmask": "255.255.0.0",
"gateway": "10.254.254.254"
}
Example:
Request:
DELETE /api/v2/ipv4networks/
{
"id": 1
}
Response:
HTTP/1.1 200 OK