Categorygithub.com/netascode/go-ise
modulepackage
0.1.1
Repository: https://github.com/netascode/go-ise.git
Documentation: pkg.go.dev

# README

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.

# Functions

BackoffDelayFactor modifies the backoff delay factor from the default of 3.
BackoffMaxDelay modifies the maximum delay between two retries from the default of 60.
BackoffMinDelay modifies the minimum delay between two retries from the default of 2.
Insecure determines if insecure https connections are allowed.
MaxRetries modifies the maximum number of retries from the default of 3.
NewClient creates a new ISE HTTP client.
NoLogPayload prevents logging of payloads.
RequestTimeout modifies the HTTP request timeout from the default of 60 seconds.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

Body wraps SJSON for building JSON body strings.
Client is an HTTP ISE client.
Req wraps http.Request for API requests.

# Type aliases

Res is an API response returned by client requests.