integer/array iconmap.get(object parameters)
该方法允许根据给定参数检索图标映射。
该方法对所有类型的用户可用。调用该方法的权限可以在用户角色设置中撤销。更多信息请参阅User roles。
(object)
定义所需输出的参数.
该方法支持以下参数.
参数 | 数据类型 | 描述 |
---|---|---|
iconmapids | ID/array | 仅返回具有指定ID的图标映射. |
sysmapids | ID/array | 仅返回在指定地图中使用的图标映射. |
selectMappings | query | 返回包含所用图标映射的mappings 属性. |
sortfield | string/array | 按给定属性对结果进行排序. 可能的值: iconmapid , name . |
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"的所有数据。
执行请求:
{ "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() 位于 ui/include/classes/api/services/CIconMap.php 文件中。