agent

package
v0.0.0-...-b77c216 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	ID           string
	Name         string
	Folder       string
	Organization string
}

Agent represent an agent resource

func NewExampleAgent

func NewExampleAgent() Agent

NewExampleAgent returns a dummy agent, i.e. fake ID, serial number, etc.

func (Agent) String

func (d Agent) String() string

func (Agent) ToResponse

func (a Agent) ToResponse() Response

ToResponse converts a folder to a corresponding Response model

type Client

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

Client provides an API client to agent service

func NewClient

func NewClient(client *rest.HTTPClient) (*Client, error)

NewClient creates a new Client and returns a tuple of a pointer to it along with an error indicating if anything went wrong. The baseURL parameter should be the target API and sessionID a valid session for the target user.

func (*Client) Discovered

func (ac *Client) Discovered(agentID string) ([]DiscoveredDevice, error)

Discovered returns all the discovered devices of an agent

func (*Client) GetAll

func (ac *Client) GetAll() ([]Agent, error)

GetAll returns all agents of the user

func (*Client) GetAllInFolder

func (ac *Client) GetAllInFolder(id string) ([]Agent, error)

GetAllInFolder returns all agents of the user

func (*Client) Remove

func (ac *Client) Remove(agentID string) error

Remove the agent

func (*Client) SetDefaultCredentials

func (ac *Client) SetDefaultCredentials(agentID, username, password string) error

SetDefaultCredentials sets the default credentials of the agent

type DiscoveredDevice

type DiscoveredDevice struct {
	SerialNumber string `json:"serialNumber"`
	FriendlyName string `json:"friendlyName"`
	ModelName    string `json:"modelName"`
	Onboarded    bool   `json:"onboarded"`
	Agent        string
}

DiscoveredDevice represent a device discovered by an agent

func (DiscoveredDevice) String

func (d DiscoveredDevice) String() string

type Response

type Response struct {
	ID           string          `json:"id"`
	Name         string          `json:"name"`
	Folder       *rest.Reference `json:"folder"`
	Organization *rest.Reference `json:"organization"`
}

Response represent a response model from agent service

Jump to

Keyboard shortcuts

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