@@ -368,6 +368,31 @@ curl -v -L http://circuitpython.local/cp/devices.json
368
368
}
369
369
```
370
370
371
+ #### ` /cp/diskinfo.json `
372
+
373
+ Returns information about the attached disk(s). A list of objects, one per disk.
374
+
375
+ * ` root ` : Filesystem path to the root of the disk.
376
+ * ` free ` : Count of free bytes on the disk.
377
+ * ` block_size ` : Size of a block in bytes.
378
+ * ` writable ` : True when CircuitPython and the web workflow can write to the disk. USB may claim a disk instead.
379
+ * ` total ` : Total bytes that make up the disk.
380
+
381
+ Example:
382
+ ``` sh
383
+ curl -v -L http://circuitpython.local/cp/diskinfo.json
384
+ ```
385
+
386
+ ``` json
387
+ [{
388
+ "root" : " /" ,
389
+ "free" : 2964992 ,
390
+ "block_size" : 512 ,
391
+ "writable" : true ,
392
+ "total" : 2967552
393
+ }]
394
+ ```
395
+
371
396
#### ` /cp/serial/ `
372
397
373
398
@@ -380,7 +405,7 @@ This is an authenticated endpoint in both modes.
380
405
381
406
Returns information about the device.
382
407
383
- * ` web_api_version ` : Always ` 1 ` . This versions the rest of the API and new versions may not be backwards compatible.
408
+ * ` web_api_version ` : Between ` 1 ` and ` 3 ` . This versions the rest of the API and new versions may not be backwards compatible. See below for more info .
384
409
* ` version ` : CircuitPython build version.
385
410
* ` build_date ` : CircuitPython build date.
386
411
* ` board_name ` : Human readable name of the board.
@@ -436,3 +461,9 @@ CircuitPython is expected to be masked UTF-8, as the spec requires. Data from Ci
436
461
client is unmasked. It is also unbuffered so the client will get a variety of frame sizes.
437
462
438
463
Only one WebSocket at a time is supported.
464
+
465
+ ### Versions
466
+
467
+ * ` 1 ` - Initial version.
468
+ * ` 2 ` - Added ` /cp/diskinfo.json ` .
469
+ * ` 3 ` - Changed ` /cp/diskinfo.json ` to return a list in preparation for multi-disk support.
0 commit comments