From 97cb072981a8210df5b5f96b884e67c01639cbf0 Mon Sep 17 00:00:00 2001 From: Arksine Date: Mon, 7 Sep 2020 12:51:39 -0400 Subject: [PATCH] docs: Add documentation for "delete_file" websocket API. Signed-off-by: Eric Callahan --- docs/api_changes.md | 11 +++++++++++ docs/web_api.md | 9 +++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/api_changes.md b/docs/api_changes.md index 12e3c3f..da2a678 100644 --- a/docs/api_changes.md +++ b/docs/api_changes.md @@ -1,6 +1,17 @@ This document keeps a record of all changes to Moonraker's remote 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: "/"}, id: } + ``` + Where is either "gcodes" or "config", and is + the relative path to the file for deletion. For example: + `path: "gcodes/my_sub_dir/my_gcode_file.gcode"` + + ### September 3rd 2020 - The Websocket APIs have changed for clarity. The APIs methods now use namespaces similar to those found in common programming languages. diff --git a/docs/web_api.md b/docs/web_api.md index 71357e1..6665194 100644 --- a/docs/web_api.md +++ b/docs/web_api.md @@ -563,7 +563,11 @@ to delete a file in a subdirectory. `DELETE /server/files/gcodes/` - Websocket command:\ - Not Available + `{jsonrpc: "2.0", method: "server.files.delete_file", params: + {path: "gcodes/"}, id: }` + + If the gcode file exists within a subdirectory, the relative + path should be included in the file name. - Returns:\ 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/` - Websocket command:\ - Not Available + `{jsonrpc: "2.0", method: "server.files.delete_file", params: + {path: "config/}, id: }` - Returns:\ The HTTP request returns the name of the deleted file.