cronitor

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Provider

func Provider() *schema.Provider

Types

type Client

type Client struct {
	ApiKey string
}

func (Client) Create

func (c Client) Create(m Monitor) (code *string, err error)

func (Client) Delete

func (c Client) Delete(code string) error

func (Client) Read

func (c Client) Read(code string) (*Monitor, error)

func (Client) Update

func (c Client) Update(code string, m Monitor) error

type Monitor

type Monitor struct {
	Code          string        `json:"code,omitempty"`
	Name          string        `json:"name"`
	Type          string        `json:"type"`
	Tags          []string      `json:"tags,omitempty"`
	Notifications Notifications `json:"notifications"`
	Rules         []Rule        `json:"rules"`
	Note          string        `json:"note"`
	Timezone      string        `json:"timezone"`
}

type Notifications

type Notifications struct {
	Phones    []string `json:"phones,omitempty"`
	Webhooks  []string `json:"webhooks,omitempty"`
	Emails    []string `json:"emails,omitempty"`
	Pagerduty []string `json:"pagerduty,omitempty"`
	Slack     []string `json:"slack,omitempty"`
	Templates []string `json:"templates,omitempty"`
}

type Rule

type Rule struct {
	RuleType             string `json:"rule_type"`
	Value                string `json:"value,omitempty"`
	TimeUnit             string `json:"time_unit,omitempty"`
	HoursToFollowupAlert int    `json:"hours_to_followup_alert,omitempty"`
	GraceSeconds         int    `json:"grace_seconds,omitempty"`
}

Jump to

Keyboard shortcuts

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