This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
specifications:uri [2015/08/26 11:59] guvalif created |
specifications:uri [2021/04/01 13:51] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| < | < | ||
| URI Definition | URI Definition | ||
| - | ============== | + | =============================================================================== |
| - | fix me. | + | Basic Specification |
| + | ------------------------------------------------------------------------------- | ||
| + | |||
| + | Network host of Control Server is normally **" | ||
| + | Its port is decided by `port` property written in **config.json**. (Default value is 17264.) | ||
| + | |||
| + | The server provides REST API. | ||
| + | Thus, anyone can use each resource and command using following syntax. | ||
| + | |||
| + | ``` | ||
| + | http://< | ||
| + | ``` | ||
| + | |||
| + | `< | ||
| + | Basically its keeps pace to major version of the application. | ||
| + | (For-instance: | ||
| + | |||
| + | ### Returned JSON Format When Get a Resource | ||
| + | |||
| + | When you create GET request, the server returns JSON like below. | ||
| + | |||
| + | ```json | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | ``` | ||
| + | |||
| + | ### Returned JSON Format When a Command Runs | ||
| + | |||
| + | When you create HTTP request (not GET) or call each command, the server returns JSON like below. | ||
| + | |||
| + | ```json | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | } | ||
| + | ``` | ||
| + | |||
| + | |||
| + | Resources List | ||
| + | ------------------------------------------------------------------------------- | ||
| + | |||
| + | ### Command-line Stream (cmdstream) | ||
| + | |||
| + | Could be gotten WebSocket based stream resource that controls PLEN. | ||
| + | |||
| + | Sending command name and each argument with **/ (slash)** as separator, | ||
| + | you can call directly commands implemented by Python. | ||
| + | ([See also...](https:// | ||
| + | |||
| + | ```javascript | ||
| + | var socket = new WebSocket(' | ||
| + | |||
| + | socket.send('< | ||
| + | ``` | ||
| + | |||
| + | Returned value is stringified returned value on Python runtime environment. | ||
| + | |||
| + | ### Motion (motions) | ||
| + | |||
| + | Could be gotten motion resource that defines PLEN's movement. | ||
| + | Please set slot number you want to access to `< | ||
| + | |||
| + | ``` | ||
| + | http:// | ||
| + | ``` | ||
| + | |||
| + | |HTTP Request|Operation | ||
| + | |: | ||
| + | |**GET** | ||
| + | |**DELETE** | ||
| + | |**PUT** | ||
| + | |||
| + | ``` | ||
| + | http:// | ||
| + | http:// | ||
| + | ``` | ||
| + | |||
| + | |Commands|Operation | ||
| + | |: | ||
| + | |**play**|Play a motion.| | ||
| + | |**stop**|Stop a motion.| | ||
| + | |||
| + | ### Version Information (version) | ||
| + | |||
| + | Could be gotten version information resource. | ||
| + | |||
| + | ``` | ||
| + | http:// | ||
| + | ``` | ||
| + | |||
| + | |HTTP Request|Operation | ||
| + | |: | ||
| + | |**GET** | ||
| + | |||
| + | ### Construction Information of the Server (metadata) | ||
| + | |||
| + | Could be gotten server information resources below. | ||
| + | |||
| + | - API version | ||
| + | - Required firmware version of PLEN | ||
| + | |||
| + | ``` | ||
| + | http:// | ||
| + | ``` | ||
| + | |||
| + | |HTTP Request|Operation | ||
| + | |: | ||
| + | |**GET** | ||
| + | |||
| + | |||
| + | Commands List (Doable by Itself) | ||
| + | ------------------------------------------------------------------------------- | ||
| + | |||
| + | ### Connect to PLEN (connect) | ||
| + | |||
| + | ``` | ||
| + | http:// | ||
| + | ``` | ||
| + | |||
| + | ### Disconnect from PLEN (disconnect) | ||
| + | |||
| + | ``` | ||
| + | http:// | ||
| + | ``` | ||
| </ | </ | ||