Page MenuHomeVyOS Platform

Add reboot and poweroff the system via API
Closed, ResolvedPublicFEATURE REQUEST

Description

Add the ability to reboot and poweroff the system via API

Details

Version
-
Is it a breaking change?
Perfectly compatible
Issue type
Feature (new functionality)

Event Timeline

Viacheslav changed the task status from Open to In progress.Nov 21 2023, 10:14 AM
Viacheslav claimed this task.

PR https://github.com/vyos/vyos-1x/pull/2516

$ curl -k --location --request POST 'https://192.168.122.14/reboot' \
  --form data='{"op": "reboot", "path": ["now"]}' \
  --form key='foo'
{"success": true, "data": "Warning: there are unsaved configuration changes!\nRun 'save' command if you do not want to lose those changes after reboot/shutdown.\n\n", "error": null}


$ curl -k --location --request POST 'https://192.168.122.14/poweroff' \
  --form data='{"op": "poweroff", "path": ["now"]}' \
  --form key='foo'

{"success": true, "data": "Warning: there are unsaved configuration changes!\nRun 'save' command if you do not want to lose those changes after reboot/shutdown.\n\n", "error": null}
Viacheslav changed the task status from In progress to Needs testing.Nov 22 2023, 12:14 AM
Viacheslav moved this task from Open to Finished on the VyOS 1.5 Circinus board.

@a.apostoliuk will be available in the next rolling release.

Viacheslav moved this task from Open to Finished on the VyOS 1.4 Sagitta board.

Works fine

$ curl -k --location --request POST 'https://192.168.122.11/reboot'   --form data='{"op": "reboot", "path": ["now"]}'   --form key='foo'
{"success": true, "data": "Warning: there are unsaved configuration changes!\nRun 'save' command if you do not want to lose those changes after reboot/shutdown.\n\n", "error": null}