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

删除

Description

描述

object script.delete(array scriptIds)

This method allows to delete scripts. 此方法允许删除脚本。 ::: noteclassic This method is only available to Super admin user type. Permissions to call the method can be revoked in user role settings. See User roles for more information. ::: ::: 请注意 此方法只有_超级管理员_ 用户可以使用。可以在用户角色设置中撤销调用此方法的权限。更多信息见 User roles :::

参数

(数组) 要删除的脚本ID。

返回值

(对象) 返回一个scriptids属性包含被删除脚本ID的对象。

示例

Delete multiple scripts

删除多个脚本

Delete two scripts. 删除两个脚本 Request: 请求

{
           "jsonrpc": "2.0",
           "method": "script.delete",
           "params": [
               "3",
               "4"
           ],
           "id": 1
       }

Response: 响应

{
           "jsonrpc": "2.0",
           "result": {
               "scriptids": [
                   "3",
                   "4"
               ]
           },
           "id": 1
       }

源代码

CScript::delete() 在frontends/php/include/classes/api/services/CScript.php