Open UnAfraid opened 5 years ago
Hello,
Any chance of making a bit higher level API as well?
like
// Create new mikrotik api client client := mikrotik.NewClientApi("192.168.88.1:8728") if err := client.Connect("admin", ""); err != nil { log.Fatalf("Failed to connect: %s", err.Error()) } defer client.Close() // Obtain system information system, err := client.System() check(err) // Obtain system resource information resources, err := system.Resources(); check(err) // Print some system resources log.Printf("Uptime: %s", resources.Uptime) log.Printf("Version: %s", resources.Version) log.Printf("Build-time: %s", resources.BuildTime) // .. // Obtain information about interfaces iface, err := client.Interface() check(err) // Print basic info about each interface for idx, iface := range iface.ToArray() { log.Printf("Interface: #%d %s Type: %s Mac: %s", idx, iface.Name, iface.Type, iface.MacAddress) }
https://github.com/GNewbury1/terraform-provider-routeros/tree/main/client
Interesting idea. But maybe as side project, or as extension. For now, primary focus is on direct api usage to be polished.
Hello,
Any chance of making a bit higher level API as well?
like