diff --git a/python_algorithms/RESTful/RESTAPI.md b/python_algorithms/RESTful/RESTAPI.md index 513d7d4..f29cbb7 100644 --- a/python_algorithms/RESTful/RESTAPI.md +++ b/python_algorithms/RESTful/RESTAPI.md @@ -21,7 +21,6 @@ ```json { "MODE":1, - "STATUS":"Ready", "target": { "SHX":0, "SHY":0, @@ -47,7 +46,8 @@ "phimotor":11, "omegamotor":180 }, - "cyclecount":123456789 + "cyclecount":123456789, + "status":"Ready" } ``` @@ -77,6 +77,28 @@ "s4":15, "phimotor":11, "omegamotor":180 + } +} +``` + +## Getting readback values of NewGon: +**Definition** + +`GET /newgon/readback` + +**Response** +- `200 OK` on success + +```json +{ + "readback": { + "s1":12, + "s2":13, + "s3":14, + "s4":15, + "phimotor":11, + "omegamotor":180 + "timestamp": "102020200" } } ``` @@ -85,32 +107,53 @@ # SETTING INFORMATION -## Setting many variables to NewGon +## Setting the operation MODE NewGon **Definition** -`POST /status` +`POST /newgon/MODE` +`POST /newgon/mode` + +**Arguments** +mode=1 + +or + +```json +{ + "MODE":1, +} +``` +**Responses** +- `200 OK` - on success +- `404 Not Found` if the variable does not exist + + +## Setting target values to NewGon +**Definition** + +`POST /newgon/target` **Arguments** ```json { - "MODE":1, - "STATUS":"Ready", - "SHX":0, - "SHY":0, - "SHZ":18, - "CHI":10, - "PHI":0, - "OMEGA":0, - "OX":0, - "OY":0, - "OZ":0, - "s1":12, - "s2":13, - "s3":14, - "s4":15, - "phimotor":11, - "cyclecount":123456789 + "target": { + "SHX":0, + "SHY":0, + "SHZ":18, + "CHI":10, + "PHI":0, + "OMEGA":0, + "OX":0, + "OY":0, + "OZ":0, + "s1":12, + "s2":13, + "s3":14, + "s4":15, + "phimotor":11, + "omegamotor":180 + } } ``` **Responses** @@ -121,7 +164,7 @@ ## Setting individual varibles to NewGon **Definition** -`POST /status` +`POST /newgon/target` **Arguments** @@ -132,6 +175,9 @@ } ``` + + + { "SHX":2.2 "message":"SHX->2.2."