Categorygithub.com/projectbadger/brocade-go
module
0.0.5
Repository: https://github.com/projectbadger/brocade-go.git
Documentation: pkg.go.dev

# README

Brocade FOS REST API interface in Go

A library for interfacing with Brocade FOS REST API.

The documentation is taken from the Broadcom Brocade FOS REST API documentation

WIP!

Not all of the models have been implemented yet and methods only provide read functions.

Using the models

The models are in individual packages in rest/running

Using the API

To use the REST API, you must instantiate a session and create a REST interface implementation with it. If the session is not sessionless, it is imperative to log out after use.

rest := rest.NewRESTJSONSessionless("localhost:8080", "/rest", "username", "password", http.DefaultClient)
ps, errs := rest.Running().FRU().GetPowerSupply()

To ensure proper login and logout, a helper session function can be used for non-sessionless login.

rest := rest.NewRESTJSONSession("localhost:8080", "/rest", "username", "password", http.DefaultClient)
err := rest.Session(func(session session.Session) error {
	ps, errs := rest.Running().FRU().GetPowerSupply()
	if errs != nil {
		return errs
	}
})

Subpackages

# Packages

No description provided by the author
Brocade REST interface To use the REST interface, instantiate a new one and interact with its components.
No description provided by the author
No description provided by the author