Documentation ¶
Index ¶
- func AristaEOSConnectWithSSH(d *NetDevice) error
- func ArubaAOSCXConnectWithSSH(d *NetDevice) error
- func CiscoASAConnectWithSSH(d *NetDevice) error
- func CiscoAireOSConnectWithSSH(d *NetDevice) error
- func CiscoIOSXRConnectWithSSH(d *NetDevice) error
- func CiscoNXOSConnectWithSSH(d *NetDevice) error
- func CiscoSMBConnectWithSSH(d *NetDevice) error
- func InitSSHParams(s *SSHParams)
- func InitTelnetParams(s *TelnetParams)
- func JuniperJunosConnectWithSSH(d *NetDevice) error
- func ReadSSH(stdOut io.Reader, expect *regexp.Regexp, timeout int64) string
- func ReadTelnet(r io.Reader, expect *regexp.Regexp, timeout int64) (string, error)
- func RunWithSSH(nd NetDevice, commands []string, ch chan data.Result, wg *sync.WaitGroup)
- func RunWithTelnet(nd NetDevice, commands []string, ch chan data.Result, wg *sync.WaitGroup)
- func SSHClientConfig(c data.Credentials, s SSHParams) (*ssh.ClientConfig, error)
- func SendCommandWithSSH(conn SSHConn, cmd string, expect *regexp.Regexp, timeout int64) (data.CommandOutput, error)
- func SendCommandWithTelnet(conn *telnet.Conn, cmd string, expect *regexp.Regexp, timeout int64) (data.CommandOutput, error)
- func SendCommandsWithSSH(conn SSHConn, commands []string, expect *regexp.Regexp, timeout int64) ([]data.CommandOutput, error)
- func SendCommandsWithTelnet(conn *telnet.Conn, commands []string, expect *regexp.Regexp, timeout int64) ([]data.CommandOutput, error)
- func WriteSSH(stdIn io.Writer, cmd string) (int, error)
- func WriteTelnet(w io.Writer, s string) error
- type Devices
- type NetDevice
- func NewAristaEOSDevice(d NetDevice) NetDevice
- func NewArubaAOSCXDevice(d NetDevice) NetDevice
- func NewCiscoASADevice(d NetDevice) NetDevice
- func NewCiscoAireOSDevice(d NetDevice) NetDevice
- func NewCiscoIOSXRDevice(d NetDevice) NetDevice
- func NewCiscoNXOSDevice(d NetDevice) NetDevice
- func NewCiscoSMBDevice(d NetDevice) NetDevice
- func NewJuniperJunosDevice(d NetDevice) NetDevice
- func (d *NetDevice) ConnectWithSSH() error
- func (d *NetDevice) ConnectWithTelnet() error
- func (d NetDevice) DisconnectSSH() error
- func (d NetDevice) DisconnectTelnet() error
- func (d NetDevice) SendCommandWithSSH(command string) data.Result
- func (d NetDevice) SendCommandWithTelnet(cmd string) data.Result
- func (d NetDevice) SendCommandsWithSSH(commands []string) data.Result
- func (d NetDevice) SendCommandsWithTelnet(commands []string) data.Result
- type SSHConn
- type SSHParams
- type TelnetParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AristaEOSConnectWithSSH ¶
func CiscoASAConnectWithSSH ¶
func CiscoNXOSConnectWithSSH ¶
func CiscoSMBConnectWithSSH ¶
func InitSSHParams ¶
func InitSSHParams(s *SSHParams)
func InitTelnetParams ¶
func InitTelnetParams(s *TelnetParams)
func ReadTelnet ¶
func RunWithSSH ¶
RunWithSSH is the entrypoint to run commands
func RunWithTelnet ¶
func SSHClientConfig ¶
func SSHClientConfig(c data.Credentials, s SSHParams) (*ssh.ClientConfig, error)
func SendCommandWithSSH ¶
func SendCommandWithTelnet ¶
func SendCommandsWithSSH ¶
func SendCommandsWithTelnet ¶
Types ¶
type Devices ¶
type Devices struct {
Devices []NetDevice `json:"devices"`
}
Devices holds a collection of Device structs
type NetDevice ¶
type NetDevice struct { IP string `json:"ip"` Name string `json:"name"` Vendor string `json:"vendor"` Platform string `json:"platform"` Connector string `json:"connector"` SSHParams `json:"sshParams"` TelnetParams `json:"telnetParams"` data.Variables `json:"variables"` Timeout int64 UserPromptRE *regexp.Regexp SuperUserPromptRE *regexp.Regexp ConfigPromtRE *regexp.Regexp SSHConn TelnetConn *telnet.Conn data.Credentials }
func NewAristaEOSDevice ¶
NewAristaEOSDevice takes a NetDevice and initializes a AristaEOSDevice.
func NewArubaAOSCXDevice ¶
NewArubaAOSCXDevice takes a NetDevice and initializes a ArubaAOSCXDevice.
func NewCiscoASADevice ¶
NewCiscoASADevice takes a NetDevice and initializes a CiscoASADevice.
func NewCiscoAireOSDevice ¶
NewCiscoAireOSDevice takes a NetDevice and initializes a CiscoAireOSDevice.
func NewCiscoIOSXRDevice ¶
NewCiscoIOSXRDevice takes a NetDevice and initializes a CiscoIOSXRDevice.
func NewCiscoNXOSDevice ¶
NewCiscoNXOSDevice takes a NetDevice and initializes a CiscoNXOSDevice.
func NewCiscoSMBDevice ¶
NewCiscoSMBDevice takes a NetDevice and initializes a CiscoSMBDevice.
func NewJuniperJunosDevice ¶
NewJuniperJunosDevice takes a NetDevice and initializes a JuniperJunosDevice.
func (*NetDevice) ConnectWithSSH ¶
func (*NetDevice) ConnectWithTelnet ¶
func (NetDevice) DisconnectSSH ¶
func (NetDevice) DisconnectTelnet ¶
func (NetDevice) SendCommandWithSSH ¶
func (NetDevice) SendCommandWithTelnet ¶
func (NetDevice) SendCommandsWithSSH ¶
type SSHConn ¶
func ConnectWithSSH ¶
type TelnetParams ¶
type TelnetParams struct {
Port int `json:"port"`
}