获取

描述

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

这个方法允许根据给定参数检索出符合条件的拓扑图。

参数

(object) 定义所需输出的参数。

此方法支持一下参数。

ParameterTypeDescription
sysmapidsstring/array仅返回给出IDS的拓扑图。
useridsstring/array仅返回所给用户IDS所属的拓扑图。
expandUrlsflag将全局拓扑图url添加到相应的拓扑图元素,并扩展所有拓扑图元素url中的宏。
selectIconMapquery返回“iconmap”属性中拓扑图上使用的图标映射。
selectLinksquery返回“links”属性中元素之间的映射链接。
selectSelementsquery返回“ selements “属性中的map元素。
selectUrlsquery返回“URLs”属性中的映射url。
selectUsersquery返回与“users”属性共享映射的用户。
selectUserGroupsquery返回与“userGroups”属性共享映射的用户组。
selectShapesquery在“形状”属性中返回地图中的地图形状。
selectLinesquery在“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: (整数/数组)回报:

  • 一个数组对象;

  • 如果使用了countOutput参数,则检索对象的计数。

举例

检索一个拓扑图

检索关于拓扑图id为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. }
  168. ],
  169. "id": 1
  170. }

See also

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