Documentation
¶
Index ¶
- type BasicResponse
- type CPU
- type Config
- type Console
- type Cpulimit
- type CreateResponse
- type Delay
- type Endpoints
- type ErrorResponse
- type Ethernet
- type EthernetEndpoints
- type EthernetInterfaces
- type EveNgClient
- func (c *EveNgClient) AddFolder(path string, folderName string) error
- func (c *EveNgClient) AddLab(path string, name string, version string, author string, description string, ...) error
- func (c *EveNgClient) AddNetwork(labPath string, networkType string, networkName string, left int, top int, ...) (int, error)
- func (c *EveNgClient) AddNode(labPath string, nodeType string, template string, config string, delay int, ...) (int, error)
- func (c *EveNgClient) AddUser(username string, name string, email string, password string, role string, ...) error
- func (c *EveNgClient) ConnectNodeInterfaceToNetwork(labPath string, nodeID int, interfaceID int, networkID int) error
- func (c *EveNgClient) DisconnectNodeInterfaceFromNetwork(labPath string, nodeID int, interfaceID int) error
- func (c *EveNgClient) EditLab(labPath string, name string, version string, author string, description string) error
- func (c *EveNgClient) EditUser(username string, name string, email string, password string, role string, ...) error
- func (c *EveNgClient) ExportNode(labPath string, nodeID int) error
- func (c *EveNgClient) ExportNodes(labPath string) error
- func (c *EveNgClient) GetFolders(path string) (Folders, error)
- func (c *EveNgClient) GetLab(labPath string) (Lab, error)
- func (c *EveNgClient) GetLabFiles(path string) (LabFiles, error)
- func (c *EveNgClient) GetNetwork(labPath string, networkID int) (Network, error)
- func (c *EveNgClient) GetNetworkTypes() (NetworkTypes, error)
- func (c *EveNgClient) GetNetworks(labPath string) (Networks, error)
- func (c *EveNgClient) GetNode(labPath string, nodeID int) (Node, error)
- func (c *EveNgClient) GetNodeInterfaces(labPath string, nodeID int) (Interfaces, error)
- func (c *EveNgClient) GetNodeTemplate(templateName string) (Template, error)
- func (c *EveNgClient) GetNodeTemplates() (Templates, error)
- func (c *EveNgClient) GetNodes(labPath string) (Nodes, error)
- func (c *EveNgClient) GetSystemStatus() (SystemStatus, error)
- func (c *EveNgClient) GetTopology(labPath string) (TopologyPoints, error)
- func (c *EveNgClient) GetUser(username string) (User, error)
- func (c *EveNgClient) GetUserRoles() (UserRoles, error)
- func (c *EveNgClient) GetUsers() (Users, error)
- func (c *EveNgClient) Login() error
- func (c *EveNgClient) Logout() error
- func (c *EveNgClient) MoveFolder(oldPath string, newPath string) error
- func (c *EveNgClient) MoveLab(labPath string, newPath string) error
- func (c *EveNgClient) RemoveFolder(path string) error
- func (c *EveNgClient) RemoveLab(labPath string) error
- func (c *EveNgClient) RemoveNetwork(labPath string, networkID int) error
- func (c *EveNgClient) RemoveNode(labPath string, nodeID int) error
- func (c *EveNgClient) RemoveUser(username string) error
- func (c *EveNgClient) SetNodeStartupConfig(labPath string, nodeID int, startupConfigFilePath string) error
- func (c *EveNgClient) SetNodeStartupConfigString(labPath string, nodeID int, startupConfigString string) error
- func (c *EveNgClient) SetUsernameAndPassword(username, password string) error
- func (c *EveNgClient) StartNode(labPath string, nodeID int) error
- func (c *EveNgClient) StartNodes(labPath string) error
- func (c *EveNgClient) StopNode(labPath string, nodeID int) error
- func (c *EveNgClient) StopNodes(labPath string) error
- func (c *EveNgClient) WipeNode(labPath string, nodeID int) error
- func (c *EveNgClient) WipeNodes(labPath string) error
- type Firstmac
- type Folder
- type FolderContents
- type Folders
- type HTTPError
- type Icon
- type Image
- type IntValTemplateOption
- type Interface
- type Interfaces
- type Lab
- type LabFile
- type LabFiles
- type List
- type Name
- type Network
- type NetworkTypes
- type NetworkWithID
- type Networks
- type Node
- type NodeWithID
- type Nodes
- type NotValidError
- type Nvram
- type Options
- type Picture
- type Pictures
- type Qemu
- type Qemuarch
- type Qemunic
- type Qemuoptions
- type Qemuversion
- type RAM
- type Rdppassword
- type Rdpuser
- type Serial
- type SerialEndpoints
- type SerialInterfaces
- type StringArray
- type StringValTemplateOption
- type SystemStatus
- type Template
- type Templates
- type Topology
- type TopologyPoints
- type UUID
- type User
- type UserRoles
- type Users
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicResponse ¶
type BasicResponse struct { Code interface{} `json:"code"` Data interface{} `json:"data"` Message string `json:"message"` Status string `json:"status"` }
BasicResponse contains the data returned by the api in case of a get
type CPU ¶
type CPU struct {
IntValTemplateOption
}
CPU contains information about the templates cpu option
type Config ¶
type Config struct { List StringArray `json:"list"` StringValTemplateOption }
Config contains information about a template config
type Console ¶
type Console struct { List List `json:"list"` StringValTemplateOption }
Console contains information about the templates qonsole option
type Cpulimit ¶
type Cpulimit struct {
IntValTemplateOption
}
Cpulimit contains information about the templates Cpulimit option
type CreateResponse ¶
type CreateResponse struct {
ID int `json:"id"`
}
CreateResponse contains the data returned by the api in case of a create
type Delay ¶
type Delay struct {
IntValTemplateOption
}
Delay contains information about the templates delay option
type Endpoints ¶
type Endpoints struct { Ethernet EthernetEndpoints `json:"ethernet"` Serial SerialEndpoints `json:"serial"` }
Endpoints contains information about ethernet and serial endpoints
type ErrorResponse ¶
ErrorResponse - Contains error information.
type Ethernet ¶
type Ethernet struct {
IntValTemplateOption
}
Ethernet contains information about the templates ethernet option
type EthernetEndpoints ¶
EthernetEndpoints contains information about EthernetEndpoints
type EthernetInterfaces ¶
type EthernetInterfaces []Interface
EthernetInterfaces an array of EthernetInterfaces
type EveNgClient ¶
type EveNgClient struct {
// contains filtered or unexported fields
}
EveNgClient is an implementation of the client specified for eve-ng
func NewEveNgClient ¶
func NewEveNgClient(baseURL string) (*EveNgClient, error)
NewEveNgClient generates a new eve-ng api-client object which can be used to communicate with the eve-ng REST API
func (*EveNgClient) AddFolder ¶
func (c *EveNgClient) AddFolder(path string, folderName string) error
AddFolder adds a new folder to the given directory
func (*EveNgClient) AddLab ¶
func (c *EveNgClient) AddLab(path string, name string, version string, author string, description string, body string) error
AddLab adds a lab to
func (*EveNgClient) AddNetwork ¶
func (c *EveNgClient) AddNetwork(labPath string, networkType string, networkName string, left int, top int, visibility int, postfix int) (int, error)
AddNetwork add a new network to a lab
func (*EveNgClient) AddNode ¶
func (c *EveNgClient) AddNode(labPath string, nodeType string, template string, config string, delay int, icon string, image string, name string, left int, top int, ram int, console string, cpu int, cpuLimit string, ethernet int, firstMac string, rdpUser string, rdpPassword string, uuid string, count int) (int, error)
AddNode add a new node to a lab
func (*EveNgClient) AddUser ¶
func (c *EveNgClient) AddUser(username string, name string, email string, password string, role string, expiration string, dateStart string, extAuth string, pod int, pexpiration string, cpu int, ram int) error
AddUser adds a new user
func (*EveNgClient) ConnectNodeInterfaceToNetwork ¶
func (c *EveNgClient) ConnectNodeInterfaceToNetwork(labPath string, nodeID int, interfaceID int, networkID int) error
ConnectNodeInterfaceToNetwork connects the given node interface to a network
func (*EveNgClient) DisconnectNodeInterfaceFromNetwork ¶
func (c *EveNgClient) DisconnectNodeInterfaceFromNetwork(labPath string, nodeID int, interfaceID int) error
DisconnectNodeInterfaceFromNetwork disconnects the given node interface to a network
func (*EveNgClient) EditLab ¶
func (c *EveNgClient) EditLab(labPath string, name string, version string, author string, description string) error
EditLab edit an existing lab
func (*EveNgClient) EditUser ¶
func (c *EveNgClient) EditUser(username string, name string, email string, password string, role string, expiration string, pod int, pexpiration string) error
EditUser edits an existing user
func (*EveNgClient) ExportNode ¶
func (c *EveNgClient) ExportNode(labPath string, nodeID int) error
ExportNode exports a specific node in a lab
func (*EveNgClient) ExportNodes ¶
func (c *EveNgClient) ExportNodes(labPath string) error
ExportNodes exports all nodes in a lab
func (*EveNgClient) GetFolders ¶
func (c *EveNgClient) GetFolders(path string) (Folders, error)
GetFolders returns all folders in a given path
func (*EveNgClient) GetLab ¶
func (c *EveNgClient) GetLab(labPath string) (Lab, error)
GetLab retrieves data for the given lab
func (*EveNgClient) GetLabFiles ¶
func (c *EveNgClient) GetLabFiles(path string) (LabFiles, error)
GetLabFiles returns all lab files in a given path
func (*EveNgClient) GetNetwork ¶
func (c *EveNgClient) GetNetwork(labPath string, networkID int) (Network, error)
GetNetwork returns data for given network id for lab
func (*EveNgClient) GetNetworkTypes ¶
func (c *EveNgClient) GetNetworkTypes() (NetworkTypes, error)
GetNetworkTypes returns all available network types
func (*EveNgClient) GetNetworks ¶
func (c *EveNgClient) GetNetworks(labPath string) (Networks, error)
GetNetworks returns a list of all networks configured in a lab
func (*EveNgClient) GetNode ¶
func (c *EveNgClient) GetNode(labPath string, nodeID int) (Node, error)
GetNode - Returns data for a specific lab node
func (*EveNgClient) GetNodeInterfaces ¶
func (c *EveNgClient) GetNodeInterfaces(labPath string, nodeID int) (Interfaces, error)
GetNodeInterfaces returns all interfaces for a specific lab node
func (*EveNgClient) GetNodeTemplate ¶
func (c *EveNgClient) GetNodeTemplate(templateName string) (Template, error)
GetNodeTemplate returns data of a specific template
func (*EveNgClient) GetNodeTemplates ¶
func (c *EveNgClient) GetNodeTemplates() (Templates, error)
GetNodeTemplates returns all node templates
func (*EveNgClient) GetNodes ¶
func (c *EveNgClient) GetNodes(labPath string) (Nodes, error)
GetNodes returns all nodes in a lab
func (*EveNgClient) GetSystemStatus ¶
func (c *EveNgClient) GetSystemStatus() (SystemStatus, error)
GetSystemStatus returns the system status of eve-ng
func (*EveNgClient) GetTopology ¶
func (c *EveNgClient) GetTopology(labPath string) (TopologyPoints, error)
GetTopology retrieves topology for given lab
func (*EveNgClient) GetUser ¶
func (c *EveNgClient) GetUser(username string) (User, error)
GetUser retreives data for given user
func (*EveNgClient) GetUserRoles ¶
func (c *EveNgClient) GetUserRoles() (UserRoles, error)
GetUserRoles returns all available user roles
func (*EveNgClient) GetUsers ¶
func (c *EveNgClient) GetUsers() (Users, error)
GetUsers retreives a list of all users
func (*EveNgClient) Login ¶
func (c *EveNgClient) Login() error
Login performs a login via an eve-ng api-client
func (*EveNgClient) Logout ¶
func (c *EveNgClient) Logout() error
Logout performs a logout via an eve-ng api-client
func (*EveNgClient) MoveFolder ¶
func (c *EveNgClient) MoveFolder(oldPath string, newPath string) error
MoveFolder moves/renames an existing folder
func (*EveNgClient) MoveLab ¶
func (c *EveNgClient) MoveLab(labPath string, newPath string) error
MoveLab moves a lab to an existing folder
func (*EveNgClient) RemoveFolder ¶
func (c *EveNgClient) RemoveFolder(path string) error
RemoveFolder deletes an existing folder
func (*EveNgClient) RemoveLab ¶
func (c *EveNgClient) RemoveLab(labPath string) error
RemoveLab remove an existing lab
func (*EveNgClient) RemoveNetwork ¶
func (c *EveNgClient) RemoveNetwork(labPath string, networkID int) error
RemoveNetwork removes a given network
func (*EveNgClient) RemoveNode ¶
func (c *EveNgClient) RemoveNode(labPath string, nodeID int) error
RemoveNode removes a node from a lab
func (*EveNgClient) RemoveUser ¶
func (c *EveNgClient) RemoveUser(username string) error
RemoveUser removes an existing user
func (*EveNgClient) SetNodeStartupConfig ¶
func (c *EveNgClient) SetNodeStartupConfig(labPath string, nodeID int, startupConfigFilePath string) error
SetNodeStartupConfig sets a startup config for a given node. The startup config is passed as a path to a local startup config file.
func (*EveNgClient) SetNodeStartupConfigString ¶
func (c *EveNgClient) SetNodeStartupConfigString(labPath string, nodeID int, startupConfigString string) error
SetNodeStartupConfigString sets a startup config for a given node. The startup config is passed as a string.
func (*EveNgClient) SetUsernameAndPassword ¶
SetUsernameAndPassword - Is used to set a username and password for https auth
func (*EveNgClient) StartNode ¶
func (c *EveNgClient) StartNode(labPath string, nodeID int) error
StartNode starts a specific node in a lab
func (*EveNgClient) StartNodes ¶
func (c *EveNgClient) StartNodes(labPath string) error
StartNodes starts all nodes in a lab
func (*EveNgClient) StopNode ¶
func (c *EveNgClient) StopNode(labPath string, nodeID int) error
StopNode stops a specific node in a lab
func (*EveNgClient) StopNodes ¶
func (c *EveNgClient) StopNodes(labPath string) error
StopNodes stops all nodes in a lab
func (*EveNgClient) WipeNode ¶
func (c *EveNgClient) WipeNode(labPath string, nodeID int) error
WipeNode wipes a specific node in a lab
func (*EveNgClient) WipeNodes ¶
func (c *EveNgClient) WipeNodes(labPath string) error
WipeNodes wipes all nodes in a lab
type Firstmac ¶
type Firstmac struct {
StringValTemplateOption
}
Firstmac contains information about the templates firstmac option
type FolderContents ¶
FolderContents is a list of folders and labs inside a folder
type HTTPError ¶
type HTTPError struct { StatusCode int Status string Body *ErrorResponse }
HTTPError - Represents an http error returned by the api.
type Icon ¶
type Icon struct { List List `json:"list"` StringValTemplateOption }
Icon contains information about the templates icon option
type Image ¶
type Image struct { List interface{} `json:"list"` StringValTemplateOption }
Image contains information about the templates image option
type IntValTemplateOption ¶
type IntValTemplateOption struct { Name string `json:"name"` Type string `json:"type"` Value int `json:"value"` }
IntValTemplateOption contains the standard fields of a templateOption
type Interfaces ¶
type Interfaces struct { Ethernet EthernetInterfaces `json:"ethernet"` Serial SerialInterfaces `json:"serial"` }
Interfaces contains information about ethernet and serial interfaces
type Lab ¶
type Lab struct { ID string `json:"id"` Name string `json:"name"` Version string `json:"version"` Author string `json:"author"` Body string `json:"body"` Description string `json:"description"` Filename string `json:"filename"` }
Lab contains information about a lab
type Name ¶
type Name struct {
StringValTemplateOption
}
Name contains information about the templates name option
type Network ¶
type Network struct { Count int `json:"count"` Name string `json:"name"` Type string `json:"type"` Top int `json:"top"` Left int `json:"left"` Style string `json:"style"` Linkstyle string `json:"linkstyle"` Color string `json:"color"` Label string `json:"label"` Visibility int `json:"visibility"` }
Network contains information about a network
type NetworkWithID ¶
NetworkWithID contains information about a network including its id
type Node ¶
type Node struct { UUID string `json:"uuid"` Name string `json:"name"` Type string `json:"type"` Status int `json:"status"` Template string `json:"template"` CPU int `json:"cpu"` RAM int `json:"ram"` Image string `json:"image"` Console string `json:"console"` Ethernet int `json:"ethernet"` Delay int `json:"delay"` Icon string `json:"icon"` URL string `json:"url"` Top int `json:"top"` Left int `json:"left"` Config string `json:"config"` Firstmac string `json:"firstmac"` Configlist interface{} `json:"configlist"` }
Node contains information about a node
type NodeWithID ¶
NodeWithID contains information about a node including its id
type NotValidError ¶
type NotValidError struct{}
NotValidError - Is returned when the client was not initialized properly
func (*NotValidError) Error ¶
func (m *NotValidError) Error() string
type Nvram ¶
type Nvram struct {
IntValTemplateOption
}
Nvram contains information about the templates nvram option
type Options ¶
type Options struct { Config Config `json:"config"` Delay Delay `json:"delay"` Ethernet Ethernet `json:"ethernet"` Icon Icon `json:"icon"` Image Image `json:"image"` Name Name `json:"name"` Nvram Nvram `json:"nvram"` RAM RAM `json:"ram"` Serial Serial `json:"serial"` UUID UUID `json:"uuid"` Cpulimit Cpulimit `json:"cpulimit"` CPU CPU `json:"cpu"` Firstmac Firstmac `json:"firstmac"` Qemuversion Qemuversion `json:"qemuversion"` Qemuarch Qemuarch `json:"qemuarch"` Qemunic Qemunic `json:"qemunic"` Qemuoptions Qemuoptions `json:"qemuoptions"` Console Console `json:"console"` Rdpuser Rdpuser `json:"rdpuser"` Rdppassword Rdppassword `json:"rdppassword"` }
Options contains information about the templates options
type Picture ¶
type Picture struct { ID int `json:"id"` Name string `json:"name"` Type string `json:"type"` Map string `json:"map"` Width int `json:"width"` Height int `json:"height"` }
Picture contains information about a specific picture
type Qemu ¶
type Qemu struct { Arch string `json:"arch"` Nic string `json:"nic"` Options string `json:"options"` }
Qemu contains information about the templates qemu option
type Qemuarch ¶
type Qemuarch struct { List List `json:"list"` StringValTemplateOption }
Qemuarch contains information about the templates qemuarch option
type Qemunic ¶
type Qemunic struct { List List `json:"list"` StringValTemplateOption }
Qemunic contains information about the templates qemunic option
type Qemuoptions ¶
type Qemuoptions struct {
StringValTemplateOption
}
Qemuoptions contains information about the templates qemuoptions option
type Qemuversion ¶
type Qemuversion struct { List List `json:"list"` StringValTemplateOption }
Qemuversion contains information about the templates qemuversion option
type RAM ¶
type RAM struct {
IntValTemplateOption
}
RAM contains information about the templates ram option
type Rdppassword ¶
type Rdppassword struct {
StringValTemplateOption
}
Rdppassword contains information about the templates rdppassword option
type Rdpuser ¶
type Rdpuser struct {
StringValTemplateOption
}
Rdpuser contains information about the templates rdpuser option
type Serial ¶
type Serial struct {
IntValTemplateOption
}
Serial contains information about the templates Serial option
type SerialEndpoints ¶
SerialEndpoints contains information about SerialEndpoints
type SerialInterfaces ¶
type SerialInterfaces []Interface
SerialInterfaces an array of SerialInterfaces
type StringArray ¶
type StringArray []string
StringArray resembles the field List of some stucts returned by the api because they are different than the List struct
type StringValTemplateOption ¶
type StringValTemplateOption struct { Name string `json:"name"` Type string `json:"type"` Value string `json:"value"` }
StringValTemplateOption contains the standard fields of a templateOption
type SystemStatus ¶
type SystemStatus struct { Cached int `json:"cached"` CPU string `json:"cpu"` //! should be int Disk string `json:"disk"` //! should be int Dynamips string `json:"dynamips"` //! should be int Iol string `json:"iol"` //! should be int Mem string `json:"mem"` //! should be int Qemu string `json:"qemu"` //! should be int Qemuversion string `json:"qemu_version"` Swap string `json:"swap"` //! should be int Version string `json:"version"` }
SystemStatus contains information regarding the system status TODO: CPU, Disk, etc. should be int and not string
type Template ¶
type Template struct { Description string `json:"description"` Options Options `json:"options"` Type string `json:"type"` Qemu Qemu `json:"qemu"` }
Template contains information about a specific template
type Topology ¶
type Topology struct { Destination string `json:"destination"` DestinationLabel string `json:"destination_label"` DestinationType string `json:"destination_type"` DestinationInterfaceID string `json:"destinationinterfaceid"` DestinationNodename string `json:"destinationnodename"` DestinationSuspend int `json:"destinationsuspend"` DestinationDelay int `json:"destinationdelay"` DestinationLoss int `json:"destinationloss"` DestinationBandwidth int `json:"destinationbandwidth"` DestinationJitter int `json:"destinationjitter"` Source string `json:"source"` SourceLabel string `json:"source_label"` SourceType string `json:"source_type"` SourceNodename string `json:"sourcenodename"` SourceInterfaceID int `json:"sourceinterface"` SourceSuspend int `json:"sourcesuspend"` SourceDelay int `json:"sourcedelay"` SourceLoss int `json:"sourceloss"` SourceBandwidth int `json:"sourcebandwidth"` SourceJitter int `json:"sourcejitter"` Type string `json:"type"` NetworkID int `json:"networkid"` Style string `json:"style"` Linkstyle string `json:"linkstyle"` Label string `json:"label"` Color string `json:"color"` }
Topology contains information about a network topology point
type TopologyPoints ¶
type TopologyPoints []Topology
TopologyPoints an array of network topology points
type UUID ¶
type UUID struct {
StringValTemplateOption
}
UUID contains information about the templates UUID option
type User ¶
type User struct { Username string `json:"username"` Email string `json:"email"` ExtAuth string `json:"ext_auth"` RAM string `json:"ram"` CPU string `json:"cpu"` Expiration string `json:"expiration"` Name string `json:"name"` Session string `json:"session"` Role string `json:"role"` Online int `json:"online"` IP string `json:"ip"` Folder string `json:"folder"` Lab string `json:"lab"` Pod string `json:"pod"` Pexpiration string `json:"pexpiration"` DateStart string `json:"datestart"` DiskUsage float64 `json:"diskusage"` }
User contains information about a specific user