uptimerobot.monitors {uptimeRobot} | R Documentation |
Get general informations about monitors
Description
uptimerobots.monitors.responses
return a dataset with general informations
for a set of monitors.
Usage
uptimerobot.monitors(api.key, monitors = NULL, types = NULL,
statuses = NULL, search = NULL, summary = list(), limit = 50,
offset = 0, fields = uptimerobot.fields("monitor")$typical)
Arguments
api.key |
A valid key for connecting to UptimeRobors public API. |
monitors |
vector or comma-delimited string with the IDs of the monitors to get. If not used or set to |
types |
vector or comma-delimited string of monitor types. If not used or set to |
statuses |
vector or comma-delimited string of monitor statuses. If not used or set to |
search |
An optional keyword of to search within monitor URL or friendly name to get filtered results. |
summary |
list of logical values to flag summary indicators to add to the output dataset. |
limit |
An integer value used for pagination. Defines the max number of records to return in each page. Default and max. is 50. |
offset |
An integer value to set the index of the first monitor to get (used for pagination). |
fields |
vector or comma-delimited string with the general informations to include in the output dataset.
You may want to use the helper function |
Details
If a vector of monitor is not given, the function will return data for all the available monitors.
summary
parameter expect a lists of three named logic values that set which columns of additional statistics for each monitor must be added to output dataset for
each available monitor. These are summary values only, as the instances are obtained using a set of dedicated functions.
-
response.times
set toTRUE
to add a column with the number of pings with response times available for the monitor to the output. These values can be queried usinguptimerobot.monitor.responses
function. -
log.records
set toTRUE
to add a column with the number of log entries recorded for the monitor to the output. These records can be queried usinguptimerobot.monitor.logs
function. -
alert.contacts
set toTRUE
to add a column with the number of alert contacts binded to the monitor to the output. Detailed informations about these contacts can be queried usinguptimerobot.monitor.contacts
function.
You may just add the elements you want to include into the list, as they default to FALSE
if missing. Set an empty list to exclude all the summary statistics from the output.
The API uses pagination and returns no more than 50 monitors on each page. Use limit
and offset
to set a different number of
monitors to get on each page and to move between pages. Leave default values to get all the data.
Value
A dataset with general informations about the given monitors
Author(s)
Gabriele Baldassarre
See Also
uptimerobot.monitor.responses
, uptimerobot.monitor.logs
, uptimerobot.monitor.contacts
Examples
## Not run:
# Let's assume the api.key is available into the environment variable KEY
api.key <- Sys.getenv("KEY", "")
# Returns all the monitors with a default set of attributes
monitors.df <- uptimerobot.monitors(api.key)
#' # Returns all the monitors of 'keyword' type
monitors.kwd..df <- uptimerobot.monitors(api.key, type="keyword")
# Returns all the monitors and all the attributes
monitors.full.df <- uptimerobot.monitors(api.key, fields=uptimerobot.fields("monitor")$full))
# Returns only the two monitors with ID: 1234, 5678
monitors.df <- uptimerobot.monitors(api.key, c("1234", "5678"))
## End(Not run)