Learn R Programming

uptimeRobot (version 1.0.0)

uptimerobot.monitor.delete: Delete a monitor

Description

uptimerobot.monitor.delete remove a monitor and all existing statistics of it.

Usage

uptimerobot.monitor.delete(api.key, id)

Arguments

api.key
string with a valid key for connecting to Uptimerobot API.
id
numeric or integer with the ID of the monitor to delete.

Value

The function returns TRUE in case success. An error is thrown otherwise.

Examples

Run this code
## Not run: 
#  # Let's assume the api.key is available into the environment variable KEY
#  api.key <- Sys.getenv("KEY", "")
# 
#  # Create a monitor and get its monitor.id
#  monitor.id <- uptimerobot.monitor.new(api.key,
#    friendly.name="Open Analytics",
#    url="https://gabrielebaldassarre.com", type="http"
#  )
# 
#  # Change the friendly name of the monitor
#   if(uptimerobot.monitor.edit(api.key,
#      monitor.id,
#      friendly.name="Open Analytics - gabrielebaldassarre.com"
#   ){
#    message("Monitor has been successfully edited!")
#  }
# 
#  # Delete the just-made monitor
#  if(uptimerobot.monitor.delete(api.key, monitor.id){
#    message("Monitor has been successfully deleted!")
#  }
# ## End(Not run)

Run the code above in your browser using DataLab