Control network settings of the system
In order to use this API, one must firstly get the number of available networks using the /network endpoint. It will return an integer value.
This integer value can later be used to make requests to get/change the particular networks. The indexing is zero-based, so if networks_count = 4 was returned, the available network paths are /network/0-3.
Path: /api/system/network
Method: GET
Minimum user role: admin
Response:
[{
"network_id": 1,
"connection_start_time": 1675771183,
"state": "connected",
"dhcp_enabled": true,
"ip": "192.168.1.9",
"netmask": "255.255.255.0",
"gateway": "192.168.1.1",
"nameserver": "192.168.1.1",
"mac": "70:85:cc:3e:dd:f6",
"hostname": "profitap-desktop",
"network_authentication_enabled": true,
"network_authentication_md5":
{
"identity": "foobar",
"password": "barfoo"
},
"network_authentication_tls":
{
"identity": "foobar",
"ca_cert": "foobar",
"client_cert": "foobar",
"private_key": "foobar",
"private_key_pw": "foobar"
}
}]network_id contains ID of this network which is to be used to change the settings of this network in other requestsnetwork_authentication_enabled is true, one and only one of {network_authentication_md5, network_authentication_tls} must be setdhcp_enabled is false, both ip and netmask must be setPath: /api/system/network/{ID}
Method: GET
Minimum user role: admin
Response:
{
"connection_start_time": 1675771183,
"state": "connected",
"dhcp_enabled": true,
"ip": "192.168.1.9",
"netmask": "255.255.255.0",
"gateway": "192.168.1.1",
"nameserver": "192.168.1.1",
"mac": "70:85:cc:3e:dd:f6",
"hostname": "profitap-desktop",
"network_authentication_enabled": true,
"network_authentication_md5":
{
"identity": "foobar",
"password": "barfoo"
},
"network_authentication_tls":
{
"identity": "foobar",
"ca_cert": "foobar",
"client_cert": "foobar",
"private_key": "foobar",
"private_key_pw": "foobar"
}
}Path: /api/system/network/{ID}
Method: PUT
Minimum user role: admin
Request body: a subset of the network object. Writable fields include dhcp_enabled, ip, netmask, gateway, nameserver, hostname, network_authentication_enabled, network_authentication_md5, network_authentication_tls.
{
"dhcp_enabled": true,
"hostname": "profitap-desktop"
}hostname field can only be changed if request is done to /network/0 endpoint; all other networks will reject the request with this field setdhcp_enabled is false, both ip and netmask must be setnetwork_authentication_enabled is true, exactly one of network_authentication_md5 or network_authentication_tls must be setResponse: on success, 200 OK with the updated network object (same shape as GET response); on failure, 400 Bad Request with validation errors or 500 Internal Server Error.