Brocade VTM Rest Client
Currently supported objects are:
- Pools
- Monitors
There is an examples directory in the source which contains some code of how to use it.
config := vtm.NewDefaultConfig()
config.URL = "http://127.0.0.1:9070"
client := vtm.NewClient(config)
pools, err := client.ListPools()
if err == nil {
log.Printf("Found %d pools", len(pools))
}
poolName := "my-pool"
pool := vtm.NewPool()
pool.AddNode(vtm.NodeItem{Node: "foo.bar.com:123", Weight: 1})
_, err = client.CreatePool(poolName, pool)
if err == nil {
log.Printf("Successfully created the pool: %s", poolName)
}