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.
°¨¦°ù¨¦²õ:
{
"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
}
³Õ¨¢±ô²¹²õ³ú:
{
"jsonrpc": "2.0",
&±ç³Ü´Ç³Ù;±ð°ù±ð»å³¾¨¦²Ô²â&±ç³Ü´Ç³Ù;: {
"hostids": [
"10160",
"10167"
]
},
&±ç³Ü´Ç³Ù;²¹³ú´Ç²Ô´Ç²õ¨ª³Ù¨®&±ç³Ü´Ç³Ù;: 1
}
CHost::massAdd() az ui/include/classes/api/services/CHost.php-ban.