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
- Host: GitHub
- URL: https://github.com/wileespaghetti/go-uptimerobot-v2
- Owner: WileESpaghetti
- License: mit
- Created: 2017-10-31T01:29:11.000Z (over 8 years ago)
- Default Branch: develop
- Last Pushed: 2024-11-06T03:42:11.000Z (over 1 year ago)
- Last Synced: 2024-11-06T04:29:19.233Z (over 1 year ago)
- Topics: uptime-robot, uptimerobot, uptimerobot-api, uptimerobotapi
- Language: Go
- Homepage:
- Size: 163 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-uptimerobot-v2

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