EventService
更新时间: 2026/06/26
在Gitcode上查看源码

ResourceDefinition

uris

  • /redfish/v1/EventService

properties

名称类型是否只读取值范围/枚举值说明
@odata.contextstringtrue-EventService资源模型的OData描述信息
@odata.idstringtrue-EventService资源节点的访问路径
@odata.typestringtrue-EventService资源类型
Idstringtrue-EventService资源的ID
Namestringtrue-EventService资源的名称
Statusobjecttrue-EventService的状态,包括:
● Health:EventService健康状态
● State:EventService使能状态
● Severity:EventService的自定义健康状态
Status.Statestringtrue-EventService使能状态
Status.Oem.Public.Severitystringfalse-EventService的自定义健康状态
Status.Healthstringtrue-EventService健康状态
ServiceEnabledbooleanfalsetrue,false事件上报开关状态
DeliveryRetryAttemptsnumberfalse-指事件订阅发送失败最大尝试次数
DeliveryRetryIntervalSecondsnumberfalse-指发送任何给定事件的重试尝试之间的秒数
EventTypesForSubscriptionstringtrueStatusChange,ResourceUpdated,ResourceAdded,ResourceRemoved,Alert,MetricReport指可以订阅的事件的类型,取值为以下合法值的组合:
● StatusChange:资源状态改变事件
● ResourceUpdated:资源更新事件
● ResourceAdded:资源添加事件
● ResourceRemoved:资源移除事件
● Alert:告警事件
● MetricReport: 指标报告事件
Subscriptionsobjecttrue-指事件目标资源的集合的导航资源
Subscriptions[].@odata.idstringfalse-指事件目标资源的访问路径
Actionsobjecttrue-EventService可执行的操作
Actions.#EventService.SubmitTestEventobjecttrue-发送测试事件
Actions.#EventService.SubmitTestEvent.targetstringtrue-发送测试事件操作的路径
Actions.#EventService.SubmitTestEvent.@Redfish.ActionInfostringtrue-发送测试事件操作信息的查询路径
Actions.Oem.Public.#EventService.Rearmobjecttrue-重新上报未恢复的事件
Actions.Oem.Public.#EventService.Rearm.targetstringtrue-重新上报未恢复事件的操作的路径
Actions.Oem.Public.#EventService.Rearm.@Redfish.ActionInfostringtrue-重新上报未恢复事件的操作信息的查询路径
Actions.Oem.Public.#EventService.MockPreciseAlarmobjecttrue-模拟精准告警
Actions.Oem.Public.#EventService.MockPreciseAlarm.targetstringtrue-模拟精准告警的操作的路径
Actions.Oem.Public.#EventService.MockPreciseAlarm.@Redfish.ActionInfostringtrue-模拟精准告警的操作信息的查询路径
Actions.Oem.Public.#EventService.ShieldSystemAlertobjecttrue-屏蔽系统事件上报
Actions.Oem.Public.#EventService.ShieldSystemAlert.targetstringtrue-屏蔽系统事件上报的操作的路径
Actions.Oem.Public.#EventService.ShieldSystemAlert.@Redfish.ActionInfostringtrue-屏蔽系统事件上报的操作信息的查询路径
Actions.Oem.Public.#EventService.SetEventSeverityLevelobjecttrue-配置事件告警级别
Actions.Oem.Public.#EventService.SetEventSeverityLevel.targetstringtrue-配置事件告警级别的操作的路径
Actions.Oem.Public.#EventService.SetEventSeverityLevel.@Redfish.ActionInfostringtrue-配置事件告警级别的操作信息的查询路径
Oem.Publicobjectfalse-自定义属性
Oem.Public.ServerIdentitySourcestringfalseBoardSN,ProductAssetTag,HostNameBoardSN:使用电路板序列号作为服务器标识符; ProductAssetTag:使用产品资产标签作为服务器标识符; HostName:使用主机名作为服务器标识符
Oem.Public.ShieldSystemAlertarraytrue-被屏蔽上报的事件码:EventCode:事件码EventName:事件名
Oem.Public.AlertLanguagestringfalseen,zh上报事件的语言:en:英文zh:中文
Oem.Public.ReportTypestringtrueOemEventRedfish上报事件类型:OemEvent:自定义事件
Oem.Public.SnmpReportTypestringfalseOemEvent,SELSNMP Trap上报事件类型:OemEvent:自定义事件SEL:传感器事件
Oem.Public.ShieldResourcesForSubscriptionsarrayfalse-屏蔽事件上报的资源属性列表
Oem.Public.ShieldResourcesForSubscriptions[].Resourcestringfalse-屏蔽事件上报资源的访问路径
Oem.Public.ShieldResourcesForSubscriptions.Attributesarrayfalse-屏蔽事件上报属性的名称列表
Oem.Public.HeartbeatSupportedbooleantrue-表示是否支持事件订阅心跳

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创建会话时获得

使用指南

使用实例

请求样例:

http
GET https://device_ip/redfish/v1/EventService

请求头:


X-Auth-Token: 123456789***********************

请求消息体:无

响应样例:

json
{
  "@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

请求消息体:

json
{
  "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_typeSNMP Trap上报事件类型● OemEvent:自定义事件
● SEL:传感器事件

使用指南

使用实例

请求样例:

http
PATCH https://device_ip/redfish/v1/EventService

请求头:


X-Auth-Token: 123456789***********************
Content-Type: application/json
If-Match: W/"06348C97"

请求消息体:

json
{
  "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"
          ]
        }
      ]
    }
  }
}

响应样例:

json
{
  "@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

请求消息体:

json
{
  "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和事件源参数的校验。

使用实例

请求样例:

http
POST https://device_ip/redfish/v1/EventService/Actions/EventService.SubmitTestEvent

请求头:


X-Auth-Token: 123456789***********************
Content-Type: application/json

请求消息体:

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"
  }
}

响应样例:

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)

Rearm

命令功能

对未恢复的事件重新上报

命令格式

URL: https://device_ip/redfish/v1/EventService/Actions/Oem/Public/EventService.Rearm

请求头:


X-Auth-Token: 123456789***********************
Content-Type: header_type

请求消息体:

json
{}

请求头参数说明

参见 请求头参数说明

请求体参数说明

使用指南

使用实例

请求样例:

http
POST https://device_ip/redfish/v1/EventService/Actions/Oem/Public/EventService.Rearm

请求头:


X-Auth-Token: 123456789***********************
Content-Type: application/json

请求消息体:

json
{}

响应样例:

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

请求消息体:

json
{
  "EventCode": EventCode_value,
  "SubjectIndex": SubjectIndex_value,
  "Type": Type_value
}

请求头参数说明

参见 请求头参数说明

请求体参数说明

参数参数说明取值
EventCode_value事件码字符串 格式:0x1200003A
SubjectIndex_value事件索引数字 表示模拟告警对应的主体序号
Type_value操作类型操作类型,可以取的合法值为:
● Assert:模拟产生告警,此操作类型需携带有效的事件码
● Deassert:模拟恢复告警,此操作类型需携带有效的事件码
● StopAll:停止所有模拟的告警

使用指南

使用实例

请求样例:

http
POST https://device_ip/redfish/v1/EventService/Actions/Oem/Public/EventService.MockPreciseAlarm

请求头:


X-Auth-Token: 123456789***********************
Content-Type: application/json

请求消息体:

json
{
  "EventCode": "0x29000001",
  "SubjectIndex": 1,
  "Type": "Assert"
}

响应样例:

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)

ShieldSystemAlert

命令功能

屏蔽系统事件上报

命令格式

URL: https://device_ip/redfish/v1/EventService/Actions/Oem/Public/EventService.ShieldSystemAlert

请求头:


X-Auth-Token: 123456789***********************
Content-Type: header_type

请求消息体:

json
{
  "EventCode": EventCode_value,
  "Enabled": Enabled_value
}

请求头参数说明

参见 请求头参数说明

请求体参数说明

参数参数说明取值
EventCode_value事件码字符串 格式:0x29000001
Enabled_value是否开启指定事件码的屏蔽功能布尔 true: 开启屏蔽 false: 取消屏蔽

使用指南

使用实例

请求样例:

http
POST https://device_ip/redfish/v1/EventService/Actions/Oem/Public/EventService.ShieldSystemAlert

请求头:


X-Auth-Token: 123456789***********************
Content-Type: application/json

请求消息体:

json
{
  "EventCode": "0x29000001",
  "Enabled": true
}

响应样例:

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)

SetEventSeverityLevel

命令功能

配置事件告警级别

命令格式

URL: https://device_ip/redfish/v1/EventService/Actions/Oem/Public/EventService.SetEventSeverityLevel

请求头:


X-Auth-Token: 123456789***********************
Content-Type: header_type

请求消息体:

json
{
  "EventId": EventId_value,
  "Level": Level_value
}

请求头参数说明

参见 请求头参数说明

请求体参数说明

参数参数说明取值
EventId_value事件码字符串 格式:0x29000001
Level_value告警级别字符串 Normal: 正常 Minor: 一般 Major:严重 Critical: 致命

使用指南

使用实例

请求样例:

http
POST https://device_ip/redfish/v1/EventService/Actions/Oem/Public/EventService.SetEventSeverityLevel

请求头:


X-Auth-Token: 123456789***********************
Content-Type: application/json

请求消息体:

json
{
  "EventId": "0x29000001",
  "Level": "Normal"
}

响应样例:

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