Zabbix Documentation 1.8

3.04.04.4 (current)| In development:5.0 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

User Tools

Site Tools


Sidebar

api:screen:create

Table of Contents

create()

This function allows you to create a screen as defined by the screen data array.

Parameters

ParameterTypeOptionalDescriptionDetails
screen dataarray or object Array of Screen objects with additional parameter screenitemsscreenid shouldn't be specified
screenitems dataarray or object array of screen item objects

Returns

ParameterDescription
resultOperation successful. Result will contain array of created Screen IDs. screenid are assigned to each Screen object
errorIn case of any errors

Example

Create new screen

{
"jsonrpc":"2.0",
"method":"screen.create",
"params":[{
	"name":"ZABBIX Server",
	"hsize":"2",
	"vsize":"4",
	"screenitems":[{
		"resourcetype":"2",
		"resourceid":"100100000000002",
		"width":"0",
		"height":"0",
		"x":"0",
		"y":"0",
		"colspan":"2",
		"rowspan":"0",
		"elements":"0",
		"valign":"0",
		"halign":"0",
		"style":"0",
		"url":"",
		"dynamic":"0"
	},{
		"resourcetype":"0",
		"resourceid":"100100000000002",
		"width":"400",
		"height":"100",
		"x":"0",
		"y":"1",
		"colspan":"0",
		"rowspan":"0",
		"elements":"0",
		"valign":"0",
		"halign":"0",
		"style":"0",
		"url":"",
		"dynamic":"1"
	},{
		"resourcetype":"0",
		"resourceid":"100100000000003",
		"width":"400",
		"height":"100",
		"x":"0",
		"y":"3",
		"colspan":"0",
		"rowspan":"0",
		"elements":"0",
		"valign":"0",
		"halign":"0",
		"style":"0",
		"url":"",
		"dynamic":"0"
	},{
		"resourcetype":"0",
		"resourceid":"100100000000004",
		"width":"400",
		"height":"100",
		"x":"1",
		"y":"3",
		"colspan":"0",
		"rowspan":"0",
		"elements":"0",
		"valign":"0",
		"halign":"0",
		"style":"0",
		"url":"",
		"dynamic":"0"
	},{
		"resourcetype":"0",
		"resourceid":"100100000000005",
		"width":"400",
		"height":"100",
		"x":"1",
		"y":"2",
		"colspan":"0",
		"rowspan":"0",
		"elements":"0",
		"valign":"0",
		"halign":"0",
		"style":"0",
		"url":"",
		"dynamic":"0"
	},{
		"resourcetype":"0",
		"resourceid":"100100000000587",
		"width":"500",
		"height":"100",
		"x":"1",
		"y":"1",
		"colspan":"0",
		"rowspan":"0",
		"elements":"0",
		"valign":"0",
		"halign":"0",
		"style":"0",
		"url":"",
		"dynamic":"0"
	},{
		"resourcetype":"7",
		"resourceid":"0",
		"width":"500",
		"height":"100",
		"x":"0",
		"y":"2",
		"colspan":"0",
		"rowspan":"0",
		"elements":"0",
		"valign":"0",
		"halign":"0",
		"style":"0",
		"url":"",
		"dynamic":"0"
	}]
}],
"auth":"038e1d7b1735c6a5436ee9eae095879e",
"id":2
}

Screen created successfully:

{
"jsonrpc":"2.0",
"result":{
	"screenids":["100100000012213"]
},
"id":2
}

Screen already exists:

{
"jsonrpc":"2.0",
"error":{
      "code":-32602,
      "message":"Invalid params.",
      "data":"[ CScreen::create ] Screen [ ZABBIX Server ] already exists"
},
"id":2
}