lockgate

package module
v0.0.0-...-3c0ba4a Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2014 License: MIT Imports: 17 Imported by: 0

README

lockgate

CloudStack CLI inspired by tugboat

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConfigDir          = expandPath(path.Join("~", ".lg"))
	ConfigFile         = "config.yaml"
	VirtualMachineKeys = []string{
		"id",
		"name",
		"displayname",
		"state",
		"zonename",
		"templatename",
		"serviceofferingname",
	}
	DefaultConfig = Config{
		Account: AccountConfig{
			URL:       "http://localhost:8080/client/api",
			Username:  "admin",
			Password:  "password",
			APIKey:    "",
			SecretKey: "",
		},
		Commands: map[string]CommandConfig{
			"vm list": CommandConfig{
				Options: map[string]interface{}{},
				Keys:    VirtualMachineKeys,
			},
			"vm start": CommandConfig{
				Options: map[string]interface{}{},
				Keys:    VirtualMachineKeys,
			},
			"vm stop": CommandConfig{
				Options: map[string]interface{}{},
				Keys:    VirtualMachineKeys,
			},
			"vm deploy": CommandConfig{
				Options: map[string]interface{}{},
				Keys:    VirtualMachineKeys,
			},
			"vm destroy": CommandConfig{
				Options: map[string]interface{}{},
				Keys:    VirtualMachineKeys,
			},
			"network list": CommandConfig{
				Options: map[string]interface{}{},
				Keys: []string{
					"id",
					"name",
					"networkofferingname",
				},
			},
			"firewallrule list": CommandConfig{
				Options: map[string]interface{}{},
				Keys: []string{
					"id",
					"cidrlist",
					"protocol",
					"startport",
					"endport",
					"icmpcode",
					"icmptype",
				},
			},
			"portforwardingrule list": CommandConfig{
				Options: map[string]interface{}{},
				Keys: []string{
					"id",
					"ipaddress",
					"virtualmachinename",
					"protocol",
					"publicport",
					"publicendport",
					"privateport",
					"privateendport",
				},
			},
			"serviceoffering list": CommandConfig{
				Options: map[string]interface{}{},
				Keys: []string{
					"id",
					"name",
					"cpunumber",
					"cpuspeed",
					"memory",
				},
			},
			"template list": CommandConfig{
				Options: map[string]interface{}{},
				Keys: []string{
					"id",
					"name",
					"displaytext",
				},
			},
			"ip list": CommandConfig{
				Options: map[string]interface{}{},
				Keys: []string{
					"id",
					"zonename",
					"issourcenat",
					"ipaddress",
				},
			},
			"zone list": CommandConfig{
				Options: map[string]interface{}{},
				Keys: []string{
					"id",
					"name",
				},
			},
		},
	}
)

Functions

func GetArgumentsFromStdin

func GetArgumentsFromStdin() []string

func GetClient

func GetClient(c *cli.Context) (*cloudstack.Client, error)

func GetConfigFilePath

func GetConfigFilePath(profile string) string

func GetProfile

func GetProfile(c *cli.Context) string

func PrettyPrint

func PrettyPrint(b []byte)

func SetLogLevel

func SetLogLevel(c *cli.Context)

Types

type AccountConfig

type AccountConfig struct {
	URL       string `yaml:"url"`
	Username  string `yaml:"username"`
	Password  string `yaml:"password"`
	APIKey    string `yaml:"apikey"`
	SecretKey string `yaml:"secretkey"`
}

type CommandConfig

type CommandConfig struct {
	Options map[string]interface{} `yaml:"options"`
	Keys    []string               `yaml:"keys"`
}

type Config

type Config struct {
	Account  AccountConfig            `yaml:"account"`
	Commands map[string]CommandConfig `yaml:"command"`
}

func LoadConfig

func LoadConfig(profile string) (*Config, error)

type Lister

type Lister interface {
	List(map[string]string) ([]interface{}, error)
}

type TabWriter

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

func GetTabWriter

func GetTabWriter(c *cli.Context) *TabWriter

func (*TabWriter) Print

func (tw *TabWriter) Print(xs interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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