Skip to content

netascode/go-ise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Tests

go-ise

go-ise is a Go client library for Cisco ISE. It is based on Nathan's excellent goaci module and features a simple, extensible API and advanced JSON manipulation.

Getting Started

Installing

To start using go-ise, install Go and go get:

$ go get -u github.com/netascode/go-ise

Basic Usage

package main

import "github.com/netascode/go-ise"

func main() {
    client, _ := ise.NewClient("https://1.1.1.1", "user", "pwd")

    res, _ := client.Get("/ers/config/internaluser")
    println(res.Get("SearchResult.resources.#.name").String())
}

This will print something like:

["user1","user2","user3"]

Result manipulation

ise.Result uses GJSON to simplify handling JSON results. See the GJSON documentation for more detail.

res, _ := client.Get("/ers/config/internaluser")

for _, user := range res.Get("SearchResult.resources").Array() {
    println(user.Get("@pretty").String()) // pretty print internal users
}

POST data creation

ise.Body is a wrapper for SJSON. SJSON supports a path syntax simplifying JSON creation.

body := ise.Body{}.
    Set("InternalUser.name", "User1").
    Set("InternalUser.password", "Cisco123")
client.Post("/ers/config/internaluser", body.Str)

Documentation

See the documentation for more details.

About

A Go client library for Cisco ISE.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages