map.get

Description

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

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

Parameters

(object) Parameters defining the desired output.

The method supports the following parameters.

ParameterTypeDescription
sysmapidsstring/arrayReturns only maps with the given IDs.
useridsstring/arrayReturns only maps that belong to the given user IDs.
expandUrlsflagAdds global map URLs to the corresponding map elements and expands macros in all map element URLs.
selectIconMapqueryReturns an iconmap property with the icon map used on the map.
selectLinksqueryReturns a links property with the map links between elements.
selectSelementsqueryReturns a selements property with the map elements.
selectUrlsqueryReturns a urls property with the map URLs.
selectUsersqueryReturns a users property with users that the map is shared with.
selectUserGroupsqueryReturns a userGroups property with user groups that the map is shared with.
selectShapesqueryReturns a shapes property with the map shapes.
selectLinesqueryReturns a lines property with the map lines.
sortfieldstring/arraySort the result by the given properties.

Possible values are: name, width and height.
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 a map

Retrieve all data about map “3”.

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "map.get",
  4. "params": {
  5. "output": "extend",
  6. "selectSelements": "extend",
  7. "selectLinks": "extend",
  8. "selectUsers": "extend",
  9. "selectUserGroups": "extend",
  10. "selectShapes": "extend",
  11. "selectLines": "extend",
  12. "sysmapids": "3"
  13. },
  14. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  15. "id": 1
  16. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": [
  4. {
  5. "selements": [
  6. {
  7. "selementid": "10",
  8. "sysmapid": "3",
  9. "elementtype": "4",
  10. "iconid_off": "1",
  11. "iconid_on": "0",
  12. "label": "Zabbix server",
  13. "label_location": "3",
  14. "x": "11",
  15. "y": "141",
  16. "iconid_disabled": "0",
  17. "iconid_maintenance": "0",
  18. "elementsubtype": "0",
  19. "areatype": "0",
  20. "width": "200",
  21. "height": "200",
  22. "viewtype": "0",
  23. "use_iconmap": "1",
  24. "application": "",
  25. "urls": [],
  26. "elements": []
  27. },
  28. {
  29. "selementid": "11",
  30. "sysmapid": "3",
  31. "elementtype": "4",
  32. "iconid_off": "1",
  33. "iconid_on": "0",
  34. "label": "Web server",
  35. "label_location": "3",
  36. "x": "211",
  37. "y": "191",
  38. "iconid_disabled": "0",
  39. "iconid_maintenance": "0",
  40. "elementsubtype": "0",
  41. "areatype": "0",
  42. "width": "200",
  43. "height": "200",
  44. "viewtype": "0",
  45. "use_iconmap": "1",
  46. "application": "",
  47. "urls": [],
  48. "elements": []
  49. },
  50. {
  51. "selementid": "12",
  52. "sysmapid": "3",
  53. "elementtype": "0",
  54. "iconid_off": "185",
  55. "iconid_on": "0",
  56. "label": "{HOST.NAME}\r\n{HOST.CONN}",
  57. "label_location": "0",
  58. "x": "111",
  59. "y": "61",
  60. "iconid_disabled": "0",
  61. "iconid_maintenance": "0",
  62. "elementsubtype": "0",
  63. "areatype": "0",
  64. "width": "200",
  65. "height": "200",
  66. "viewtype": "0",
  67. "use_iconmap": "0",
  68. "application": "",
  69. "urls": [],
  70. "elements": [
  71. {
  72. "hostid": "10084"
  73. }
  74. ]
  75. }
  76. ],
  77. "links": [
  78. {
  79. "linkid": "23",
  80. "sysmapid": "3",
  81. "selementid1": "10",
  82. "selementid2": "11",
  83. "drawtype": "0",
  84. "color": "00CC00",
  85. "label": "",
  86. "linktriggers": []
  87. }
  88. ],
  89. "users": [
  90. {
  91. "sysmapuserid": "1",
  92. "userid": "2",
  93. "permission": "2"
  94. }
  95. ],
  96. "userGroups": [
  97. {
  98. "sysmapusrgrpid": "1",
  99. "usrgrpid": "7",
  100. "permission": "2"
  101. }
  102. ],
  103. "shapes":[
  104. {
  105. "sysmap_shapeid":"1",
  106. "type":"0",
  107. "x":"0",
  108. "y":"0",
  109. "width":"680",
  110. "height":"15",
  111. "text":"{MAP.NAME}",
  112. "font":"9",
  113. "font_size":"11",
  114. "font_color":"000000",
  115. "text_halign":"0",
  116. "text_valign":"0",
  117. "border_type":"0",
  118. "border_width":"0",
  119. "border_color":"000000",
  120. "background_color":"",
  121. "zindex":"0"
  122. }
  123. ],
  124. "lines":[
  125. {
  126. "sysmap_shapeid":"2",
  127. "x1": 30,
  128. "y1": 10,
  129. "x2": 100,
  130. "y2": 50,
  131. "line_type": 1,
  132. "line_width": 10,
  133. "line_color": "009900",
  134. "zindex":"1"
  135. }
  136. ],
  137. "sysmapid": "3",
  138. "name": "Local nerwork",
  139. "width": "400",
  140. "height": "400",
  141. "backgroundid": "0",
  142. "label_type": "2",
  143. "label_location": "3",
  144. "highlight": "1",
  145. "expandproblem": "1",
  146. "markelements": "0",
  147. "show_unack": "0",
  148. "grid_size": "50",
  149. "grid_show": "1",
  150. "grid_align": "1",
  151. "label_format": "0",
  152. "label_type_host": "2",
  153. "label_type_hostgroup": "2",
  154. "label_type_trigger": "2",
  155. "label_type_map": "2",
  156. "label_type_image": "2",
  157. "label_string_host": "",
  158. "label_string_hostgroup": "",
  159. "label_string_trigger": "",
  160. "label_string_map": "",
  161. "label_string_image": "",
  162. "iconmapid": "0",
  163. "expand_macros": "0",
  164. "severity_min": "0",
  165. "userid": "1",
  166. "private": "1",
  167. "show_suppressed": "1"
  168. }
  169. ],
  170. "id": 1
  171. }

See also

Source

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