api

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 1, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	URL      string // base URL of form http://ipaddr:port with no trailing slash
	Username string
	Password string
	Site     string
	// contains filtered or unexported fields
}

func New

func New(username, password, url, site string) (*Client, error)

func (*Client) GetClients

func (c *Client) GetClients() (clients []NetworkClient, err error)

func (*Client) GetNetworks

func (c *Client) GetNetworks() (networks []Network, err error)

func (*Client) GetUsers

func (c *Client) GetUsers() (users []User, err error)

func (*Client) Login

func (c *Client) Login() error

type ClientResp

type ClientResp struct {
	Data []NetworkClient `json:"data"`
}

type Network

type Network struct {
	ID         string `json:"_id"`
	Name       string `json:"name"`
	DomainName string `json:"domain_name"`
}

type NetworkClient

type NetworkClient struct {
	ID         string `json:"_id"`
	Name       string `json:"name"`
	Hostname   string `json:"hostname"`
	IP         string `json:"ip"`
	UseFixedIP bool   `json:"use_fixedip"`
	NetworkId  string `json:"network_id"`
}

type NetworkResp

type NetworkResp struct {
	Data []Network `json:"data"`
}

type User

type User struct {
	Hostname   string `json:"hostname"`
	FixedIP    string `json:"fixed_ip"`
	UseFixedIP bool   `json:"use_fixedip"`
}

type UserResp

type UserResp struct {
	Data []User `json:"data"`
}

Jump to

Keyboard shortcuts

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