[curl]
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/watchdog/list
|
For example
[curl in Linux]
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/watchdog/list
{
"data": [
"/xyz/openbmc_project/watchdog/host0"
],
"message": "200 OK",
"status": "ok"
}
{
"data": [
"/xyz/openbmc_project/watchdog/host0"
],
"message": "200 OK",
"status": "ok"
}
Enumerate of Watchdog
[curl]
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/watchdog/enumerate
|
For example
[curl in Linux]
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/watchdog/enumerate
{
"data": {
"/xyz/openbmc_project/watchdog/host0": {
"Enabled": 1,
"ExpireAction": "xyz.openbmc_project.State.Watchdog.Action.HardReset",
"Initialized": 0,
"Interval": 30000,
"TimeRemaining": 24583
}
},
"message": "200 OK",
"status": "ok"
}
{
"data": {
"/xyz/openbmc_project/watchdog/host0": {
"Enabled": 1,
"ExpireAction": "xyz.openbmc_project.State.Watchdog.Action.HardReset",
"Initialized": 0,
"Interval": 30000,
"TimeRemaining": 24583
}
},
"message": "200 OK",
"status": "ok"
}
Enable or Disable Host Watchdog
[curl]
Enable
curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": 1}' https://${bmc_ip}/xyz/openbmc_project/watchdog/host0/attr/Enabled
|
curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": 0}' https://${bmc_ip}/xyz/openbmc_project/watchdog/host0/attr/Enabled
|
For example
[curl in Linux]
$ curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": 1}' https://192.168.88.38/xz/openbmc_project/watchdog/host0/attr/Enabled
{
"data": null,
"message": "200 OK",
"status": "ok"
}
$ curl b cjar -k https://192.168.88.38/xyz/openbmc_project/watchdog/host0
{
"data": {
"Enabled": 1,
"ExpireAction": "xyz.openbmc_project.State.Watchdog.Action.HardReset",
"Initialized": 0,
"Interval": 2400000,
"TimeRemaining": 2398289
},
"message": "200 OK",
"status": "ok"
}
{
"data": null,
"message": "200 OK",
"status": "ok"
}
$ curl b cjar -k https://192.168.88.38/xyz/openbmc_project/watchdog/host0
{
"data": {
"Enabled": 1,
"ExpireAction": "xyz.openbmc_project.State.Watchdog.Action.HardReset",
"Initialized": 0,
"Interval": 2400000,
"TimeRemaining": 2398289
},
"message": "200 OK",
"status": "ok"
}
Host Watchdog Expire Action
[curl]
Get Host Watchdog Expire Action
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/watchdog/host0/attr/ExpireAction
|
curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "xyz.openbmc_project.State.Watchdog.Action.HardReset" }' https://${bmc_ip}/xyz/openbmc_project/watchdog/host0/attr/ExpireAction
|
curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "xyz.openbmc_project.State.Watchdog.Action.PowerCycle" }' https://${bmc_ip}/xyz/openbmc_project/watchdog/host0/attr/ExpireAction
|
curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "xyz.openbmc_project.State.Watchdog.Action.PowerOff" }' https://${bmc_ip}/xyz/openbmc_project/watchdog/host0/attr/ExpireAction
|
For example
[curl in Linux]
$ curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "xyz.openbmc_project.Stte.Watchdog.Action.PowerOff" }' https://192.168.88.38/xyz/openbmc_project/watchdog/host0/attr/ExpireAction
{
"data": null,
"message": "200 OK",
"status": "ok"
}
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/watchdog/host0/attr/ExpireAction
{
"data": "xyz.openbmc_project.State.Watchdog.Action.PowerOff",
"message": "200 OK",
"status": "ok"
}
{
"data": null,
"message": "200 OK",
"status": "ok"
}
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/watchdog/host0/attr/ExpireAction
{
"data": "xyz.openbmc_project.State.Watchdog.Action.PowerOff",
"message": "200 OK",
"status": "ok"
}
Host Watchdog Interval
[curl]
Get Interval
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/watchdog/host0/attr/Interval
|
curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "<INTERVAL_ms>"}' https://${bmc_ip}/xyz/openbmc_project/watchdog/host0/attr/Interval
|
For example
[curl in Linux]
$ curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "3000"}' https://192.168.88.38/xyz/openbmc_project/watchdog/host0/attr/Interval
{
"data": null,
"message": "200 OK",
"status": "ok"
}
$ curl b cjar -k https://192.168.88.38/xyz/openbmc_project/watchdog/host0/attr/Interval
{
"data": 3000,
"message": "200 OK",
"status": "ok"
}
{
"data": null,
"message": "200 OK",
"status": "ok"
}
$ curl b cjar -k https://192.168.88.38/xyz/openbmc_project/watchdog/host0/attr/Interval
{
"data": 3000,
"message": "200 OK",
"status": "ok"
}
Check Host Watchdog Time Remaining
[curl]
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/watchdog/host0/attr/TimeRemaining
|
For example
[curl in Linux]
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/watchdog/host0/attr/TimeRemaining
{
"data": 2377451,
"message": "200 OK",
"status": "ok"
}
{
"data": 2377451,
"message": "200 OK",
"status": "ok"
}
Reference
[1] "OpenBMC" https://github.com/openbmc/
[2] "OpenBMC REST cheat sheet" https://github.com/openbmc/docs/blob/master/REST-cheatsheet.md
[3] "Host Management with OpenBMC" https://github.com/openbmc/docs/blob/master/host-management.md
[4] "OpenBMC REST API" https://github.com/openbmc/docs/blob/master/rest-api.md
[1] "OpenBMC" https://github.com/openbmc/
[2] "OpenBMC REST cheat sheet" https://github.com/openbmc/docs/blob/master/REST-cheatsheet.md
[3] "Host Management with OpenBMC" https://github.com/openbmc/docs/blob/master/host-management.md
[4] "OpenBMC REST API" https://github.com/openbmc/docs/blob/master/rest-api.md
Last Updated: 26-02-2018
Awesome website. Helped us out a lot with this crazy spec.
ReplyDeleteThank you. That means a lot to me.
DeleteThank you for creating this website
ReplyDeletethank you for making awesome stuff. it was a difficult to navigate and understand thro' this spec. this blog made things lot easier.
ReplyDeleteThank You for Visiting.
DeleteGreat insights on using curl with OpenBMC for managing watchdog timers! For those of you in Guildford, UK looking for expert computer services, check out 1st Class Computer Services. Their team excels in providing comprehensive solutions that ensure your systems are running optimally.
ReplyDelete