说明
This method allows to update existing item prototypes. 此方法允许更新存在的item prototypes(监控项原型)。
Parameters
(object/array)
Item prototype properties to be updated.Item prototype 要更新的属性。
The itemid
property must be defined for each item prototype, all other properties are optional. Only the passed properties will be updated, all others will remain unchanged.Item prototype 的 itemid
的属性必须定义,所有其他属性为可选。只用被传递的属性才会被更新,所有其他未被传递的属性保持不变。
Additionally to the , the method accepts the following parameters.此方法接受如下参数。
Return values
返回值
示例
Changing the interface of an item prototype
改变 item prototype 的接口
Change the host interface that will be used by discovered items. 改变将被用于发现监控项的主机接口。
Request:
Response:
{
"jsonrpc": "2.0",
"result": {
"27428"
]
},
"id": 1
}
Update dependent item prototype
更新依赖的item prototype
Update Dependent item prototype with new Master item prototype ID. Only dependencies on same host (template/discovery rule) are allowed, therefore Master and Dependent item should have same hostid and ruleid. 以新的主item prototype的ID来更新依赖的 item prototype。只有在相同host(template/discovery rule)的依赖才允许,因此主监控项和依赖监控项应有相同hostid和ruleid。
Response:
{
"jsonrpc": "2.0",
"itemids": [
"189030"
},
"id": 1
}
Update HTTP agent item prototype
更新 HTTP agent item prototype
Change query fields and remove all custom headers. 改变查询字段并移除所有自定义请求头。
Request:
Response:
{
"jsonrpc": "2.0",
"result": {
"itemids": [
"28305"
]
},
}