Home

Awesome

Infoblox Go Client

An Infoblox NIOS WAPI client library in Golang. The library enables us to do a CRUD oprations on NIOS Objects.

This library is compatible with Go 1.2+

Build Status

Build Status

Prerequisites

Installation

To get the latest released version v2.7.0 of Go Client use below command.

go get github.com/infobloxopen/infoblox-go-client/v2

To get the previous major version v1.1.1 use below command.

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

Note: Go client version v2.0.0 and above have breaking changes and are not backward compatible.

Usage

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

   package main

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

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

Supported NIOS operations