创建

描述

object screen.create(object/array **screens**)

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

参数

(object/array)创建聚合图形

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

ParameterTypeDescription
screenitemsarray为聚合图形创建聚合图形项
usersarray聚合图形用户共享在聚合图形上创建
userGroupsarray聚合图形用户组共享在聚合图形上创建

返回值

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

示例如下

创建一个聚合图形

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

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "screen.create",
  4. "params": {
  5. "name": "Graphs",
  6. "hsize": 3,
  7. "vsize": 2,
  8. "screenitems": [
  9. {
  10. "resourcetype": 0,
  11. "resourceid": "612",
  12. "rowspan": 1,
  13. "colspan": 1,
  14. "x": 0,
  15. "y": 0
  16. }
  17. ]
  18. },
  19. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  20. "id": 1
  21. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": {
  4. "screenids": [
  5. "26"
  6. ]
  7. },
  8. "id": 1
  9. }

聚合图形分享

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

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "screen.create",
  4. "params": {
  5. "name": "Screen sharing",
  6. "hsize": 3,
  7. "vsize": 2,
  8. "users": [
  9. {
  10. "userid": "4",
  11. "permission": "3"
  12. }
  13. ],
  14. "userGroups": [
  15. {
  16. "usrgrpid": "7",
  17. "permission": "2"
  18. }
  19. ]
  20. },
  21. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  22. "id": 1
  23. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": {
  4. "screenids": [
  5. "83"
  6. ]
  7. },
  8. "id": 1
  9. }

猜你想看

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