cli

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2017 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "amtool",
	Short: "Alertmanager CLI",
	Long: `View and modify the current Alertmanager state.

[Config File]

The alertmanger tool will read a config file from the --config cli argument, AMTOOL_CONFIG environment variable,
$HOME/.amtool.yml or /etc/amtool.yml the options are as follows

	alertmanager.url
		Set a default alertmanager url for each request

	author
		Set a default author value for new silences. If this argument is not specified then the username will be used

	comment_required
		Require a comment on silence creation

	output
		Set a default output type. Options are (simple, extended, json)
	`,
}

RootCmd represents the base command when called without any subcommands

Functions

func CommandWrapper

func CommandWrapper(command func(*cobra.Command, []string) error) func(*cobra.Command, []string)

func Execute

func Execute()

Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func GetAlertmanagerURL

func GetAlertmanagerURL() (*url.URL, error)

func TypeMatcher

func TypeMatcher(matcher labels.Matcher) (types.Matcher, error)

Only valid for when you are going to add a silence Doesn't allow negative operators

func TypeMatchers

func TypeMatchers(matchers []labels.Matcher) (types.Matchers, error)

Only valid for when you are going to add a silence

Types

type ByAlphabetical

type ByAlphabetical []labels.Matcher

func (ByAlphabetical) Len

func (s ByAlphabetical) Len() int

func (ByAlphabetical) Less

func (s ByAlphabetical) Less(i, j int) bool

func (ByAlphabetical) Swap

func (s ByAlphabetical) Swap(i, j int)

type Config

type Config struct {
	Config      string                 `json:"config"`
	ConfigJSON  config.Config          `json:configJSON`
	MeshStatus  map[string]interface{} `json:"meshStatus"`
	VersionInfo map[string]string      `json:"versionInfo"`
	Uptime      time.Time              `json:"uptime"`
}

Config is the response type of alertmanager config endpoint Duped in cli/format needs to be moved to common/model

type MeshStatus

type MeshStatus struct {
	Name     string       `json:"name"`
	NickName string       `json:"nickName"`
	Peers    []PeerStatus `json:"peerStatus"`
}

type PeerStatus

type PeerStatus struct {
	Name     string `json:"name"`
	NickName string `json:"nickName"`
	UID      uint64 `uid`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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