Only
更新时间: 2026/06/29
在Gitcode上查看源码ResourceDefinition
uris
https://device_ip/resourcecollection?only
properties
| 名称 | 类型 | 是否只读 | 取值范围/枚举值 | 说明 |
|---|---|---|---|---|
| @odata.context | string | true | - | 资源模型的OData描述信息 |
| @odata.id | string | true | - | 资源节点的访问路径 |
| @odata.type | string | true | - | 资源类型 |
| Id | string | true | - | 资源唯一标识 |
| Name | string | true | - | 资源名称 |
| Destination | string | true | - | 目的地事件服务的URI |
| EventTypes | array | true | - | 事件类型列表 |
| Protocol | string | true | - | 事件连接的协议类型 |
| Context | string | true | - | 客户端提供的上下文字符串 |
| HttpHeaders | object | true | - | 事件订阅HTTP头参数 |
| MessageIds | array | true | - | 事件消息Id匹配列表 |
| OriginResources | array | true | - | 事件源匹配列表 |
| SendHeartbeat | boolean | true | - | 是否使能心跳 |
| HeartbeatIntervalMinutes | number | true | - | 心跳上报的时间间隔 |
supported_methods
- GET
HTTP methods
GET
命令功能
获取唯一成员(only)
说明
适用于资源集合。如果目标资源集合仅包含一个成员,则客户端可以使用此查询参数请求返回该成员的资源。如果集合包含零个成员或多个成员,则返回整个资源集合。
如果组合使用参数"only"与其他查询参数,则返回400:QueryCombinationInvalid错误。
BMC300 5.8.0.1及以上版本支持
命令格式
URL: https://device_ip/resourcecollection?only
请求头:
X-Auth-Token: 123456789***********************请求消息体: 无
参数说明
| 参数 | 参数说明 | 取值 |
|---|---|---|
| device_ip | 登录设备的IP地址 | IPv4或IPv6地址 |
| resourcecollection | 预期使用查询参数访问的集合资源 | 集合资源接口对应的uri,如/redfish/v1/Chassis |
| auth_value | 执行该GET请求时,必须在"Headers"中携带"X-Auth-Token"值用于鉴权 | 可通过/redfish/v1/SessionService/Sessions创建会话时获得 |
使用实例
查询事件订阅资源集合中唯一的事件订阅。
请求样例:
http
GET https://device_ip/redfish/v1/EventService/Subscriptions?only请求头:
X-Auth-Token: 123456789***********************请求消息体:无
响应样例:
json
{
"@odata.context": "/redfish/v1/$metadata#EventService/Subscriptions/Members/$entity",
"@odata.id": "/redfish/v1/EventService/Subscriptions/1",
"@odata.type": "#EventDestination.v1_1_1.EventDestination",
"Id": "1",
"Name": "EventSubscription 1",
"Destination": "https://10.10.10.191/iBMCRedfishEvents/iBMCEventReceiver.php",
"EventTypes": [
"StatusChange",
"ResourceUpdated",
"ResourceAdded",
"ResourceRemoved",
"Alert"
],
"HttpHeaders": null,
"Protocol": "Redfish",
"Context": "event subscription context string",
"MessageIds": [
"iBMCEvents.2.0.PSUPredictiveFailure "
],
"OriginResources": [
{
"@odata.id": "/redfish/v1/Chassis/1/Power#/PowerSupplies/0"
}
],
"SendHeartbeat": true,
"HeartbeatIntervalMinutes": 10
}响应码:200