Documentation ¶
Overview ¶
Copyright © 2019 NAME HERE <EMAIL ADDRESS>
Copyright © 2019 NAME HERE <EMAIL ADDRESS>
Index ¶
- Variables
- func AskForConfirmation(s string, tries int, in io.Reader) bool
- func Completion(cmd *cobra.Command, args []string)
- func DELETE(resource, path, username, password string) (resp *resty.Response, err error)
- func Execute(version string)
- func FilesInDirectory(dirname string) (names []string)
- func GET(resource, path, username, password string) (resp *resty.Response, err error)
- func NewTable() *tablewriter.Table
- func POST(body interface{}, resource, path, username, password string) (resp *resty.Response, err error)
- func Version(cmd *cobra.Command, args []string)
- type Config
- type DeviceFacts
- type SystemDetails
Constants ¶
This section is empty.
Variables ¶
var RootCmd = &cobra.Command{
Use: "hb",
Short: "Healthbot Command Line Interface",
Long: `A tool for interacting with Healthbot over the REST API.
The intent with this tool is to provide bulk or aggregate functions, that
simplify interacting with Healthbot.
`,
}
RootCmd represents the base command when called without any subcommands
var ( // VERSION passed in as a build variable VERSION string )
Functions ¶
func AskForConfirmation ¶ added in v0.0.8
AskForConfirmation - console y/n
func Completion ¶
Completion is a helper function to allow passing arguments to other functions (so that they can be unit tested)
func Execute ¶
func Execute(version string)
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func FilesInDirectory ¶ added in v0.0.8
FilesInDirectory - returns a list of filenames for a given directory
func NewTable ¶ added in v0.0.7
func NewTable() *tablewriter.Table
NewTable - provides a blank table for rendering.
Types ¶
type Config ¶ added in v0.0.6
type Config struct { Directory string Resource string Username string Password string Erase string }
Config - bean for common provisioning configuration info
type DeviceFacts ¶ added in v0.0.6
type DeviceFacts []struct { DeviceID string `json:"device-id"` Facts struct { Hostname string `json:"hostname"` JunosInfo []struct { LastRebootReason string `json:"last-reboot-reason"` MastershipState string `json:"mastership-state"` Model string `json:"model"` Name string `json:"name"` Status string `json:"status"` UpTime string `json:"up-time"` } `json:"junos-info"` Platform string `json:"platform"` PlatformInfo []struct { Name string `json:"name"` Platform string `json:"platform"` } `json:"platform-info"` Product string `json:"product"` Release string `json:"release"` SerialNumber string `json:"serial-number"` } `json:"facts,omitempty"` }
DeviceFacts - Provides Device Facts
type SystemDetails ¶ added in v0.0.6
type SystemDetails struct { ServerTime string `json:"server-time"` Version string `json:"version"` }
SystemDetails - Provides some basic hb info