Documentation
¶
Index ¶
- Constants
- func Debug(params ...interface{})
- func DisableDebugging()
- func EnableDebugging()
- func GetProfiles() []string
- func LoadCache(c *Config) interface{}
- type API
- type APIArg
- type Config
- func (c Config) CacheFile() string
- func (c *Config) GetAPIVerbMap() map[string][]*API
- func (c *Config) GetCache() map[string]*API
- func (c *Config) GetPrompt() string
- func (c *Config) LoadProfile(name string)
- func (c *Config) Name() string
- func (c *Config) PrintHeader()
- func (c *Config) SaveCache(response map[string]interface{})
- func (c *Config) StartSpinner(suffix string) *spinner.Spinner
- func (c *Config) StopSpinner(waiter *spinner.Spinner)
- func (c *Config) UpdateCache(response map[string]interface{}) interface{}
- func (c *Config) UpdateConfig(key string, value string, update bool)
- func (c *Config) Version() string
- type Core
- type ServerProfile
Constants ¶
View Source
const ( COLUMN = "column" CSV = "csv" JSON = "json" TABLE = "table" TEXT = "text" )
Output formats
View Source
const FAKE = "fake"
FAKE is used for fake CLI only options like filter=
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶
type API struct {
Name string
Verb string
Noun string
Args []*APIArg
RequiredArgs []string
Related []string
Async bool
Description string
ResponseKeys []string
}
API describes a CloudStack API
type APIArg ¶
type APIArg struct {
Name string
Type string
Related []string
Description string
Required bool
Length int
}
APIArg are the args passable to an API
type Config ¶
type Config struct {
Dir string
ConfigFile string
HistoryFile string
LogFile string
HasShell bool
Core *Core
ActiveProfile *ServerProfile
}
Config describes CLI config file and default options
func (*Config) GetAPIVerbMap ¶
GetAPIVerbMap returns API cache by verb
func (*Config) LoadProfile ¶
LoadProfile loads an existing profile
func (*Config) PrintHeader ¶
func (c *Config) PrintHeader()
PrintHeader prints startup message in CLI mode
func (*Config) StartSpinner ¶
StartSpinner starts and returns a waiting cursor that the CLI can use
func (*Config) StopSpinner ¶
StopSpinner stops the provided spinner if it is valid
func (*Config) UpdateCache ¶
UpdateCache uses auto-discovery data to update internal API cache
func (*Config) UpdateConfig ¶
UpdateConfig updates and saves config
type Core ¶
type Core struct {
Prompt string `ini:"prompt"`
AsyncBlock bool `ini:"asyncblock"`
Timeout int `ini:"timeout"`
Output string `ini:"output"`
VerifyCert bool `ini:"verifycert"`
ProfileName string `ini:"profile"`
}
Core block describes common options for the CLI
type ServerProfile ¶
type ServerProfile struct {
URL string `ini:"url"`
Username string `ini:"username"`
Password string `ini:"password"`
Domain string `ini:"domain"`
APIKey string `ini:"apikey"`
SecretKey string `ini:"secretkey"`
Client *http.Client `ini:"-"`
}
ServerProfile describes a management server
Click to show internal directories.
Click to hide internal directories.