The method allows to retrieve scripts according to the given parameters.
This method is available to users of any type. Permissions to call the method can be revoked in user role settings. See for more information.
Parameters
(object)
Parameters defining the desired output.
(integer/array)
Returns either:
an array of objects;
the count of retrieved objects, if the
countOutput
parameter has been used.
Examples
Retrieve all scripts
Request:
Response:
{
"jsonrpc": "2.0",
"result": [
{
"scriptid": "1",
"name": "Ping",
"command": "/bin/ping -c 3 {HOST.CONN} 2>&1",
"host_access": "2",
"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": "",
"confirmation": "",
"type": "0",
{
"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 ui/include/classes/api/services/CScript.php.