commander

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateDirector

func GenerateDirector(boshDirector BoshDirector, loggerBosh boshlog.Logger) (boshdir.Director, error)

Types

type BoshDirector

type BoshDirector struct {
	Name         string  `yaml:"name"`
	ClientId     string  `yaml:"client_id"`
	ClientSecret string  `yaml:"client_secret"`
	Username     string  `yaml:"username"`
	Password     string  `yaml:"password"`
	DirectorUrl  string  `yaml:"director_url"`
	CACert       string  `yaml:"ca_cert"`
	CACertFile   string  `yaml:"ca_cert_file"`
	RefreshToken string  `yaml:"refresh_token,omitempty"`
	Gateway      Gateway `yaml:"gateway"`
}

func (*BoshDirector) LoadCaCertFile

func (boshDir *BoshDirector) LoadCaCertFile() error

func (*BoshDirector) UnmarshalYAML

func (c *BoshDirector) UnmarshalYAML(unmarshal func(interface{}) error) error

type BoshDirectors

type BoshDirectors []BoshDirector

func (BoshDirectors) FindDirector

func (boshDirs BoshDirectors) FindDirector(name string) BoshDirector

type BoshSshInstance

type BoshSshInstance struct {
	Deployment boshdir.Deployment
	Instance   boshdir.VMInfo
}

func (BoshSshInstance) String

func (i BoshSshInstance) String() string

type CommandRunner

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

func NewCommandRunner

func NewCommandRunner(boshCommanderScript *Script, loggerBosh boshlog.Logger) *CommandRunner

func (*CommandRunner) FindBoshSshInstances

func (a *CommandRunner) FindBoshSshInstances(boshDirector boshdir.Director, jobName Regexp, inDeplNames ...Regexp) ([]BoshSshInstance, error)

func (*CommandRunner) Run

func (a *CommandRunner) Run(director BoshDirector) error

func (*CommandRunner) RunCommandByInstance

func (a *CommandRunner) RunCommandByInstance(boshSshInstance BoshSshInstance, commands []string, connOpts boshssh.ConnectionOpts) error

func (*CommandRunner) RunCommandByInstances

func (a *CommandRunner) RunCommandByInstances(boshSshInstances []BoshSshInstance, commands []string, connOpts boshssh.ConnectionOpts) error

func (*CommandRunner) SshCommandErrToLog

func (a *CommandRunner) SshCommandErrToLog(err ssh.ErrCommandSsh)

func (*CommandRunner) SshOutputToLog

func (a *CommandRunner) SshOutputToLog(output string)

type Config

type Config struct {
	Environments Environments `yaml:"environments"`
}

func (*Config) UnmarshalYAML

func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

type Environment

type Environment struct {
	URL    string `yaml:"url"`
	CACert string `yaml:"ca_cert,omitempty"`

	Alias string `yaml:"alias,omitempty"`

	// Auth
	Username     string `yaml:"username,omitempty"`
	Password     string `yaml:"password,omitempty"`
	RefreshToken string `yaml:"refresh_token,omitempty"`
}

func (Environment) ToDirector

func (e Environment) ToDirector() BoshDirector

type Environments

type Environments []Environment

func (Environments) FindByNameOrUrl

func (envs Environments) FindByNameOrUrl(ident string) (Environment, error)

type Gateway

type Gateway struct {
	Username       string `yaml:"username"`
	Host           string `yaml:"host"`
	PrivateKeyPath string `yaml:"private_key_path"`
}

type Regexp

type Regexp struct {
	*regexp.Regexp
	Raw string
}

func (Regexp) MarshalYAML

func (re Regexp) MarshalYAML() (interface{}, error)

func (*Regexp) UnmarshalFlag

func (re *Regexp) UnmarshalFlag(data string) error

func (*Regexp) UnmarshalYAML

func (re *Regexp) UnmarshalYAML(unmarshal func(interface{}) error) error

type Regexps

type Regexps []Regexp

func (Regexps) MatchString

func (re Regexps) MatchString(match string) bool

type Script

type Script struct {
	JobMatch    Regexp   `yaml:"job_match"   long:"job-match"      short:"j"                 value-name:"JOB_MATCH"  description:"Job to target"`
	Deployments []Regexp `` /* 168-byte string literal not displayed */
	Sudo        bool     `` /* 139-byte string literal not displayed */
	Script      []string `yaml:"script"      long:"script"         short:"s"                 value-name:"SCRIPT"     description:"Scripts to run"`
	AfterAll    []string `` /* 181-byte string literal not displayed */
}

func (*Script) Check

func (c *Script) Check() error

func (*Script) UnmarshalYAML

func (c *Script) UnmarshalYAML(unmarshal func(interface{}) error) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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