Maps (port 5000)
Use these endpoints to install maps on the Cyclops computer and choose which one Cyclops uses.
GET
/api/maps
List installed maps
GET
/api/maps/current
Read the active map
POST
/api/upload/maps
Upload and install a map
GET
/api/extraction/status
Follow the progress of a map install
POST
/api/maps/set
Choose the active map
POST
/api/maps/delete
Delete an installed map
The base URL is http://192.168.218.100:5000.
Responses
This API uses a different response format from v2. Every JSON response has a code field set to SUCCESS or ERROR. On error, message explains why:
{
"code": "ERROR",
"message": "Map 'a1b2c3d4_my_area' not found"
}Always check code, not only the HTTP status.
Installing a map
A complete install takes four steps:
Upload the map archive with
POST /api/upload/maps.Poll
GET /api/extraction/statusuntilphaseiscomplete.Make it the active map with
POST /api/maps/set.Set a home position inside the new map with
POST /api/v2/system/home-position. This restarts Cyclops so it loads the new map.
List installed maps
GET /api/maps
Maps are sorted newest first.
name
Map name. Use it to select or delete the map.
size
Installed size, in bytes.
modified
Last time the map was changed on the device, in seconds since the Unix epoch.
completed
false if the install did not finish. Delete the map and upload it again.
checksum
SHA-256 of the uploaded archive. null if unknown.
format_version
Map format version.
min_firmware_version
Oldest Cyclops software version that can use this map.
Read the active map
GET /api/maps/current
active_map is null when no map is selected.
Upload a map
POST /api/upload/maps
Uploads a map archive and installs it. The request body is the raw .tar.gz file, not a form upload. Get the archive from Vozilla. See Uploading maps.
Headers
filename
Archive file name, URL-encoded. Required. Must end in .tar.gz.
checksum
SHA-256 of the archive, as hex. Optional. If set, the upload fails when the data does not match.
Content-Length
Archive size, in bytes. The device uses it to check that it has enough free space.
Content-Type
application/octet-stream
The map name is the file name without .tar.gz. Keep the original file name: the archive contains a folder with that name, and the install fails if they do not match.
Example
--upload-file streams the file and sets Content-Length. Do not use --data-binary @file for large maps, because curl then loads the whole file into memory.
The device unpacks the archive while it receives it. The response arrives once all data is received. The device then validates the map in the background.
Large maps can take a long time to upload. Do not set a short timeout on this request.
Errors
400
The filename header is missing or does not end in .tar.gz.
500
The upload failed, for example a checksum mismatch or an archive without a folder named after the map. message explains why.
507
Not enough free space. The response includes required_bytes and free_bytes. Delete maps you no longer need and retry.
Follow the install
GET /api/extraction/status
Returns the progress of the latest map install. Poll it every few seconds after the upload returns.
phase
Meaning
extracting
The archive is being received and unpacked.
validating
The device is checking the map.
complete
The map is installed and can be selected.
failed
The install failed. error explains why.
The device keeps this status in memory only. If it is empty, for example after the Cyclops computer restarts, check completed for the map in GET /api/maps instead.
Choose the active map
POST /api/maps/set
Request body
map_name
string
Name of an installed map. Required.
Then set the home position, as described in Installing a map.
Errors
400
map_name is missing, or the map install did not finish.
404
No map with that name is installed.
Delete a map
POST /api/maps/delete
Deletes an installed map from the Cyclops computer.
Request body
map_name
string
Name of the map to delete. Required.
new_active_map
string
Map to make active if you delete the active map. Optional.
If you delete the active map without new_active_map, no map is active afterwards. If you pass new_active_map, set a home position inside it next so Cyclops restarts with it. If the new map cannot be selected, the map is still deleted and the response includes new_active_map_error.
Errors
400
map_name is missing, or no map with that name is installed.
Last updated
