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
参数,则为检索到的 objects 的数量。检索关于图标映射 "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 中。