HTTP API add reboot and poweroff endpoints example

This commit is contained in:
Viacheslav Hletenko 2023-11-24 12:25:55 +02:00
parent 9a7daff149
commit d29ee63b82

View File

@ -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
======