diff options
Diffstat (limited to 'docs/automation')
| -rw-r--r-- | docs/automation/command-scripting.rst | 2 | ||||
| -rw-r--r-- | docs/automation/vyos-api.rst | 37 | 
2 files changed, 38 insertions, 1 deletions
| diff --git a/docs/automation/command-scripting.rst b/docs/automation/command-scripting.rst index 64564e5a..c8a72a36 100644 --- a/docs/automation/command-scripting.rst +++ b/docs/automation/command-scripting.rst @@ -94,7 +94,7 @@ Here is a simple example:    #!/bin/vbash    source /opt/vyatta/etc/functions/script-template    configure -  source < /config/scripts/setfirewallgroup.py +  source <(/config/scripts/setfirewallgroup.py)    commit 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  ====== | 
