Downtime - Listing

Endpoint to list current downtimes

By default, all downtimes will be listed. You can filter this list based on the same parameters for Filtering Service Objects.

Note: If you use the “object type specific parameters” within the Creating Downtime section, you will get a 400 error as those parameters are not used when listing.

Note: There is a limitation where if you filter by service name, then it will return hosts as well as services of that service name. Use the hs=hostname::servicename parameter instead to locate a specific service on a host.

Paging

You can specify the following URL parameters to use paging:

  • rows - defaults to 50 entries in the downtimes list. Set to all to get all results.
  • page - defaults to 1st page.

Note: Due to the SQL joins that are used and the way that the result comes back in a nested fashion, it is possible to list a downtime that misses out the related host/service objects. If you need the precise list of objects based on the downtimes, the best thing to do is search by the downtime filters (comment, start_time, end_time) and set rows=0. This should always return the correct number of objects for the particular downtime.

Response

Output of a list response:

{
    "summary": {
        "rows": ....
        "totalrows": ....
        "allrows": ....
        "page": ....
        "totalpages": ....
        "num_hosts": ....
        "num_services": ....
    },
    "list":
    [{
            "started": 0,         // 0 = not started yet, 1 = started
            "start_time": ....,  // if started, actual start time, else scheduled start time
            "scheduled_end_time": .....,
            "comment": .....,
            "author": .....,
            "objects": {
                "hosts": [{
                    "hostname": ...., "id": ...
                }],
                "services": [{
                    "id": ...., "hostname": ...., "servicename": ....
                }],
            }
        },
        ...
    ]
}

The list is ordered by scheduled start time, scheduled end time, comment data, author name.

By default, datetime values are returned as epoch seconds. If you want to have a datetime string, add the URL parameter format_datetime=1.