This is a translation of the original English documentation page. Help us make it better.

iconmap.get

説明

integer/array iconmap.get(object parameters)

このメソッドでは、指定されたパラメーターに従ってアイコンマップを取得できます。

このメソッドはどのタイプのユーザーでも利用可能です。このメソッドを呼び出す権限は、ユーザーロール設定で 取り消すことができます。詳しくはユーザーの役割を参照してください。

パラメータ

(object) 目的の出力を定義するパラメーター。

このメソッドは、次のパラメーターをサポートします。

パラメータ タイプ 説明
iconmapids string/array 指定されたIDのアイコンマップのみを返します
sysmapids string/array 指定されたマップで使用されているアイコンマップのみを返します
selectMappings query アイコンマッピングを使用してmappingsプロパティを返します
sortfield string/array 指定されたプロパティで結果を並べ替えます。

可能な値はiconmapidnameです。
countOutput boolean すべてのgetメソッドに共通するこれらのパラメーターについてはリファレンス解説で詳しく説明されています
editable boolean
excludeSearch boolean
filter object
limit integer
output query
preservekeys boolean
search object
searchByAny boolean
searchWildcardsEnabled boolean
sortorder string/array
startSearch boolean

戻り値

(integer/array) 次のいずれかを返します:

  • オブジェクトの配列
  • countOutputパラメータが使用されている場合、取得されたオブジェクトの数

アイコンマップを取得する

アイコンマップ"3"に関するすべてのデータを取得します。

Request:

{  "jsonrpc": "2.0",  "method": "iconmap.get",  "params": {  "iconmapids": "3",  "output": "extend",  "selectMappings": "extend"  },  "auth": "038e1d7b1735c6a5436ee9eae095879e",  "id": 1 }

Response:

{  "jsonrpc": "2.0",  "result": [  {  "mappings": [  {  "iconmappingid": "3",  "iconmapid": "3",  "iconid": "6",  "inventory_link": "1",  "expression": "server",  "sortorder": "0"  },  {  "iconmappingid": "4",  "iconmapid": "3",  "iconid": "10",  "inventory_link": "1",  "expression": "switch",  "sortorder": "1"  }  ],  "iconmapid": "3",  "name": "Host type icons",  "default_iconid": "2"  }  ],  "id": 1 }

参照

ソース

CIconMap::get() in ui/include/classes/api/services/CIconMap.php.