ResourceDefinition
uris
https://device_ip/redfish/v1/Chassis?$expand=.($levels=levels_num)
properties
| 名称 | 类型 | 是否只读 | 取值范围/枚举值 | 说明 |
|---|---|---|---|---|
| @odata.context | string | true | - | 资源模型的OData描述信息 |
| @odata.id | string | true | - | 资源节点的访问路径 |
| @odata.type | string | true | - | 资源类型 |
| Name | string | true | - | 资源名称 |
| Members@odata.count | number | true | - | 集合资源成员总数 |
| Members | array | true | - | 展开超链接后的资源成员列表 |
| Members[].@odata.context | string | true | - | 展开后资源的元数据描述信息 |
| Members[].@odata.id | string | true | - | 展开后资源的访问路径 |
| Members[].@odata.type | string | true | - | 展开后资源的类型 |
| Members[].Id | string | true | - | 展开后资源的唯一标识 |
| Members[].Name | string | true | - | 展开后资源的名称 |
| Members[].Oem | object | true | - | 展开后资源的自定义属性 |
| Members@odata.nextLink | string | true | - | 下一页的链接 |
supported_methods
- GET
HTTP methods
GET
命令功能
扩展超链接显示($expand)
说明
本命令适用于包含超链接的资源的查询操作,当GET操作的回显信息中包含特殊要求的超链接资源时,可以展开这种超链接,即将超链接指向的资源信息包含在本次请求中。"$expand"参数可以在不知道资源的链接时,减少请求次数。可以展开的特殊超链接必须满足以下条件: ● 某个属性值为JSON对象,且这种JSON对象仅包含一个属性名称为"@odata_id",属性值为有效的超链接; ● 某个属性值为JSON对象类型的集合,且这种JSON对象仅包含一个属性名称为"@odata_id",属性值为有效的超链接; 当前仅支持扩展一层超链接,即不扩展超链接展开信息中的下一层超链接。此外,"$expand"参数可以与上节的"$skip"、"$top"参数混合使用。
命令格式
URL: https://device_ip/redfish/v1/Chassis?$expand=.($levels=levels_num) 或 URL: https://device_ip/redfish/v1/Chassis/?$top=top_num&$skip=skip_num&$expand=.($levels=levels_num)
请求头:
X-Auth-Token: 123456789***********************请求消息体: 无
参数说明
| 参数 | 参数说明 | 取值 |
|---|---|---|
| device_ip | 登录设备的IP地址 | IPv4或IPv6地址 |
| levels_num | 展开超链接的递归层数 | 当前仅支持数值为1 |
| auth_value | 执行该GET请求时,必须在"Headers"中携带"X-Auth-Token"值用于鉴权 | 可通过/redfish/v1/SessionService/Sessions创建会话时获得 |
使用指南
集合资源的回显受分页限制,与"$skip"和"$top"参数一致。
使用实例
不带"$expand"参数查询SessionService资源的请求样例:
GET https://device_ip/redfish/v1/SessionService请求头:
X-Auth-Token: 123456789***********************请求消息体:无
响应样例:
{
"@odata.context": "/redfish/v1/$metadata#SessionService",
"@odata.id": "/redfish/v1/SessionService",
"@odata.type": "#SessionService.v1_0_2.SessionService",
"Id": "SessionService",
"Name": "Session Service",
"SessionTimeout": 300,
"Sessions": {
"@odata.id": "/redfish/v1/SessionService/Sessions"
},
"Oem": {
"Public": {
"WebSessionTimeoutMinutes": 5,
"WebSessionMode": "Private"
}
}
}响应码:200
使用"$expand"参数查询SessionService资源的请求样例:
GET https://device_ip/redfish/v1/SessionService?$expand=.($levels=1)请求头:
X-Auth-Token: 123456789***********************请求消息体:无
响应样例:
{
"@odata.context": "/redfish/v1/$metadata#SessionService",
"@odata.id": "/redfish/v1/SessionService",
"@odata.type": "#SessionService.v1_0_2.SessionService",
"Id": "SessionService",
"Name": "Session Service",
"SessionTimeout": 300,
"Sessions": {
"@odata.context": "/redfish/v1/$metadata#SessionService/Sessions/$entity",
"@odata.id": "/redfish/v1/SessionService/Sessions",
"@odata.type": "#SessionCollection.SessionCollection",
"Name": "Session Collection",
"Members@odata.count": 0,
"Members": []
},
"Oem": {
"Public": {
"WebSessionTimeoutMinutes": 5,
"WebSessionMode": "Private"
}
}
}响应码:200
不使用"$expand"参数查询集合类资源的请求样例:
GET https://device_ip/redfish/v1/Chassis?$skip=2&$top=3请求头:
X-Auth-Token: 123456789***********************请求消息体:无
响应样例:
{
"@odata.context": "/redfish/v1/$metadata#Chassis",
"@odata.id": "/redfish/v1/Chassis",
"@odata.type": "#ChassisCollection.ChassisCollection",
"Name": "Chassis Collection",
"Members@odata.count": 43,
"Members": [
{
"@odata.id": "/redfish/v1/Chassis/U41"
},
{
"@odata.id": "/redfish/v1/Chassis/U40"
}
],
"Members@odata.nextLink": "/redfish/v1/Chassis?$skip=4&$top=32"
}响应码:200
使用"$expand"参数查询集合类资源的请求样例:
GET https://device_ip/redfish/v1/Chassis?$skip=2&$top=2&$expand=.($levels=1)请求头:
X-Auth-Token: 123456789***********************请求消息体:无
响应样例:
{
"@odata.context": "/redfish/v1/$metadata#Chassis",
"@odata.id": "/redfish/v1/Chassis",
"@odata.type": "#ChassisCollection.ChassisCollection",
"Name": "Chassis Collection",
"Members@odata.count": 43,
"Members": [
{
"@odata.context": "/redfish/v1/$metadata#Chassis/Members/$entity",
"@odata.id": "/redfish/v1/Chassis/U41",
"@odata.type": "#Chassis.v1_7_0.Chassis",
"Id": "U41",
"Name": "Chassis Asset Info",
"ChassisType": null,
"Manufacturer": null,
"Model": null,
"SerialNumber": null,
"PartNumber": null,
"WeightKg": null,
"IndicatorLED": "Off",
"Status": {
"State": "Absent",
"Health": "OK"
},
"Oem": {
"Public": {
"TopUSlot": 41,
"IndicatorColor": null,
"DiscoveredTime": null,
"UHeight": null,
"DeviceType": null,
"RatedPowerWatts": null,
"CheckInTime": null,
"AssetOwner": null,
"LifeCycleYear": null,
"RFIDTagUID": null,
"ExtendField": null,
"Actions": {
"#Chassis.ControlIndicatorLED": {
"target": "/redfish/v1/Chassis/U41/Oem/Public/Actions/Chassis.ControlIndicatorLED",
"@Redfish.ActionInfo": "/redfish/v1/Chassis/U41/ControlIndicatorLEDActionInfo"
}
}
}
},
"Links": {
"ContainedBy": {
"@odata.id": "/redfish/v1/Chassis/Rack"
}
}
},
{
"@odata.context": "/redfish/v1/$metadata#Chassis/Members/$entity",
"@odata.id": "/redfish/v1/Chassis/U40",
"@odata.type": "#Chassis.v1_7_0.Chassis",
"Id": "U40",
"Name": "Chassis Asset Info",
"ChassisType": null,
"Manufacturer": null,
"Model": null,
"SerialNumber": null,
"PartNumber": null,
"WeightKg": null,
"IndicatorLED": "Off",
"Status": {
"State": "Absent",
"Health": "OK"
},
"Oem": {
"Public": {
"TopUSlot": 40,
"IndicatorColor": null,
"DiscoveredTime": null,
"UHeight": null,
"DeviceType": null,
"RatedPowerWatts": null,
"CheckInTime": null,
"AssetOwner": null,
"LifeCycleYear": null,
"RFIDTagUID": null,
"ExtendField": null,
"Actions": {
"#Chassis.ControlIndicatorLED": {
"target": "/redfish/v1/Chassis/U40/Oem/Public/Actions/Chassis.ControlIndicatorLED",
"@Redfish.ActionInfo": "/redfish/v1/Chassis/U40/ControlIndicatorLEDActionInfo"
}
}
}
},
"Links": {
"ContainedBy": {
"@odata.id": "/redfish/v1/Chassis/Rack"
}
}
}
],
"Members@odata.nextLink": "/redfish/v1/Chassis?$skip=4&$top=32"
}响应码:200