Network
Basic Networking
URL |
|
---|---|
Method | GET |
Description | Gets a list of currently defined IP addresses |
Response | {
"ipaddress": [«list of ip addresses»]
} |
URL |
|
---|---|
Method | GET |
Description | Receives information on the current network setup. |
Response | {
"type": "wifi|ethernet",
"connection": "static|dhcp",
"static": {
"ipaddress": «ipaddress»,
"netmask": «netmask»,
"gateway": «gateway»
},
"wifi": {
"ssid": «ssid»,
"key": «pre shared key»
}
} |
URL |
|
---|---|
Method | PUT |
Description | Sets network settings, will reboot afterwards. |
Request | {
"type": "wifi|ethernet",
"connection": "static|dhcp",
"static": {
"ipaddress": «ipaddress»,
"netmask": «netmask»,
"gateway": «gateway»
},
"wifi": {
"ssid": «ssid»,
"key": «pre shared key»
}
} |
Response | HTTP204 when successful, followed by a reboot |
Possible Errors | HTTP400 when request was invalid |
HTTPS Support
HTTPS support is available with user-supplied PFX certificates, encrypted with a password. During startup, the PTLControl will decide if it will use HTTPS or not. When any error occurs, it falls back to HTTP. It is up to the client to connect using HTTP or HTTPS. It will also be available on port 5000.
To upload the PFX file and password, the API provides a https
call. Uploading a new certificate will overwrite an existing one. The PTL Control needs to be restarted for changes to take effect.
URL |
|
---|---|
Method | POST |
Description | Upload a new HTTPS certificate (in |
Request | |
Response | HTTP204 |
Possible Error | When an invalid certificate is uploaded, the system falls back to HTTP. |
URL |
|
---|---|
Method | DELETE |
Description | Remove certificate and password |
Request | Empty |
Response | HTTP204 |