iconmap.get

説明

integer/array iconmap.get(object parameters)

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

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

パラメータ

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

このメソッドは以下のパラメータをサポートしています。

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

指定可能な値: iconmapid, name
countOutput boolean これらのパラメータについては、リファレンスコメント で説明されています。
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」に関するすべてのデータを取得します。

リクエスト:

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

レスポンス:

{
    "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.