The method allows to retrieve host prototypes 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.
The method supports the following parameters.
an array of objects;
the count of retrieved objects, if the
countOutput
parameter has been used.
Examples
Retrieving host prototypes from an LLD rule
Retrieve all host prototypes, their group links, group prototypes and tags from an LLD rule.
Request:
{
"jsonrpc": "2.0",
"result": [
{
"hostid": "10092",
"host": "{#HV.UUID}",
"status": "0",
"templateid": "0",
"discover": "0",
"custom_interfaces": "1",
"inventory_mode": "-1",
"groupLinks": [
"group_prototypeid": "4",
"hostid": "10092",
"groupid": "7",
"templateid": "0"
}
],
"groupPrototypes": [
{
"group_prototypeid": "7",
"hostid": "10092",
"name": "{#CLUSTER.NAME}",
"templateid": "0"
}
],
"tags": [
{
"tag": "Datacenter",
},
{
"tag": "Instance type",
"value": "{#INSTANCE_TYPE}"
],
"interfaces": [
{
"main": "1",
"type": "2",
"useip": "1",
"ip": "127.0.0.1",
"dns": "",
"port": "161",
"details": {
"version": "2",
"bulk": "1",
"community": "{$SNMP_COMMUNITY}"
}
}
]
}
],
"id": 1
Source
CHostPrototype::get() in ui/include/classes/api/services/CHostPrototype.php.