这是原厂英文文档的翻译页面. 欢迎帮助我们 完善文档.

创建

描述

object screen.create(object/array screens)

此方法允许创建新的聚合图形

参数

(object/array)创建聚合图形

此外 standard screen properties,此方法接受以下参数:

Parameter Type Description
screenitems array 为聚合图形创建聚合图形项
users array 聚合图形用户共享在聚合图形上创建
userGroups array 聚合图形用户组共享在聚合图形上创建

返回值

(object) 返回一个对象,该对象包含在screenids属性下创建的聚合图形的id。返回的id的顺序与传递的聚合图形的顺序相匹配。

示例如下

创建一个聚合图形

创建一个2行3列名字叫"Graphs"的聚合图形,并且在表格的左上角添加一个图形。

Request:

{
           "jsonrpc": "2.0",
           "method": "screen.create",
           "params": {
               "name": "Graphs",
               "hsize": 3,
               "vsize": 2,
               "screenitems": [
                   {
                       "resourcetype": 0,
                       "resourceid": "612",
                       "rowspan": 1,
                       "colspan": 1,
                       "x": 0,
                       "y": 0
                   }
               ]
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "screenids": [
                   "26"
               ]
           },
           "id": 1
       }

聚合图形分享

创建一个两种共享类型的聚合图形(用户和用户组)

Request:

{
           "jsonrpc": "2.0",
           "method": "screen.create",
           "params": {
               "name": "Screen sharing",
               "hsize": 3,
               "vsize": 2,
               "users": [
                   {
                       "userid": "4",
                       "permission": "3"
                   }
               ],
               "userGroups": [
                   {
                       "usrgrpid": "7",
                       "permission": "2"
                   }
               ]
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "screenids": [
                   "83"
               ]
           },
           "id": 1
       }

猜你想看

CScreen::create() in frontends/php/include/classes/api/services/CScreen.php.