Only
更新时间: 2026/06/29
在Gitcode上查看源码

ResourceDefinition

uris

  • https://device_ip/resourcecollection?only

properties

名称类型是否只读取值范围/枚举值说明
@odata.contextstringtrue-资源模型的OData描述信息
@odata.idstringtrue-资源节点的访问路径
@odata.typestringtrue-资源类型
Idstringtrue-资源唯一标识
Namestringtrue-资源名称
Destinationstringtrue-目的地事件服务的URI
EventTypesarraytrue-事件类型列表
Protocolstringtrue-事件连接的协议类型
Contextstringtrue-客户端提供的上下文字符串
HttpHeadersobjecttrue-事件订阅HTTP头参数
MessageIdsarraytrue-事件消息Id匹配列表
OriginResourcesarraytrue-事件源匹配列表
SendHeartbeatbooleantrue-是否使能心跳
HeartbeatIntervalMinutesnumbertrue-心跳上报的时间间隔

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