Documentation ¶
Index ¶
- Variables
- func CheckConfig(args []string) error
- func CommandWrapper(command func(*cobra.Command, []string) error) func(*cobra.Command, []string)
- func Execute()
- func GetAlertmanagerURL() (*url.URL, error)
- func TypeMatcher(matcher labels.Matcher) (types.Matcher, error)
- func TypeMatchers(matchers []labels.Matcher) (types.Matchers, error)
- type ByAlphabetical
- type Config
- type MeshStatus
- type PeerStatus
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 alertmanager tool will read a config file from the --config cli argument, AMTOOL_CONFIG environment variable or
from one of two default config locations. Valid config file formats are JSON, TOML, YAML, HCL and Java Properties, use
whatever makes sense for your project.
The default config file paths are $HOME/.config/amtool/config.yml or /etc/amtool/config.yml
The accepted config 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 CheckConfig ¶ added in v0.9.0
func CommandWrapper ¶
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 TypeMatcher ¶
Only valid for when you are going to add a silence Doesn't allow negative operators
Types ¶
type ByAlphabetical ¶
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 { ConfigYAML string `json:"configYAML"` 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 ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.