docs: document new "notify_metadata_update" notification

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Arksine 2020-09-01 11:37:06 -04:00
parent 28977bd579
commit d59d1e5f7f
2 changed files with 64 additions and 1 deletions

View File

@ -1,7 +1,40 @@
This document keeps a record of all changes to Moonraker's remote This document keeps a record of all changes to Moonraker's remote
facing APIs. facing APIs.
### August 16 2020 ### September 1st 2020
- A new notification has been added: `notify_metdata_update`. This
notification is sent when Moonraker parses metdata from a new upload.
Note that the upload must be made via the API, files manually (using
SAMBA, SCP, etc) do not trigger a notification. The notification is
sent in the following format:
```
{jsonrpc: "2.0", method: "notify_metadata_update", params: [metadata]}
```
Where `metadata` is an object in the following format:
```json
{
filename: "file name",
size: <file size>,
modified: "last modified date",
slicer: "Slicer Name",
first_layer_height: <in mm>,
layer_height: <in mm>,
object_height: <in mm>,
estimated_time: <time in seconds>,
filament_total: <in mm>,
thumbnails: [
{
width: <in pixels>,
height: <in pixels>,
size: <length of string>,
data: <base64 string>
}, ...
]
}
```
### August 16th 2020
- The structure of data returned from `/printer/info` (`get_printer_info`) - The structure of data returned from `/printer/info` (`get_printer_info`)
has changed to the following format: has changed to the following format:
```json ```json

View File

@ -747,6 +747,36 @@ The following `actions` are currently available:
- `move_item` - `move_item`
- `copy_item` - `copy_item`
### Metadata Update
When a new file is uploaded via the API a websocket notification is broadcast
to all connected clients after parsing is complete:
`{jsonrpc: "2.0", method: "notify_metadata_update", params: [metadata]}`
Where `metadata` is an object in the following format:
```json
{
filename: "file name",
size: <file size>,
modified: "last modified date",
slicer: "Slicer Name",
first_layer_height: <in mm>,
layer_height: <in mm>,
object_height: <in mm>,
estimated_time: <time in seconds>,
filament_total: <in mm>,
thumbnails: [
{
width: <in pixels>,
height: <in pixels>,
size: <length of string>,
data: <base64 string>
}, ...
]
}
```
# Appendix # Appendix
### Websocket setup ### Websocket setup