The method allows to retrieve maintenances according to the given parameters.该方法允许根据给定的参数检索维护。

    Parameters 参数

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

    The method supports the following parameters.该方法支持以下参数。

    • an array of objects;

    • the count of retrieved objects, if the countOutput 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. ],
    17. "timeperiods": [
    18. {
    19. "timeperiodid": "4",
    20. "every": "1",
    21. "month": "0",
    22. "dayofweek": "1",
    23. "day": "0",
    24. "start_time": "64800",
    25. "period": "3600",
    26. "start_date": "2147483647"
    27. }
    28. ]
    29. }
    30. ],
    31. "id": 1
    32. }

    Source 来源

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