snmpsimclient

package module
v0.0.0-...-83f8f76 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2020 License: BSD-2-Clause Imports: 8 Imported by: 0

README

snmpsim-restapi-go-client

Go Report Card GitHub license GitHub code style GoDoc doc

Description

Golang package - client library for the snmpsim REST API.

The library is used by snmpsim-control-client and snmpsim-check.

This go client is an open-source library to communicate with the snmpsim REST API which is written in Python.

Code Style

This project was written according to the uber-go coding style.

Features

Management Client
  • Create laboratory environments to test SNMP calls
  • Configuration of laboratory environments
  • Possibility to create Endpoints, Engines, Agents, Users and Tags
  • Agents can be added to Laboratories
  • Engines can be added to Agents
  • Users and Endpoints can be added to Engines
  • Tags can be applied to all of the above
  • Possibility to delete all objects linked to a tag (for cleanup purposes)
Metrics Client
  • Can check metrics of a lab environment
  • Possibility to check processes, packet activity and message activity

Requirements

The latest version of the snmpsim python module needs to be installed and configured.

Further information on how to download and configure snmpsim can be found here.

Snmpsim-control-plane has to be installed and running. A guide for setting Control Plane can be found here.

To check if your setup works, follow the steps provided in the 'Tests' section of this document.

Installation

go get github.com/inexio/snmpsim-restapi-go-client

or

git clone https://github.com/inexio/snmpsim-restapi-go-client.git

Usage

Management Client
	//Create a new management api client
	client, err := snmpsimclient.NewManagementClient("https://127.0.0.1:8000")
	
	//Set http auth username and password (optional)
	err = client.SetUsernameAndPassword("httpAuthUsername", "httpAuthPassword")

	//Create a new lab
	lab, err := client.CreateLab("myLab") //optionally use CreateLabWithTag(..., tagId) [tagId as last param]

	//Create a new engine
	engine, err := client.CreateEngine("myEngine", "0102030405070809") //optionally use CreateEngineWithTag(..., tagId) [tagId as last param]

	//Create a new endpoint
	endpoint, err := client.CreateEndpoint("myEndpoint", "127.0.0.1", "1234") //optionally use CreateEndpointWithTag(..., tagId) [tagId as last param]

	//Create a new user
	user, err := client.CreateUser("uniqueUserIdentifier", "myUser", "", "", "", "") //optionally use CreateUserWithTag(..., tagId) [tagId as last param]

	//Add user to engine
	err = client.AddUserToEngine(engine.ID, user.ID)

	//Add endpoint to engine
	err = client.AddEndpointToEngine(engine.ID, endpoint.ID)

	//Create a new agent
	agent, err := client.CreateAgent("myAgent", "agent/data/dir") //optionally use CreateAgentWithTag(..., tagId) [tagId as last param]


	//Add engine to agent
	err = client.AddEngineToAgent(agent.ID, engine.ID)

	//Add agent to lab
	err = client.AddAgentToLab(lab.ID, agent.ID)

	//Set lab power on
	err = client.SetLabPower(lab.ID, true)
	
	//Delete lab
	err = client.DeleteLab(lab.ID)
Metrics Client
	//Create a new metrics api client
	client, err := snmpsimclient.NewMetricsClient("https://127.0.0.1:8001")

	//Set http auth username and password (optional)
	err = client.SetUsernameAndPassword("httpAuthUsername", "httpAuthPassword")

	//Get all packet metrics
	packets, err := client.GetPackets(nil)

	//Get all possible filters for packets
	packetFilters, err := client.GetPacketFilters()
	
	//Get all packets for endpoint "127.0.0.1:1234"
	filters := make(map[string]string)
	filters["local_address"] = "127.0.0.1:1234"
	packets, err := client.GetPackets(filters)

	//Get all message metrics
	messages, err := client.GetMessages(nil)
Tests

Our library provides a few unit and integration tests. To use these tests, the yaml config files in the test-data directory must be adapted to your setup.

In order to run these test, run the follwing command inside root directory of this repository:

go test

If you want to check if your setup works, run:

go test -run TestManagementClient_buildUpSetupAndTestIt

Getting Help

If there are any problems or something does not work as intended, open an issue on GitHub.

Contribution

Contributions to the project are welcome.

We are looking forward to your bug reports, suggestions and fixes.

If you want to make any contributions make sure your go report does match up with our projects score of A+.

When you contribute make sure your code is conform to the uber-go coding style.

Happy Coding!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	ID        int       `json:"id"`
	Name      string    `json:"name"`
	DataDir   string    `json:"data_dir"`
	Engines   Engines   `json:"engines"`
	Selectors Selectors `json:"selectors"`
	Tags      Tags      `json:"tags"`
}

Agent - Represents SNMP agent. Consists of SNMP engine and transport endpoints it binds.

type Agents

type Agents []Agent

Agents is an array of agents.

type Console

type Console struct {
	ID        int    `json:"id"`
	Timestamp string `json:"timestamp"`
	Text      string `json:"text"`
}

Console - contains information regarding the console

type ConsolePages

type ConsolePages struct {
	Count      int    `json:"count"`
	LastUpdate string `json:"last_update"`
}

ConsolePages - contains information regarding snmpsim consoles

type Consoles

type Consoles []Console

Consoles is an array of Consoles

type Endpoint

type Endpoint struct {
	ID       int    `json:"id"`
	Name     string `json:"name"`
	Protocol string `json:"protocol"`
	Address  string `json:"address"`
	Tags     Tags   `json:"tags"`
}

Endpoint - SNMP transport endpoint object. Each SNMP engine can bind one or more transport endpoints. Each transport endpoint can only be bound by one SNMP engine.

type Endpoints

type Endpoints []Endpoint

Endpoints is an array of endpoints.

type Engine

type Engine struct {
	ID        int       `json:"id"`
	Name      string    `json:"name"`
	EngineID  string    `json:"engine_id"`
	Endpoints Endpoints `json:"endpoints"`
	Users     Users     `json:"users"`
	Tags      Tags      `json:"tags"`
}

Engine - Represents a unique, independent and fully operational SNMP engine, though not yet attached to any transport endpoints.

type Engines

type Engines []Engine

Engines is an array of engines.

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
	Status  int    `json:"status"`
}

ErrorResponse contains error information.

type HTTPError

type HTTPError struct {
	StatusCode int
	Status     string
	Body       *ErrorResponse
}

HTTPError represents an http error returned by the api.

func (HTTPError) Error

func (h HTTPError) Error() string

type Lab

type Lab struct {
	ID     int    `json:"id"`
	Name   string `json:"name"`
	Power  string `json:"power"`
	Agents Agents `json:"agents"`
	Tags   Tags   `json:"tags"`
}

Lab - Group of SNMP agents belonging to the same virtual laboratory. Some operations can be applied to them all at once.

type Labs

type Labs []Lab

Labs is an array of Labs.

type ManagementClient

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

ManagementClient is a client for communicating with the management api.

func NewManagementClient

func NewManagementClient(baseURL string) (*ManagementClient, error)

NewManagementClient creates a new ManagementClient.

func (*ManagementClient) AddAgentToLab

func (c *ManagementClient) AddAgentToLab(labID, agentID int) error

AddAgentToLab adds an Agent to a Lab.

func (*ManagementClient) AddEndpointToEngine

func (c *ManagementClient) AddEndpointToEngine(engineID, endpointID int) error

AddEndpointToEngine adds an Endpoint to an Engine.

func (*ManagementClient) AddEngineToAgent

func (c *ManagementClient) AddEngineToAgent(agentID, engineID int) error

AddEngineToAgent adds an Engine to an Agent.

func (*ManagementClient) AddSelectorToAgent

func (c *ManagementClient) AddSelectorToAgent(agentID, selectorID int) (Agent, error)

AddSelectorToAgent adds a Selector to an Agent.

func (*ManagementClient) AddTagToAgent

func (c *ManagementClient) AddTagToAgent(agentID, tagID int) error

AddTagToAgent adds a tag to a agent.

func (*ManagementClient) AddTagToEndpoint

func (c *ManagementClient) AddTagToEndpoint(endpointID, tagID int) error

AddTagToEndpoint adds a tag to a endpoint.

func (*ManagementClient) AddTagToEngine

func (c *ManagementClient) AddTagToEngine(engineID, tagID int) error

AddTagToEngine adds a tag to a engine.

func (*ManagementClient) AddTagToLab

func (c *ManagementClient) AddTagToLab(labID, tagID int) error

AddTagToLab adds a tag to a lab.

func (*ManagementClient) AddTagToUser

func (c *ManagementClient) AddTagToUser(userID, tagID int) error

AddTagToUser adds a tag to a user.

func (*ManagementClient) AddUserToEngine

func (c *ManagementClient) AddUserToEngine(engineID, userID int) error

AddUserToEngine adds an User to an Engine

func (*ManagementClient) CreateAgent

func (c *ManagementClient) CreateAgent(name, dataDir string) (Agent, error)

CreateAgent creates a new agent.

func (*ManagementClient) CreateAgentWithTag

func (c *ManagementClient) CreateAgentWithTag(name, dataDir string, tagID int) (Agent, error)

CreateAgentWithTag creates a new agent tagged with the given tag.

func (*ManagementClient) CreateEndpoint

func (c *ManagementClient) CreateEndpoint(name, address, protocol string) (Endpoint, error)

CreateEndpoint creates a new endpoint.

func (*ManagementClient) CreateEndpointWithTag

func (c *ManagementClient) CreateEndpointWithTag(name, address, protocol string, tagID int) (Endpoint, error)

CreateEndpointWithTag creates a new endpoint tagged with the given tag.

func (*ManagementClient) CreateEngine

func (c *ManagementClient) CreateEngine(name, engineID string) (Engine, error)

CreateEngine creates a new engine.

func (*ManagementClient) CreateEngineWithTag

func (c *ManagementClient) CreateEngineWithTag(name, engineID string, tagID int) (Engine, error)

CreateEngineWithTag creates a new engine tagged with the given tag.

func (*ManagementClient) CreateLab

func (c *ManagementClient) CreateLab(name string) (Lab, error)

CreateLab creates a new lab.

func (*ManagementClient) CreateLabWithTag

func (c *ManagementClient) CreateLabWithTag(name string, tagID int) (Lab, error)

CreateLabWithTag creates a new lab tagged with the given tag.

func (*ManagementClient) CreateSelector

func (c *ManagementClient) CreateSelector(comment, template string) (Selector, error)

CreateSelector creates a new selector.

func (*ManagementClient) CreateTag

func (c *ManagementClient) CreateTag(name, description string) (Tag, error)

CreateTag creates a new tag.

func (*ManagementClient) CreateUser

func (c *ManagementClient) CreateUser(user, name, authKey, authProto, privKey, privProto string) (User, error)

CreateUser creates a new user.

func (*ManagementClient) CreateUserWithTag

func (c *ManagementClient) CreateUserWithTag(user, name, authKey, authProto, privKey, privProto string, tagID int) (User, error)

CreateUserWithTag creates a new user tagged with the given tag.

func (*ManagementClient) DeleteAgent

func (c *ManagementClient) DeleteAgent(id int) error

DeleteAgent deletes the agent with the given id.

func (*ManagementClient) DeleteAllObjectsWithTag

func (c *ManagementClient) DeleteAllObjectsWithTag(tagID int) (Tag, error)

DeleteAllObjectsWithTag deletes all objects with the given tag.

func (*ManagementClient) DeleteEndpoint

func (c *ManagementClient) DeleteEndpoint(id int) error

DeleteEndpoint the Lab with the given id.

func (*ManagementClient) DeleteEngine

func (c *ManagementClient) DeleteEngine(id int) error

DeleteEngine deletes the engine with the given id.

func (*ManagementClient) DeleteLab

func (c *ManagementClient) DeleteLab(id int) error

DeleteLab deletes the Lab with the given id.

func (*ManagementClient) DeleteRecordFile

func (c *ManagementClient) DeleteRecordFile(remotePath string) error

DeleteRecordFile deletes the record file at the given path.

func (*ManagementClient) DeleteSelector

func (c *ManagementClient) DeleteSelector(id int) error

DeleteSelector deletes the selector with the given id.

func (*ManagementClient) DeleteTag

func (c *ManagementClient) DeleteTag(id int) error

DeleteTag deletes the tag with the given id.

func (*ManagementClient) DeleteUser

func (c *ManagementClient) DeleteUser(id int) error

DeleteUser deletes the user with the given id.

func (*ManagementClient) GetAgent

func (c *ManagementClient) GetAgent(id int) (Agent, error)

GetAgent returns the agent with the given id.

func (*ManagementClient) GetAgents

func (c *ManagementClient) GetAgents(filters map[string]string) (Agents, error)

GetAgents returns a list of agents, optionally filtered.

func (*ManagementClient) GetEndpoint

func (c *ManagementClient) GetEndpoint(id int) (Endpoint, error)

GetEndpoint returns the endpoint with the given id.

func (*ManagementClient) GetEndpoints

func (c *ManagementClient) GetEndpoints(filters map[string]string) (Endpoints, error)

GetEndpoints returns a list of endpoints, optionally filtered.

func (*ManagementClient) GetEngine

func (c *ManagementClient) GetEngine(id int) (Engine, error)

GetEngine returns the engine with the given id.

func (*ManagementClient) GetEngines

func (c *ManagementClient) GetEngines(filter map[string]string) (Engines, error)

GetEngines returns a list of all engines.

func (*ManagementClient) GetLab

func (c *ManagementClient) GetLab(id int) (Lab, error)

GetLab returns the lab with the given id.

func (*ManagementClient) GetLabs

func (c *ManagementClient) GetLabs(filter map[string]string) (Labs, error)

GetLabs returns a list of labs, optionally filtered.

func (*ManagementClient) GetRecordFile

func (c *ManagementClient) GetRecordFile(remotePath string) (string, error)

GetRecordFile returns the record file at the given path.

func (*ManagementClient) GetRecordFiles

func (c *ManagementClient) GetRecordFiles() (Recordings, error)

GetRecordFiles returns a list of all record files.

func (*ManagementClient) GetSelector

func (c *ManagementClient) GetSelector(id int) (Selector, error)

GetSelector returns the selector with the given id.

func (*ManagementClient) GetSelectors

func (c *ManagementClient) GetSelectors() (Selectors, error)

GetSelectors returns a list of all selectors.

func (*ManagementClient) GetTag

func (c *ManagementClient) GetTag(id int) (Tag, error)

GetTag returns the lab with the given id.

func (*ManagementClient) GetTags

func (c *ManagementClient) GetTags(filters map[string]string) (Tags, error)

GetTags returns a list of users, optionally filtered.

func (*ManagementClient) GetUser

func (c *ManagementClient) GetUser(id int) (User, error)

GetUser returns the user with the given id.

func (*ManagementClient) GetUsers

func (c *ManagementClient) GetUsers(filters map[string]string) (Users, error)

GetUsers returns a list of users, optionally filtered.

func (*ManagementClient) RemoveAgentFromLab

func (c *ManagementClient) RemoveAgentFromLab(labID, agentID int) error

RemoveAgentFromLab removes an Agent from a Lab.

func (*ManagementClient) RemoveEndpointFromEngine

func (c *ManagementClient) RemoveEndpointFromEngine(engineID, endpointID int) error

RemoveEndpointFromEngine removes an Endpoint from an Engine.

func (*ManagementClient) RemoveEngineFromAgent

func (c *ManagementClient) RemoveEngineFromAgent(agentID, engineID int) error

RemoveEngineFromAgent removes an Engine from an Agent.

func (*ManagementClient) RemoveSelectorFromAgent

func (c *ManagementClient) RemoveSelectorFromAgent(agentID, selectorID int) (Agent, error)

RemoveSelectorFromAgent removes a Selector from an Agent.

func (*ManagementClient) RemoveTagFromAgent

func (c *ManagementClient) RemoveTagFromAgent(agentID, tagID int) error

RemoveTagFromAgent removes a tag from a agent.

func (*ManagementClient) RemoveTagFromEndpoint

func (c *ManagementClient) RemoveTagFromEndpoint(endpointID, tagID int) error

RemoveTagFromEndpoint removes a tag from a endpoint.

func (*ManagementClient) RemoveTagFromEngine

func (c *ManagementClient) RemoveTagFromEngine(engineID, tagID int) error

RemoveTagFromEngine removes a tag from a engine.

func (*ManagementClient) RemoveTagFromLab

func (c *ManagementClient) RemoveTagFromLab(labID, tagID int) error

RemoveTagFromLab removes a tag from a lab.

func (*ManagementClient) RemoveTagFromUser

func (c *ManagementClient) RemoveTagFromUser(userID, tagID int) error

RemoveTagFromUser removes a tag from a user.

func (*ManagementClient) RemoveUserFromEngine

func (c *ManagementClient) RemoveUserFromEngine(engineID, userID int) error

RemoveUserFromEngine removes an User from an Engine.

func (*ManagementClient) SetLabPower

func (c *ManagementClient) SetLabPower(labID int, power bool) error

SetLabPower activates or deactivates a lab.

func (*ManagementClient) SetTimeout

func (c *ManagementClient) SetTimeout(timeout time.Duration)

SetTimeout can be used to set a timeout for requests raised from client.

func (*ManagementClient) SetUsernameAndPassword

func (c *ManagementClient) SetUsernameAndPassword(username, password string) error

SetUsernameAndPassword is used to set a username and password for https auth

func (*ManagementClient) UploadRecordFile

func (c *ManagementClient) UploadRecordFile(localPath, remotePath string) error

UploadRecordFile uploads the given record file to the api and saves it at the given remote path inside of the data dir.

func (*ManagementClient) UploadRecordFileString

func (c *ManagementClient) UploadRecordFileString(recordContents *string, remotePath string) error

UploadRecordFileString uploads the given record data to the api and saves it as a .snmprec file at the given remote path inside of the data dir.

type MessageFilters

type MessageFilters filters

MessageFilters resembles the response structure of GetMessageFilters

type MessageMetrics

type MessageMetrics struct {
	FirstHit   *int       `json:"first_hit"`
	LastHit    *int       `json:"last_hit"`
	Pdus       *int64     `json:"pdus"`
	VarBinds   *int64     `json:"var_binds"`
	Failures   *int64     `json:"failures"`
	Variations Variations `json:"variations"`
}

MessageMetrics - SNMP message level metrics.

type MetricsClient

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

MetricsClient is a client for communicating with the metrics api.

func NewMetricsClient

func NewMetricsClient(baseURL string) (*MetricsClient, error)

NewMetricsClient creates a new NewMetricsClient.

func (*MetricsClient) GetMessageFilters

func (c *MetricsClient) GetMessageFilters() (MessageFilters, error)

GetMessageFilters returns all message filters.

func (*MetricsClient) GetMessages

func (c *MetricsClient) GetMessages(filters map[string]string) (MessageMetrics, error)

GetMessages returns message metrics.

func (*MetricsClient) GetPacketFilters

func (c *MetricsClient) GetPacketFilters() (PacketFilters, error)

GetPacketFilters returns all packet filters.

func (*MetricsClient) GetPackets

func (c *MetricsClient) GetPackets(filters map[string]string) (PacketMetrics, error)

GetPackets returns packet metrics.

func (*MetricsClient) GetPossibleValuesForMessageFilter

func (c *MetricsClient) GetPossibleValuesForMessageFilter(filter string) ([]string, error)

GetPossibleValuesForMessageFilter returns a list of all values that can be used for the given filter.

func (*MetricsClient) GetPossibleValuesForPacketFilter

func (c *MetricsClient) GetPossibleValuesForPacketFilter(filter string) ([]string, error)

GetPossibleValuesForPacketFilter returns a list of all values that can be used for the given filter.

func (*MetricsClient) GetProcess

func (c *MetricsClient) GetProcess(id int) (ProcessMetrics, error)

GetProcess returns the process with the given id.

func (*MetricsClient) GetProcessConsolePage

func (c *MetricsClient) GetProcessConsolePage(processID int, pageID int) (Console, error)

GetProcessConsolePage returns the console-pages for the given process- and console-page-id.

func (*MetricsClient) GetProcessConsolePages

func (c *MetricsClient) GetProcessConsolePages(processID int) (Consoles, error)

GetProcessConsolePages returns an array of console-pages for the given process-id.

func (*MetricsClient) GetProcessEndpoint

func (c *MetricsClient) GetProcessEndpoint(processID int, endpointID int) (ProcessEndpoint, error)

GetProcessEndpoint returns the endpoint for the given process- and endpoint-id.

func (*MetricsClient) GetProcessEndpoints

func (c *MetricsClient) GetProcessEndpoints(id int) (ProcessEndpoints, error)

GetProcessEndpoints returns an array of endpoints for the given process-id.

func (*MetricsClient) GetProcesses

func (c *MetricsClient) GetProcesses(filters map[string]string) (ProcessesMetrics, error)

GetProcesses returns process metrics.

func (*MetricsClient) SetTimeout

func (c *MetricsClient) SetTimeout(timeout time.Duration)

SetTimeout can be used to set a timeout for requests raised from client.

func (*MetricsClient) SetUsernameAndPassword

func (c *MetricsClient) SetUsernameAndPassword(username, password string) error

SetUsernameAndPassword is used to set a username and password for https auth

type NotValidError

type NotValidError struct{}

NotValidError is returned when the client was not initialized properly with the NewManagementClient() func

func (*NotValidError) Error

func (m *NotValidError) Error() string

type PacketFilters

type PacketFilters filters

PacketFilters resembles the response structure of GetPacketFilters

type PacketMetrics

type PacketMetrics struct {
	FirstHit        *int   `json:"first_hit"`
	LastHit         *int   `json:"last_hit"`
	Total           *int64 `json:"total"`
	ParseFailures   *int64 `json:"parse_failures"`
	AuthFailures    *int64 `json:"auth_failures"`
	ContextFailures *int64 `json:"context_failures"`
}

PacketMetrics - Transport endpoint related activity. Includes raw network packet counts as well as SNMP messages failed to get processed at the later stages.

type ProcessEndpoint

type ProcessEndpoint struct {
	ID       int            `json:"id"`
	Protocol string         `json:"protocol"`
	Address  string         `json:"address"`
	Process  ProcessMetrics `json:"process"`
}

ProcessEndpoint - SNMP transport endpoint object. Each SNMP process can bind one or more transport endpoints. Each transport endpoint can only be bound by one SNMP process.

type ProcessEndpoints

type ProcessEndpoints []ProcessEndpoint

ProcessEndpoints is an array of process-endpoint

type ProcessLifeCycle

type ProcessLifeCycle struct {
	Exits    *int `json:"exits"`
	Restarts *int `json:"restarts"`
}

ProcessLifeCycle - How this process has being doing.

type ProcessMetrics

type ProcessMetrics struct {
	ID             int          `json:"id"`
	Path           string       `json:"path"`
	Runtime        int          `json:"runtime"`
	CPU            int          `json:"cpu"`
	Memory         int          `json:"memory"`
	Files          int          `json:"files"`
	Exits          int          `json:"exits"`
	Changes        int          `json:"changes"`
	UpdateInterval int          `json:"update_interval"`
	LastUpdate     string       `json:"last_update"`
	ConsolePages   ConsolePages `json:"console_pages"`
	Supervisor     Supervisor   `json:"supervisor"`
}

ProcessMetrics - SNMP simulator system is composed of many running processes. This object describes common properties of a process.

Cmdline   *string           `json:"cmdline"`
Uptime    *int              `json:"uptime"`
Owner     *string           `json:"owner"`

LifeCycle  	*ProcessLifeCycle	`json:"lifecycle"`

type ProcessesMetrics

type ProcessesMetrics []ProcessMetrics

ProcessesMetrics is an array of ProcessMetrics.

type Recording

type Recording struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Path string `json:"path"`
}

Recording - Represents a single simulation data file residing by path under simulation data root.

type Recordings

type Recordings []Recording

Recordings is an array of recordings.

type Selector

type Selector struct {
	ID       int    `json:"id"`
	Comment  string `json:"comment"`
	Template string `json:"template"`
	Tags     Tags   `json:"tags"`
}

Selector - Each selector should end up being a path to a simulation data file relative to the command responder's data directory. The value of the selector can be static or, more likely, it contains templates that are expanded at run time. Each template can expand into some property of the inbound request. Known templates include:

${context-engine-id}
${context-name}
${endpoint-id}
${source-address}

type Selectors

type Selectors []Selector

Selectors is an array of selectors.

type Supervisor

type Supervisor struct {
	Hostname string `json:"hostname"`
	WatchDir string `json:"watch_dir"`
}

Supervisor - contains information regarding the supervisor

type Tag

type Tag struct {
	ID          int       `json:"id"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Agents      Agents    `json:"agents"`
	Endpoints   Endpoints `json:"endpoints"`
	Engines     Engines   `json:"engines"`
	Labs        Labs      `json:"labs"`
	Selectors   Selectors `json:"selectors"`
	Users       Users     `json:"users"`
}

Tag - tags a collection of SNMP simulator control plane resources

type Tags

type Tags []Tag

Tags is an array of tags.

type User

type User struct {
	ID        int    `json:"id"`
	Name      string `json:"name"`
	User      string `json:"user"`
	AuthKey   string `json:"auth_key"`
	AuthProto string `json:"auth_proto"`
	PrivKey   string `json:"priv_key"`
	PrivProto string `json:"priv_proto"`
	Tags      Tags   `json:"tags"`
}

User - SNMPv3 USM user object. Contains SNMPv3 credentials grouped by user name.

type Users

type Users []User

Users is an array of users.

type Variation

type Variation struct {
	FirstHit *int    `json:"first_hit"`
	LastHit  *int    `json:"last_hit"`
	Total    *int64  `json:"total"`
	Name     *string `json:"name"`
	Failures *int64  `json:"failures"`
}

Variation - Variation module metrics.

type Variations

type Variations []Variation

Variations is an array of variations.

Jump to

Keyboard shortcuts

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