Skip to content

Commit

Permalink
Merge pull request #1161 from sever-sever/api-endpoints
Browse files Browse the repository at this point in the history
HTTP API add reboot and poweroff endpoints example
  • Loading branch information
rebortg authored Nov 24, 2023
2 parents 9a7daff + d29ee63 commit ff28490
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions docs/automation/vyos-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
======

Expand Down

0 comments on commit ff28490

Please sign in to comment.