This method allows to create new hosts.
Parameters
(object/array)
Hosts to create.
Additionally to the standard host properties, the method accepts the following parameters.
Returns an object containing the IDs of the created hosts under the hostids
property. The order of the returned IDs matches the order of the passed hosts.
Examples
Creating a host
Create a host called “Linux server” with an IP interface and tags, add it to a group, link a template to it and set the MAC addresses in the host inventory.
Response:
Creating a host with SNMP interface
Create a host called “SNMP host” with an SNMPv3 interface with details.
Request:
Response:
Source
CHost::create() in ui/include/classes/api/services/CHost.php.