This resource shows how to interact with zone configurations in SENSR.
You can add, delete or modify zones.
GET§
-
/settings/zone/list§
Get the list of available config-id and config data type of a zone.
- Parameters
- Return code
- 200 OK
- List of the types that SENSR API supports natively
Example§
$ curl -X GET 'localhost:9080/settings/zone/list' ** Respond ** [ { "id": "Int", "name": "String", "zone_type": "Int", "speed_limit": "Float", "loitering_threshold": "Int", "min_z": "Float", "max_z": "Float", "vertices": "Array[Vector2]" } ]
-
/settings/zone§
Get an actual config of the desired zone
If you do not pass any zone-id, this command returns the full zone-ids in SENSR.- Parameters
- zone-id : ID of zone.
- Return code
- 200 OK
- 400 BAD REQ
Example§
$ curl -X GET 'localhost:9080/settings/zone?zone-id=1001' ** Respond ** { "id": 1001, "name": "zone-1001", "zone_type": 1, "speed_limit": 27.77, "loitering_threshold": 0, "min_z": 0.0, "max_z": 2.5, "vertices": [ [ 8.95, -21.91 ], [ -13.30, -25.27 ], [ -12.95, -4.06 ], [ 16.37, 5.74 ], [ 9.58, -21.35 ] ] }
- Parameters
POST§
-
/settings/zone§
Update the config of the desired zone (id field should be unique.)
- Parameters
- zone-id : ID of zone.
- Return code
- 200 OK
- 400 BAD REQ
Example§
$ curl -X POST 'localhost:9080/settings/zone?zone-id=1001' --data '{ "id": 1001, "name": "zone-1001", "zone_type": 1, "speed_limit": 27.77, "loitering_threshold": 0, "min_z": 0.0, "max_z": 2.5, "vertices": [ [ -4.04, 5.27 ], [ -3.68, 3.32 ], [ -5.65, 3.02 ], [ -5.96, 4.85 ] ] }' ** Respond ** 200 OK
- Parameters
PUT§
-
/settings/zone§
Adds a new zone. If this command was successful, the id of newly added zone is returned.
Please call POST command to the newly added zone right after this command.
Because the default config of the newly added zone are not proper in most cases.- Parameters
- Return code
- 200 OK
- 400 BAD REQ
Example§
$ curl -X PUT 'localhost:9080/settings/zone' ** Respond ** "1001"