[curl]
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/led/list
|
For example
[curl in Linux]
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/led/list
{
"data": [
"/xyz/openbmc_project/led/groups/enclosure_identify",
"/xyz/openbmc_project/led/groups/power_on",
"/xyz/openbmc_project/led/groups/enclosure_fault",
"/xyz/openbmc_project/led/physical/identify",
"/xyz/openbmc_project/led/groups",
"/xyz/openbmc_project/led/physical/heartbeat",
"/xyz/openbmc_project/led/groups/bmc_booted",
"/xyz/openbmc_project/led/groups/lamp_test"
],
"message": "200 OK",
"status": "ok"
}
{
"data": [
"/xyz/openbmc_project/led/groups/enclosure_identify",
"/xyz/openbmc_project/led/groups/power_on",
"/xyz/openbmc_project/led/groups/enclosure_fault",
"/xyz/openbmc_project/led/physical/identify",
"/xyz/openbmc_project/led/groups",
"/xyz/openbmc_project/led/physical/heartbeat",
"/xyz/openbmc_project/led/groups/bmc_booted",
"/xyz/openbmc_project/led/groups/lamp_test"
],
"message": "200 OK",
"status": "ok"
}
Enumerate of LED
[curl]
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/led/enumerate
|
For example
[curl in Linux]
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/led/enumerate
{
"data": {
"/xyz/openbmc_project/led/groups": {},
"/xyz/openbmc_project/led/groups/bmc_booted": {
"Asserted": 1
},
"/xyz/openbmc_project/led/groups/enclosure_fault": {
"Asserted": 0
},
"/xyz/openbmc_project/led/groups/enclosure_identify": {
"Asserted": 0
},
"/xyz/openbmc_project/led/groups/lamp_test": {
"Asserted": 0
},
"/xyz/openbmc_project/led/groups/power_on": {
"Asserted": 1
},
"/xyz/openbmc_project/led/physical/heartbeat": {
"Color": "xyz.openbmc_project.Led.Physical.Palette.Unknown",
"DutyOn": 50,
"Period": 1000,
"State": "xyz.openbmc_project.Led.Physical.Action.Blink"
},
"/xyz/openbmc_project/led/physical/identify": {
"Color": "xyz.openbmc_project.Led.Physical.Palette.Unknown",
"DutyOn": 50,
"Period": 1000,
"State": "xyz.openbmc_project.Led.Physical.Action.Off"
}
},
"message": "200 OK",
"status": "ok"
}
{
"data": {
"/xyz/openbmc_project/led/groups": {},
"/xyz/openbmc_project/led/groups/bmc_booted": {
"Asserted": 1
},
"/xyz/openbmc_project/led/groups/enclosure_fault": {
"Asserted": 0
},
"/xyz/openbmc_project/led/groups/enclosure_identify": {
"Asserted": 0
},
"/xyz/openbmc_project/led/groups/lamp_test": {
"Asserted": 0
},
"/xyz/openbmc_project/led/groups/power_on": {
"Asserted": 1
},
"/xyz/openbmc_project/led/physical/heartbeat": {
"Color": "xyz.openbmc_project.Led.Physical.Palette.Unknown",
"DutyOn": 50,
"Period": 1000,
"State": "xyz.openbmc_project.Led.Physical.Action.Blink"
},
"/xyz/openbmc_project/led/physical/identify": {
"Color": "xyz.openbmc_project.Led.Physical.Palette.Unknown",
"DutyOn": 50,
"Period": 1000,
"State": "xyz.openbmc_project.Led.Physical.Action.Off"
}
},
"message": "200 OK",
"status": "ok"
}
Group of LED
[curl]
List of Group
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/led/groups/
|
BMC Booted
Get bmc_booted Value
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/led/groups/bmc_booted
|
curl -b cjar -k -X PUT -H "Content-Type: application/json" -d '{"data": 1}' https://${bmc_ip}/xyz/openbmc_project/led/groups/bmc_booted/attr/Asserted
|
curl -b cjar -k -X PUT -H "Content-Type: application/json" -d '{"data": 0}' https://${bmc_ip}/xyz/openbmc_project/led/groups/bmc_booted/attr/Asserted
|
Enclosure Fault
Get enclosure_fault Value
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/led/groups/enclosure_fault
|
curl -b cjar -k -X PUT -H "Content-Type: application/json" -d '{"data": 1}' https://${bmc_ip}/xyz/openbmc_project/led/groups/enclosure_fault/attr/Asserted
|
curl -b cjar -k -X PUT -H "Content-Type: application/json" -d '{"data": 0}' https://${bmc_ip}/xyz/openbmc_project/led/groups/enclosure_fault/attr/Asserted
|
Enclosure Identify
Get enclosure_identify Value
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/led/groups/enclosure_identify
|
curl -b cjar -k -X PUT -H "Content-Type: application/json" -d '{"data": 1}' https://${bmc_ip}/xyz/openbmc_project/led/groups/enclosure_identify/attr/Asserted
|
curl -b cjar -k -X PUT -H "Content-Type: application/json" -d '{"data": 0}' https://${bmc_ip}/xyz/openbmc_project/led/groups/enclosure_identify/attr/Asserted
|
Lamp Test
Get lamp_test Value
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/led/groups/lamp_test
|
curl -b cjar -k -X PUT -H "Content-Type: application/json" -d '{"data": 1}' https://${bmc_ip}/xyz/openbmc_project/led/groups/lamp_test/attr/Asserted
|
curl -b cjar -k -X PUT -H "Content-Type: application/json" -d '{"data": 0}' https://${bmc_ip}/xyz/openbmc_project/led/groups/lamp_test/attr/Asserted
|
Power On
Get power_on Value
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/led/groups/power_on
|
curl -b cjar -k -X PUT -H "Content-Type: application/json" -d '{"data": 1}' https://${bmc_ip}/xyz/openbmc_project/led/groups/power_on/attr/Asserted
|
curl -b cjar -k -X PUT -H "Content-Type: application/json" -d '{"data": 0}' https://${bmc_ip}/xyz/openbmc_project/led/groups/power_on/attr/Asserted
|
For example
[curl in Linux]
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/led/groups/
{
"data": [
"/xyz/openbmc_project/led/groups/enclosure_identify",
"/xyz/openbmc_project/led/groups/enclosure_fault",
"/xyz/openbmc_project/led/groups/power_on",
"/xyz/openbmc_project/led/groups/bmc_booted",
"/xyz/openbmc_project/led/groups/lamp_test"
],
"message": "200 OK",
"status": "ok"
}
$ curl b cjar -k -X PUT -H "Content-Type: application/json" -d '{"data": 1}' https://192.168.88.38/xyz/openbmc_project/led/groups/lamp_test/attr/Asserted
{
"data": null,
"message": "200 OK",
"status": "ok"
}
{
"data": [
"/xyz/openbmc_project/led/groups/enclosure_identify",
"/xyz/openbmc_project/led/groups/enclosure_fault",
"/xyz/openbmc_project/led/groups/power_on",
"/xyz/openbmc_project/led/groups/bmc_booted",
"/xyz/openbmc_project/led/groups/lamp_test"
],
"message": "200 OK",
"status": "ok"
}
$ curl b cjar -k -X PUT -H "Content-Type: application/json" -d '{"data": 1}' https://192.168.88.38/xyz/openbmc_project/led/groups/lamp_test/attr/Asserted
{
"data": null,
"message": "200 OK",
"status": "ok"
}
Physical
[curl]
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/led/physical/
|
Heartbeat
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/led/physical/heartbeat
|
curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "xyz.openbmc_project.Led.Physical.Action.On"}' https://${bmc_ip}/xyz/openbmc_project/led/physical/heartbeat/attr/State
|
curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "xyz.openbmc_project.Led.Physical.Action.Off"}' https://${bmc_ip}/xyz/openbmc_project/led/physical/heartbeat/attr/State
|
curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "xyz.openbmc_project.Led.Physical.Action.Blink"}' https://${bmc_ip}/xyz/openbmc_project/led/physical/heartbeat/attr/State
|
Identify
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/led/physical/identify
|
curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "xyz.openbmc_project.Led.Physical.Action.On"}' https://${bmc_ip}/xyz/openbmc_project/led/physical/identify/attr/State
|
curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "xyz.openbmc_project.Led.Physical.Action.Off"}' https://${bmc_ip}/xyz/openbmc_project/led/physical/identify/attr/State
|
curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "xyz.openbmc_project.Led.Physical.Action.Blink"}' https://${bmc_ip}/xyz/openbmc_project/led/physical/identify/attr/State
|
For example
[curl in Linux]
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/led/physical/
{
"data": [
"/xyz/openbmc_project/led/physical/identify",
"/xyz/openbmc_project/led/physical/heartbeat"
],
"message": "200 OK",
"status": "ok"
}
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/led/physical/heartbeat
{
"data": {
"Color": "xyz.openbmc_project.Led.Physical.Palette.Unknown",
"DutyOn": 50,
"Period": 1000,
"State": "xyz.openbmc_project.Led.Physical.Action.Blink"
},
"message": "200 OK",
"status": "ok"
}
$ curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "yz.openbmc_project.Led.Physical.Action.On"}' https://192.168.88.38/xyz/openbmc_project/led/physical/heartbeat/attr/State
{
"data": null,
"message": "200 OK",
"status": "ok"
}
{
"data": [
"/xyz/openbmc_project/led/physical/identify",
"/xyz/openbmc_project/led/physical/heartbeat"
],
"message": "200 OK",
"status": "ok"
}
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/led/physical/heartbeat
{
"data": {
"Color": "xyz.openbmc_project.Led.Physical.Palette.Unknown",
"DutyOn": 50,
"Period": 1000,
"State": "xyz.openbmc_project.Led.Physical.Action.Blink"
},
"message": "200 OK",
"status": "ok"
}
$ curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "yz.openbmc_project.Led.Physical.Action.On"}' https://192.168.88.38/xyz/openbmc_project/led/physical/heartbeat/attr/State
{
"data": null,
"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
[5] "LED Support for OpenBMC" https://github.com/openbmc/docs/blob/master/LED-architecture.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
[5] "LED Support for OpenBMC" https://github.com/openbmc/docs/blob/master/LED-architecture.md
Last Updated: 23-02-2018
No comments:
Post a Comment