You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
import (
"encoding/json"
"fmt"
"log"
"github.com/e-XpertSolutions/f5-rest-client/f5"
)
func main() {
f5Client, err := f5.NewBasicClient("https://<some-ip-address>", "admin", "admin")
if err != nil {
log.Fatal(err)
}
f5Client.DisableCertCheck()
var data struct{
Items []struct{
Name string `json:"name"`
} `json:"items"`
}
if err := f5.ReadQuery("/mgmt/tm/ltm/snatpool", &data); err != nil {
log.Fatal(err)
}
}
Basically you just need to define the structure returned by the API and use the ReadQuery method.
If you need more attributes, you can also query the API using Postman, cURL or directly from the browser and use somehting like json-to-go to generate the Go struct for you:
hi, @gilliek
I want to get the snat member list attribute in ltm, what should I do? We don't see the corresponding method of struct?
The text was updated successfully, but these errors were encountered: