templatescreen.create

Description说明

object templatescreen.create(object/array templateScreens)

This method allows to create new template screens该方法允许创建新的模板聚合图形.

Parameters参数

(object/array) Template screens to create要创建的模板聚合图形.

Additionally to the standard template screen properties, the method accepts the following parameters.除standard template screen properties之外,该方法接受以下参数.

Parameter参数 Type类型 Description说明
screenitems array Template screen items to create on the screen聚合图形上要创建的模板聚合图形项.

Return values返回值

(object) Returns an object containing the IDs of the created template screens under the screenids property. The order of the returned IDs matches the order of the passed template screens.(object)返回一个包含screenids属性下创建的模板聚合图形的ID的对象,返回的ID的顺序与传递的模板聚合图形的顺序相匹配。

Examples范例

Create a template screen创建模板聚合图形

Create a template screen named “Graphs” with 2 rows and 3 columns and add a graph to the upper-left cell创建一个名为“Graphs”的模板聚合图形,带有2行和3列,并将图形添加到左上角的单元格。.

Request请求:

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

Response响应:

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

See also参考

Source来源

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