Skip to content

Instantly share code, notes, and snippets.

@flaviotorres
Created January 23, 2019 01:49
Show Gist options
  • Save flaviotorres/6e09c16d46ca2a79b131650c6b8c4e7f to your computer and use it in GitHub Desktop.
Save flaviotorres/6e09c16d46ca2a79b131650c6b8c4e7f to your computer and use it in GitHub Desktop.
Supermicro redfish power on off
SERVER="my-server"
USER="ADMIN"
PASS="ADMIN"
# ON
curl -si -u $USER:$PASS -k -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"Action": "Reset", "ResetType": "On"}' https://$SERVER/redfish/v1/Systems/1/Actions/ComputerSystem.Reset
#OFF
curl -si -u $USER:$PASS -k -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"Action": "Reset", "ResetType": "ForceOff"}' https://$SERVER/redfish/v1/Systems/1/Actions/ComputerSystem.Reset
# Other methods available:
curl -si -u $USER:$PASS -k -XGET https://$SERVER/redfish/v1/Systems/1/
"Actions": {
"#ComputerSystem.Reset": {
"target": "/redfish/v1/Systems/1/Actions/ComputerSystem.Reset",
"[email protected]": [
"On",
"ForceOff",
"GracefulShutdown",
"GracefulRestart",
"ForceRestart",
"Nmi",
"ForceOn"
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment