Search API

このAPIでは、クエリ文字列と検索条件にマッチする、監視や監視グループをリストアップできます。検索結果には、監視と関連付いたユーザーの情報もあります。

XMLでレスポンスを受けるには

http://[APM Host]:[APM Port]/AppManager/xml/Search?apikey=[API_KEY]&query=[QUERY]&searchCondition=[SEARCH_CONDITION]

JSONでレスポンスを受けるには

http://[APM Host]:[APM Port]/AppManager/json/Search?apikey=[API_KEY]&query=[QUERY]&searchCondition=[SEARCH_CONDITION]

リクエスト パラメーター

フィールド 説明
query ユーザーに関連付いた監視リスト内を検索するのに使う文字列を指定してください。

追加パラメーター

フィールド 説明
searchCondition ユーザーに関連付いた監視リスト内を検索するのに使う監視タイプを指定してください。たとえば、displayname、monitortype、ipaddress、customfieldsの指定ができます。監視タイプをすべて検索対象にするには「all」を指定します。

レスポンス詳細

フィールド 説明
Type 検索結果で取得する要素のタイプを表します。
HealthStatus 検索結果のステータスを表します。
AvailabilityMessage 検索結果の可用性メッセージを表します。
DisplayName 検索結果の表示名を表します。
ManagedServer Enterprise Editionで、監視や監視グループの追加先のManagedサーバーの名前を表します。Professinal Editionでは値は「NA」になります。
AvailabilityStatus 検索結果の可用性ステータスを表します。
SubGroup 検索結果の所属カテゴリです。
ResourceId 検索結果のリソースIDです。
HealthMessage 検索結果のステータス メッセージを表します。
HealthSeverity 検索結果のステータス重要度を表します。
ImagePath 監視タイプや監視グループの画像パスを指します。
AvailabilitySeverity 検索結果の可用性の重要度を表します。
DetailsPageURL 検索結果の詳細ページを表します。

<response response-code="4000"><Monitor Type="Linux" HealthStatus="clear" AvailabilityMessage="Resource up. <br>The resource karthi linux is available." DisplayName="karthi linux" ManagedServer="Admin Server" AvailabilityStatus="up" SubGroup="Linux" ResourceId="10000117" HealthMessage="Health of karthi linux is clear. <br>Root Cause : <br>1. karthi linux is up<br>2. Data Collection Successful<br>" HealthSeverity="5" ImagePath="/images/icon_monitors_linux.gif" AvailabilitySeverity="5" DetailsPageURL="/showresource.do?resourceid=10000117&method=showResourceForResourceID&PRINTER_FRIENDLY=true"/><Monitor Type="Linux" HealthStatus="clear" AvailabilityMessage="Resource up. <br>The resource app-centos32-1 is available." DisplayName="app-centos32-1" ManagedServer="Admin Server" AvailabilityStatus="up" SubGroup="Linux" ResourceId="10000108" HealthMessage="Health of app-centos32-1 is clear. <br>Root Cause : <br>1. app-centos32-1 is up<br>2. Data Collection Successful<br>" HealthSeverity="5" ImagePath="/images/icon_monitors_linux.gif" AvailabilitySeverity="5" DetailsPageURL="/showresource.do?resourceid=10000108&method=showResourceForResourceID&PRINTER_FRIENDLY=true"/><Monitor Type="Linux" HealthStatus="clear" AvailabilityMessage="Resource up. <br>The resource prasadh linux is available." DisplayName="prasadh linux" ManagedServer="Admin Server" AvailabilityStatus="up" SubGroup="Linux" ResourceId="10000071" HealthMessage="Health of prasadh linux is clear. <br>Root Cause : <br>1. prasadh linux is up<br>2. Data Collection Successful<br>" HealthSeverity="5" ImagePath="/images/icon_monitors_linux.gif" AvailabilitySeverity="5" DetailsPageURL="/showresource.do?resourceid=10000071&method=showResourceForResourceID&PRINTER_FRIENDLY=true"/></response>

検索条件にallを指定してのリクエスト入力

http://apm-prod1:9090/AppManager/xml/Search?apikey=4f77fe9c75f4472764a07846bf7f032d&query=linux&searchCondition=all

レスポンス

<AppManager-response uri="/AppManager/xml/Search"><result><response response-code="4000"><Monitor Type="Linux" HealthStatus="clear" AvailabilityMessage="Resource up. <br>The resource linux is available." DisplayName="linux" AvailabilityStatus="up" SubGroup="Linux" ResourceId="20000107" HealthMessage="Health of linux is clear. <br>Root Cause : <br>1. linux is up<br>2. Data Collection Successful<br>" HealthSeverity="5" ImagePath="/images/icon_monitors_linux.gif" AvailabilitySeverity="5" DetailsPageURL="/showresource.do?resourceid=20000107&method=showResourceForResourceID&PRINTER_FRIENDLY=true"/><Monitor Type="Linux" HealthStatus="clear" AvailabilityMessage="Resource up. <br>The resource app-centos32-2 is available." DisplayName="app-centos32-2" AvailabilityStatus="up" SubGroup="Linux" ResourceId="20000786" HealthMessage="Health of app-centos32-2 is clear. <br>Root Cause : <br>1. app-centos32-2 is up<br>2. Data Collection Successful<br>" HealthSeverity="5" ImagePath="/images/icon_monitors_linux.gif" AvailabilitySeverity="5" DetailsPageURL="/showresource.do?resourceid=20000786&method=showResourceForResourceID&PRINTER_FRIENDLY=true"/><Monitor Type="Linux" HealthStatus="critical" AvailabilityMessage="Resource up. <br>The resource app-centos5-64-1 is available." DisplayName="app-centos5-64-1" AvailabilityStatus="up" SubGroup="Linux" ResourceId="20001014" HealthMessage="Health of app-centos5-64-1 is critical. <br>Root Cause : <br>1. CPU Utilization 22 > 0 % (threshold).<br>2. Response Time 2 > 0 ms (threshold).<br>" HealthSeverity="1" ImagePath="/images/icon_monitors_linux.gif" AvailabilitySeverity="5" DetailsPageURL="/showresource.do?resourceid=20001014&method=showResourceForResourceID&PRINTER_FRIENDLY=true"/></response></result></AppManager-response>

JSONでレスポンスを受けるには

http://apm-prod1:9090/AppManager/json/Search?apikey=4f77fe9c75f4472764a07846bf7f032d&query=linux&searchCondition=monitortype

JSONレスポンスのサンプル

{"response":{"result":[{"Type":"Linux","HealthStatus":"clear","AvailabilityMessage":"Resource up. <br>The resource app-centos32-1 is available.","DisplayName":"app-centos32-1","ManagedServer":"Admin Server","AvailabilityStatus":"up","SubGroup":"Linux","ResourceId":"10000108","HealthMessage":"Health of app-centos32-1 is clear. <br>Root Cause : <br>1. app-centos32-1 is upsult;br>2. Data Collection Successful<br>","HealthSeverity":"5","ImagePath":"/images/icon_monitors_linux.gif","AvailabilitySeverity":"5","DetailsPageURL":"/showresource.do?resourceid=10000108&method=showResourceForResourceID&PRINTER_FRIENDLY=true"},{"Type":"Linux","HealthStatus":"clear","AvailabilityMessage":"Resource up. <br>The resource linux is available.","DisplayName":"linux","ManagedServer":"Admin Server","AvailabilityStatus":"up","SubGroup":"Linux","ResourceId":"10000117","HealthMessage":"Health of karthi linux is clear. <br>Root Cause : <br>1. linux is up<br>2. Data Collection Successful<br>","HealthSeverity":"5","ImagePath":"/images/icon_monitors_linux.gif","AvailabilitySeverity":"5","DetailsPageURL":"/showresource.do?resourceid=10000117&method=showResourceForResourceID&PRINTER_FRIENDLY=true"},{"Type":"Linux","HealthStatus":"clear","AvailabilityMessage":"Resource up. <br>The resource prasadh linux is available.","DisplayName":"prasadh linux","ManagedServer":"Admin Server","AvailabilityStatus":"up","SubGroup":"Linux","ResourceId":"10000071","HealthMessage":"Health of linux1 is clear. <br>Root Cause : <br>1. linux1 is up<br>2. Data Collection Successful<br>","HealthSeverity":"5","ImagePath":"/images/icon_monitors_linux.gif","AvailabilitySeverity":"5","DetailsPageURL":"/showresource.do?resourceid=10000071&method=showResourceForResourceID&PRINTER_FRIENDLY=true"}],"uri":"/AppManager/json/Search"},"response-code":"4000"}