client

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetToken added in v0.0.5

func GetToken(baseURL string, username string, password string) (token *string, err error)

GetToken requests a JWT token from the server to be used in future requests

Types

type Alarm added in v0.0.7

type Alarm map[string]interface{}

Alarm represents an alarm event object.

type AnalyticMetricFilter added in v0.0.5

type AnalyticMetricFilter map[string]string

AnalyticMetricFilter represents a filter map of keys and values

func (AnalyticMetricFilter) ToString added in v0.0.5

func (filter AnalyticMetricFilter) ToString() string

ToString converts a filter map to a string for debug

type AnalyticMetricRequest added in v0.0.5

type AnalyticMetricRequest struct {
	ID        string               `json:"id"`
	Transform string               `json:"transform"`
	Window    AnalyticWindow       `json:"window"`
	Filters   AnalyticMetricFilter `json:"filters"`
}

AnalyticMetricRequest defines the request for a metric

type AnalyticParameter

type AnalyticParameter struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

AnalyticParameter represents a key value parameter

type AnalyticPoint

type AnalyticPoint struct {
	Value float64 `json:"value"`
	Time  string  `json:"date"`
}

AnalyticPoint represents a point in time

type AnalyticWindow

type AnalyticWindow struct {
	End   string `json:"end"`
	Start string `json:"start"`
}

AnalyticWindow represents a start and end time window

type AuditEvent added in v0.0.7

type AuditEvent struct {
	Type      string                 `json:"type"`
	Timestamp time.Time              `json:"timestamp"`
	Router    string                 `json:"router"`
	Node      string                 `json:"node"`
	Data      map[string]interface{} `json:"data"`
}

AuditEvent represents an event object.

type Client

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

Client represents a HTTP connection to a 128T host.

func CreateClient

func CreateClient(baseURL string, token string) *Client

CreateClient creates a Client object given a baseURL, token, and httpClient.

func (*Client) GetAlarms added in v0.0.7

func (client *Client) GetAlarms(router string) ([]Alarm, error)

GetAlarms retrieves the currently active alarms for a given router

func (*Client) GetAuditEvents added in v0.0.7

func (client *Client) GetAuditEvents(router string, filter []string, startTime time.Time, endTime time.Time) ([]AuditEvent, error)

GetAuditEvents retrieves the historical audit events for a router

func (*Client) GetMetric added in v0.0.5

func (client *Client) GetMetric(router string, request *AnalyticMetricRequest) ([]AnalyticPoint, error)

GetMetric retrieves an array of AnalyticPoint for a given metric.

func (*Client) GetMetricMetadata added in v0.1.0

func (client *Client) GetMetricMetadata() ([]*MetricDescriptor, error)

GetMetricMetadata asks the server for all available metric descriptors

func (*Client) GetMetricPermutations added in v0.1.0

func (client *Client) GetMetricPermutations(router string, descriptor MetricDescriptor) ([]*MetricPermutation, error)

GetMetricPermutations retrieves, for a given metric, all the parameter permutations available.

func (*Client) GetRouters added in v0.1.0

func (client *Client) GetRouters() ([]Router, error)

GetRouters retrieves a list of the routers

func (*Client) GetSystemInfo added in v0.0.8

func (client *Client) GetSystemInfo() (SystemInformation, error)

GetSystemInfo retrieves the version of the given node.

type MetricDescriptor added in v0.0.5

type MetricDescriptor struct {
	ID          string
	Description string
	Keys        []string
}

MetricDescriptor describes a metric within the system.

type MetricPermutation added in v0.1.0

type MetricPermutation struct {
	Parameters map[string]string
}

MetricPermutation describes a series of parameters and their values that can be used to retrieve a metric

type Router

type Router struct {
	Name     string `json:"name"`
	Location string `json:"locationCoordinates"`
}

Router represents a 128T Router

func (Router) LocationGeohash added in v0.0.8

func (a Router) LocationGeohash() (string, error)

LocationGeohash converts the ISO location field into a geohash

type SystemInformation added in v0.0.8

type SystemInformation struct {
	Version string `json:"softwareVersion"`
}

SystemInformation represents information about the connected 128T server.

Jump to

Keyboard shortcuts

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