告警动作 API


此API将用于在Applications Manager中执行告警动作,如分配,取消分配,正常告警添加,列出注释

XML响应API:

http://[ APM Host ]:[ APM Port ]/AppManager/xml/AlarmAction?apikey=<api_key>&action=<action_type>&entity=<alarm_entity>&username=<user name>&message=<message>

JSON响应的API:

http://[ APM Host ]:[ APM Port ]/AppManager/json/AlarmAction?apikey=<api_key>&action=<action_type>&entity=<alarm_entity>&username=<user name>&message=<message>

请求参数:

字段描述
AppManager_Host 安装了Applications Manager的服务器。
AppManager_Port Applications Manager Web服务器端口。
api_key 执行动作的用户的API密钥。
action_type PickupAlarm / UnpickupAlarm / ClearAlarm / AddAnnotation / ListAnnotations
entity 实体字段应包含值[监视器resourceid] _ [属性ID]。这是Applications Manager中告警的唯一标识符。
message 指定用于注释告警的消息。
username 缺少告警时使用的用户名,将使用apikey的用户名。

XML输入样例:

http://apm-prod1:9090/AppManager/xml/AlarmAction?apikey=37097301e45784daa94889f35f2509ab&action=ClearAlarm&entity=10000285_527

示例XML响应:

<AppManager-response uri="/AppManager/xml/AlarmAction"><result><response response-code="4000"><message>Successfully Cleared the Alarm!</message></response></result></AppManager-response>

JSON输入

http://apm-prod1:9090/AppManager/json/AlarmAction?apikey=37097301e45784daa94889f35f2509ab&action=ClearAlarm&entity=10000285_527

JSON响应

{"response":{"result":[{"message":"Successfully Cleared the Alarm!"}],"uri":"/AppManager/json/AlarmAction"},"response-code":"4000"}