获取
描述
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.