From d29ee63b82a77c186c0827d562d14e0627c1db31 Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Fri, 24 Nov 2023 12:25:55 +0200 Subject: HTTP API add reboot and poweroff endpoints example --- docs/automation/vyos-api.rst | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'docs/automation') 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 ====== -- cgit v1.2.3