Basic Resources
Basic resources are used to discover the Redfish service version and the collections of resources exposed by the device. A client can first query the version resource, then access the Service Root of the corresponding version, and follow the @odata.id values in the responses to continue accessing resources such as Systems, Managers, and Accounts.
Obtaining a Session Token
Submit the username and password to the login API. Authentication information only needs to be carried in the request body during login.
curl --request POST \
--header 'Content-Type: application/json' \
--data '{
"username": "<username>",
"password": "<password>"
}' \
'<protocol>://<device-ip>:<port>/redfish/v1/login'
After a successful login, obtain the token from data.token in the response:
{
"code": 200,
"data": {
"name": "<username>",
"token": "<token>"
},
"msg": "login success"
}
Subsequent requests put the returned token into the X-Xsrf-Token request header:
X-Xsrf-Token: <token>
1 Version Resource
Query the Redfish major versions supported by the service and their entry paths. A client can use the returned paths to continue discovering the Service Root of the corresponding version.
Request
| Item | Content |
|---|---|
| Method | GET |
| Path | /redfish |
| Authentication | HTTP Basic Auth or X-Xsrf-Token |
| Request body | None |
| Success status code | 200 OK |
Response Example
The following is a real response returned by a test device, with HTTP status code 200 OK.
{
"v1": "/redfish/v1/"
}
Response Fields
| Field | Type | Description |
|---|---|---|
v1 | string | Access path of the Redfish v1 Service Root. |
Error Response
When no valid authentication information is provided, the service returns 401 Unauthorized, with the same response format as the Service Root API.
2 Service Root Collection
Query the Redfish Service Root. The response contains the service's own identifiers, protocol version, device UUID, and entry points to other resources provided by the current device.
Request
| Item | Content |
|---|---|
| Method | GET |
| Path | /redfish/v1 |
| Authentication | HTTP Basic Auth or X-Xsrf-Token |
| Request body | None |
| Success status code | 200 OK |
Response Example
The following is a real response obtained by requesting the current test environment http://172.16.100.172:443 with a valid account, with HTTP status code 200 OK. Switching to HTTPS does not change the response structure; device-specific fields such as UUID will differ on other devices.
{
"@odata.id": "/redfish/v1/",
"@odata.type": "#ServiceRoot.v1.15.0.ServiceRoot",
"AccountService": {
"@odata.id": "/redfish/v1/AccountService"
},
"BmcVersion": "1.0.1",
"Id": "RootService",
"Managers": {
"@odata.id": "/redfish/v1/Managers"
},
"Name": "Root Service",
"Oem": {
"@odata.id": "/redfish/v1/Oem"
},
"RedfishVersion": "1.9.0",
"Switch": {
"@odata.id": "/redfish/v1/Switch"
},
"Systems": {
"@odata.id": "/redfish/v1/Systems"
},
"UUID": "138D3DBD-B2C1-4BD7-8D9A-112B2789E284",
"UpdateFwService": {
"@odata.id": "/redfish/v1/UpdateFwService"
},
"UpdateFwService_V2": {
"@odata.id": "/redfish/v1/UpdateFwService_V2"
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
@odata.id | string | Unique access path of the Service Root; the current implementation returns /redfish/v1/. |
@odata.type | string | OData type of the Service Root; the current implementation is #ServiceRoot.v1.15.0.ServiceRoot. |
Id | string | Service Root identifier; the current implementation is RootService. |
Name | string | Service Root name; the current implementation is Root Service. |
RedfishVersion | string | Redfish protocol version supported by the current implementation. |
BmcVersion | string | Current BMC service version. |
UUID | string | Globally unique identifier of the current device. |
AccountService | object | Entry point to the account service resource. |
Managers | object | Entry point to the BMC management resource. |
Oem | object | Entry point to the Firefly OEM extension resources. |
Switch | object | Entry point to the switch management resource. |
Systems | object | Entry point to the Systems resource. |
UpdateFwService | object | Entry point to the firmware upgrade service. |
UpdateFwService_V2 | object | Entry point to the second version of the firmware upgrade service. |
Error Response
When no valid authentication information is provided, the service returns:
{
"code": 401,
"msg": "unauthorized"
}
curl --request POST \
--header 'X-Xsrf-Token: <token>' \
'<protocol>://<device-ip>:<port>/redfish/v1/logout'