阈值配置API


这些API允许管理员用户在Applications Manager中配置阈值。阈值配置API旨在支持GET和POST请求:


请求参数

执行此API请求所涉及的参数包括:

字段 描述
thresholdname 阈值显示名称。对于包含特殊字符的显示名称,在RESTAPI中传递阈值名称时,将替换为%23,将替换为%26,将+替换为%2B
criticalcondition, warningcondition, clearcondition, secondarycriticalthresholdcondition, secondarywarningthresholdcondition, secondaryinfothresholdcondition 条件的可能值为:
  • 数值和浮动阈值条件::
    • LT - 小于 httpValue
    • GT - 大于 httpValue
    • EQ -等于 httpValue
    • NE - 不等于 httpValue
    • LE -小于或等于
    • GE - 大于或等于
  • 字符串阈值条件:
    • CT - 包含
    • DC - 不包含
    • QL -等于
    • NQ -不等于
    • SW -开始
    • EW - 截止
criticalconditionjoiner, warningconditionjoiner, infoconditionjoiner 用于评估两个阈值条件的合并条件。可能的值为:
  • OR-逻辑或条件
  • AND -逻辑与条件
criticalvalue, warningvalue, clearvalue, secondarycriticalthresholdvalue, secondarywarningthresholdvalue, secondaryinfothresholdvalue 值的危急警告正常的状态。
criticalmessage, warningmessage, clearmessage 通知用户紧急警告正常情况的消息。
criticalpolls, warningpolls, clearpolls 表示严重警告正常严重级别的连续轮询的最大次数的值。
min_criticalpolls, min_warningpolls, min_clearpolls 表示严重警告正常严重级别的最小连续轮询次数的值。
type 阈值的数据类型。可能的值为:
  • 数字阈值为1
  • 浮动阈值4
  • 字符串阈值3
thresholdType 要配置的阈值类型。可能的值为:
  • 0-标准阈值
  • 1-自适应阈值
adaptiveHigherPercentage 阈值上限的值,以百分比(%)为单位。可能的值为:
  • 0-禁用百分比复选框
  • 1-启用百分比复选框
adaptiveBaseformulaType 设置自适应阈值所基于的公式类型。可能的值为:
  • 0-基准
  • 1-自定义表达式
adaptiveBaseWeek 在自适应阈值中固定基线值所依据的星期。可能的值为前一周周-月-年格式的所需周。
businessHourAssociatedToThreshold 启用营业时间作为阈值的选项。可能的值:enabled
businessType 阈值所基于的营业时间类型。可能的值为:
  • 0-在选定的工作时间以外
  • 1-在选定的工作时间内
selectedBusinessHourID 表示营业时间ID的值。默认值为0

创建阈值

以下API允许管理员用户在Applications Manager中创建阈值。

语法:

对于XML响应:

http://[ APM Host ]:[ APM Port ]/AppManager/xml/threshold?apikey=[ API Key ]&type=[ Type ]&thresholdname=[ Threshold Name ]&thresholdType=[ Threshold Type ]&criticalcondition=[ Critical Condition ]&criticalvalue=[ Critical Value ]&criticalconditionjoiner=[ Critical Condition Joiner ]&secondarycriticalthresholdcondition=[ Secondary Critical Condition ]&secondarycriticalthresholdvalue=[ Secondary Critical Value ]&criticalmessage=[ Critical Message ]&min_criticalpolls=[ Minimum Critical Polls ]&criticalpolls=[ Maximum Critical Polls ]&warningcondition=[ Warning Condition ]&warningvalue=[ Warning Value ]&warningconditionjoiner=[ Warning Condition Joiner ]&secondarywarningthresholdcondition=[ Secondary Warning Condition ]&secondarywarningthresholdvalue=[ Secondary Warning Value ]&warningmessage=[ Warning Message ]&min_warningpolls=[ Minimum Warning Polls ]&warningpolls=[ Maximum Warning Polls ]&clearcondition=[ Clear Condition ]&clearvalue=[ Clear Value ]&infoconditionjoiner=[ Clear Condition Joiner ]&secondaryinfothresholdcondition=[ Secondary Clear Condition ]&secondaryinfothresholdvalue=[ Secondary Clear Value ]&clearmessage=[ Clear Message ]&min_clearpolls=[ Minimum Clear Polls ]&clearpolls=[ Maximum Clear Polls ]&businessHourAssociatedToThreshold=[ Associate Business Hour ]&businessType=[ Business Hour Type ]&selectedBusinessHourID=[ Business Hour ID ]

对于JSON响应:

http://[ APM Host ]:[ APM Port ]/AppManager/json/threshold?apikey=[ API Key ]&type=[ Type ]&thresholdname=[ Threshold Name ]&thresholdType=[ Threshold Type ]&criticalcondition=[ Critical Condition ]&criticalvalue=[ Critical Value ]&criticalconditionjoiner=[ Critical Condition Joiner ]&secondarycriticalthresholdcondition=[ Secondary Critical Condition ]&secondarycriticalthresholdvalue=[ Secondary Critical Value ]&criticalmessage=[ Critical Message ]&min_criticalpolls=[ Minimum Critical Polls ]&criticalpolls=[ Maximum Critical Polls ]&warningcondition=[ Warning Condition ]&warningvalue=[ Warning Value ]&warningconditionjoiner=[ Warning Condition Joiner ]&secondarywarningthresholdcondition=[ Secondary Warning Condition ]&secondarywarningthresholdvalue=[ Secondary Warning Value ]&warningmessage=[ Warning Message ]&min_warningpolls=[ Minimum Warning Polls ]&warningpolls=[ Maximum Warning Polls ]&clearcondition=[ Clear Condition ]&clearvalue=[ Clear Value ]&infoconditionjoiner=[ Clear Condition Joiner ]&secondaryinfothresholdcondition=[ Secondary Clear Condition ]&secondaryinfothresholdvalue=[ Secondary Clear Value ]&clearmessage=[ Clear Message ]&min_clearpolls=[ Minimum Clear Polls ]&clearpolls=[ Maximum Clear Polls ]&businessHourAssociatedToThreshold=[ Associate Business Hour ]&businessType=[ Business Hour Type ]&selectedBusinessHourID=[ Business Hour ID ]

示例

http://app-windows:59090/AppManager/xml/threshold?apikey=09eebdd6893db4d20e16b84dff6664f1&type=1&thresholdname=Sample Threshold&thresholdType=0&criticalcondition=GT&criticalvalue=10&criticalconditionjoiner=AND&secondarycriticalthresholdcondition=LT&secondarycriticalthresholdvalue=15&criticalmessage=criticalMessage&min_criticalpolls=2&criticalpolls=5&warningcondition=GT&warningvalue=5&warningconditionjoiner=AND&secondarywarningthresholdcondition=LT&secondarywarningthresholdvalue=10&warningmessage=warningMessage&min_warningpolls=2&warningpolls=5&clearcondition=GT&clearvalue=0&infoconditionjoiner=AND&secondaryinfothresholdcondition=LT&secondaryinfothresholdvalue=5&clearmessage=clearMessage&min_clearpolls=2&clearpolls=5&businessHourAssociatedToThreshold=enabled&businessType=1&selectedBusinessHourID=12345

创建自适应阈值

以下API允许管理员用户在Applications Manager中创建自适应阈值

语法:

对于XML响应:

http://[ APM Host ]:[ APM Port ]/AppManager/xml/threshold?apikey=[ API Key ]&type=[ Type ]&thresholdname=[ Threshold Name ]&thresholdType=1&adaptiveBaseformulaType=[ Adaptive Base Formula Type ]&adaptiveBaseWeek=[ Adaptive Base Week ]&adaptiveHigherPercentage=[ Adaptive Higher Percentage ]&criticalcondition=[ Critical Condition ]&criticalvalue=[ Critical Value ]&criticalconditionjoiner=[ Critical Condition Joiner ]&secondarycriticalthresholdcondition=[ Secondary Critical Condition ]&secondarycriticalthresholdvalue=[ Secondary Critical Value ]&criticalmessage=[ Critical Message ]&min_criticalpolls=[ Minimum Critical Polls ]&criticalpolls=[ Maximum Critical Polls ]&warningcondition=[ Warning Condition ]&warningvalue=[ Warning Value ]&warningconditionjoiner=[ Warning Condition Joiner ]&secondarywarningthresholdcondition=[ Secondary Warning Condition ]&secondarywarningthresholdvalue=[ Secondary Warning Value ]&warningmessage=[ Warning Message ]&min_warningpolls=[ Minimum Warning Polls ]&warningpolls=[ Maximum Warning Polls ]&clearcondition=[ Clear Condition ]&clearvalue=[ Clear Value ]&infoconditionjoiner=[ Clear Condition Joiner ]&secondaryinfothresholdcondition=[ Secondary Clear Condition ]&secondaryinfothresholdvalue=[ Secondary Clear Value ]&clearmessage=[ Clear Message ]&min_clearpolls=[ Minimum Clear Polls ]&clearpolls=[ Maximum Clear Polls ]

对于JSON响应:

http://[ APM Host ]:[ APM Port ]/AppManager/json/threshold?apikey=[ API Key ]&type=[ Type ]&thresholdname=[ Threshold Name ]&thresholdType=1&adaptiveBaseformulaType=[ Adaptive Base Formula Type ]&adaptiveBaseWeek=[ Adaptive Base Week ]&adaptiveHigherPercentage=[ Adaptive Higher Percentage ]&criticalcondition=[ Critical Condition ]&criticalvalue=[ Critical Value ]&criticalconditionjoiner=[ Critical Condition Joiner ]&secondarycriticalthresholdcondition=[ Secondary Critical Condition ]&secondarycriticalthresholdvalue=[ Secondary Critical Value ]&criticalmessage=[ Critical Message ]&min_criticalpolls=[ Minimum Critical Polls ]&criticalpolls=[ Maximum Critical Polls ]&warningcondition=[ Warning Condition ]&warningvalue=[ Warning Value ]&warningconditionjoiner=[ Warning Condition Joiner ]&secondarywarningthresholdcondition=[ Secondary Warning Condition ]&secondarywarningthresholdvalue=[ Secondary Warning Value ]&warningmessage=[ Warning Message ]&min_warningpolls=[ Minimum Warning Polls ]&warningpolls=[ Maximum Warning Polls ]&clearcondition=[ Clear Condition ]&clearvalue=[ Clear Value ]&infoconditionjoiner=[ Clear Condition Joiner ]&secondaryinfothresholdcondition=[ Secondary Clear Condition ]&secondaryinfothresholdvalue=[ Secondary Clear Value ]&clearmessage=[ Clear Message ]&min_clearpolls=[ Minimum Clear Polls ]&clearpolls=[ Maximum Clear Polls ]

示例

http://app-windows:59090/AppManager/xml/threshold?apikey=09eebdd6893db4d20e16b84dff6664f1&type=1&thresholdname=Sample Adaptive Threshold&thresholdType=1&adaptiveBaseformulaType=0&adaptiveBaseWeek=Previous Week&adaptiveHigherPercentage=1&criticalcondition=GT&criticalvalue=10&criticalconditionjoiner=AND&secondarycriticalthresholdcondition=LT&secondarycriticalthresholdvalue=15&criticalmessage=criticalMessage&min_criticalpolls=2&criticalpolls=5&warningcondition=GT&warningvalue=5&warningconditionjoiner=AND&secondarywarningthresholdcondition=LT&secondarywarningthresholdvalue=10&warningmessage=warningMessage&min_warningpolls=2&warningpolls=5&clearcondition=GT&clearvalue=0&infoconditionjoiner=AND&secondaryinfothresholdcondition=LT&secondaryinfothresholdvalue=5&clearmessage=clearMessage&min_clearpolls=2&clearpolls=5

更新阈值

以下API允许管理员用户编辑在Applications Manager中添加的阈值。

语法

对于XML响应:

http://[ APM Host ]:[ APM Port ]/AppManager/xml/threshold?apikey=[ API Key ]&clearvalue=[ Clear Value ]&criticalpolls=[ Critical Polls ]&clearcondition=[ Clear Condition ]&criticalmessage=updated message&clearmessage=&type=1&criticalcondition=GT&warningcondition=GT&warningmessage=&warningpolls=0&describe=&newthresholdname=Sample Threshold&clearpolls=[ Warning Polls ]&thresholdid=[ Threshold Id ] &warningvalue=[ Warning Value ]&criticalvalue=[ Critical Value ]&businessHourAssociatedToThreshold=[ Associate Business Hour ]&businessType=[ Business Hour Type ]&selectedBusinessHourID=[ Business Hour ID ]

对于JSON响应:

http://[ APM Host ]:[ APM Port ]/AppManager/json/threshold?apikey=[ API Key ]&clearvalue=[ Clear Value ]&criticalpolls=[ Critical Polls ]&clearcondition=[ Clear Condition ]&criticalmessage=updated message&clearmessage=&type=1&criticalcondition=GT&warningcondition=GT&warningmessage=&warningpolls=0&describe=&newthresholdname=Sample Threshold&clearpolls=[ Warning Polls ]&thresholdid=[ Threshold Id ] &warningvalue=[ Warning Value ]&criticalvalue=[ Critical Value ]&businessHourAssociatedToThreshold=[ Associate Business Hour ]&businessType=[ Business Hour Type ]&selectedBusinessHourID=[ Business Hour ID ]

示例

http://app-windows:59090/AppManager/xml/threshold?apikey=09eebdd6893db4d20e16b84dff6664f1&clearvalue=5&criticalpolls=0&clearcondition=GT&criticalmessage=updated message&clearmessage=&type=1&criticalcondition=GT&warningcondition=GT&warningmessage=&warningpolls=0&describe=&newthresholdname=Sample Threshold&clearpolls=0&thresholdid=10001&warningvalue=5&criticalvalue=5&businessHourAssociatedToThreshold=enabled&businessType=1&selectedBusinessHourID=12345

删除阈值

以下API允许管理员用户在Applications Manager中删除阈值。

语法

对于XML响应:

http://[ APM Host ]:[ APM Port ]/AppManager/xml/threshold?apikey=[ API Key ]&thresholdid=[ Threshold Id=],&TO_DELETE=true

对于JSON响应:

http://[ APM Host ]:[ APM Port ]/AppManager/json/threshold?apikey=[ API Key ]&thresholdid=[ Threshold Id=],&TO_DELETE=true

示例

http://app-windows:59090/AppManager/xml/threshold?apikey=09eebdd6893db4d20e16b84dff6664f1&thresholdid=10001,10003,10002,10000,&TO_DELETE=true

列出阈值

以下API允许管理员用户在Applications Manager中列出阈值。

语法

对于XML响应:

http://[ APM Host ]:[ APM Port ]/AppManager/xml/threshold?apikey=[ API Key ]

对于JSON响应:

http://[ APM Host ]:[ APM Port ]/AppManager/json/threshold?apikey=[ API Key ]

示例

http://app-windows:59090/AppManager/xml/threshold?apikey=09eebdd6893db4d20e16b84dff6664f1

示例响应:

<AppManager-response uri="/AppManager/xml/threshold"><result><response response-code="4000"><Threshold CLEARPOLLSTORETRY="Use global defaults" CLEARTHRESHOLDCONDITION="<=" CLEARTHRESHOLDMESSAGE="The Health of the response time is good" CLEARTHRESHOLDVALUE="1500" CRITICALPOLLSTORETRY="Use global defaults" CRITICALTHRESHOLDCONDITION=">" CRITICALTHRESHOLDMESSAGE="The Health of the response time is bad" CRITICALTHRESHOLDVALUE="2000" describe="This is a preconfigured Threshold for Response Time" MINIMUMCLEARPOLLSTORETRY="Use global defaults" MINIMUMCRITICALPOLLSTORETRY="Use global defaults" MINIMUMWARNINGPOLLSTORETRY="Use global defaults" THRESHOLDID="3" THRESHOLDNAME="Response Time" WARNINGPOLLSTORETRY="Use global defaults" WARNINGTHRESHOLDCONDITION=">" WARNINGTHRESHOLDMESSAGE="The Health of the response time has generated a warning" WARNINGTHRESHOLDVALUE="1500"/><Threshold CLEARPOLLSTORETRY="Use global defaults" CLEARTHRESHOLDCONDITION="<=" CLEARTHRESHOLDMESSAGE="The Connection Time is good" CLEARTHRESHOLDVALUE="1500" CRITICALPOLLSTORETRY="Use global defaults" CRITICALTHRESHOLDCONDITION=">" CRITICALTHRESHOLDMESSAGE="The Connection Time is high" CRITICALTHRESHOLDVALUE="2000" describe="This is a preconfigured Threshold for Connection Time" MINIMUMCLEARPOLLSTORETRY="Use global defaults" MINIMUMCRITICALPOLLSTORETRY="Use global defaults" MINIMUMWARNINGPOLLSTORETRY="Use global defaults" THRESHOLDID="4" THRESHOLDNAME="Connection Time" WARNINGPOLLSTORETRY="Use global defaults" WARNINGTHRESHOLDCONDITION=">" WARNINGTHRESHOLDMESSAGE="The Connection Time has generated a warning" WARNINGTHRESHOLDVALUE="1500"/><Threshold CLEARPOLLSTORETRY="Use global defaults" CLEARTHRESHOLDCONDITION="<=" CLEARTHRESHOLDMESSAGE="The Request per minute is good" CLEARTHRESHOLDVALUE="120" CRITICALPOLLSTORETRY="Use global defaults" CRITICALTHRESHOLDCONDITION=">" CRITICALTHRESHOLDMESSAGE="The Request per minute is high" CRITICALTHRESHOLDVALUE="240" describe="This is a preconfigured Threshold for Request per minute" MINIMUMCLEARPOLLSTORETRY="Use global defaults" MINIMUMCRITICALPOLLSTORETRY="Use global defaults" MINIMUMWARNINGPOLLSTORETRY="Use global defaults" THRESHOLDID="5" THRESHOLDNAME="Request per minute" WARNINGPOLLSTORETRY="Use global defaults" WARNINGTHRESHOLDCONDITION=">" WARNINGTHRESHOLDMESSAGE="The Request per minute has generated a warning" WARNINGTHRESHOLDVALUE="120"/></response></result></AppManager-response>