这个API可以帮助用户获得指定一段时间内监视器或监控组的宕机信息。
API用于XML请求:
http://[ APM Host ]:[ APM Port ]//AppManager/xml/GetDowntimeDetails?apikey=[API Key ]&period=6&resourceid=10000035&showFullDetails=true
API用于JSON请求:
http://[ APM Host ]:[ APM Port ]/AppManager/json/GetDowntimeDetails?apikey=[API Key ]&period=6&resourceid=10000035&showFullDetails=true
请求参数:
字段 | 描述 |
apikey | 通过“管理”标签下的生成API Key选项生成。 |
resourceid | 监视器的资源标识,通过它您可以ping通与监视器相应的主机。 |
period | 从Applications Manager服务器ping通任何可以作为参数传递的服务器的主机。 |
showFullDetails | 一个可选参数,用户指定用户是否需要在请求中将每日宕机详细信息作为附加数据。值可以为是或否(默认为否)。 |
XML输入 http://apm-prod1:9090/AppManager/xml/GetDowntimeDetails?apikey=c4e547c2330e2eb92d3e7af2362da9e9&period=6&resourceid=10000135&showFullDetails=true
XML请求 <AppManager-response uri="/AppManager/xml/GetDowntimeDetails"> <result> <response response-code="4000"> <Monitor AvailabilityMessage="-" SchedulePercent="0.0" DisplayName="LocalFile" ResourceId="10000135" UnmanagePercent="0.0" AvailabilitySeverity="-" DownPercent="100.0" UpPercent="8.012714E-4" Period="6"> <Downtimes Date="August 21, 2013" DownPercent="54.88" SchedulePercent="0.0" UpPercent="45.12" UnmanagePercent="0.0"> <DowntimeSummary DownTimeMillis="1377062383743" UpTime="11:59:59 PM" DownTime="10:49:44 AM" Downtime_Reason="No Information Available." TotalDownTime="13 Hrs 10 Mins 15 Secs" ReasonID="-1"/> </Downtimes> <Downtimes Date="May 20, 2013" DownPercent="0.0" SchedulePercent="0.0" UpPercent="100.0" UnmanagePercent="0.0"/> <Downtimes Date="May 19, 2013" DownPercent="0.0" SchedulePercent="0.0" UpPercent="100.0" UnmanagePercent="0.0"/></Monitor></response> </result> </AppManager-response> |
JSON输入 http://apm-prod1:9090/AppManager/xml/GetDowntimeDetails?apikey=c4e547c2330e2eb92d3e7af2362da9e9&period=6&resourceid=10000135&showFullDetails=true JSON请求 {"response":{"result":[{"AvailabilityMessage":"-","SchedulePercent":"0.0","DisplayName":"LocalFile","ResourceId":"10000155","UnmanagePercent":"0.0","AvailabilitySeverity":"-","DownPercent":"100.0","Downtimes":[{"Date":"August 22, 2013","DownPercent":"100.0","SchedulePercent":"0.0","UpPercent":"0.0","UnmanagePercent":"0.0","DowntimeSummary":[{"DownTimeMillis":"1377109801322","UpTime":"11:59:59 PM","DownTime":"12:00:01 AM","Downtime_Reason":"No Information Available.","TotalDownTime":"23 Hrs 59 Mins 58 Secs","ReasonID":"-1"}]},{"Date":"August 21, 2013","DownPercent":"54.88","SchedulePercent":"0.0","UpPercent":"45.12","UnmanagePercent":"0.0","DowntimeSummary":[{"DownTimeMillis":"1377062383743","UpTime":"11:59:59 PM","DownTime":"10:49:44 AM","Downtime_Reason":"No Information Available.","TotalDownTime":"13 Hrs 10 Mins 16 Secs","ReasonID":"-1"}]},{"Date":"August 20, 2013","DownPercent":"0.0","SchedulePercent":"0.0","UpPercent":"100.0","UnmanagePercent":"0.0","DowntimeSummary":[]},{"Date":"August 19, 2013","DownPercent":"0.0","SchedulePercent":"0.0","UpPercent":"100.0","UnmanagePercent":"0.0","DowntimeSummary":[]}],"UpPercent":"2.8367646E-4","Period":"6"}],"uri":"/AppManager/json/GetDowntimeDetails"},"response-code":"4000"} |
请求参数:
字段 | 描述 | ||||||||||||||||||||||||||||
AvailabilityMessage | 资源的当前有效性RCA消息。 | ||||||||||||||||||||||||||||
SchedulePercent | 资源的总计划宕机时间百分比。 | ||||||||||||||||||||||||||||
DisplayName | 资源的显示名称。 | ||||||||||||||||||||||||||||
ResourceId | 监视器的资源ID,通过它可以ping通监视器相应的主机。 | ||||||||||||||||||||||||||||
UnmanagePercent | 资源的非托管宕机时间百分比。 | ||||||||||||||||||||||||||||
AvailabilitySeverity | 资源的当前可用性程度。 | ||||||||||||||||||||||||||||
DownPercent | 资源的总宕机时间百分比。 | ||||||||||||||||||||||||||||
UpPercent | 资源的总运行时间百分比。 | ||||||||||||||||||||||||||||
Period | 宕机时间详细信息请求时期: Period : 8 ===> 今年 |
||||||||||||||||||||||||||||
宕机时间 (仅在请求全部细节时显示) |
|