command

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2017 License: MPL-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Commands is the mapping of all the available Consul commands.

Functions

This section is empty.

Types

type AgentCommand added in v0.8.5

type AgentCommand struct {
	BaseCommand
	Revision          string
	Version           string
	VersionPrerelease string
	HumanVersion      string
	ShutdownCh        <-chan struct{}
	// contains filtered or unexported fields
}

AgentCommand is a Command implementation that runs a Consul agent. The command will not end unless a shutdown message is sent on the ShutdownCh. If two messages are sent on the ShutdownCh it will forcibly exit.

func (*AgentCommand) Help added in v0.8.5

func (cmd *AgentCommand) Help() string

func (*AgentCommand) Run added in v0.8.5

func (cmd *AgentCommand) Run(args []string) int

func (*AgentCommand) Synopsis added in v0.8.5

func (cmd *AgentCommand) Synopsis() string

type BaseCommand added in v0.8.5

type BaseCommand struct {
	UI    cli.Ui
	Flags FlagSetFlags
	// contains filtered or unexported fields
}

func (*BaseCommand) HTTPAddr added in v0.8.5

func (c *BaseCommand) HTTPAddr() string

func (*BaseCommand) HTTPClient added in v0.8.5

func (c *BaseCommand) HTTPClient() (*api.Client, error)

HTTPClient returns a client with the parsed flags. It panics if the command does not accept HTTP flags or if the flags have not been parsed.

func (*BaseCommand) HTTPDatacenter added in v0.8.5

func (c *BaseCommand) HTTPDatacenter() string

func (*BaseCommand) HTTPStale added in v0.8.5

func (c *BaseCommand) HTTPStale() bool

func (*BaseCommand) HTTPToken added in v0.8.5

func (c *BaseCommand) HTTPToken() string

func (*BaseCommand) Help added in v0.8.5

func (c *BaseCommand) Help() string

Help returns the help for this flagSet.

func (*BaseCommand) HideFlags added in v0.8.5

func (c *BaseCommand) HideFlags(flags ...string)

HideFlags is used to set hidden flags that will not be shown in help text

func (*BaseCommand) NewFlagSet added in v0.8.5

func (c *BaseCommand) NewFlagSet(command cli.Command) *flag.FlagSet

NewFlagSet creates a new flag set for the given command. It automatically generates help output and adds the appropriate API flags.

func (*BaseCommand) Parse added in v0.8.5

func (c *BaseCommand) Parse(args []string) error

Parse is used to parse the underlying flag set.

type ByMemberName added in v0.6.0

type ByMemberName []*consulapi.AgentMember

so we can sort members by name

func (ByMemberName) Len added in v0.6.0

func (m ByMemberName) Len() int

func (ByMemberName) Less added in v0.6.0

func (m ByMemberName) Less(i, j int) bool

func (ByMemberName) Swap added in v0.6.0

func (m ByMemberName) Swap(i, j int)

type CatalogCommand added in v0.9.0

type CatalogCommand struct {
	BaseCommand
}

func (*CatalogCommand) Help added in v0.9.0

func (c *CatalogCommand) Help() string

func (*CatalogCommand) Run added in v0.9.0

func (c *CatalogCommand) Run(args []string) int

func (*CatalogCommand) Synopsis added in v0.9.0

func (c *CatalogCommand) Synopsis() string

type CatalogListDatacentersCommand added in v0.9.0

type CatalogListDatacentersCommand struct {
	BaseCommand
}

func (*CatalogListDatacentersCommand) Help added in v0.9.0

func (*CatalogListDatacentersCommand) Run added in v0.9.0

func (c *CatalogListDatacentersCommand) Run(args []string) int

func (*CatalogListDatacentersCommand) Synopsis added in v0.9.0

func (c *CatalogListDatacentersCommand) Synopsis() string

type CatalogListNodesCommand added in v0.9.0

type CatalogListNodesCommand struct {
	BaseCommand
}

CatalogListNodesCommand is a Command implementation that is used to fetch all the nodes in the catalog.

func (*CatalogListNodesCommand) Help added in v0.9.0

func (c *CatalogListNodesCommand) Help() string

func (*CatalogListNodesCommand) Run added in v0.9.0

func (c *CatalogListNodesCommand) Run(args []string) int

func (*CatalogListNodesCommand) Synopsis added in v0.9.0

func (c *CatalogListNodesCommand) Synopsis() string

type CatalogListServicesCommand added in v0.9.0

type CatalogListServicesCommand struct {
	BaseCommand
}

CatalogListServicesCommand is a Command implementation that is used to fetch all the datacenters the agent knows about.

func (*CatalogListServicesCommand) Help added in v0.9.0

func (*CatalogListServicesCommand) Run added in v0.9.0

func (c *CatalogListServicesCommand) Run(args []string) int

func (*CatalogListServicesCommand) Synopsis added in v0.9.0

func (c *CatalogListServicesCommand) Synopsis() string

type ConfigTestCommand added in v0.5.1

type ConfigTestCommand struct {
	BaseCommand
}

ConfigTestCommand is a Command implementation that is used to verify config files

func (*ConfigTestCommand) Help added in v0.5.1

func (c *ConfigTestCommand) Help() string

func (*ConfigTestCommand) Run added in v0.5.1

func (c *ConfigTestCommand) Run(args []string) int

func (*ConfigTestCommand) Synopsis added in v0.5.1

func (c *ConfigTestCommand) Synopsis() string

type EventCommand added in v0.4.0

type EventCommand struct {
	BaseCommand
}

EventCommand is a Command implementation that is used to fire new events

func (*EventCommand) Help added in v0.4.0

func (c *EventCommand) Help() string

func (*EventCommand) Run added in v0.4.0

func (c *EventCommand) Run(args []string) int

func (*EventCommand) Synopsis added in v0.4.0

func (c *EventCommand) Synopsis() string

type ExecCommand added in v0.4.0

type ExecCommand struct {
	BaseCommand

	ShutdownCh <-chan struct{}
	// contains filtered or unexported fields
}

ExecCommand is a Command implementation that is used to do remote execution of commands

func (*ExecCommand) Help added in v0.4.0

func (c *ExecCommand) Help() string

func (*ExecCommand) Run added in v0.4.0

func (c *ExecCommand) Run(args []string) int

func (*ExecCommand) Synopsis added in v0.4.0

func (c *ExecCommand) Synopsis() string

type FlagSetFlags added in v0.8.5

type FlagSetFlags uint

FlagSetFlags is an enum to define what flags are present in the default FlagSet returned.

const (
	FlagSetNone       FlagSetFlags = 1 << iota
	FlagSetClientHTTP FlagSetFlags = 1 << iota
	FlagSetServerHTTP FlagSetFlags = 1 << iota

	FlagSetHTTP = FlagSetClientHTTP | FlagSetServerHTTP
)

type ForceLeaveCommand

type ForceLeaveCommand struct {
	BaseCommand
}

ForceLeaveCommand is a Command implementation that tells a running Consul to force a member to enter the "left" state.

func (*ForceLeaveCommand) Help

func (c *ForceLeaveCommand) Help() string

func (*ForceLeaveCommand) Run

func (c *ForceLeaveCommand) Run(args []string) int

func (*ForceLeaveCommand) Synopsis

func (c *ForceLeaveCommand) Synopsis() string

type InfoCommand

type InfoCommand struct {
	BaseCommand
}

InfoCommand is a Command implementation that queries a running Consul agent for various debugging statistics for operators

func (*InfoCommand) Help

func (c *InfoCommand) Help() string

func (*InfoCommand) Run

func (c *InfoCommand) Run(args []string) int

func (*InfoCommand) Synopsis

func (c *InfoCommand) Synopsis() string

type JoinCommand

type JoinCommand struct {
	BaseCommand
}

JoinCommand is a Command implementation that tells a running Consul agent to join another.

func (*JoinCommand) Help

func (c *JoinCommand) Help() string

func (*JoinCommand) Run

func (c *JoinCommand) Run(args []string) int

func (*JoinCommand) Synopsis

func (c *JoinCommand) Synopsis() string

type KVCommand added in v0.7.1

type KVCommand struct {
	BaseCommand
}

KVCommand is a Command implementation that just shows help for the subcommands nested below it.

func (*KVCommand) Help added in v0.7.1

func (c *KVCommand) Help() string

func (*KVCommand) Run added in v0.7.1

func (c *KVCommand) Run(args []string) int

func (*KVCommand) Synopsis added in v0.7.1

func (c *KVCommand) Synopsis() string

type KVDeleteCommand added in v0.7.1

type KVDeleteCommand struct {
	BaseCommand
}

KVDeleteCommand is a Command implementation that is used to delete a key or prefix of keys from the key-value store.

func (*KVDeleteCommand) Help added in v0.7.1

func (c *KVDeleteCommand) Help() string

func (*KVDeleteCommand) Run added in v0.7.1

func (c *KVDeleteCommand) Run(args []string) int

func (*KVDeleteCommand) Synopsis added in v0.7.1

func (c *KVDeleteCommand) Synopsis() string

type KVExportCommand added in v0.7.3

type KVExportCommand struct {
	BaseCommand
}

KVExportCommand is a Command implementation that is used to export a KV tree as JSON

func (*KVExportCommand) Help added in v0.7.3

func (c *KVExportCommand) Help() string

func (*KVExportCommand) Run added in v0.7.3

func (c *KVExportCommand) Run(args []string) int

func (*KVExportCommand) Synopsis added in v0.7.3

func (c *KVExportCommand) Synopsis() string

type KVGetCommand added in v0.7.1

type KVGetCommand struct {
	BaseCommand
}

KVGetCommand is a Command implementation that is used to fetch the value of a key from the key-value store.

func (*KVGetCommand) Help added in v0.7.1

func (c *KVGetCommand) Help() string

func (*KVGetCommand) Run added in v0.7.1

func (c *KVGetCommand) Run(args []string) int

func (*KVGetCommand) Synopsis added in v0.7.1

func (c *KVGetCommand) Synopsis() string

type KVImportCommand added in v0.7.3

type KVImportCommand struct {
	BaseCommand
	// contains filtered or unexported fields
}

KVImportCommand is a Command implementation that is used to import a KV tree stored as JSON

func (*KVImportCommand) Help added in v0.7.3

func (c *KVImportCommand) Help() string

func (*KVImportCommand) Run added in v0.7.3

func (c *KVImportCommand) Run(args []string) int

func (*KVImportCommand) Synopsis added in v0.7.3

func (c *KVImportCommand) Synopsis() string

type KVPutCommand added in v0.7.1

type KVPutCommand struct {
	BaseCommand
	// contains filtered or unexported fields
}

KVPutCommand is a Command implementation that is used to write data to the key-value store.

func (*KVPutCommand) Help added in v0.7.1

func (c *KVPutCommand) Help() string

func (*KVPutCommand) Run added in v0.7.1

func (c *KVPutCommand) Run(args []string) int

func (*KVPutCommand) Synopsis added in v0.7.1

func (c *KVPutCommand) Synopsis() string

type KeygenCommand

type KeygenCommand struct {
	BaseCommand
}

KeygenCommand is a Command implementation that generates an encryption key for use in `consul agent`.

func (*KeygenCommand) Help

func (c *KeygenCommand) Help() string

func (*KeygenCommand) Run

func (c *KeygenCommand) Run(args []string) int

func (*KeygenCommand) Synopsis

func (c *KeygenCommand) Synopsis() string

type KeyringCommand added in v0.5.0

type KeyringCommand struct {
	BaseCommand
}

KeyringCommand is a Command implementation that handles querying, installing, and removing gossip encryption keys from a keyring.

func (*KeyringCommand) Help added in v0.5.0

func (c *KeyringCommand) Help() string

func (*KeyringCommand) Run added in v0.5.0

func (c *KeyringCommand) Run(args []string) int

func (*KeyringCommand) Synopsis added in v0.5.0

func (c *KeyringCommand) Synopsis() string

type LeaveCommand

type LeaveCommand struct {
	BaseCommand
}

LeaveCommand is a Command implementation that instructs the Consul agent to gracefully leave the cluster

func (*LeaveCommand) Help

func (c *LeaveCommand) Help() string

func (*LeaveCommand) Run

func (c *LeaveCommand) Run(args []string) int

func (*LeaveCommand) Synopsis

func (c *LeaveCommand) Synopsis() string

type LockCommand added in v0.5.0

type LockCommand struct {
	BaseCommand

	ShutdownCh <-chan struct{}
	// contains filtered or unexported fields
}

LockCommand is a Command implementation that is used to setup a "lock" which manages lock acquisition and invokes a sub-process

func (*LockCommand) Help added in v0.5.0

func (c *LockCommand) Help() string

func (*LockCommand) Run added in v0.5.0

func (c *LockCommand) Run(args []string) int

func (*LockCommand) Synopsis added in v0.5.0

func (c *LockCommand) Synopsis() string

type LockUnlock added in v0.5.0

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

LockUnlock is used to abstract over the differences between a lock and a semaphore.

type MaintCommand added in v0.5.0

type MaintCommand struct {
	BaseCommand
}

MaintCommand is a Command implementation that enables or disables node or service maintenance mode.

func (*MaintCommand) Help added in v0.5.0

func (c *MaintCommand) Help() string

func (*MaintCommand) Run added in v0.5.0

func (c *MaintCommand) Run(args []string) int

func (*MaintCommand) Synopsis added in v0.5.0

func (c *MaintCommand) Synopsis() string

type MembersCommand

type MembersCommand struct {
	BaseCommand
}

MembersCommand is a Command implementation that queries a running Consul agent what members are part of the cluster currently.

func (*MembersCommand) Help

func (c *MembersCommand) Help() string

func (*MembersCommand) Run

func (c *MembersCommand) Run(args []string) int

func (*MembersCommand) Synopsis

func (c *MembersCommand) Synopsis() string

type MonitorCommand

type MonitorCommand struct {
	BaseCommand

	ShutdownCh <-chan struct{}
	// contains filtered or unexported fields
}

MonitorCommand is a Command implementation that queries a running Consul agent what members are part of the cluster currently.

func (*MonitorCommand) Help

func (c *MonitorCommand) Help() string

func (*MonitorCommand) Run

func (c *MonitorCommand) Run(args []string) int

func (*MonitorCommand) Synopsis

func (c *MonitorCommand) Synopsis() string

type OperatorAutopilotCommand added in v0.8.0

type OperatorAutopilotCommand struct {
	BaseCommand
}

func (*OperatorAutopilotCommand) Help added in v0.8.0

func (c *OperatorAutopilotCommand) Help() string

func (*OperatorAutopilotCommand) Run added in v0.8.0

func (c *OperatorAutopilotCommand) Run(args []string) int

func (*OperatorAutopilotCommand) Synopsis added in v0.8.0

func (c *OperatorAutopilotCommand) Synopsis() string

type OperatorAutopilotGetCommand added in v0.8.0

type OperatorAutopilotGetCommand struct {
	BaseCommand
}

func (*OperatorAutopilotGetCommand) Help added in v0.8.0

func (*OperatorAutopilotGetCommand) Run added in v0.8.0

func (c *OperatorAutopilotGetCommand) Run(args []string) int

func (*OperatorAutopilotGetCommand) Synopsis added in v0.8.0

func (c *OperatorAutopilotGetCommand) Synopsis() string

type OperatorAutopilotSetCommand added in v0.8.0

type OperatorAutopilotSetCommand struct {
	BaseCommand
}

func (*OperatorAutopilotSetCommand) Help added in v0.8.0

func (*OperatorAutopilotSetCommand) Run added in v0.8.0

func (c *OperatorAutopilotSetCommand) Run(args []string) int

func (*OperatorAutopilotSetCommand) Synopsis added in v0.8.0

func (c *OperatorAutopilotSetCommand) Synopsis() string

type OperatorCommand added in v0.7.0

type OperatorCommand struct {
	BaseCommand
}

OperatorCommand is used to provide various low-level tools for Consul operators.

func (*OperatorCommand) Help added in v0.7.0

func (c *OperatorCommand) Help() string

func (*OperatorCommand) Run added in v0.7.0

func (c *OperatorCommand) Run(args []string) int

func (*OperatorCommand) Synopsis added in v0.7.0

func (c *OperatorCommand) Synopsis() string

Synopsis returns a one-line description of this command.

type OperatorRaftCommand added in v0.8.0

type OperatorRaftCommand struct {
	BaseCommand
}

func (*OperatorRaftCommand) Help added in v0.8.0

func (c *OperatorRaftCommand) Help() string

func (*OperatorRaftCommand) Run added in v0.8.0

func (c *OperatorRaftCommand) Run(args []string) int

func (*OperatorRaftCommand) Synopsis added in v0.8.0

func (c *OperatorRaftCommand) Synopsis() string

type OperatorRaftListCommand added in v0.8.0

type OperatorRaftListCommand struct {
	BaseCommand
}

func (*OperatorRaftListCommand) Help added in v0.8.0

func (c *OperatorRaftListCommand) Help() string

func (*OperatorRaftListCommand) Run added in v0.8.0

func (c *OperatorRaftListCommand) Run(args []string) int

func (*OperatorRaftListCommand) Synopsis added in v0.8.0

func (c *OperatorRaftListCommand) Synopsis() string

type OperatorRaftRemoveCommand added in v0.8.0

type OperatorRaftRemoveCommand struct {
	BaseCommand
}

func (*OperatorRaftRemoveCommand) Help added in v0.8.0

func (*OperatorRaftRemoveCommand) Run added in v0.8.0

func (c *OperatorRaftRemoveCommand) Run(args []string) int

func (*OperatorRaftRemoveCommand) Synopsis added in v0.8.0

func (c *OperatorRaftRemoveCommand) Synopsis() string

type RTTCommand added in v0.6.0

type RTTCommand struct {
	BaseCommand
}

RTTCommand is a Command implementation that allows users to query the estimated round trip time between nodes using network coordinates.

func (*RTTCommand) Help added in v0.6.0

func (c *RTTCommand) Help() string

func (*RTTCommand) Run added in v0.6.0

func (c *RTTCommand) Run(args []string) int

func (*RTTCommand) Synopsis added in v0.6.0

func (c *RTTCommand) Synopsis() string

type ReloadCommand added in v0.3.0

type ReloadCommand struct {
	BaseCommand
}

ReloadCommand is a Command implementation that instructs the Consul agent to reload configurations

func (*ReloadCommand) Help added in v0.3.0

func (c *ReloadCommand) Help() string

func (*ReloadCommand) Run added in v0.3.0

func (c *ReloadCommand) Run(args []string) int

func (*ReloadCommand) Synopsis added in v0.3.0

func (c *ReloadCommand) Synopsis() string

type SnapshotCommand added in v0.7.1

type SnapshotCommand struct {
	UI cli.Ui
}

SnapshotCommand is a Command implementation that just shows help for the subcommands nested below it.

func (*SnapshotCommand) Help added in v0.7.1

func (c *SnapshotCommand) Help() string

func (*SnapshotCommand) Run added in v0.7.1

func (c *SnapshotCommand) Run(args []string) int

func (*SnapshotCommand) Synopsis added in v0.7.1

func (c *SnapshotCommand) Synopsis() string

type SnapshotInspectCommand added in v0.7.1

type SnapshotInspectCommand struct {
	BaseCommand
}

SnapshotInspectCommand is a Command implementation that is used to display metadata about a snapshot file

func (*SnapshotInspectCommand) Help added in v0.7.1

func (c *SnapshotInspectCommand) Help() string

func (*SnapshotInspectCommand) Run added in v0.7.1

func (c *SnapshotInspectCommand) Run(args []string) int

func (*SnapshotInspectCommand) Synopsis added in v0.7.1

func (c *SnapshotInspectCommand) Synopsis() string

type SnapshotRestoreCommand added in v0.7.1

type SnapshotRestoreCommand struct {
	BaseCommand
}

SnapshotRestoreCommand is a Command implementation that is used to restore the state of the Consul servers for disaster recovery.

func (*SnapshotRestoreCommand) Help added in v0.7.1

func (c *SnapshotRestoreCommand) Help() string

func (*SnapshotRestoreCommand) Run added in v0.7.1

func (c *SnapshotRestoreCommand) Run(args []string) int

func (*SnapshotRestoreCommand) Synopsis added in v0.7.1

func (c *SnapshotRestoreCommand) Synopsis() string

type SnapshotSaveCommand added in v0.7.1

type SnapshotSaveCommand struct {
	BaseCommand
}

SnapshotSaveCommand is a Command implementation that is used to save the state of the Consul servers for disaster recovery.

func (*SnapshotSaveCommand) Help added in v0.7.1

func (c *SnapshotSaveCommand) Help() string

func (*SnapshotSaveCommand) Run added in v0.7.1

func (c *SnapshotSaveCommand) Run(args []string) int

func (*SnapshotSaveCommand) Synopsis added in v0.7.1

func (c *SnapshotSaveCommand) Synopsis() string

type TargetedUI added in v0.8.2

type TargetedUI struct {
	Target string
	UI     cli.Ui
}

TargetedUI is a UI that wraps another UI implementation and modifies the output to indicate a specific target. Specifically, all Say output is prefixed with the target name. Message output is not prefixed but is offset by the length of the target so that output is lined up properly with Say output. Machine-readable output has the proper target set.

func (*TargetedUI) Ask added in v0.8.2

func (u *TargetedUI) Ask(query string) (string, error)

func (*TargetedUI) Error added in v0.8.2

func (u *TargetedUI) Error(message string)

func (*TargetedUI) Info added in v0.8.2

func (u *TargetedUI) Info(message string)

func (*TargetedUI) Output added in v0.8.2

func (u *TargetedUI) Output(message string)

type ValidateCommand added in v0.8.0

type ValidateCommand struct {
	BaseCommand
}

ValidateCommand is a Command implementation that is used to verify config files

func (*ValidateCommand) Help added in v0.8.0

func (c *ValidateCommand) Help() string

func (*ValidateCommand) Run added in v0.8.0

func (c *ValidateCommand) Run(args []string) int

func (*ValidateCommand) Synopsis added in v0.8.0

func (c *ValidateCommand) Synopsis() string

type VersionCommand

type VersionCommand struct {
	HumanVersion string
	UI           cli.Ui
}

VersionCommand is a Command implementation prints the version.

func (*VersionCommand) Help

func (c *VersionCommand) Help() string

func (*VersionCommand) Run

func (c *VersionCommand) Run(_ []string) int

func (*VersionCommand) Synopsis

func (c *VersionCommand) Synopsis() string

type WatchCommand added in v0.4.0

type WatchCommand struct {
	BaseCommand
	ShutdownCh <-chan struct{}
}

WatchCommand is a Command implementation that is used to setup a "watch" which uses a sub-process

func (*WatchCommand) Help added in v0.4.0

func (c *WatchCommand) Help() string

func (*WatchCommand) Run added in v0.4.0

func (c *WatchCommand) Run(args []string) int

func (*WatchCommand) Synopsis added in v0.4.0

func (c *WatchCommand) Synopsis() string

Jump to

Keyboard shortcuts

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