Open jhgiii opened 2 years ago
package main
import (
"fmt"
"github.com/aristanetworks/goeapi"
"github.com/aristanetworks/goeapi/module"
)
type VRF struct {
RouterID string `json:"routerId"`
Peers map[string]module.BGPNeighborSummary `json:"peers"`
VRF string `json:"vrf"`
ASN interface{} `json:"asn"`
}
func main() {
node, err := goeapi.ConnectTo("sp1")
if err != nil {
panic(err)
}
s := module.Show(node)
showData, err := s.ShowIPBGPSummary()
if err != nil {
fmt.Println(err)
}
fmt.Printf("%v", showData.VRFs)
}
package main
import ( "fmt"
)
func main() { node, err := goeapi.ConnectTo("sp1") if err != nil { panic(err) } s := module.Show(node) showData, err := s.ShowIPBGPSummary() if err != nil { fmt.Println(err) } fmt.Printf("%v", showData.VRFs) }
When running I received the following error:
1 error(s) decoding:
Looking through the code base, I see the following struct:
type VRF struct { RouterID string
json:"routerId"
Peers map[string]BGPNeighborSummaryjson:"peers"
VRF stringjson:"vrf"
ASN int64json:"asn"
}It may be safer to expect a string type