GithubHelp home page GithubHelp logo

sky-uk / go-pulse-vtm Goto Github PK

View Code? Open in Web Editor NEW
5.0 10.0 2.0 301 KB

Go Bindings for Pulse Secure Virtual Traffic Manager

License: BSD 3-Clause "New" or "Revised" License

Go 94.76% Makefile 5.24%
brocade-traffic-manager brocade stingray pulse-vtm vtm

go-pulse-vtm's Introduction

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(<resource type>,<resource name>, <resource profile>, <pointer to map/struct>)

    // 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(<resource type>, <resource name>, <pointer to map/struct>)

Retrieve a resource by its url

    err := client.GetByURL(<resource type>, <resource name>, <pointer to map/struct>)

Deleting a resource

    err := client.Delete(<resource type>, <resource name>)

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(<resource type>)

Dealing with information resources

The GetInformation API returns the information section for the passed server name

    info, err := client.GetInformation(<server name>)

Dealing with statistics

The GetStatistics API returns all the statistics resources for a server node name

    stats, err := client.GetStatistics(<server name>)

Getting the server state

The GetState API returns the current state for the passed server node name

    state, err := client.GetState(<server name>)

go-pulse-vtm's People

Contributors

grubert65 avatar lakshmi-enjeti avatar no-acl avatar ruimoreira avatar sandeep-sidhu avatar standingb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-pulse-vtm's Issues

problem with using cli

Hi

I have just setup everything correctly , using the latest relase , and getting this error on every command:

Error retreiving the list of monitors. Error: Response status code: 404
[iahmad@web-prod-ijaz001 go-brocade-vtm-0.2.11]$ ./go-brocade-vtm-cli -debug monitor-show-all
2017/09/26 16:24:05 --------------------------------------------------------------
2017/09/26 16:24:05 Request payload:
2017/09/26 16:24:05
2017/09/26 16:24:05 --------------------------------------------------------------
------> content:

Error retreiving the list of monitors. Error: Response status code: 404

support for creating backups and restore

Hi ,

currently I have a jenkins job that takes vtm backups daily and another one for restoring a particular backup , but I am using the raw REST curl apporach , can you please add these operations in your cli? I would have started contributing it but most of the stuff seems already done and i am quite new to golang.

  • list current backups
  • take a backup
  • restore a spcific backup by name
  • just restore the last backup
  • dump the difference between two backups as text or json

thanks

Newer version support

Kinda the opposite of the other question - I was trying to find something that would support API 5.x (we're running brocade 17.3) and I was so close, then re-read this repo.

Are you guys thinking of upgrading to support 5.x or should I bite the bullet and start writing it myself?

Older version support

What are you plans for supporting older versions? It would be a great help to us in content-discovery if we could get support for API v1.0 and later.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.