docs: Add documentation for "delete_file" websocket API.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Arksine 2020-09-07 12:51:39 -04:00
parent 4285ea7348
commit 97cb072981
2 changed files with 18 additions and 2 deletions

View File

@ -1,6 +1,17 @@
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.
### September 7th 2020
- A new websocket API has been added, `server.files.delete_file`:
```
{jsonrpc: "2.0", method: "server.files.delete_file", params:
{path: "<root>/<file_name>"}, id: <request id>}
```
Where <root> is either "gcodes" or "config", and <file_name> is
the relative path to the file for deletion. For example:
`path: "gcodes/my_sub_dir/my_gcode_file.gcode"`
### September 3rd 2020 ### September 3rd 2020
- The Websocket APIs have changed for clarity. The APIs methods now - The Websocket APIs have changed for clarity. The APIs methods now
use namespaces similar to those found in common programming languages. use namespaces similar to those found in common programming languages.

View File

@ -563,7 +563,11 @@ to delete a file in a subdirectory.
`DELETE /server/files/gcodes/<file_name>` `DELETE /server/files/gcodes/<file_name>`
- Websocket command:\ - Websocket command:\
Not Available `{jsonrpc: "2.0", method: "server.files.delete_file", params:
{path: "gcodes/<file_name>"}, id: <request id>}`
If the gcode file exists within a subdirectory, the relative
path should be included in the file name.
- Returns:\ - Returns:\
The HTTP request returns the name of the deleted file. The HTTP request returns the name of the deleted file.
@ -585,7 +589,8 @@ to delete a file in a subdirectory.
`DELETE /server/files/config/<file_name>` `DELETE /server/files/config/<file_name>`
- Websocket command:\ - Websocket command:\
Not Available `{jsonrpc: "2.0", method: "server.files.delete_file", params:
{path: "config/<file_name>}, id: <request id>}`
- Returns:\ - Returns:\
The HTTP request returns the name of the deleted file. The HTTP request returns the name of the deleted file.