ResourceDefinition
uris
/redfish/v1/EventService
properties
| 名称 | 类型 | 是否只读 | 取值范围/枚举值 | 说明 |
|---|---|---|---|---|
| @odata.context | string | true | - | EventService资源模型的OData描述信息 |
| @odata.id | string | true | - | EventService资源节点的访问路径 |
| @odata.type | string | true | - | EventService资源类型 |
| Id | string | true | - | EventService资源的ID |
| Name | string | true | - | EventService资源的名称 |
| Status | object | true | - | EventService的状态,包括: ● Health:EventService健康状态 ● State:EventService使能状态 ● Severity:EventService的自定义健康状态 |
| Status.State | string | true | - | EventService使能状态 |
| Status.Oem.Public.Severity | string | false | - | EventService的自定义健康状态 |
| Status.Health | string | true | - | EventService健康状态 |
| ServiceEnabled | boolean | false | true,false | 事件上报开关状态 |
| DeliveryRetryAttempts | number | false | - | 指事件订阅发送失败最大尝试次数 |
| DeliveryRetryIntervalSeconds | number | false | - | 指发送任何给定事件的重试尝试之间的秒数 |
| EventTypesForSubscription | string | true | StatusChange,ResourceUpdated,ResourceAdded,ResourceRemoved,Alert,MetricReport | 指可以订阅的事件的类型,取值为以下合法值的组合: ● StatusChange:资源状态改变事件 ● ResourceUpdated:资源更新事件 ● ResourceAdded:资源添加事件 ● ResourceRemoved:资源移除事件 ● Alert:告警事件 ● MetricReport: 指标报告事件 |
| Subscriptions | object | true | - | 指事件目标资源的集合的导航资源 |
| Subscriptions[].@odata.id | string | false | - | 指事件目标资源的访问路径 |
| Actions | object | true | - | EventService可执行的操作 |
| Actions.#EventService.SubmitTestEvent | object | true | - | 发送测试事件 |
| Actions.#EventService.SubmitTestEvent.target | string | true | - | 发送测试事件操作的路径 |
| Actions.#EventService.SubmitTestEvent.@Redfish.ActionInfo | string | true | - | 发送测试事件操作信息的查询路径 |
| Actions.Oem.Public.#EventService.Rearm | object | true | - | 重新上报未恢复的事件 |
| Actions.Oem.Public.#EventService.Rearm.target | string | true | - | 重新上报未恢复事件的操作的路径 |
| Actions.Oem.Public.#EventService.Rearm.@Redfish.ActionInfo | string | true | - | 重新上报未恢复事件的操作信息的查询路径 |
| Actions.Oem.Public.#EventService.MockPreciseAlarm | object | true | - | 模拟精准告警 |
| Actions.Oem.Public.#EventService.MockPreciseAlarm.target | string | true | - | 模拟精准告警的操作的路径 |
| Actions.Oem.Public.#EventService.MockPreciseAlarm.@Redfish.ActionInfo | string | true | - | 模拟精准告警的操作信息的查询路径 |
| Actions.Oem.Public.#EventService.ShieldSystemAlert | object | true | - | 屏蔽系统事件上报 |
| Actions.Oem.Public.#EventService.ShieldSystemAlert.target | string | true | - | 屏蔽系统事件上报的操作的路径 |
| Actions.Oem.Public.#EventService.ShieldSystemAlert.@Redfish.ActionInfo | string | true | - | 屏蔽系统事件上报的操作信息的查询路径 |
| Actions.Oem.Public.#EventService.SetEventSeverityLevel | object | true | - | 配置事件告警级别 |
| Actions.Oem.Public.#EventService.SetEventSeverityLevel.target | string | true | - | 配置事件告警级别的操作的路径 |
| Actions.Oem.Public.#EventService.SetEventSeverityLevel.@Redfish.ActionInfo | string | true | - | 配置事件告警级别的操作信息的查询路径 |
| Oem.Public | object | false | - | 自定义属性 |
| Oem.Public.ServerIdentitySource | string | false | BoardSN,ProductAssetTag,HostName | BoardSN:使用电路板序列号作为服务器标识符; ProductAssetTag:使用产品资产标签作为服务器标识符; HostName:使用主机名作为服务器标识符 |
| Oem.Public.ShieldSystemAlert | array | true | - | 被屏蔽上报的事件码:EventCode:事件码EventName:事件名 |
| Oem.Public.AlertLanguage | string | false | en,zh | 上报事件的语言:en:英文zh:中文 |
| Oem.Public.ReportType | string | true | OemEvent | Redfish上报事件类型:OemEvent:自定义事件 |
| Oem.Public.SnmpReportType | string | false | OemEvent,SEL | SNMP Trap上报事件类型:OemEvent:自定义事件SEL:传感器事件 |
| Oem.Public.ShieldResourcesForSubscriptions | array | false | - | 屏蔽事件上报的资源属性列表 |
| Oem.Public.ShieldResourcesForSubscriptions[].Resource | string | false | - | 屏蔽事件上报资源的访问路径 |
| Oem.Public.ShieldResourcesForSubscriptions.Attributes | array | false | - | 屏蔽事件上报属性的名称列表 |
| Oem.Public.HeartbeatSupported | boolean | true | - | 表示是否支持事件订阅心跳 |
supported_methods
- GET
- PATCH
- POST
HTTP methods
GET
命令功能
查询事件服务资源
命令格式
URL: https://device_ip/redfish/v1/EventService
请求头:
X-Auth-Token: 123456789***********************请求消息体: 无
参数说明
| 参数 | 参数说明 | 取值 |
|---|---|---|
| device_ip | 登录设备的IP地址 | IPv4或IPv6地址 |
| auth_value | 执行该GET请求时,必须在"Headers"中携带"X-Auth-Token"值用于鉴权 | 可通过/redfish/v1/SessionService/Sessions创建会话时获得 |
使用指南
无
使用实例
请求样例:
GET https://device_ip/redfish/v1/EventService请求头:
X-Auth-Token: 123456789***********************请求消息体:无
响应样例:
{
"@odata.context": "/redfish/v1/$metadata#EventService",
"@odata.id": "/redfish/v1/EventService",
"@odata.type": "#EventService.v1_0_2.EventService",
"Id": "EventService",
"Name": "Event Service",
"Status": {
"State": "Enabled",
"Oem": {
"Public": {
"Severity": "Informational"
}
},
"Health": "OK"
},
"ServiceEnabled": false,
"DeliveryRetryAttempts": 3,
"DeliveryRetryIntervalSeconds": 60,
"EventTypesForSubscription": [
"StatusChange",
"ResourceUpdated",
"ResourceAdded",
"ResourceRemoved",
"Alert",
"MetricReport"
],
"Subscriptions": {
"@odata.id": "/redfish/v1/EventService/Subscriptions"
},
"Actions": {
"#EventService.SubmitTestEvent": {
"target": "/redfish/v1/EventService/Actions/EventService.SubmitTestEvent",
"@Redfish.ActionInfo": "/redfish/v1/EventService/SubmitTestEventActionInfo"
},
"Oem": {
"Public": {
"#EventService.Rearm": {
"target": "/redfish/v1/EventService/Actions/Oem/Public/EventService.Rearm",
"@Redfish.ActionInfo": "/redfish/v1/EventService/RearmActionInfo"
},
"#EventService.MockPreciseAlarm": {
"target": "/redfish/v1/EventService/Actions/Oem/Public/EventService.MockPreciseAlarm",
"@Redfish.ActionInfo": "/redfish/v1/EventService/MockPreciseAlarmActionInfo"
},
"#EventService.ShieldSystemAlert": {
"target": "/redfish/v1/EventService/Actions/Oem/Public/EventService.ShieldSystemAlert",
"@Redfish.ActionInfo": "/redfish/v1/EventService/ShieldSystemAlertActionInfo"
},
"#EventService.SetEventSeverityLevel": {
"target": "/redfish/v1/EventService/Actions/Oem/Public/EventService.SetEventSeverityLevel",
"@Redfish.ActionInfo": "/redfish/v1/EventService/SetEventSeverityLevelActionInfo"
}
}
}
},
"Oem": {
"Public": {
"ServerIdentitySource": "BoardSN",
"ShieldSystemAlert": [
{
"EventCode": "0x00000003",
"EventName": "CPUOverTempMajor"
}
],
"AlertLanguage": "en",
"ReportType": "OemEvent",
"SnmpReportType": "OemEvent",
"ShieldResourcesForSubscriptions": [
{
"Resource": "/redfish/v1/Chassis/*/Power",
"Attributes": [
"PowerControl/PowerConsumedWatts",
"PowerControl/PowerMetrics/AverageConsumedWatts",
"PowerControl/Oem/Public/PowerMetricsExtended/TotalConsumedPowerkWh",
"PowerControl/Oem/Public/HeatKcal",
"PowerControl/Oem/Public/BatteryMetricsExtended",
"Voltages/ReadingVolts",
"PowerControl/Oem/Public/PowerMetricsExtended",
"PowerSupplies/LineInputVoltage",
"PowerSupplies/Oem/Public/InletTemperatureCelsius",
"PowerSupplies/Oem/Public/InnerTemperatureCelsius",
"PowerSupplies/Oem/Public/PowerInputWatts"
]
}
],
"HeartbeatSupported": true
}
}
}响应码:200
PATCH
命令功能
修改事件服务资源
命令格式
URL: https://device_ip/redfish/v1/EventService
请求头:
X-Auth-Token: 123456789***********************
Content-Type: header_type
If-Match: ifmatch_value请求消息体:
{
"ServiceEnabled": enable_state,
"DeliveryRetryAttempts": delivery_retry_attempts,
"DeliveryRetryIntervalSeconds": delivery_retry_interval_Seconds,
"Oem": {
"Public": {
"ServerIdentitySource": identity_source,
"AlertLanguage": alert_language,
"ShieldResourcesForSubscriptions": [
{
"Resource": uri_str,
"Attributes": [
Attributes_value
]
}
],
"SnmpReportType": snmp_report_type_value
}
}
}请求头参数说明
参见 请求头参数说明
请求体参数说明
| 参数 | 参数说明 | 取值 |
|---|---|---|
| ifmatch_value | 请求消息的匹配参数 | 可通过对相应资源发起GET操作,从响应头中获取(对应于"ETag"参数) |
| enable_state | 事件上报开关状态 | ● true ● false |
| delivery_retry_attempts | 事件订阅发送失败最大尝试次数 | 重传次数,取值为[3, 10]。默认值:3 |
| delivery_retry_interval_Seconds | 发送任何给定事件重新尝试之间的秒数 | 重传间隔,取值为[60, 600]。默认值:60 |
| identity_source | 事件主机标识源 | ● BoardSN ● ProductAssetTag ● HostName |
| alert_language | 事件上报语言类型 | ● en ● zh |
| ShieldResourcesForSubscriptions | 屏蔽事件上报的资源属性 | 最多支持屏蔽128条URI |
| uri_str | 屏蔽事件上报资源的访问路径 | 合法资源URI,支持*所在的分段字符串通配 |
| Attributes_value | 屏蔽事件上报的属性列表 | ● 属性的路径配置需要覆盖从属关系,从根属性开始以/为分割符配置下一级的属性直至目标属性 ● 对象缺省默认为当前资源下的所有属性 ● 单条URI最多支持屏蔽16个属性 |
| snmp_report_type | SNMP Trap上报事件类型 | ● OemEvent:自定义事件 ● SEL:传感器事件 |
使用指南
无
使用实例
请求样例:
PATCH https://device_ip/redfish/v1/EventService请求头:
X-Auth-Token: 123456789***********************
Content-Type: application/json
If-Match: W/"06348C97"请求消息体:
{
"ServiceEnabled": false,
"DeliveryRetryAttempts": 3,
"DeliveryRetryIntervalSeconds": 60,
"Oem": {
"Public": {
"ServerIdentitySource": "BoardSN",
"AlertLanguage": "zh",
"ShieldResourcesForSubscriptions": [
{
"Resource": "/redfish/v1/Chassis/*/Power",
"SnmpReportType": "OemEvent",
"Attributes": [
"PowerControl/PowerConsumedWatts",
"PowerControl/PowerMetrics/AverageConsumedWatts",
"PowerControl/Oem/Public/PowerMetricsExtended/TotalConsumedPowerkWh",
"PowerControl/Oem/Public/HeatKcal",
"PowerControl/Oem/Public/BatteryMetricsExtended",
"Voltages/ReadingVolts",
"PowerControl/Oem/Public/PowerMetricsExtended",
"PowerSupplies/LineInputVoltage",
"PowerSupplies/Oem/Public/InletTemperatureCelsius",
"PowerSupplies/Oem/Public/InnerTemperatureCelsius",
"PowerSupplies/Oem/Public/PowerInputWatts"
]
}
]
}
}
}响应样例:
{
"@odata.context": "/redfish/v1/$metadata#EventService",
"@odata.id": "/redfish/v1/EventService",
"@odata.type": "#EventService.v1_0_2.EventService",
"Id": "EventService",
"Name": "Event Service",
"Status": {
"State": "Enabled",
"Health": "OK",
"Oem": {
"Public": {
"Severity": "Informational"
}
}
},
"ServiceEnabled": false,
"DeliveryRetryAttempts": 3,
"DeliveryRetryIntervalSeconds": 60,
"EventTypesForSubscription": [
"StatusChange",
"ResourceUpdated",
"ResourceAdded",
"ResourceRemoved",
"Alert",
"MetricReport"
],
"Subscriptions": {
"@odata.id": "/redfish/v1/EventService/Subscriptions"
},
"Actions": {
"#EventService.SubmitTestEvent": {
"target": "/redfish/v1/EventService/Actions/EventService.SubmitTestEvent",
"@Redfish.ActionInfo": "/redfish/v1/EventService/SubmitTestEventActionInfo"
},
"Oem": {
"Public": {
"#EventService.Rearm": {
"target": "/redfish/v1/EventService/Actions/Oem/Public/EventService.Rearm",
"@Redfish.ActionInfo": "/redfish/v1/EventService/RearmActionInfo"
},
"#EventService.MockPreciseAlarm": {
"target": "/redfish/v1/EventService/Actions/Oem/Public/EventService.MockPreciseAlarm",
"@Redfish.ActionInfo": "/redfish/v1/EventService/MockPreciseAlarmActionInfo"
},
"#EventService.ShieldSystemAlert": {
"target": "/redfish/v1/EventService/Actions/Oem/Public/EventService.ShieldSystemAlert",
"@Redfish.ActionInfo": "/redfish/v1/EventService/ShieldSystemAlertActionInfo"
},
"#EventService.SetEventSeverityLevel": {
"target": "/redfish/v1/EventService/Actions/Oem/Public/EventService.SetEventSeverityLevel",
"@Redfish.ActionInfo": "/redfish/v1/EventService/SetEventSeverityLevelActionInfo"
}
}
}
},
"Oem": {
"Public": {
"ServerIdentitySource": "BoardSN",
"ShieldSystemAlert": [],
"AlertLanguage": "zh",
"ReportType": "OemEvent",
"SnmpReportType": "OemEvent",
"ShieldResourcesForSubscriptions": [
{
"Resource": "/redfish/v1/Chassis/*/Power",
"Attributes": [
"PowerControl/PowerConsumedWatts",
"PowerControl/PowerMetrics/AverageConsumedWatts",
"PowerControl/Oem/Public/PowerMetricsExtended/TotalConsumedPowerkWh",
"PowerControl/Oem/Public/HeatKcal",
"PowerControl/Oem/Public/BatteryMetricsExtended",
"Voltages/ReadingVolts",
"PowerControl/Oem/Public/PowerMetricsExtended",
"PowerSupplies/LineInputVoltage",
"PowerSupplies/Oem/Public/InletTemperatureCelsius",
"PowerSupplies/Oem/Public/InnerTemperatureCelsius",
"PowerSupplies/Oem/Public/PowerInputWatts"
]
}
]
}
}
}响应码:200
POST (ACTION)
SubmitTestEvent
命令功能
模拟测试事件
命令格式
URL: https://device_ip/redfish/v1/EventService/Actions/EventService.SubmitTestEvent
请求头:
X-Auth-Token: 123456789***********************
Content-Type: header_type请求消息体:
{
"EventType": event_type,
"EventId": event_id,
"EventTimestamp": time_stamp,
"Severity": severity,
"Message": message,
"MessageId": message_id,
"MessageArgs": message_args,
"OriginOfCondition": origin_of_condition
}请求头参数说明
参见 请求头参数说明
请求体参数说明
| 参数 | 参数说明 | 取值 |
|---|---|---|
| event_type | 测试事件类型 | 模拟的事件类型,可以取的合法值为: ● StatusChange:资源状态改变事件 ● ResourceUpdated:资源更新事件 ● ResourceAdded:资源添加事件 ● ResourceRemoved:资源移除事件 ● Alert:告警事件 ● MetricReport: 指标报告事件 |
| event_id | 模拟事件对应的事件码 | 字符串 |
| time_stamp | 模拟事件产生的时间戳 | 字符串 格式:YYYY-MM-DD HH-MM-SS |
| severity | 模拟事件严重等级 | 严重性 Redfish支持的严重级别包括:OK、Warning、Critical |
| message | 模拟事件消息 | 字符串 |
| message_id | 模拟事件消息Id | 字符串 |
| message_args | 模拟事件消息格式化参数 | 字符串数组 |
| origin_of_condition | 模拟事件关联的事件源列表 | 对象数组 |
使用指南
测试事件主要验证事件订阅接收地址的连通性,不进行消息Id和事件源参数的校验。
使用实例
请求样例:
POST https://device_ip/redfish/v1/EventService/Actions/EventService.SubmitTestEvent请求头:
X-Auth-Token: 123456789***********************
Content-Type: application/json请求消息体:
{
"EventType": "StatusChange",
"EventId": "myEventId",
"EventTimestamp": "2017-02-14T09:42:59Z",
"Severity": "OK",
"Message": "123",
"MessageId": "iBMCEvents.1.0.ResourceStatusChanged",
"MessageArgs": [
"arg0",
"201703232106"
],
"OriginOfCondition": {
"@odata.id": "/redfish/v1"
}
}响应样例:
{
"error": {
"code": "Base.1.0.GeneralError",
"message": "A general error has occurred. See ExtendedInfo for more information.",
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_0_0.Message",
"MessageId": "Base.1.0.Success",
"RelatedProperties": [],
"Message": "Successfully Completed Request",
"MessageArgs": [],
"Severity": "OK",
"Resolution": "None"
}
]
}
}响应码:200
POST (ACTION)
Rearm
命令功能
对未恢复的事件重新上报
命令格式
URL: https://device_ip/redfish/v1/EventService/Actions/Oem/Public/EventService.Rearm
请求头:
X-Auth-Token: 123456789***********************
Content-Type: header_type请求消息体:
{}请求头参数说明
参见 请求头参数说明
请求体参数说明
无
使用指南
无
使用实例
请求样例:
POST https://device_ip/redfish/v1/EventService/Actions/Oem/Public/EventService.Rearm请求头:
X-Auth-Token: 123456789***********************
Content-Type: application/json请求消息体:
{}响应样例:
{
"error": {
"code": "Base.1.0.GeneralError",
"message": "A general error has occurred. See ExtendedInfo for more information.",
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_0_0.Message",
"MessageId": "Base.1.0.Success",
"RelatedProperties": [],
"Message": "Successfully Completed Request",
"MessageArgs": [],
"Severity": "OK",
"Resolution": "None"
}
]
}
}响应码:200
POST (ACTION)
MockPreciseAlarm
命令功能
模拟精准告警
说明
Type_value取值为Deassert时,用来模拟恢复告警,但是只恢复可以自动恢复的告警。
命令格式
URL: https://device_ip/redfish/v1/EventService/Actions/Oem/Public/EventService.MockPreciseAlarm
请求头:
X-Auth-Token: 123456789***********************
Content-Type: header_type请求消息体:
{
"EventCode": EventCode_value,
"SubjectIndex": SubjectIndex_value,
"Type": Type_value
}请求头参数说明
参见 请求头参数说明
请求体参数说明
| 参数 | 参数说明 | 取值 |
|---|---|---|
| EventCode_value | 事件码 | 字符串 格式:0x1200003A |
| SubjectIndex_value | 事件索引 | 数字 表示模拟告警对应的主体序号 |
| Type_value | 操作类型 | 操作类型,可以取的合法值为: ● Assert:模拟产生告警,此操作类型需携带有效的事件码 ● Deassert:模拟恢复告警,此操作类型需携带有效的事件码 ● StopAll:停止所有模拟的告警 |
使用指南
无
使用实例
请求样例:
POST https://device_ip/redfish/v1/EventService/Actions/Oem/Public/EventService.MockPreciseAlarm请求头:
X-Auth-Token: 123456789***********************
Content-Type: application/json请求消息体:
{
"EventCode": "0x29000001",
"SubjectIndex": 1,
"Type": "Assert"
}响应样例:
{
"error": {
"code": "Base.1.0.GeneralError",
"message": "A general error has occurred. See ExtendedInfo for more information.",
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_0_0.Message",
"MessageId": "Base.1.0.Success",
"RelatedProperties": [],
"Message": "Successfully Completed Request",
"MessageArgs": [],
"Severity": "OK",
"Resolution": "None"
}
]
}
}响应码:200
POST (ACTION)
ShieldSystemAlert
命令功能
屏蔽系统事件上报
命令格式
URL: https://device_ip/redfish/v1/EventService/Actions/Oem/Public/EventService.ShieldSystemAlert
请求头:
X-Auth-Token: 123456789***********************
Content-Type: header_type请求消息体:
{
"EventCode": EventCode_value,
"Enabled": Enabled_value
}请求头参数说明
参见 请求头参数说明
请求体参数说明
| 参数 | 参数说明 | 取值 |
|---|---|---|
| EventCode_value | 事件码 | 字符串 格式:0x29000001 |
| Enabled_value | 是否开启指定事件码的屏蔽功能 | 布尔 true: 开启屏蔽 false: 取消屏蔽 |
使用指南
无
使用实例
请求样例:
POST https://device_ip/redfish/v1/EventService/Actions/Oem/Public/EventService.ShieldSystemAlert请求头:
X-Auth-Token: 123456789***********************
Content-Type: application/json请求消息体:
{
"EventCode": "0x29000001",
"Enabled": true
}响应样例:
{
"error": {
"code": "Base.1.0.GeneralError",
"message": "A general error has occurred. See ExtendedInfo for more information.",
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_0_0.Message",
"MessageId": "Base.1.0.Success",
"RelatedProperties": [],
"Message": "Successfully Completed Request",
"MessageArgs": [],
"Severity": "OK",
"Resolution": "None"
}
]
}
}响应码:200
POST (ACTION)
SetEventSeverityLevel
命令功能
配置事件告警级别
命令格式
URL: https://device_ip/redfish/v1/EventService/Actions/Oem/Public/EventService.SetEventSeverityLevel
请求头:
X-Auth-Token: 123456789***********************
Content-Type: header_type请求消息体:
{
"EventId": EventId_value,
"Level": Level_value
}请求头参数说明
参见 请求头参数说明
请求体参数说明
| 参数 | 参数说明 | 取值 |
|---|---|---|
| EventId_value | 事件码 | 字符串 格式:0x29000001 |
| Level_value | 告警级别 | 字符串 Normal: 正常 Minor: 一般 Major:严重 Critical: 致命 |
使用指南
无
使用实例
请求样例:
POST https://device_ip/redfish/v1/EventService/Actions/Oem/Public/EventService.SetEventSeverityLevel请求头:
X-Auth-Token: 123456789***********************
Content-Type: application/json请求消息体:
{
"EventId": "0x29000001",
"Level": "Normal"
}响应样例:
{
"error": {
"code": "Base.1.0.GeneralError",
"message": "A general error has occurred. See ExtendedInfo for more information.",
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_0_0.Message",
"MessageId": "Base.1.0.Success",
"RelatedProperties": [],
"Message": "Successfully Completed Request",
"MessageArgs": [],
"Severity": "OK",
"Resolution": "None"
}
]
}
}响应码:200