You are viewing documentation for the development version, it may be incomplete.
Join our translation project and help translate Zabbix documentation into your native language.

iconmap.create

Description

object iconmap.create(object/array iconMaps)

This method allows to create new icon maps.

This method is only available to Super admin user type. Permissions to call the method can be revoked in user role settings. See User roles for more information.

Parameters

(object/array) Icon maps to create.

Additionally to the standard icon map properties, the method accepts the following parameters.

Parameter Type Description
mappings array Icon mappings to be created for the icon map.

Parameter behavior:
- required

Return values

(object) Returns an object containing the IDs of the created icon maps under the iconmapids property. The order of the returned IDs matches the order of the passed icon maps.

Examples

Create an icon map

Create an icon map to display hosts of different types.

Request:

{
           "jsonrpc": "2.0",
           "method": "iconmap.create",
           "params": {
               "name": "Type icons",
               "default_iconid": "2",
               "mappings": [
                   {
                       "inventory_link": 1,
                       "expression": "server",
                       "iconid": "3"
                   },
                   {
                       "inventory_link": 1,
                       "expression": "switch",
                       "iconid": "4"
                   }
               ]
           },
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "iconmapids": [
                   "2"
               ]
           },
           "id": 1
       }

See also

Source

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