2022 Zabbix中国峰会
2022 Zabbix中国峰会

application.update

说明

object application.update(object/array applications)

此方法用于更新目前的应用集。

Parameters

(object/array) 需要被更新的 应用集属性

Applicationid属性必须在每个应用集中已定义,其他所有属性为可选项。只有传递过去的属性会被更新,其他所有属性仍然保持不变。

返回值

(object) 返回一个 applicationids 属性下已更新应用集的ID的对象。

范例

更新应用集的名称。

更新应用集的名称为“Processes and performance”。

请求:

{
           "jsonrpc": "2.0",
           "method": "application.update",
           "params": {
               "applicationid": "13",
               "name": "Processes and performance"
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

响应:

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

来源

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

Description

object application.update(object/array applications)

This method allows to update existing applications.

Parameters

(object/array) Application properties to be updated.

The applicationid property must be defined for each application, all other properties are optional. Only the passed properties will be updated, all others will remain unchanged.

Return values

(object) Returns an object containing the IDs of the updated applications under the applicationids property.

Examples

Changing the name of an application

Change the name of the application to "Processes and performance".

Request:

{
           "jsonrpc": "2.0",
           "method": "application.update",
           "params": {
               "applicationid": "13",
               "name": "Processes and performance"
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

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

Source

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