mirror of
https://github.com/vyos/vyos-documentation.git
synced 2025-10-26 08:41:46 +01:00
HTTP API add reboot and poweroff endpoints example
This commit is contained in:
parent
9a7daff149
commit
d29ee63b82
@ -143,6 +143,43 @@ The ``reset`` endpoint run a ``reset`` command.
|
|||||||
"error": null
|
"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
|
/image
|
||||||
======
|
======
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user