Uptime Robot APIv2 command-line client and library
go build -o uptimerobot cmd/uptimerobot/main.go
./uptimerobot GROUP [COMMAND] --api-key=$KEY
package main
import (
"fmt"
"github.com/WileESpaghetti/go-uptimerobot-v2/uptime_robot"
)
func main() {
// initialize the API client
apiKey := "your-api-key"
ur := uptime_robot.NewClient(apiKey)
// get all monitors
monitors, err := ur.GetMonitors()
if err != nil {
fmt.Println(err)
return
}
for _, m := range monitors {
fmt.Printf("%d: %s: %s\n", m.ID, m.Url, m.Status)
}
// get specific monitors
}
- account - displays account information
- monitor
- contact
- psp
- help
- other cobra built-ins
- api_key
- api_key
- monitors
- types
- statuses
- custom_uptime_ratios
- does not accept hyphen as a separator yet
- custom_down_durations
- custom_uptime_ranges
- all_time_uptime_ratio
- all_time_uptime_durations
- logs
- logs_start_date [Requires Pro Plan]
- logs_end_date [Requires Pro Plan]
- log_types
- logs_limit
- response_times
- response_times_limit
- response_times_average
- response_times_start_date
- response_times_end_date
- alert_contacts
- mwindows
- ssl
- custom_http_headers
- custom_http_statuses
- http_request_details
- auth_type
- timezone
- not really a property of a monitor and is returned as a property of the main response object
- offset
- limit
- search
- api_key
- alert_contacts
- offset
- limit
- api_key
- psps
- offset
- limit
- api_key
- mwindows
- offset
- limit