Cabinet
...
URL
...
http://<<ip address>>/rest/cabinet
...
Method
...
GET
...
Description
...
Receives information on the cabinet.
...
Response
...
Code Block | ||
---|---|---|
| ||
{
"planks": «numberofplanks»,
"sections": «numberofsections»,
"name": «nameofcabinet»,
"status": [«listofhumanreadablestatusmessages»]
} |
Status message can be:
Missing tag at plank P, section S (Tag ID N)
No connection to controller
When list of messages is empty, cabinet is “OK”.
...
Status
...
Status | ||||
---|---|---|---|---|
|
...
URL
The API enables any programmer to directly control the PTL Control using a REST interface and a websocket.
The base address for the REST interface is http://<<ip address>>:5000/rest
...
Method
...
PUT
...
Description
...
.
...
Request
...
Code Block | ||
---|---|---|
| ||
{
"planks": «numberofplanks»,
"sections": «numberofsections»,
"name": «nameofcabinet»
} |
...
Response
...
...
Possible Errors
...
HTTP400 when request was invalid
Code Block | ||
---|---|---|
| ||
{
"message": «human readable error»
} |
...
Status
...
Status | ||||
---|---|---|---|---|
|
...
URL
...
http://<<ip address>>/rest/cabinet/lighttest
...
Method
...
PUT
...
Description
...
The
...
Request
...
Code Block | ||
---|---|---|
| ||
{
"mode": "on" | "off"
} |
...
Response
...
HTTP204 when successful
...
Possible Errors
...
HTTP400 when request was invalid
Code Block | ||
---|---|---|
| ||
{
"message": «human readable error»
} |
...
Status
...
Status | ||||
---|---|---|---|---|
|
...
URL
...
http://<<ip address>>/rest/cabinet/teach
...
Method
...
PUT
...
Description
...
Sets the cabinet in or out of teach mode.
...
Request
...
Code Block | ||
---|---|---|
| ||
{
"mode": "on" | "off"
} |
...
Response
...
HTTP204 when successful
...
Possible Errors
...
HTTP400 when request was invalid
Code Block | ||
---|---|---|
| ||
{
"message": «human readable error»
} |
...
Status
...
Status | ||||
---|---|---|---|---|
|
...
URL
...
http://<<ip address>>/rest/cabinet/teach
...
Method
...
GET
...
Description
...
Get current state of teach mode
...
Responses
...
HTTP204 when not in teach mode
HTTP200 when in teach mode, with following body:
Code Block | ||
---|---|---|
| ||
{
"tag": [«list of tags found»]
} |
...
Status
...
Status | ||||
---|---|---|---|---|
|
Section
Plank and section numbering is 1-based. So if 4 planks are available, they are numbered 1 to 4.
...
URL
...
http://<<ip address>>/rest/plank/«plankno»/section/«sectionno»
...
Method
...
GET
...
Description
...
Receives information of section.
...
Response
...
Code Block | ||
---|---|---|
| ||
{
"value": «lastdisplayedvalue»,
"state": «state»
} |
...
Possible Error
...
HTTP404 with no body when section does not exist.
...
Status
...
Status | ||||
---|---|---|---|---|
|
...
URL
...
http://<<ip address>>/rest/plank/«plankno»/section/«sectionno»
...
Method
...
PUT
...
Description
...
Sets value on display.
...
Request
...
Code Block | ||
---|---|---|
| ||
{
"value": «valuetodisplay»
} |
...
Response
...
HTTP204 when successful
...
Possible Errors
...
HTTP400 when request was invalid
Code Block | ||
---|---|---|
| ||
{
"message": «human readable error»
} |
HTTP404 with no body when section does not exist
...
Status
...
address for the websocket is ws://<<ip address>>:5000/ws
.
The API has the following actions available:
Child pages (Children Display) |
---|