WileESpaghetti / go-uptimerobot-v2

Uptime Robot APIv2 client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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
  • monitors
  • 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
    • logs_end_date
    • 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
  • offset
  • limit
  • search

About

Uptime Robot APIv2 client

License:MIT License


Languages

Language:Go 99.6%Language:Makefile 0.4%