iconmap.get

Description

integer/array iconmap.get(object **parameters**)

The method allows to retrieve icon maps according to the given parameters.

Parameters

(object) Parameters defining the desired output.

The method supports the following parameters.

ParameterTypeDescription
iconmapidsstring/arrayReturn only icon maps with the given IDs.
sysmapidsstring/arrayReturn only icon maps that are used in the given maps.
selectMappingsqueryReturn a mappings property with the icon mappings used.
sortfieldstring/arraySort the result by the given properties.

Possible values are: iconmapid and name.
countOutputbooleanThese parameters being common for all get methods are described in detail in the reference commentary.
editableboolean
excludeSearchboolean
filterobject
limitinteger
outputquery
preservekeysboolean
searchobject
searchByAnyboolean
searchWildcardsEnabledboolean
sortorderstring/array
startSearchboolean

Return values

(integer/array) Returns either:

  • an array of objects;

  • the count of retrieved objects, if the countOutput parameter has been used.

Examples

Retrieve an icon map

Retrieve all data about icon map “3”.

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "iconmap.get",
  4. "params": {
  5. "iconmapids": "3",
  6. "output": "extend",
  7. "selectMappings": "extend"
  8. },
  9. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  10. "id": 1
  11. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": [
  4. {
  5. "mappings": [
  6. {
  7. "iconmappingid": "3",
  8. "iconmapid": "3",
  9. "iconid": "6",
  10. "inventory_link": "1",
  11. "expression": "server",
  12. "sortorder": "0"
  13. },
  14. {
  15. "iconmappingid": "4",
  16. "iconmapid": "3",
  17. "iconid": "10",
  18. "inventory_link": "1",
  19. "expression": "switch",
  20. "sortorder": "1"
  21. }
  22. ],
  23. "iconmapid": "3",
  24. "name": "Host type icons",
  25. "default_iconid": "2"
  26. }
  27. ],
  28. "id": 1
  29. }

See also

Source

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