/network/interface

Resource URI

/network/interface

HTTP GET

Retrieves all network interfaces on the system.

GET /network/interface

Method

Response Payload

JSON

{
  "interfaces" : [
    {
      "ifname" : "lo",
      "uri" : "\/network\/interface\/lo"
    },
    {
      "ifname" : "eth0",
      "uri" : "\/network\/interface\/eth0"
    },
    {
      "ifname" : "eth0:0",
      "uri" : "\/network\/interface\/eth0:0"
    }
  ],
}

Single Instance

Retrieves information for a single network interface.

GET /network/interface/eth0

Method

Response Payload

JSON

{
    "if_name" : "192.168.195.12",
    "ipv4_addr" : "192.168.195.12",
    "ipv4_mask" : "255.255.255.0",
    "mac" : "00:21:70:cf:32:b1",
    "mode" : "dhcp",
    "dns1" : "10.20.22.1",
    "dns2" : ""
}

HTTP PUT

Configures a single network interface.

PUT /network/interface/eth0

Method

Request Payload

JSON

{
    "if_name" : "eth0"
    "ipv4_addr" : "10.20.129.12",
    "ipv4_mask" : "255.255.255.0",
    "gateway" : "10.20.129.250"
    "mode" : "static"
    "dns1" : "10.20.129.1"
}