uptimerobotapi

package
v0.9.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2023 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AlertContactStatus = mapKeys(alertContactStatus)
View Source
var AlertContactType = mapKeys(alertContactType)
View Source
var MonitorHTTPAuthType = mapKeys(monitorHTTPAuthType)
View Source
var MonitorHTTPMethod = mapKeys(monitorHTTPMethod)
View Source
var MonitorKeywordType = mapKeys(monitorKeywordType)
View Source
var MonitorSubType = mapKeys(monitorSubType)
View Source
var MonitorType = mapKeys(monitorType)
View Source
var StatusPageSort = mapKeys(statusPageSort)
View Source
var StatusPageStatus = mapKeys(statusPageStatus)

Functions

This section is empty.

Types

type Account

type Account struct {
	Email           string
	MonitorLimit    int
	MonitorInterval int
	UpMonitors      int
	DownMonitors    int
	PausedMonitors  int
}

type AlertContact

type AlertContact struct {
	ID           string `json:"id"`
	FriendlyName string `json:"friendly_name"`
	Value        string `json:"value"`
	Type         string
	Status       string
}

type AlertContactCreateRequest

type AlertContactCreateRequest struct {
	FriendlyName string
	Type         string
	Value        string
}

type AlertContactUpdateRequest

type AlertContactUpdateRequest struct {
	ID           string
	FriendlyName string
	Value        string
}

type Monitor

type Monitor struct {
	ID           int    `json:"id"`
	FriendlyName string `json:"friendly_name"`
	URL          string `json:"url"`
	Type         string `json:"type"`
	Status       string `json:"status"`
	Interval     int    `json:"interval"`

	SubType string `json:"sub_type"`
	Port    int    `json:"port"`

	KeywordType  string `json:"keyword_type"`
	KeywordValue string `json:"keyword_value"`

	HTTPMethod   string `json:"http_method"`
	HTTPUsername string `json:"http_username"`
	HTTPPassword string `json:"http_password"`
	HTTPAuthType string `json:"http_auth_type"`

	IgnoreSSLErrors bool `json:"ignore_ssl_errors"`

	CustomHTTPHeaders map[string]string

	AlertContacts []MonitorAlertContact
}

type MonitorAlertContact

type MonitorAlertContact struct {
	ID         string `json:"id"`
	Recurrence int    `json:"recurrence"`
	Threshold  int    `json:"threshold"`
}

type MonitorCreateRequest

type MonitorCreateRequest struct {
	FriendlyName string
	URL          string
	Type         string
	Interval     int

	SubType string
	Port    int

	KeywordType  string
	KeywordValue string

	HTTPMethod   string
	HTTPUsername string
	HTTPPassword string
	HTTPAuthType string

	IgnoreSSLErrors bool

	AlertContacts []MonitorRequestAlertContact

	CustomHTTPHeaders map[string]string
}

type MonitorRequestAlertContact

type MonitorRequestAlertContact struct {
	ID         string
	Threshold  int
	Recurrence int
}

type MonitorUpdateRequest

type MonitorUpdateRequest struct {
	ID           int
	FriendlyName string
	URL          string
	Type         string
	Interval     int

	SubType string
	Port    int

	KeywordType  string
	KeywordValue string

	HTTPMethod   string
	HTTPUsername string
	HTTPPassword string
	HTTPAuthType string

	IgnoreSSLErrors bool

	AlertContacts []MonitorRequestAlertContact

	CustomHTTPHeaders map[string]string
}

type StatusPage

type StatusPage struct {
	ID           int
	FriendlyName string `json:"friendly_name"`
	// CustomDomain string `json:"custom_domain"`
	StandardURL string `json:"standard_url"`
	CustomURL   string `json:"custom_url"`
	Sort        string
	Status      string
	DNSAddress  string
	Monitors    []int `json:"monitors"`
}

type StatusPageCreateRequest

type StatusPageCreateRequest struct {
	FriendlyName string
	CustomDomain string
	Password     string
	Monitors     []int
	Status       string
	Sort         string
}

type StatusPageUpdateRequest

type StatusPageUpdateRequest struct {
	ID           int
	FriendlyName string
	CustomDomain string
	Password     string
	Monitors     []int
	Status       string
	Sort         string
}

type UptimeRobotApiClient

type UptimeRobotApiClient struct {
	// contains filtered or unexported fields
}

func New

func New(apiKey string) UptimeRobotApiClient

func (UptimeRobotApiClient) CreateAlertContact

func (client UptimeRobotApiClient) CreateAlertContact(req AlertContactCreateRequest) (ac AlertContact, err error)

func (UptimeRobotApiClient) CreateMonitor

func (client UptimeRobotApiClient) CreateMonitor(req MonitorCreateRequest) (m Monitor, err error)

func (UptimeRobotApiClient) CreateStatusPage

func (client UptimeRobotApiClient) CreateStatusPage(req StatusPageCreateRequest) (sp StatusPage, err error)

CreateStatusPage creates a new status page

func (UptimeRobotApiClient) DeleteAlertContact

func (client UptimeRobotApiClient) DeleteAlertContact(id string) (err error)

func (UptimeRobotApiClient) DeleteMonitor

func (client UptimeRobotApiClient) DeleteMonitor(id int) (err error)

func (UptimeRobotApiClient) DeleteStatusPage

func (client UptimeRobotApiClient) DeleteStatusPage(id int) (err error)

DeleteStatusPage updates an existing status page

func (UptimeRobotApiClient) GetAccountDetails

func (client UptimeRobotApiClient) GetAccountDetails() (acc Account, err error)

func (UptimeRobotApiClient) GetAlertContact

func (client UptimeRobotApiClient) GetAlertContact(id string) (ac AlertContact, err error)

func (UptimeRobotApiClient) GetAlertContacts

func (client UptimeRobotApiClient) GetAlertContacts() (acs []AlertContact, err error)

func (UptimeRobotApiClient) GetMonitor

func (client UptimeRobotApiClient) GetMonitor(id int) (m Monitor, err error)

func (UptimeRobotApiClient) GetMonitorIDs

func (client UptimeRobotApiClient) GetMonitorIDs(friendlyName string) (ids []int, err error)

func (UptimeRobotApiClient) GetStatusPage

func (client UptimeRobotApiClient) GetStatusPage(id int) (sp StatusPage, err error)

func (UptimeRobotApiClient) MakeCall

func (client UptimeRobotApiClient) MakeCall(
	endpoint string,
	params string,
) (map[string]interface{}, error)

func (UptimeRobotApiClient) UpdateAlertContact

func (client UptimeRobotApiClient) UpdateAlertContact(req AlertContactUpdateRequest) (err error)

func (UptimeRobotApiClient) UpdateMonitor

func (client UptimeRobotApiClient) UpdateMonitor(req MonitorUpdateRequest) (m Monitor, err error)

func (UptimeRobotApiClient) UpdateStatusPage

func (client UptimeRobotApiClient) UpdateStatusPage(req StatusPageUpdateRequest) (sp StatusPage, err error)

UpdateStatusPage updates an existing status page

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL