8000 String Interpolation with a custom command · Issue #47 · aristanetworks/goeapi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
String Interpolation with a custom command #47
Open
@gavmckee80

Description

@gavmckee80

@cheynearista

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0