[curl]
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/time/
|
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/time/list
|
For example
[curl in Linux]
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/time/list
{
 "data": [
   "/xyz/openbmc_project/time/owner",
   "/xyz/openbmc_project/time/bmc",
   "/xyz/openbmc_project/time/host",
   "/xyz/openbmc_project/time/sync_method"
 ],
"message": "200 OK",
"status": "ok"
}
{
 "data": [
   "/xyz/openbmc_project/time/owner",
   "/xyz/openbmc_project/time/bmc",
   "/xyz/openbmc_project/time/host",
   "/xyz/openbmc_project/time/sync_method"
 ],
"message": "200 OK",
"status": "ok"
}
Enumerate Time Objects
[curl]
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/time/enumerate
|
For example
[curl in Linux]
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/time/enumerate
{
"data": {
"/xyz/openbmc_project/time/bmc": {
"Elapsed": 1519373997329371
},
"/xyz/openbmc_project/time/host": {
"Elapsed": 1519373997349029
},
"/xyz/openbmc_project/time/owner": {
"TimeOwner": "xyz.openbmc_project.Time.Owner.Owners.BMC"
},
"/xyz/openbmc_project/time/sync_method": {
"TimeSyncMethod": "xyz.openbmc_project.Time.Synchronization.Method.NTP"
}
},
"message": "200 OK",
"status": "ok"
}
{
"data": {
"/xyz/openbmc_project/time/bmc": {
"Elapsed": 1519373997329371
},
"/xyz/openbmc_project/time/host": {
"Elapsed": 1519373997349029
},
"/xyz/openbmc_project/time/owner": {
"TimeOwner": "xyz.openbmc_project.Time.Owner.Owners.BMC"
},
"/xyz/openbmc_project/time/sync_method": {
"TimeSyncMethod": "xyz.openbmc_project.Time.Synchronization.Method.NTP"
}
},
"message": "200 OK",
"status": "ok"
}
BMC Time Epoch
[curl]
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/time/bmc
|
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/time/bmc/attr/Elapsed
|
For example
[curl in Linux]
curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/time/bmc
{
"data": {
"Elapsed": 1519377854457019
},
"message": "200 OK",
"status": "ok"
}
{
"data": {
"Elapsed": 1519377854457019
},
"message": "200 OK",
"status": "ok"
}
Host Time Epoch
[curl]
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/time/host
|
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/time/host/attr/Elapsed
|
For example
[curl in Linux]
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/time/host/attr/Elapsed
{
"data": 1519378035021970,
"message": "200 OK",
"status": "ok"
}
{
"data": 1519378035021970,
"message": "200 OK",
"status": "ok"
}
Time Owner
[curl]
Get Time Owner
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/time/owner
|
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/time/owner/attr/TimeOwner
|
curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "xyz.openbmc_project.Time.Owner.Owners.Both"}' https://${bmc_ip}/xyz/openbmc_project/time/owner/attr/TimeOwner
|
curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "xyz.openbmc_project.Time.Owner.Owners.BMC"}' https://${bmc_ip}/xyz/openbmc_project/time/owner/attr/TimeOwner
|
curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "xyz.openbmc_project.Time.Owner.Owners.Host"}' https://${bmc_ip}/xyz/openbmc_project/time/owner/attr/TimeOwner
|
curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "xyz.openbmc_project.Time.Owner.Owners.Split"}' https://${bmc_ip}/xyz/openbmc_project/time/owner/attr/TimeOwner
|
For example
[curl in Linux]
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/time/owner
{
"data": {
"TimeOwner": "xyz.openbmc_project.Time.Owner.Owners.BMC"
},
"message": "200 OK",
"status": "ok"
}
$ curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "xyz.openbmc_project.Tie.Owner.Owners.Host"}' https://192.168.88.38/xyz/openbmc_project/time/owner/attr/TimeOwner
{
"data": null,
"message": "200 OK",
"status": "ok"
}
$ curl b cjar -k https://192.168.88.38/xyz/openbmc_project/time/owner
{
"data": {
"TimeOwner": "xyz.openbmc_project.Time.Owner.Owners.Host"
},
"message": "200 OK",
"status": "ok"
}
{
"data": {
"TimeOwner": "xyz.openbmc_project.Time.Owner.Owners.BMC"
},
"message": "200 OK",
"status": "ok"
}
$ curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "xyz.openbmc_project.Tie.Owner.Owners.Host"}' https://192.168.88.38/xyz/openbmc_project/time/owner/attr/TimeOwner
{
"data": null,
"message": "200 OK",
"status": "ok"
}
$ curl b cjar -k https://192.168.88.38/xyz/openbmc_project/time/owner
{
"data": {
"TimeOwner": "xyz.openbmc_project.Time.Owner.Owners.Host"
},
"message": "200 OK",
"status": "ok"
}
Time Sync Method
[curl]
Get Time Sync Method
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/time/sync_method
|
curl -b cjar -k https://${bmc_ip}/xyz/openbmc_project/time/sync_method/attr/TimeSyncMethod
|
curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "xyz.openbmc_project.Time.Synchronization.Method.NTP" }' https://${bmc_ip}/xyz/openbmc_project/time/sync_method/attr/TimeSyncMethod
|
curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "xyz.openbmc_project.Time.Synchronization.Method.Manual" }' https://${bmc_ip}/xyz/openbmc_project/time/sync_method/attr/TimeSyncMethod
|
For example
[curl in Linux]
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/time/sync_method/attr/TimeSyncMethod
{
"data": "xyz.openbmc_project.Time.Synchronization.Method.NTP",
"message": "200 OK",
"status": "ok"
}
$ curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "xyz.openbmc_project.Time.Synchronization.Method.Manual"}' https://192.168.88.38/xyz/openbmc_project/time/sync_method/attr/TimeSyncMethod
{
"data": null,
"message": "200 OK",
"status": "ok"
}
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/time/sync_method/attr/TimeSyncMethod
{
"data": "xyz.openbmc_project.Time.Synchronization.Method.Manual",
"message": "200 OK",
"status": "ok"
}
{
"data": "xyz.openbmc_project.Time.Synchronization.Method.NTP",
"message": "200 OK",
"status": "ok"
}
$ curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "xyz.openbmc_project.Time.Synchronization.Method.Manual"}' https://192.168.88.38/xyz/openbmc_project/time/sync_method/attr/TimeSyncMethod
{
"data": null,
"message": "200 OK",
"status": "ok"
}
$ curl -b cjar -k https://192.168.88.38/xyz/openbmc_project/time/sync_method/attr/TimeSyncMethod
{
"data": "xyz.openbmc_project.Time.Synchronization.Method.Manual",
"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: 23-02-2018
No comments:
Post a Comment