An open API service indexing awesome lists of open source software.

https://github.com/wileespaghetti/go-uptimerobot-v2

Uptime Robot APIv2 client
https://github.com/wileespaghetti/go-uptimerobot-v2

uptime-robot uptimerobot uptimerobot-api uptimerobotapi

Last synced: about 1 year ago
JSON representation

Uptime Robot APIv2 client

Awesome Lists containing this project

README

          

# go-uptimerobot-v2

![example workflow](https://github.com/WileESpaghetti/go-uptimerobot-v2/actions/workflows/go.yml/badge.svg)

Uptime Robot APIv2 command-line client and library

[UptimeRobot API Documentation](https://uptimerobot.com/api)

## Build
```shell
go build -o uptimerobot cmd/uptimerobot/main.go
```

## Command Usage

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

## Library Usage

```go
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`
- [X] api_key

#### `getMonitors`
- [X] api_key
- [X] monitors
- [X] types
- [X] statuses
- [X] custom_uptime_ratios
- does not accept hyphen as a separator yet
- [ ] custom_down_durations
- [ ] custom_uptime_ranges
- [X] all_time_uptime_ratio
- [X] all_time_uptime_durations
- [X] logs
- [ ] logs_start_date [Requires Pro Plan]
- [ ] logs_end_date [Requires Pro Plan]
- [X] log_types
- [X] logs_limit
- [X] response_times
- [X] response_times_limit
- [X] response_times_average
- [X] response_times_start_date
- [X] response_times_end_date
- [X] alert_contacts
- [ ] mwindows
- [ ] ssl
- [ ] custom_http_headers
- [X] custom_http_statuses
- [ ] http_request_details
- [X] 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`
- [X] api_key
- [X] alert_contacts
- [ ] offset
- [ ] limit

#### `getPSPs`
- [X] api_key
- [X] psps
- [ ] offset
- [ ] limit

#### `getMWindows`
- [ ] api_key
- [ ] mwindows
- [ ] offset
- [ ] limit