package switchy import ( "fmt" "strconv" "github.rackspace.com/gorax/clients/sshAPI" ) func (s *SwitchClient) Run(command string) (*sshAPI.SSHCommand, error) { return s.sshClient.PostReCommand(command, "# $|#$", 60) } // GetVlans runs a 'show vlan' on the switch and calls the parser for the output func (sw *SwitchClient) GetVlans() error { cmd, err := sw.Run("sh vlan") if err != nil { return err } fmt.Println(*cmd.Response) sw.ShowVlanParse(cmd.Response) return nil } func (sw *SwitchClient) GetVlanConfig() error { cmd, err := sw.Run("show run vlan") if err != nil { return err } fmt.Println(strconv.Quote(*cmd.Response)) return nil }