Skip to content

WileESpaghetti/go-uptimerobot-v2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-uptimerobot-v2

example workflow

Uptime Robot APIv2 command-line client and library

UptimeRobot API Documentation

Build

go build -o uptimerobot cmd/uptimerobot/main.go

Command Usage

./uptimerobot GROUP [COMMAND] --api-key=$KEY

Library Usage

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
    
	
    
}

Implemented groups

  • account - displays account information
  • monitor
  • contact
  • psp
  • help
  • other cobra built-ins

API Support

getAccountDetails

  • api_key

getMonitors

  • 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

getAlertContacts

  • api_key
  • alert_contacts
  • offset
  • limit

getPSPs

  • api_key
  • psps
  • offset
  • limit

getMWindows

  • api_key
  • mwindows
  • offset
  • limit