This method allows to create new maintenances. 此方法允许创建新的维护模式。

    Parameters 参数

    (object/array) Maintenances to create.

    Additionally to the , the method accepts the following parameters. 另外见standard maintenance properties,此方法接受如下参数。

    At least one host or host group must be defined for each maintenance.每个维护模式至少一个主机或主机组被定义。

    Examples 示例

    Creating a maintenance 创建一个维护模式

    Create a maintenance with data collection for host group “2”. It must be active from 22.01.2013 till 22.01.2014, come in effect each Sunday at 18:00 and last for one hour. 为主机组“2”以with data collection(持续收集数据)模式创建一个维护模式。该维护模式生效于22.01.2013 到 22.01.2014,每周六的18:00生效,并持续1个小时。

    Request:

    1. {
    2. "jsonrpc": "2.0",
    3. "result": {
    4. ]
    5. },
    6. "id": 1

    Source

    CMaintenance::create() in frontends/php/include/classes/api/services/CMaintenance.php.