This method allows to simultaneously add multiple related objects to all the given hosts.此方法允许同时添加多个相关对象到指定的主机。
Parameters 参数
(object)
Parameters containing the IDs of the hosts to update and the objects to add to all the hosts. 参数包含升级主机的ID和添加到所有主机中的对象。
The method accepts the following parameters.该方法接受以下参数。
Examples 范例
Adding macros 添加宏
Add two new macros to two hosts.添加两个新的宏到两个主机中。
Request:
Response:
- {
- "jsonrpc": "2.0",
- "result": {
- "hostids": [
- "10160",
- "10167"
- },
- "id": 1
- }
Source 来源
CHost::massAdd() in frontends/php/include/classes/api/services/CHost.php.