screen.create

说明

object screen.create(object/array screens)

该方法允许创建新screen。

参数

(object/array) Screens to create.

除了 标准screen属性之外, 该方法接受以下参数。

属性 类型 说明
screenitems array 要为screen创建的Screen items
users array 在screen上创建screen用户共享。
userGroups array 在screen上创建screen用户组共享。

返回值

(object) 返回一个包含“screenid”属性下创建的screen ID的对象。 返回的ID的顺序与传递的screen的顺序相匹配。

示例

Creating a screen

Create a screen named “Graphs” with 2 rows and 3 columns and add a graph to the upper-left cell.

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": 0,
  13. "colspan": 0,
  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. }

Screen共享

Create a screen with two types of sharing (user and user group).

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.