上一個主題: 群組 Web 服務範例語法下一個主題: 角色 Web 服務


站台群組管理的語法

若要取得 [群組] 樹狀結構中最高層群組 (預設值為 'All Groups') 之下的所有群組清單,您可以使用 groupPath 參數或 groupItemId 參數。

發出下列呼叫以使用 groupPath 參數來識別預設群組:

http://CA Performance Center 伺服器 IP 位址:8181/pc/center/webservice/groups/
groupPath/All%20Groups

附註:使用某些 REST 用戶端時,必要的語法為 ‘All Groups’ 而非 ‘All%20Groups’。 但一般而言,空格不適用於 URL。

發出下列呼叫以取得站台群組的識別碼 (siteId):

http://CA Performance Center 伺服器 IP 位址:8181/pc/center/webservice/
groups/groupItemId/siteId

在傳回的 XML 中,站台 ID 如下所示:

<GroupTree siteId="118" inheritDefault="true" path="Austin, TX">

若要取得您指定的群組下的所有子群組清單,兩個選項可供您使用:

發出下列呼叫以使用 groupPath 參數來識別子群組列在傳回的 XML 中的群組:

http://CA Performance Center 伺服器 IP 位址:8181/pc/center/webservice/
groups/groupPath/All%20Groups%5CInventory

發出下列呼叫以使用 groupItemId 參數來識別子群組列在傳回的 XML 中的群組:

附註:預設 'Inventory' 群組的 groupItemId 為 5。

http://CA Performance Center 伺服器 IP 位址:8181/pc/center/webservice/
groups/groupItemId/5

傳回的 XML 包含任何套用至該群組之群組規則的語法。 因此,我們建議在使用者介面中測試您建立的各種規則,以及檢查所產生的語法。

站台群組與規則

除了規則運算式以外,群組規則還可支援多項比較。 例如,在 XML 中使用下列語法來張貼群組規則,該群組規則可新增名稱以 'Cisco' 這個字開頭的裝置:

<Match>
   <Compare readOnly="true" using="MEMBER_OF">
       <Property name="ItemID" type="device"/>
           <Value reference="/All Groups">1</Value>
   </Compare>
   <Compare readOnly="false" using="STARTS_WITH">
      <Property name="DisplayName" type="device"/>
           <Value>Cisco*</Value>
   </Compare>
</Match>

對於群組路徑語法,正斜線字元適用於您張貼的 XML 文件。 此範例假設您已經有 “All Groups\Texas\Austin” 的群組結構:

<GroupTree inheritDefault="true" path="/All Groups/Texas/Austin">
    <Group desc="" inherit="true" location="" name="CA Officetype="custom group">
        <Group desc="" inherit="true" location="" name="Austin Lab" type="custom group"/>
    </Group>
    <Group desc="" inherit="true" location="" name="Austin Data Center" type="custom group"/>
</GroupTree>

不過,在 Web 服務要求的 URL 中,請對群組路徑使用反斜線字元。 瀏覽器會誤解正斜線。