[curl]
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/user/list
|
For example
[curl in Linux]
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/user/list
{
"data": [
"/xyz/openbmc_project/user/root"
],
"message": "200 OK",
"status": "ok"
}
{
"data": [
"/xyz/openbmc_project/user/root"
],
"message": "200 OK",
"status": "ok"
}
Enumerate of User
[curl]
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/user/enumerate
|
For example
[curl in Linux]
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/user/enumerate
{
"data": {
"/xyz/openbmc_project/user/root": {}
},
"message": "200 OK",
"status": "ok"
}
{
"data": {
"/xyz/openbmc_project/user/root": {}
},
"message": "200 OK",
"status": "ok"
}
Change Password of root
[curl]
curl -c cjar -b cjar -k -H "Content-Type: application/json" -d "{\"data\": [\"<PASSWORD>\"] }" -X POST https://${bmc_ip}/xyz/openbmc_project/user/root/action/SetPassword
|
For example
[curl in Linux]
$ curl -c cjar -b cjar -k -H "Content-Type: application/json" -d "{\"data\": [\"cc617\"] }" -X POST http://192.168.88.38/xyz/openbmc_project/user/root/action/SetPassword
{
"data": null,
"message": "200 OK",
"status": "ok"
}
$ curl -c cjar -k -X POST -H "Content-Type: application/json" -d '{"data": [ "root","0penBmc" ] }' https://192.168.88.38/login
{
"data": {
"description": "Invalid username or password"
},
"message": "200 OK",
"status": "ok"
}
$ curl -c cjar -k -X POST -H "Content-Type: application/json" -d '{"data": [ "root","cc617" ] }' https://192.168.88.38/login
{
"data": "User 'root' logged in",
"message": "200 OK",
"status": "ok"
}
{
"data": null,
"message": "200 OK",
"status": "ok"
}
$ curl -c cjar -k -X POST -H "Content-Type: application/json" -d '{"data": [ "root","0penBmc" ] }' https://192.168.88.38/login
{
"data": {
"description": "Invalid username or password"
},
"message": "200 OK",
"status": "ok"
}
$ curl -c cjar -k -X POST -H "Content-Type: application/json" -d '{"data": [ "root","cc617" ] }' https://192.168.88.38/login
{
"data": "User 'root' logged in",
"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
No comments:
Post a Comment