Sidebar

api:map:get

Table of Contents

get()

Available since version: 1.8
This function allows you to retrieve Map details based on filtering options. All parameters are optional. If parameter is set in query this option counted as ON, except if parameter is equal to NULL.

Parameters

ParameterTypeDescriptionDetails
nodeidsarrayNode IDs
sysmapidsarrayMap IDs
editableintegeronly with read-write permission. Ignored for SuperAdmins
filterarrayOptional filter by map fields
searcharrayReturn maps by any given object field pattern
startSearchintegerSearch maps field pattern only in start of the field
excludeSearchintegerExclude from result, maps by given field pattern
searchWildcardsEnabledintegerSearch pattern in whole field using wildcards 1 - enable, 0 - disable
outputstringOutput options Values: shorten, refer, extend
select_selementsstringSelect map items Values: shorten, refer, extend
select_linksstringSelect map item links Values: shorten, refer, extend
countOutputintegerCount maps, return the number of maps found
preservekeysintegerReturn hash instead of array Keys of hash are object IDs
sortfieldstringSort by Map field Values: name
sortorderstringSort order Values: ASC, DESC
limitintegermax number of map objects to return

Returns

ParameterDescription
resultOperation successful. Result will contain array of Map objects.
errorIn case of any errors

Example

Get maps details by Map name “zabbix”, with map elements and links:

{
"jsonrpc":"2.0",
"method":"Map.get",
"params":{
	"filter": {"name": ["zabbix"]},
	"select_selements": "extend",
	"select_links": "extend",
	"output": "extend"
},
"auth":"6f38cddc44cfbb6c1bd186f9a220b5a0",
"id":2
}

Retrieved Map details:

{
"jsonrpc":"2.0",
"result":[{
	"sysmapid":"100100000000031",
	"name":"Link Map",
	"width":"800",
	"height":"600",
	"backgroundid":"0",
	"label_type":"2",
	"label_location":"0",
	"highlight":1,
	"expandproblem":1,
	"markelements":0,
	"show_unack":0,
	"selements":[{
		"selementid":"100100000000414",
		"sysmapid":"100100000000031",
		"elementid":"100100000037426",
		"elementtype":"2",
		"iconid_off":"100100000000001",
		"iconid_on":"0",
		"iconid_unknown":"0",
		"label":"New Element",
		"label_location":"0",
		"x":"242",
		"y":"267",
		"url":"",
		"iconid_disabled":"0",
		"iconid_maintenance":"0"
	},{
		"selementid":"100100000000415",
		"sysmapid":"100100000000031",
		"elementid":"0",
		"elementtype":"4",
		"iconid_off":"100100000000001",
		"iconid_on":"0",
		"iconid_unknown":"0",
		"label":"New Element",
		"label_location":"0",
		"x":"455",
		"y":"279",
		"url":"",
		"iconid_disabled":"0",
		"iconid_maintenance":"0"
	},{
		"selementid":"100100000000416",
		"sysmapid":"100100000000031",
		"elementid":"0",
		"elementtype":"4",
		"iconid_off":"100100000000001",
		"iconid_on":"0",
		"iconid_unknown":"0",
		"label":"New Element",
		"label_location":"0",
		"x":"454",
		"y":"111",
		"url":"",
		"iconid_disabled":"0",
		"iconid_maintenance":"0"
	},{
		"selementid":"100100000000417",
		"sysmapid":"100100000000031",
		"elementid":"100100000037426",
		"elementtype":"2",
		"iconid_off":"100100000000001",
		"iconid_on":"0",
		"iconid_unknown":"0",
		"label":"New Element",
		"label_location":"-1",
		"x":"222",
		"y":"68",
		"url":"",
		"iconid_disabled":"0",
		"iconid_maintenance":"0"
	},{
		"selementid":"100100000000418",
		"sysmapid":"100100000000031",
		"elementid":"0",
		"elementtype":"4",
		"iconid_off":"100100000000001",
		"iconid_on":"0",
		"iconid_unknown":"0",
		"label":"New Element",
		"label_location":"0",
		"x":"103",
		"y":"150",
		"url":"",
		"iconid_disabled":"0",
		"iconid_maintenance":"0"
	},{
		"selementid":"100100000000422",
		"sysmapid":"100100000000031",
		"elementid":"100100000000006",
		"elementtype":"1",
		"iconid_off":"100100000000005",
		"iconid_on":"100100000000013",
		"iconid_unknown":"0",
		"label":"{HOSTNAME}",
		"label_location":"2",
		"x":"570",
		"y":"197",
		"url":"",
		"iconid_disabled":"0",
		"iconid_maintenance":"0"
	}],
	"links":[{
		"linkid":"100100000000232",
		"sysmapid":"100100000000031",
		"selementid1":"100100000000414",
		"selementid2":"100100000000415",
		"drawtype":"0",
		"color":"0000CC",
		"label":"",
		"linktriggers":[{
			"linktriggerid":"100100000000326",
			"linkid":"100100000000232",
			"triggerid":"100100000037426",
			"drawtype":"0",
			"color":"0"
		}]
	},{
		"linkid":"100100000000233",
		"sysmapid":"100100000000031",
		"selementid1":"100100000000414",
		"selementid2":"100100000000415",
		"drawtype":"0",
		"color":"0000CC",
		"label":"",
		"linktriggers":[]
	},{
		"linkid":"100100000000234",
		"sysmapid":"100100000000031",
		"selementid1":"100100000000416",
		"selementid2":"100100000000417",
		"drawtype":"0",
		"color":"0000CC",
		"label":"\u0414\u042b\u0424\u041e\u0414 \u041b\u042b\u041e\u0424\u0414\u041b \u042b\u041e\u0424",
		"linktriggers":[]
	},{
		"linkid":"100100000000235",
		"sysmapid":"100100000000031",
		"selementid1":"100100000000416",
		"selementid2":"100100000000417",
		"drawtype":"0",
		"color":"0000CC",
		"label":"",
		"linktriggers":[{
			"linktriggerid":"100100000000327",
			"linkid":"100100000000235",
			"triggerid":"100100000037426",
			"drawtype":"0",
			"color":"0"
		}]
	},{
		"linkid":"100100000000236",
		"sysmapid":"100100000000031",
		"selementid1":"100100000000414",
		"selementid2":"100100000000415",
		"drawtype":"0",
		"color":"0000CC",
		"label":"",
		"linktriggers":[]
	},{
		"linkid":"100100000000237",
		"sysmapid":"100100000000031",
		"selementid1":"100100000000414",
		"selementid2":"100100000000415",
		"drawtype":"0",
		"color":"0000CC",
		"label":"",
		"linktriggers":[]
	},{
		"linkid":"100100000000238",
		"sysmapid":"100100000000031",
		"selementid1":"100100000000414",
		"selementid2":"100100000000415",
		"drawtype":"0",
		"color":"0000CC",
		"label":"",
		"linktriggers":[]
	},{
		"linkid":"100100000000239",
		"sysmapid":"100100000000031",
		"selementid1":"100100000000414",
		"selementid2":"100100000000415",
		"drawtype":"0",
		"color":"0000CC",
		"label":"",
		"linktriggers":[]
	},{
		"linkid":"100100000000311",
		"sysmapid":"100100000000031",
		"selementid1":"100100000000422",
		"selementid2":"100100000000415",
		"drawtype":"3",
		"color":"00AA00",
		"label":"",
		"linktriggers":[{
			"linktriggerid":"100100000000323",
			"linkid":"100100000000311",
			"triggerid":"100100000012794",
			"drawtype":"4",
			"color":"DD0000"
		},{
			"linktriggerid":"100100000000324",
			"linkid":"100100000000311",
			"triggerid":"100100000012795",
			"drawtype":"4",
			"color":"DD0000"
		},{
			"linktriggerid":"100100000000325",
			"linkid":"100100000000311",
			"triggerid":"100100000012796",
			"drawtype":"4",
			"color":"DD0000"
		}]
	}]
}] ,
"id":2
}