Open
Description
How do I implement a custom command where I pass a string to the GetCmd() function?
In my case below I want to build a command that returns only a single interface - testing with Ethernet1
type ShowInterfaceDescription struct {
InterfaceDescriptions map[string]InterfaceInfo `json:"interfaceDescriptions"`
}
type InterfaceInfo struct {
InterfaceStatus string `json:"interfaceStatus"`
Description string `json:"description"`
LineProtocolStatus string `json:"lineProtocolStatus"`
}
func (s *ShowInterfaceDescription) GetCmd() string {
i := "Ethernet1"
return fmt.Sprintf("show interfaces %v description", i)
}
Metadata
Metadata
Assignees
Labels
No labels