MSNTN001: Controlling the MSNSwitch
Page 11
Where:
ASSIGN:
string: “NONE”, ”OUTLET1”, ”OUTLET2”, ”BOTH”
LABEL:
string: Site Label.
HOST:
string: Website / IP Address.
IP:
string: IP Address.
RESP_TIME:
digit: Site response time. (unit: millisecond)
TIMEOUT:
digit: Count of timeout.
LOST:
digit: Percent of ping lost.
OUTLET_NAME:
string: Outlet Name.
OUTLET_STATUS:
boolean: false means Off, true means On.
OUTLET_RESET_ONLY:
boolean: false means Off, true means On.
UIS_STATUS:
boolean: false means Off, true means On.
Examples in this section are shown using cURL for Windows. Any software capable of sending and processing
HTTP packets can be used. The API’s required “--header” parameters match cURL’s defaults and are shown for
completeness. They can be omitted if your software defaults to these values as well.
EXAMPLE: Get Status
curl --url "http://192.168.0.62/api/status" --data "user=admin&password=WEB_PASSWORD" --http1.1 --
header "Accept-Encoding: gzip, deflate" --header "Accept: */*"
OUTPUT
{"connections":
[{"assign":"BOTH","label":"Google","host":"www.google.com","ip":"142.251.40.132","resp":21,"timeout":4,"l
ost":0}{"assign":"BOTH","label":"Yahoo","host":"www.yahoo.com","ip":"74.6.143.26","resp":45,"timeout":35,
"lost":0}{"assign":"BOTH","label":"Pingler","host":"www.pingler.com","ip":"69.64.32.114","resp":41,"timeout"
:5,"lost":0}{"assign":"BOTH","label":"Ask.com","host":"www.ask.com","ip":"146.75.38.114","resp":29,"timeo
ut":6,"lost":0}{"assign":"NONE","label":"Router","host":"192.168.0.1","ip":"192.168.0.1","resp":1,"timeout":2,
"lost":0}{"assign":"NONE","label":"","host":"","ip":"null","resp":0,"timeout":0,"lost":0}{"assign":"NONE","label"
:"","host":"","ip":"null","resp":0,"timeout":0,"lost":0}],"status": {"outlet":[{"name":"Outlet
1","status":true,"reset_only":false},{"name":"Outlet 2","status":true,"reset_only":false}],"uis":false}