The method allows to retrieve scripts according to the given parameters. 此方法允许检索符合所给参数的脚本
Parameters 参数
(object)
Parameters defining the desired output. (object)
定义所需输出的参数。
The method supports the following parameters. 此方法支持以下参数
(integer/array)
Returns either:
the count of retrieved objects, if the
countOutput
parameter has been used.一个数组对象
检索到对象的数目,如果
countOutput
参数被使用
Examples 示例如下
Retrieve all scripts 检索所有脚本
Retrieve all configured scripts. 检索所有的已确认的脚本
Response:
{
"jsonrpc": "2.0",
"result": [
{
"name": "Ping",
"host_access": "2",
"usrgrpid": "0",
"groupid": "0",
"description": "",
"confirmation": "",
"type": "0",
"execute_on": "1"
},
{
"scriptid": "2",
"name": "Traceroute",
"command": "/usr/bin/traceroute {HOST.CONN} 2>&1",
"host_access": "2",
"usrgrpid": "0",
"groupid": "0",
"description": "",
"execute_on": "1"
},
{
"scriptid": "3",
"name": "Detect operating system",
"command": "sudo /usr/bin/nmap -O {HOST.CONN} 2>&1",
"host_access": "2",
"usrgrpid": "7",
"groupid": "0",
"description": "",
"confirmation": "",
"type": "0",
"execute_on": "1"
}
],
"id": 1
}
Source
CScript::get() in frontends/php/include/classes/api/services/CScript.php.