manual:api:reference:map:create

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:api:reference:map:create [2014/09/30 12:54]
127.0.0.1 external edit
manual:api:reference:map:create [2019/01/28 14:50] (current)
sasha <code js> => <code java>
Line 17: Line 17:
 | selements | array | Map elements to be created on the map. | | selements | array | Map elements to be created on the map. |
 | urls | array | Map URLs to be created on the map. | | urls | array | Map URLs to be created on the map. |
 +| users | array | Map user shares to be created on the map. |
 +| userGroups | array | Map user group shares to be created on the map. |
  
 <note tip>To create map links you'll need to set a map elements ''​selementid''​ to an arbitrary value and then use this value to reference this element in the links ''​selementid1''​ or ''​selementid2''​ properties. When the element is created, this value will be replaced with the correct ID generated by Zabbix. [[create#​create_a_host_map|See example.]]</​note>​ <note tip>To create map links you'll need to set a map elements ''​selementid''​ to an arbitrary value and then use this value to reference this element in the links ''​selementid1''​ or ''​selementid2''​ properties. When the element is created, this value will be replaced with the correct ID generated by Zabbix. [[create#​create_a_host_map|See example.]]</​note>​
Line 30: Line 32:
  
 Request: Request:
-<​code ​js>+<​code ​java>
 { {
     "​jsonrpc":​ "​2.0",​     "​jsonrpc":​ "​2.0",​
Line 45: Line 47:
  
 Response: Response:
-<​code ​js>+<​code ​java>
 { {
     "​jsonrpc":​ "​2.0",​     "​jsonrpc":​ "​2.0",​
Line 62: Line 64:
  
 Request: Request:
-<​code ​js>+<​code ​java>
 { {
     "​jsonrpc":​ "​2.0",​     "​jsonrpc":​ "​2.0",​
Line 97: Line 99:
  
 Response: Response:
-<​code ​js>+<​code ​java>
 { {
     "​jsonrpc":​ "​2.0",​     "​jsonrpc":​ "​2.0",​
Line 108: Line 110:
 } }
 </​code>​ </​code>​
 +
 +=== Map sharing ===
 +
 +Create a map with two types of sharing (user and user group).
 +
 +Request:
 +<code java>
 +{
 +    "​jsonrpc":​ "​2.0",​
 +    "​method":​ "​map.create",​
 +    "​params":​ {
 +        "​name":​ "Map sharing",​
 +        "​width":​ 600,
 +        "​height":​ 600,
 +        "​users":​ [
 +            {
 +                "​userid":​ "​4",​
 +                "​permission":​ "​3"​
 +            }
 +        ],
 +        "​userGroups":​ [
 +            {
 +                "​usrgrpid":​ "​7",​
 +                "​permission":​ "​2"​
 +            }
 +        ]
 +    },
 +    "​auth":​ "​038e1d7b1735c6a5436ee9eae095879e",​
 +    "​id":​ 1
 +}
 +</​code>​
 +
 +Response:
 +<code java>
 +{
 +    "​jsonrpc":​ "​2.0",​
 +    "​result":​ {
 +        "​sysmapids":​ [
 +            "​9"​
 +        ]
 +    },
 +    "​id":​ 1
 +}
 +</​code>​
 +
  
 ==== See also ==== ==== See also ====
Line 114: Line 161:
   * [[object#​map_link|Map link]]   * [[object#​map_link|Map link]]
   * [[object#​map_url|Map URL]]   * [[object#​map_url|Map URL]]
 +  * [[object#​map_user|Map user]]
 +  * [[object#​map_user_group|Map user group]]
  
 ==== Source ==== ==== Source ====
  
-CMap::​create() in //​frontends/​php/​api/​classes/​CMap.php//​.+CMap::​create() in //​frontends/​php/​include/classes/​api/​services/​CMap.php//​.