Documentation
¶
Overview ¶
Package netalertx implements the NetAlertX network device monitoring provider.
Index ¶
- Constants
- type Device
- type DevicesResponse
- type NetAlertX
- func (n *NetAlertX) GetTopology(ctx context.Context) (*Topology, error)
- func (n *NetAlertX) GetTotals(ctx context.Context) (*Totals, error)
- func (n *NetAlertX) Health(ctx context.Context) error
- func (n *NetAlertX) ListDevices(ctx context.Context) ([]Device, error)
- func (n *NetAlertX) SearchDevices(ctx context.Context, query string) ([]Device, error)
- type SearchResponse
- type Topology
- type TopologyLink
- type TopologyNode
- type Totals
Constants ¶
const ( ID = "netalertx" EndpointKey = "endpoint" TokenKey = "token" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct {
Name string `json:"devName"`
MAC string `json:"devMAC"`
MacAlt string `json:"devMac"`
IP string `json:"devIP"`
LastIP string `json:"devLastIP"`
Type string `json:"devType"`
Vendor string `json:"devVendor"`
Owner string `json:"devOwner"`
Status string `json:"devStatus"`
Favorite int `json:"devFavorite"`
LastConnection string `json:"devLastConnection"`
}
Device is a NetAlertX network device record.
type DevicesResponse ¶
type DevicesResponse struct {
Success bool `json:"success"`
Devices []Device `json:"devices"`
Message string `json:"message,omitzero"`
}
DevicesResponse is returned by GET /devices.
type NetAlertX ¶
type NetAlertX struct {
// contains filtered or unexported fields
}
NetAlertX is an HTTP client for the NetAlertX REST API.
func GetClient ¶
func GetClient() *NetAlertX
GetClient builds a NetAlertX client from vendors.netalertx config. Returns nil when endpoint is not configured.
func NewNetAlertX ¶
NewNetAlertX creates a NetAlertX client with Bearer token auth. Returns nil when endpoint is empty.
func (*NetAlertX) GetTopology ¶
GetTopology returns network topology nodes and links.
func (*NetAlertX) ListDevices ¶
ListDevices returns all devices.
type SearchResponse ¶
SearchResponse is returned by POST /devices/search.
type Topology ¶
type Topology struct {
Nodes []TopologyNode `json:"nodes"`
Links []TopologyLink `json:"links"`
}
Topology is the network topology graph.
type TopologyLink ¶
type TopologyLink struct {
Source string `json:"source"`
Target string `json:"target"`
Port string `json:"port"`
}
TopologyLink is an edge in the network topology.
type TopologyNode ¶
type TopologyNode struct {
ID string `json:"id"`
Name string `json:"name"`
Vendor string `json:"vendor"`
}
TopologyNode is a node in the network topology.