diff options
author | Robert Göhler <github@ghlr.de> | 2023-11-24 21:28:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-24 21:28:23 +0100 |
commit | 5dff955e49dd7a6c8d11c678e11fcdff0fc3f24b (patch) | |
tree | 947b42ec9f487a8292d83767201f0b1506d18489 | |
parent | 5fb241c9ae0f95a3917a90d34c9979f06b965197 (diff) | |
parent | 9c961c0d5261c6ba16d48d7e44cb069c856d99d5 (diff) | |
download | vyos-documentation-5dff955e49dd7a6c8d11c678e11fcdff0fc3f24b.tar.gz vyos-documentation-5dff955e49dd7a6c8d11c678e11fcdff0fc3f24b.zip |
Merge pull request #1163 from vyos/mergify/bp/sagitta/pr-1161
HTTP API add reboot and poweroff endpoints example (backport #1161)
-rw-r--r-- | docs/automation/vyos-api.rst | 37 |
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 ====== |