This method allows to simultaneously add multiple related objects to all the given host groups.该方法允许同时向所有给定的主机组添加多个相关对象。
Parameters 参数
(object)
Parameters containing the IDs of the host groups to update and the objects to add to all the host groups. 包含要更新的主机组的ID和要添加到所有主机组的对象的参数。
(object)
Returns an object containing the IDs of the updated host groups under the property.返回包含“groupids”属性下更新的主机组的ID的对象。
Examples示例
Adding hosts to host groups将主机添加到主机组
Add two hosts to host groups with IDs 5 and 6.将两个主机添加到ID为5和6的主机组。
Response:
- {
- "jsonrpc": "2.0",
- "result": {
- "groupids": [
- "6"
- ]
- },
- "id": 1
- }
Source来源
CHostGroup::massAdd() in frontends/php/include/classes/api/services/CHostGroup.php.