objektum host.massadd(objektumparaméterek)
Ez a módszer lehetővé teszi több kapcsolódó objektum egyidejű hozzáadását az összeshez az adott házigazdák.
Ez a módszer csak az Admin és a Kiemelt rendszergazda számára érhető el felhasználói típusok. A metódus meghívására vonatkozó engedélyek felhasználói szerepkörben visszavonhatók beállítások. Lásd: User roles további információért.
(object) Parameters containing the IDs of the hosts to update and the objects to add to all the hosts.
The method accepts the following parameters.
| Parameter | Type | Description |
|---|---|---|
| hosts (required) |
object/array | Hosts to be updated. The hosts must have the hostid property defined. |
| groups | object/array | Host groups to add to the given hosts. The host groups must have the groupid property defined. |
| interfaces | object/array | Host interfaces to be created for the given hosts. |
| macros | object/array | User macros to be created for the given hosts. |
| templates | object/array | Templates to link to the given hosts. The templates must have the templateid property defined. |
(objektum) visszaad egy objektumot, amely tartalmazza a frissített gazdagépek azonosítóit a hostidok tulajdona alatt.
Adjon hozzá két új makrót két gazdagéphez.
Kérés:
{
"jsonrpc": "2.0",
"method": "host.massadd",
"params": {
"hosts": [
{
"hostid": "10160"
},
{
"hostid": "10167"
}
],
"macros": [
{
"macro": "{$TEST1}",
"value": "MACROTEST1"
},
{
"macro": "{$TEST2}",
"value": "MACROTEST2",
"description": "Teszt leírása"
}
]
},
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 1
}Válasz:
CHost::massAdd() az ui/include/classes/api/services/CHost.php-ban.