此API将用于对给定服务器或与给定监视器的resourceid对应的服务器执行ping操作。将执行ping命令,并将结果作为请求的响应传递。
XML响应API:
http://[ APM Host ]:[ APM Port ]/AppManager/xml/Ping?apikey=[ API Key ]&resourceid='10000157'
JSON响应的API:
http://[ APM Host ]:[ APM Port ]/AppManager/json/Ping?apikey=[ API Key ]&host='hemachand-0591'
字段 | 描述 |
---|---|
resourceid | 此值指定监视器的resourceid,以便我们可以ping与监视器相对应的主机。 |
host | 这是任何服务器的主机,可以将其作为参数从Applications Manager服务器传递到ping。 |
字段 | 描述 |
---|---|
APIKey | 这是用户名。 |
Describe | 这是创建用户帐户时对用户帐户的描述 |
EmailID | 这是用户的电子邮件ID |
GroupName | 这是用户拥有的帐户类型。例如:操作员,管理员,经理等, |
UserImage | 这是用户图像路径 |
UserID | 这是用户的ID |
UserName | 这是用户的用户名 |
XML 输入:
http://prod-server:9090/AppManager/xml/Ping?apikey=apikey=c4e547c2330e2eb92d3e7af2262da9e9&resourceid='10000157'
XML 响应:
<AppManager-response uri="/AppManager/xml/Ping">
<result>
<response response-code="4000">
<PingResult Output="Pinging 127.0.0.1 with 32 bytes of data:<br>Reply from 127.0.0.1: bytes=32 time<1ms TTL=128<br><br>Ping statistics for 127.0.0.1:<br> Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),<br>Approximate round trip times in milli-seconds:<br> Minimum = 0ms, Maximum = 0ms, Average = 0ms<br>" Host="127.0.0.1" IPAddress="127.0.0.1"/>
</response>
</result>
</AppManager-response>
JSON 输入:
http://apm-prod1:9090/AppManager/json/Ping?apikey=c4e547c2330e2eb92d3e7af2262da9e9&host=apm-prod1
JSON 响应:
{"response-code":"4000","response":{"uri":"/AppManager/json/Ping","result":[{"Output":"Pinging apm-prod1.csez.zohocorpin.com [fe80::51a4:f642:390a:7e1f%14] with 32 bytes of data:<br>Reply from fe80::51a4:f642:390a:7e1f%14: time<1ms <br><br>Ping statistics for fe80::51a4:f642:390a:7e1f%14:<br> Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),<br>Approximate round trip times in milli-seconds:<br> Minimum = 0ms, Maximum = 0ms, Average = 0ms<br>","Host":"apm-prod1.csez.zohocorpin.com","IPAddress":"192.168.26.79"}]}}