Comments (2)
Hi @lefeck
Snat API are not implemented in our client at the moment. To work around the issue you can use the following method:
https://pkg.go.dev/github.com/e-XpertSolutions/f5-rest-client/f5#Client.ReadQuery
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:
https://mholt.github.io/json-to-go/
from f5-rest-client.
Thanks for the tip, I learned.
from f5-rest-client.
Related Issues (20)
- json: cannot unmarshal string into Go struct field Pool.partition of type int64 HOT 1
- Bumping version number HOT 1
- Create an ObjectID type for dealing with partition and object name
- ltm-members
- Code update problem HOT 2
- missing public package "e-xpert_solutions/go-pretty/pretty" HOT 1
- certificate signed by unknown authority HOT 2
- Not a issue, just a question. what the different between this f5-rest-client and go-bigip repo?
- Malformed sync status causes panic
- cannot commit transaction: Missing transaction ID for this call. (code: 404) HOT 3
- How to get poolmember name through get method HOT 2
- cannot get the profiles name? HOT 2
- how to get pool member list, through the pool name of SourceAddressTranslation?
- Support for configuring ECS on a WideIP
- util BashCommand Run function broken HOT 1
- [f5/client] Basic auth credentials fail the token creation
- How to remove virtualserver configuration from other partitions?
- Missing cachePath property of FileSSLCertConfig, or how to enable hidden options HOT 1
- Add support for CachePath in sys.FileSSLCertConfig
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from f5-rest-client.