显示轮询数据API


该API允许用户在用户指定的时间段内从监视器或业务组中获取轮询的数据。

语法

XML响应API:

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

JSON响应的API:

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

请求参数

字段 描述
resourceid 此值是必须从中获取数据的监视器的resourceid。
attributeID 这是必须显示其轮询或存档数据的属性ID的值。
period 已请求停机时间详细信息的时间段:
  • 时间:0→今天
  • 时间:3→昨天
  • 时间:6→本周
  • 时间:1或-7→最近7天
  • 时间:12→上周
  • 时间:7→本月
  • 时间:2或-30→最近30天
  • 时间:11→上个月
  • 时间:9→本季度
  • 时间:8→今年
  • 时间:5→最近1年
  • 时间:20→显示所有轮询的数据
startDate andendDate 使用这些参数,您可以设置ShowPolledData API的自定义时间。以YYYY-MM-DD HH:MM格式输入startDateendDate的值,其中HH应该为24小时格式。
 
自定义期间的期间参数期间应设置为4。

示例请求

轮询数据

XML响应API:

http://[ APM Host ]:[ APM Port ]/AppManager/xml/showPolledData?apikey=8c8ec3f2cd30722d3a6f980df12c1e5f&resourceid=10000042&period=20&attributeID=310

JSON响应的API:

http://[ APM Host ]:[ APM Port ]/AppManager/json/showPolledData?apikey=8c8ec3f2cd30722d3a6f980df12c1e5f&resourceid=10000042&period=20&attributeID=3102

最近7天的数据

XML响应API:

http://[ APM Host ]:[ APM Port ]/AppManager/xml/showPolledData?apikey=8c8ec3f2cd30722d3a6f980df12c1e5f&resourceid=10000042&period=-7&attributeID=3102

JSON响应的API:

http://[ APM Host ]:[ APM Port ]/AppManager/json/showPolledData?apikey=8c8ec3f2cd30722d3a6f980df12c1e5f&resourceid=10000042&period=-7&attributeID=3102

最近30天的数据

XML响应API:

http://[ APM Host ]:[ APM Port ]/AppManager/xml/showPolledData?apikey=8c8ec3f2cd30722d3a6f980df12c1e5f&resourceid=10000042&period=-30&attributeID=3102

JSON响应的API:

http://[ APM Host ]:[ APM Port ]/AppManager/json/showPolledData?apikey=8c8ec3f2cd30722d3a6f980df12c1e5f&resourceid=10000042&period=-30&attributeID=3102

自定义时间段

XML响应API:

http://[ APM Host ]:[ APM Port ]/AppManager/xml/ShowPolledData?apikey=3d6d7d7fcabfc818ad28de01aa1c9773&resourceid=10000016&attributeID=1938&period=4&startDate=2017-11-06 11:20&endDate=2017-11-16 11:40

JSON响应的API:

http://[ APM Host ]:[ APM Port ]/AppManager/json/ShowPolledData?apikey=3d6d7d7fcabfc818ad28de01aa1c9773&resourceid=10000016&attributeID=1938&period=4&startDate=2017-11-06 11:20&endDate=2017-11-16 11:40

响应详情

字段 描述
StartTime 这是开始时间(以毫秒为单位),从中开始生成7/30 / show polled data报告
EndTime 这是以毫秒为单位的结束时间,从中可以生成7/30 / show polled data报告
StartDateTime 这是日期时间格式的开始时间,根据该时间将生成7/30 / show polled data报告
EndDateTime 这是日期时间格式的结束时间,从中可以生成7/30 / show polled data报告
ResourceName 这是从中返回数据的监视器名称
ResourceType 这是为其返回数据的资源的类型
AttributeName 这是属性的名称
Unit 这是属性的单位
AttributeID 这是用户的ID
ReportType 这是此API调用返回的数据类型(轮询数据/ 7天数据/ 30天数据)。
BusinessPeriod 这代表营业期名称
ResourceId 这是监视器的resourceid
AttributeImage 这是与此响应一起返回的数据的属性图。
Status 这是REST API调用的状态,用于获取显示轮询的数据
Period 此值指定需要返回的数据类型。其值是:显示轮询数据为20,-7天归档数据为-7,-30天归档数据为-30。
RawData
  • CollectionTime-表示收集数据的时间戳(毫秒)
  • DateTime-以日期时间格式表示收集数据的时间戳
  • 值-这代表属性的值
ArchiveData
  • ArchivedTime-表示以毫秒为单位的存档时间
  • DateTime-以数据时间格式表示存档时间
  • AvgValue-这是该归档期间内该值的平均时间
  • MinValue-这是该归档期间的最小值
  • MaxValue-这是该归档期间的最大值

示例响应

XML 输入:

http://apm-prod1:9090/AppManager/xml/ShowPolledData?apikey=c4e547c2330e2eb92d3e7af2262da9e9&resourceid=20000039&period=20&attributeID=1957

XML 响应:

<AppManager-response uri="/AppManager/xml/ShowPolledData">
<result>
<response response-code="4000">
<Monitorinfo StartTime="1328775260450" EndDateTime="Mar 29, 2012 3:00 PM" ResourceName="APM-Windows" Unit="ms" EndTime="1333013434474" BusinessPeriod="NA" MonitorType="Response Time" ReportType="Polled data" ResourceId="10001267" AttributeID="4602" AttributeImage="/webclient/temp/images/RSVmYs.jpg" ServerType="GlassFish" Status="SUCCESS" StartDateTime="Feb 9, 2012 1:44 PM" Period="20">
<RawData CollectionTime="1333013434474" Value="1" DateTime="Mar 29, 2012 3:00 PM"/>
<RawData CollectionTime="1333013134022" Value="1" DateTime="Mar 29, 2012 2:55 PM"/>
<RawData CollectionTime="1333012833497" Value="1" DateTime="Mar 29, 2012 2:50 PM"/>
<RawData CollectionTime="1333012532708" Value="1" DateTime="Mar 29, 2012 2:45 PM"/>
<RawData CollectionTime="1333012227193" Value="1" DateTime="Mar 29, 2012 2:40 PM"/>
<RawData CollectionTime="1328775260450" Value="1" DateTime="Feb 9, 2012 1:44 PM"/>
</Monitorinfo>
</response>
</result>
</AppManager-response>

JSON 输入:

http://apm-prod1:9090/AppManager/json/ShowPolledData?apikey=c4e547c2330e2eb92d3e7af2262da9e9&resourceid=20000039&period=20&attributeID=1957

JSON 响应:

{"response-code":"4000","response":{"uri":"/AppManager/json/ShowPolledData","result":[{"StartTime":"1337928634448","EndDateTime":"May 25, 2012 3:32 PM","ResourceName":"apm-prod1_Windows Vista","Unit":"%","EndTime":"1337940130413","BusinessPeriod":"NA","ReportType":"Polled data","ThresholdDetails":[],"ResourceId":"20000039","AttributeName":"CPU Utilization","AttributeID":"1957","AttributeImage":"/webclient/temp/images/fjrEKg.jpg","Status":"SUCCESS","RawData":[{"CollectionTime":"1337940130413","Value":"18","DateTime":"May 25, 2012 3:32 PM"},{"CollectionTime":"1337939525577","Value":"11","DateTime":"May 25, 2012 3:22 PM"},{"CollectionTime":"1337938920641","Value":"5","DateTime":"May 25, 2012 3:12 PM"},{"CollectionTime":"1337938315808","Value":"6","DateTime":"May 25, 2012 3:01 PM"},{"CollectionTime":"1337937710788","Value":"7","DateTime":"May 25, 2012 2:51 PM"},{"CollectionTime":"1337937105838","Value":"7","DateTime":"May 25, 2012 2:41 PM"},{"CollectionTime":"1337936500971","Value":"9","DateTime":"May 25, 2012 2:31 PM"},{"CollectionTime":"1337935895963","Value":"18","DateTime":"May 25, 2012 2:21 PM"},{"CollectionTime":"1337935291160","Value":"7","DateTime":"May 25, 2012 2:11 PM"},{"CollectionTime":"1337934686297","Value":"31","DateTime":"May 25, 2012 2:01 PM"},{"CollectionTime":"1337934079880","Value":"13","DateTime":"May 25, 2012 1:51 PM"},{"CollectionTime":"1337933475084","Value":"16","DateTime":"May 25, 2012 1:41 PM"},{"CollectionTime":"1337932869853","Value":"34","DateTime":"May 25, 2012 1:31 PM"},{"CollectionTime":"1337932263739","Value":"8","DateTime":"May 25, 2012 1:21 PM"},{"CollectionTime":"1337931658583","Value":"7","DateTime":"May 25, 2012 1:10 PM"},{"CollectionTime":"1337931053751","Value":"17","DateTime":"May 25, 2012 1:00 PM"},{"CollectionTime":"1337930448921","Value":"9","DateTime":"May 25, 2012 12:50 PM"},{"CollectionTime":"1337929844110","Value":"6","DateTime":"May 25, 2012 12:40 PM"},{"CollectionTime":"1337929239270","Value":"3","DateTime":"May 25, 2012 12:30 PM"},{"CollectionTime":"1337928634448","Value":"9","DateTime":"May 25, 2012 12:20 PM"}],"ResourceType":"Windows Vista","StartDateTime":"May 25, 2012 12:20 PM","Period":"20"}]}}