White Papers

16 Implementation of the DMTF Redfish API on Dell EMC PowerEdge Servers
{"@odata.context":"/redfish/v1/$metadata#ServiceRoot","@odata.id":"/redfish/v1",
"@odata.type":"#ServiceRoot.1.0.0.ServiceRoot","AccountService":{"@odata.id":"/r
edfish/v1/Managers/iDRAC.Embedded.1/AccountService"},"Chassis":{"@odata.id":"/re
dfish/v1/Chassis"},"Description":"Root
Service","EventService":{"@odata.id":"/redfish/v1/EventService"},"Id":"RootServi
ce","JsonSchemas":{"@odata.id":"/redfish/v1/JSONSchemas"},"Links":{"Sessions":{"
@odata.id":"/redfish/v1/Sessions"}},"Managers":{"@odata.id":"/redfish/v1/Manager
s"},"Name":"Root
Service","RedfishVersion":"1.0.0","Registries":{"@odata.id":"/redfish/v1/Registr
ies/Messages/En"},"SessionService":{"@odata.id":"/redfish/v1/SessionService"},"S
ystems":{"@odata.id":"/redfish/v1/Systems"},"Tasks":{"@odata.id":"/redfish/v1/Ta
skService"}}
For cleaner output formatting, the JSON output can be passed to Python and the module json.tool (output
limited for brevity):
Command:
curl "https://<iDRAC IP>/redfish/v1/" -k | python -m json.tool
Response:
{
"@odata.context": "/redfish/v1/$metadata#ServiceRoot",
"@odata.id": "/redfish/v1",
"@odata.type": "#ServiceRoot.1.0.0.ServiceRoot",
"AccountService": {
"@odata.id": "/redfish/v1/Managers/iDRAC.Embedded.1/AccountService"
},
"Chassis": {
"@odata.id": "/redfish/v1/Chassis" ā€¦
3.2.1 Using cURL with authentication
As discussed above, Redfish supports Basic and Session based authentication. Here are the cURL
commands used for authentication operations:
Basic authentication: Drilling down further into the Redfish API will require authentication. This can be done
using ā€œ-u username:passwordā€ on the cURL command line:
curl "https://<iDRAC IP>/redfish/v1/Chassis" -k -u root:calvin
This authenticates the single operation using the provided credentials.
Session based authentication: This requires a two stage process, creating a session called Login and
deleting session called Logout. For login, run the following command in verbose mode by appending option ā€“
v; this will output the X-Auth-Token value for use in the subsequent commands: