@@ -368,6 +368,31 @@ curl -v -L http://circuitpython.local/cp/devices.json
368368}
369369```
370370
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+
371396#### ` /cp/serial/ `
372397
373398
@@ -380,7 +405,7 @@ This is an authenticated endpoint in both modes.
380405
381406Returns information about the device.
382407
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 .
384409* ` version ` : CircuitPython build version.
385410* ` build_date ` : CircuitPython build date.
386411* ` 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
436461client is unmasked. It is also unbuffered so the client will get a variety of frame sizes.
437462
438463Only 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