summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Göhler <github@ghlr.de>2023-11-24 21:23:19 +0100
committerGitHub <noreply@github.com>2023-11-24 21:23:19 +0100
commitff28490e167d903113201376df2d3ed8f64ffe04 (patch)
treeb31cbc8fa32d95ecd0cb5ef8b1fbe9ebc914e53a
parent9a7daff149440af2cd76c78b138fc0f4ffc3b8bf (diff)
parentd29ee63b82a77c186c0827d562d14e0627c1db31 (diff)
downloadvyos-documentation-ff28490e167d903113201376df2d3ed8f64ffe04.tar.gz
vyos-documentation-ff28490e167d903113201376df2d3ed8f64ffe04.zip
Merge pull request #1161 from sever-sever/api-endpoints
HTTP API add reboot and poweroff endpoints example
-rw-r--r--docs/automation/vyos-api.rst37
1 files changed, 37 insertions, 0 deletions
diff --git a/docs/automation/vyos-api.rst b/docs/automation/vyos-api.rst
index efd00dd8..afcc1767 100644
--- a/docs/automation/vyos-api.rst
+++ b/docs/automation/vyos-api.rst
@@ -143,6 +143,43 @@ The ``reset`` endpoint run a ``reset`` command.
"error": null
}
+/reboot
+=======
+
+To initiate a reboot use the ``reboot`` endpoint.
+
+.. code-block:: none
+
+ curl --location --request POST 'https://vyos/reboot' \
+ --form data='{"op": "reboot", "path": ["now"]}' \
+ --form key='MY-HTTPS-API-PLAINTEXT-KEY'
+
+ respone:
+ {
+ "success": true,
+ "data": "",
+ "error": null
+ }
+
+/poweroff
+=========
+
+To power off the system use the ``poweroff`` endpoint.
+
+.. code-block:: none
+
+ curl --location --request POST 'https://vyos/poweroff' \
+ --form data='{"op": "poweroff", "path": ["now"]}' \
+ --form key='MY-HTTPS-API-PLAINTEXT-KEY'
+
+ respone:
+ {
+ "success": true,
+ "data": "",
+ "error": null
+ }
+
+
/image
======