icinga

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DowntimeEndpoint string = "/v1/objects/downtimes"
View Source
const HostEndpoint string = "/v1/objects/hosts"
View Source
const RemoveDowntimeEndpoint string = "/v1/actions/remove-downtime"
View Source
const ScheduleDowntimeEndpoint string = "/v1/actions/schedule-downtime"
View Source
const ServiceEndpoint string = "/v1/objects/services"

Variables

This section is empty.

Functions

func CreateDowntimePayload

func CreateDowntimePayload(message, author string, downConfig Downtime) (string, error)

func CreateHostPayload

func CreateHostPayload(server, path, role string) (string, error)

func CreateRequest

func CreateRequest(command, url, payload string, verbose, skipTls bool, config Configuration)

func ExecuteRequest

func ExecuteRequest(client *http.Client, req *http.Request)

func SendCommand

func SendCommand(command, server, objecttype string, config Configuration, payload string, skipTls, verbose, dryrun bool)

func ShowConfig

func ShowConfig(config Configuration)

Types

type Configuration

type Configuration struct {
	Access   string `yaml:"access"`
	Api      string `yaml:"api"`
	Author   string `yaml:"author"`
	Port     string
	Host     string
	Name     string
	User     string
	Password string
}

func BuildConfig

func BuildConfig(apiFlag, userFlag, passwordFlag, authorFlag string, verbose, save bool) Configuration

type Downtime

type Downtime struct {
	Begin    time.Time
	Duration time.Duration
	End      time.Time
}

func BuildDowntime

func BuildDowntime(duration, start string) Downtime

type PayloadObject

type PayloadObject struct {
	Url     string
	Content map[string]string
}

Jump to

Keyboard shortcuts

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