application.create

说明

object application.create(object/array applications)

此方法允许创建新的应用集。

参数

(object/array) 需要去创建的应用集。

此方法接受创建的应用集带有 标准应用集属性.

返回值

返回一个包含 "applicationID" 属性的应用程序 ID 的对象。 返回的ID的顺序与传递的应用程序的顺序相匹配

范例

创建一个应用集

创建一个应用集来存储 SNMP 监控项。

请求:

{
           "jsonrpc": "2.0",
           "method": "application.create",
           "params": {
               "name": "SNMP Items",
               "hostid": "10050"
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

响应:

{
           "jsonrpc": "2.0",
           "result": {
               "applicationids": [
                   "356"
               ]
           },
           "id": 1
       }

来源

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

Description

object application.create(object/array applications)

This method allows to create new applications.

Parameters

(object/array) Applications to create.

The method accepts applications with the standard application properties.

Return values

(object) Returns an object containing the IDs of the created applications under the applicationids property. The order of the returned IDs matches the order of the passed applications.

Examples

Creating an application

Create an application to store SNMP items.

Request:

{
           "jsonrpc": "2.0",
           "method": "application.create",
           "params": {
               "name": "SNMP Items",
               "hostid": "10050"
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "applicationids": [
                   "356"
               ]
           },
           "id": 1
       }

Source

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