hostgroup.massadd
Leírás
objektum hostgroup.massadd(objektumparaméterek)
Ez a módszer lehetővé teszi több kapcsolódó objektum egyidejű hozzáadását az összeshez az adott fogadócsoportokat.
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.
Parameters
(object) Parameters containing the IDs of the host groups to update
and the objects to add to all the host groups.
The method accepts the following parameters.
| Parameter | Type | Description |
|---|---|---|
| groups (required) |
object/array | Host groups to be updated. The host groups must have the groupid property defined. |
| hosts | object/array | Hosts to add to all host groups. The hosts must have the hostid property defined. |
| templates | object/array | Templates to add to all host groups. The templates must have the templateid property defined. |
Visszatérési értékek
(object) Egy objektumot ad vissza, amely tartalmazza a frissített gazdagép azonosítóit
csoportok a "groupids" tulajdonság alatt.
Példák
Adding hosts to host groups
Add two hosts to host groups with IDs 5 and 6.
Request:
{
"jsonrpc": "2.0",
"method": "hostgroup.massadd",
"params": {
"groups": [
{
"groupid": "5"
},
{
"groupid": "6"
}
],
"hosts": [
{
"hostid": "30050"
},
{
"hostid": "30001"
}
]
},
"auth": "f223adf833b2bf2ff38574a67bba6372",
"id": 1
}
Response:
{
"jsonrpc": "2.0",
"result": {
"groupids": [
"5",
"6"
]
},
"id": 1
}
Lásd még
Forrás
CHostGroup::massAdd() in ui/include/classes/api/services/CHostGroup.php.