The method allows to retrieve maintenances according to the given parameters. 此方法用于根据给定参数获取维护模式。

    Parameters 参数

    (object) Parameters defining the desired output. (object) 定义期望输出的参数。

    The method supports the following parameters. 此方法支持如下参数。

    • an array of objects;

    • the count of retrieved objects, if the parameter has been used.

    Examples 示例

    Retrieving maintenances 获取维护模式

    Retrieve all configured maintenances, and the data about the assigned host groups, hosts and defined time periods. 获取所有配置的维护模式,以及关于指定主机组、主机和定义的时间周期数据。

    Response:

    1. {
    2. "jsonrpc": "2.0",
    3. "result": [
    4. {
    5. "maintenanceid": "3",
    6. "maintenance_type": "0",
    7. "description": "",
    8. "active_since": "1358844540",
    9. "active_till": "1390466940",
    10. "groups": [
    11. {
    12. "groupid": "4",
    13. "name": "Zabbix servers",
    14. "internal": "0"
    15. }
    16. "timeperiods": [
    17. {
    18. "timeperiodid": "4",
    19. "every": "1",
    20. "month": "0",
    21. "dayofweek": "1",
    22. "day": "0",
    23. "start_time": "64800",
    24. "period": "3600",
    25. "start_date": "2147483647"
    26. }
    27. ]
    28. }
    29. ],
    30. "id": 1

    Source

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