omadaclient

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2023 License: Unlicense Imports: 4 Imported by: 0

README

Golang client for Omada Rest Api

Golang library to interface the Omada controller API.


This library is work in progress and only contains a limited API subset.
New methode will be added as required for other projects.
It is an interim solution solution until the official API documentation will be released.


Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SiteClient

type SiteClient struct {
	// contains filtered or unexported fields
}

func NewSiteClient

func NewSiteClient(url, siteName, username, password string, skipVerify, verbose bool) (*SiteClient, error)

Creates a new SiteClient

Parameters:

url : Omada controller address(example: https://192.168.0.2)
siteName : Visible site name(empty string for default site)
username : Username for login(it is advised to create a separate api user)
password : Password for login
skipVerify : Ignore SSL errors(necessary for ip addresses as url or selfsigned certificates)
erbose : Debug logging to console(should only be enabled for debugging scenarios)

Return:

SiteClient instance
error

func (*SiteClient) Close

func (c *SiteClient) Close()

SiteClient finalizer

func (*SiteClient) EndSession

func (c *SiteClient) EndSession() error

End current session

Will be called by Close

Return:

error

func (*SiteClient) GetApiInfo

func (c *SiteClient) GetApiInfo() (*model.ApiInfo, error)

Get API information

Return:

API information
error

func (*SiteClient) GetClientDetails

func (c *SiteClient) GetClientDetails(client *model.Client) error

Get enhanced information for a provided cliend and enhance the struct by it

Parameters:

client : Client to enhance(Type and Mac have to be provided as minimal information)

Return:

error

func (*SiteClient) GetClients

func (c *SiteClient) GetClients(detailed bool) (*[]model.Client, error)

Get active clients

Parameters:

detailed : get detailed device information

Return:

Client list
error

func (*SiteClient) GetDeviceDetails

func (c *SiteClient) GetDeviceDetails(device *model.Device) error

Get enhanced information for a provided device and enhance the struct by it

Parameters:

device : Device to enhance(Type and Mac have to be provided as minimal information)

Return:

error

func (*SiteClient) GetDevices

func (c *SiteClient) GetDevices(detailed bool) (*[]model.Device, error)

Get list of devices

Parameters:

detailed : get detailed device information

Return:

Devices list
error

func (*SiteClient) GetNetworks added in v0.0.5

func (c *SiteClient) GetNetworks() (*[]model.Network, error)

Get networks

Return:

Network list
error

func (*SiteClient) GetUserInfo

func (c *SiteClient) GetUserInfo() (*model.UsersCurrent, error)

Get user information for current session

Return:

User information
error

func (*SiteClient) HasActiveSession

func (c *SiteClient) HasActiveSession() bool

Determines if client has an active session

Return:

sesion state

func (*SiteClient) StartSession

func (c *SiteClient) StartSession() error

Start a new session

Will be called by api methodes if required

Return:

error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL