https://github.com/sky-uk/go-pulse-vtm
Go Bindings for Pulse Secure Virtual Traffic Manager
https://github.com/sky-uk/go-pulse-vtm
brocade brocade-traffic-manager pulse-vtm stingray vtm
Last synced: 7 months ago
JSON representation
Go Bindings for Pulse Secure Virtual Traffic Manager
- Host: GitHub
- URL: https://github.com/sky-uk/go-pulse-vtm
- Owner: sky-uk
- License: bsd-3-clause
- Created: 2017-05-23T16:48:57.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-12T10:13:08.000Z (over 7 years ago)
- Last Synced: 2024-06-20T06:26:10.796Z (about 1 year ago)
- Topics: brocade, brocade-traffic-manager, pulse-vtm, stingray, vtm
- Language: Go
- Homepage:
- Size: 294 KB
- Stars: 5
- Watchers: 10
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# go-pulse-vtm - Go Bindings for the Pulse Secure Virtual Traffic Manager (vTM)
## Overview
This is the GoLang API wrapper for Pulse Secure Virtual Traffic Manager (vTM).
Starting from version 0.4.0 the API has been redesigned.This repository used to be called go-brocade-vtm. Since version 0.4.50, this repository has been renamed to go-pulse-vtm.
# API usage
## Importing the API
```
import("github.com/sky-uk/go-pulse-vtm/api")
```## Connecting to a Pulse vTM server
The Connect API returns a client object or an error in case of issues.
The APIVersion parameter can be used to specify a server API version to use;
in case it is not provided, the list of available API versions is retrieved
from the server and the highest available is used.
Custom headers can be passed at connection time, if not passed the content type
is anyhow set to "application/json"```
headers := make(map[string]string)
// set your custom headers...
params := Params{
APIVersion: "3.8",
Server: server,
Username: username,
Password: password,
IgnoreSSL: true,
Debug: true,
Headers: headers,
}client, err := Connect(params)
```## Dealing with configuration resources
### Setting (creating/updating) a resource
The Set API is provided to both create and update a configuration resource.
The last input paramenter is a pointer to a map (or struct) where the new
created/updated resource is provided back.```
err := client.Set(,, , )// example
profile := make(map[string]interface{})
name := "new_virtual_server_8347"
// fill the profile...
//...updatedRes := make(map[string]interface{})
err = client.Set("virtual_servers", name, profile, &updatedRes)
```### Getting a resource
#### Retrieve a resource by its name
```
err := client.GetByName(, , )
```#### Retrieve a resource by its url
```
err := client.GetByURL(, , )
```### Deleting a resource
```
err := client.Delete(, )
```### Getting all resource types
The ``GetAllResourceTypes`` returns the list of all resource types
```
types, err := client.GetAllResourceTypes()
```### Getting all resources of a type
The ``GetAllResources`` API returns a list of maps containing names/urls of all
resources of the provided type.```
objs, err := client.GetAllResources()
```## Dealing with information resources
The ``GetInformation`` API returns the information section for the passed server name
```
info, err := client.GetInformation()
```## Dealing with statistics
The ``GetStatistics`` API returns all the statistics resources for a server node name
```
stats, err := client.GetStatistics()
```## Getting the server state
The ``GetState`` API returns the current state for the passed server node name
```
state, err := client.GetState()
```