Skip to content

Commit

Permalink
Add readme file (#39)
Browse files Browse the repository at this point in the history
* Add readme file

* Long overdue readme file for the client
* set httpRequestTimeout & httpPoolConnections while creating TransportConfig

  Currently NewTransportConfig takes an "httpRequestTimeout int" but it is not
  used to fill in the returned "cfg TransportConfig", which is wrong. Fixing the
  issue in this patch.
  • Loading branch information
chinmayb authored and jkraj committed Feb 20, 2018
1 parent 3238237 commit 768f9c4
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
67 changes: 67 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Infoblox Go Client

An Infoblox Client library for Go.

This library is compatible with Go 1.2+

- [Prerequisites](#Prerequisites)
- [Installation](#Installation)
- [Usage](#Usage)

## Prerequisites
* Infoblox GRID with 2.5 or above WAPI support
* Go 1.2 or above

## Installation
go get github.com/infobloxopen/infoblox-go-client

## Usage

The following is a very simple example for the client usage:

package main
import (
"fmt"
ibclient "github.com/infobloxopen/infoblox-go-client"
)

func main() {
hostConfig := ibclient.HostConfig{
Host: "<NIOS grid IP>",
Version: "<WAPI version>",
Port: "PORT",
Username: "username",
Password: "password",
}
transportConfig := ibclient.NewTransportConfig("false", 20, 10)
requestBuilder := &ibclient.WapiRequestBuilder{}
requestor := &ibclient.WapiHttpRequestor{}
conn, err := ibclient.NewConnector(hostConfig, transportConfig, requestBuilder, requestor)
if err != nil {
fmt.Println(err)
}
objMgr := ibclient.NewObjectManager(conn, "myclient", "")
//Fetches grid information
fmt.Println(objMgr.GetLicense())
}

## Supported NIOS operations

* CreateNetworkView
* CreateDefaultNetviews
* CreateNetwork
* CreateNetworkContainer
* GetNetworkView
* GetNetwork
* GetNetworkContainer
* AllocateNetwork
* UpdateFixedAddress
* GetFixedAddress
* ReleaseIP
* DeleteNetwork
* GetEADefinition
* CreateEADefinition
* UpdateNetworkViewEA
* GetCapacityReport
* GetAllMembers
* GetUpgradeStatus (2.7 or above)
2 changes: 2 additions & 0 deletions connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ func NewTransportConfig(sslVerify string, httpRequestTimeout int, httpPoolConnec
cfg.SslVerify = true
}

cfg.HttpPoolConnections = httpPoolConnections
cfg.HttpRequestTimeout = httpRequestTimeout
return
}

Expand Down

0 comments on commit 768f9c4

Please sign in to comment.