This method allows to simultaneously replace or remove related objects and update properties on multiple templates. 此方法允许同时替换或删除相关对象并更新多个模板上的属性。

    Parameters 参数

    (object) Parameters containing the IDs of the templates to update and the properties that should be updated. (object)参数包含需要更新的模板ID以及需要更新的属性。 Additionally to the , the method accepts the following parameters. 除standard template properties之外,该方法接受以下参数。

    (object) Returns an object containing the IDs of the updated templates under the templateids property. (object)返回一个对象,此对象包含在templateids中已更新模板的ID。

    Examples 范例

    Replacing host groups 替换主机组

    Request 请求:

    Response 响应:

    1. {
    2. "result": {
    3. "templateids": [
    4. "10085",
    5. "10086"
    6. },
    7. "id": 1
    8. }

    Source 源码

    CTemplate::massUpdate() in frontends/php/include/classes/api/services/CTemplate.php. CTemplate::massUpdate()方法可在frontends/php/include/classes/api/services/CTemplate.php中参考。