go-vtm is a client library for accessing the Brocade Virtual Traffic Manager (formerly Riverbed Stingray, and Zeus ZXTM) REST API.
For documentation of the vTM API, see the "Brocade Virtual Traffic Manager: REST API Guide" version 17.2, May 2017 from the Brocade support site.
import "github.com/atlassian/go-vtm"
Create a new Stingray client.
client := stingray.NewClient(nil, "https://localhost:9070", "username", "password")
Manage an extra file.
fmt.Println("Writing...")
r := stingray.NewExtraFile("name")
r.Content = []byte("Test")
resp, err := client.Set(r)
fmt.Println("Status:", resp.Status)
if err != nil {
log.Fatal(err)
}
fmt.Println("Reading...")
r, resp, err = client.GetExtraFile("name")
if err != nil {
log.Fatal(err)
}
fmt.Println("Status:", resp.Status)
fmt.Println("Content:", string(r.Content))
fmt.Println("Deleting...")
r = stingray.NewExtraFile("name")
resp, err = client.Delete(r)
if err != nil {
log.Fatal(err)
}
fmt.Println("Status:", resp.Status)
Writing...
Status: 201 Created
Reading...
Status: 200 OK
Content: Test
Deleting...
Status: 204 No Content
Support for resources is being added as needed.
- Action Program
- Alerting Action
- Aptimizer Application Scope
- Aptimizer Profile
- Bandwidth Class
- Cloud Credentials
- Custom configuration set
- Event Type
- Extra File
- GLB Service
- Global Settings
- License
- Location
- Monitor
- Monitor Program
- NAT Configuration
- Pool
- Protection Class
- Rate Shaping Class
- Rule
- SLM Class
- SSL Client Key Pair
- SSL Key Pair
- SSL Trusted Certificate
- Security Settings
- Session Persistence Class
- Traffic IP Group
- Traffic Manager (incomplete)
- TrafficScript Authenticator
- User Authenticator
- User Group
- Virtual Server