Debugging the Redfish API is relatively easy since JSON is at least partially human-readable (programmer-readable maybe? ;).
Inspect the Redfish API responses using curl
is relatively simple. We start
by running this:
curl -k -u 'username:password' https://redfish.api/redfish/v1/ | jq
We can also leave out the | jq
part if we do not have the jq
program
installed and we do not care about the prettiness of the output.
The response that we get back from the service should look something like this (we shortened the response somewhat to keep the document reasonably-sized):
{
"@odata.context": "/redfish/v1/$metadata#ServiceRoot.ServiceRoot",
"@odata.id": "/redfish/v1",
"@odata.type": "#ServiceRoot.v1_5_0.ServiceRoot",
"Chassis": {
"@odata.id": "/redfish/v1/Chassis"
},
"Links": {
"Sessions": {
"@odata.id": "/redfish/v1/SessionService/Sessions"
}
},
"Managers": {
"@odata.id": "/redfish/v1/Managers"
},
"Name": "HPE RESTful Root Service",
"Product": "ProLiant DL360 Gen10",
"SessionService": {
"@odata.id": "/redfish/v1/SessionService"
},
"Systems": {
"@odata.id": "/redfish/v1/Systems"
}
}
Now we can follow the links in response to get to the information we need. For example, to get information about the systems, we can run:
curl -k -u 'username:password' https://redfish.api/redfish/v1/Systems | jq
And again, we get back a JSON that should contain something similar to this:
{
"Description": "Computer Systems view",
"Name": "Computer Systems",
"Members": [
{
"@odata.id": "/redfish/v1/Systems/1"
}
],
"Members@odata.count": 1
}
Now rinse and repeat ;)
- Why are some fields missing from the Redfish API responses? Most of the fields described in the Redfish standard are optional. So make sure you can handle the missing fields.
- What can I do if some field is missing? You should check with your vendor if the required information is available via Redfish API. You may also need to update the BMC software to get the latest features available.
- How do I know if the data field is optional? You need to read the CSDL schemas that are available from the Redfish API web page. Good luck!