Documentation ¶
Index ¶
- func DeleteThingToResource(rc *resty.Client, thing Thing, ci ConnectionInfo, shouldCommit bool) (err error)
- func ExtractThingFromResource(rc *resty.Client, thing Thing, ci ConnectionInfo) (err error)
- func PostThingToResource(rc *resty.Client, thing Thing, ci ConnectionInfo, shouldCommit bool) (err error)
- func ReadThingFromFile(thing Thing, filename string, readfile func(filename string) ([]byte, error)) (err error)
- func WriteThingToFile(thing Thing, fw io.Writer) (err error)
- type Authentication
- type Cisco
- type ConnectionInfo
- type DGAuthentication
- type Device
- type DeviceFacts
- type DeviceGroup
- type DeviceGroups
- type Devices
- type IAgent
- type Juniper
- type NativeGpb
- type OpenConfig
- type Password
- type Snmp
- type SystemDetails
- type Thing
- type Token
- type V2
- type Vendor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteThingToResource ¶
func DeleteThingToResource(rc *resty.Client, thing Thing, ci ConnectionInfo, shouldCommit bool) (err error)
DeleteThingToResource - Use the Things Path function to build a DELETE REST request
func ExtractThingFromResource ¶
func ExtractThingFromResource(rc *resty.Client, thing Thing, ci ConnectionInfo) (err error)
ExtractThingFromResource - Use the Things Path function to build a GET REST requests and unmarshal body to yaml
func PostThingToResource ¶
func PostThingToResource(rc *resty.Client, thing Thing, ci ConnectionInfo, shouldCommit bool) (err error)
PostThingToResource - Use the Things Path function to build a POST REST requests and marshal body
Types ¶
type Authentication ¶
type Authentication struct {
Password `json:"password,omitempty" yaml:"password,omitempty"`
}
Authentication - Collection type for Auth options
type Cisco ¶
type Cisco struct {
OperatingSystem string `json:"operating-system" yaml:"operating-system"`
}
Cisco - option to define the Operating system
type ConnectionInfo ¶
ConnectionInfo - used to describe the resource endpoints
type DGAuthentication ¶
type DGAuthentication struct { Password struct { Password *string `json:"password"` Username *string `json:"username"` } `json:"password,omitempty" yaml:"password,omitempty"` }
DGAuthentication - Option to Override the individual Device Username/Passwords
type Device ¶
type Device struct { DeviceID string `json:"device-id" yaml:"device-id" csv:"device-id"` Host string `json:"host" csv:"host"` SystemID *string `json:"system-id,omitempty" yaml:"system-id,omitempty" csv:"-"` *Authentication `json:"authentication,omitempty" yaml:"authentication,omitempty"` IAgent *IAgent `json:"iAgent,omitempty" yaml:"iAgent,omitempty" csv:"-"` OpenConfig *OpenConfig `json:"open-config,omitempty" yaml:"open-config,omitempty" csv:"-"` Snmp *Snmp `json:"snmp,omitempty" yaml:"snmp,omitempty" csv:"-"` Vendor *Vendor `json:"vendor,omitempty" yaml:"vendor,omitempty" csv:"-"` }
Device - info needed to Register a Device in Healthbot
func (*Device) InnerThings ¶
InnerThings - returns inner things or empty slice
type DeviceFacts ¶
type DeviceFacts []struct { DeviceID string `json:"device-id" yaml:"device-id"` Facts struct { Hostname string `json:"hostname"` JunosInfo []struct { LastRebootReason string `json:"last-reboot-reason"` MastershipState string `json:"mastership-state"` Model string `json:"model"` Name string `json:"name"` Status string `json:"status"` UpTime string `json:"up-time"` } `json:"junos-info"` Platform string `json:"platform"` PlatformInfo []struct { Name string `json:"name"` Platform string `json:"platform"` } `json:"platform-info"` Product string `json:"product"` Release string `json:"release"` SerialNumber string `json:"serial-number" yaml:"serial-number"` } `json:"facts,omitempty"` }
DeviceFacts - Provides Device Facts
func (*DeviceFacts) Count ¶
func (d *DeviceFacts) Count() int
Count - no of components within a thing
func (*DeviceFacts) InnerThings ¶
func (d *DeviceFacts) InnerThings() []Thing
InnerThings - returns inner things or empty slice
func (*DeviceFacts) Unmarshal ¶
func (d *DeviceFacts) Unmarshal(data []byte) error
Unmarshal - tries to Unmarshal yaml first, then json into the DeviceFacts struct
type DeviceGroup ¶
type DeviceGroup struct { DeviceGroupName string `json:"device-group-name" yaml:"device-group-name"` Description *string `json:"description,omitempty" yaml:"description,omitempty"` Devices *[]string `json:"devices,omitempty" yaml:"devices,omitempty"` Playbooks *[]string `json:"playbooks,omitempty" yaml:"playbooks,omitempty"` Authentication *DGAuthentication `json:"authentication,omitempty" yaml:"authentication,omitempty"` NativeGpb *NativeGpb `json:"native-gpb,omitempty" yaml:"native-gpb,omitempty"` }
DeviceGroup - info needed to Register a DeviceGroup in Healthbot
func (*DeviceGroup) Count ¶
func (d *DeviceGroup) Count() int
Count - no of components within a thing
func (*DeviceGroup) InnerThings ¶
func (d *DeviceGroup) InnerThings() []Thing
InnerThings - returns inner things or empty slice
func (*DeviceGroup) Unmarshal ¶
func (d *DeviceGroup) Unmarshal(data []byte) error
Unmarshal - tries to Unmarshal yaml first, then json into the DeviceGroup struct
type DeviceGroups ¶
type DeviceGroups struct {
DeviceGroup []DeviceGroup `json:"device-group" yaml:"device-group"`
}
DeviceGroups - collection of Device Groups
func (*DeviceGroups) Count ¶
func (d *DeviceGroups) Count() int
Count - no of components within a thing
func (*DeviceGroups) InnerThings ¶
func (d *DeviceGroups) InnerThings() []Thing
InnerThings - returns inner things or empty slice
func (*DeviceGroups) Path ¶
func (d *DeviceGroups) Path() string
Path - resource path for DeviceGroups
func (*DeviceGroups) Unmarshal ¶
func (d *DeviceGroups) Unmarshal(data []byte) error
Unmarshal - tries to Unmarshal yaml first, then json into the DeviceGroups struct
type Devices ¶
type Devices struct {
Device []Device `json:"device"`
}
Devices - collection of Device
func (*Devices) InnerThings ¶
InnerThings - returns inner things or empty slice
type Juniper ¶
type Juniper struct {
OperatingSystem string `json:"operating-system" yaml:"operating-system"`
}
Juniper - option to define the Operating system
type NativeGpb ¶
type NativeGpb struct {
Ports []int `json:"ports"`
}
NativeGpb - Override the default JTI Port(s)
type OpenConfig ¶
type OpenConfig struct {
Port int `json:"port"`
}
OpenConfig - configure the Open Config port
type Password ¶
type Password struct { Username *string `json:"username" csv:"username,omitempty"` Password *string `json:"password" csv:"password,omitempty"` }
Password - wrapper for uname/password
type Snmp ¶
type Snmp struct { V2 *V2 `json:"v2,omitempty" yaml:"v2,omitempty"` Port int `json:"port,omitempty" yaml:"port,omitempty"` }
Snmp - configure the SNMP port or Community String
type SystemDetails ¶
type SystemDetails struct { ServerTime string `json:"server-time" yaml:"server-time"` Version string `json:"version"` }
SystemDetails - Provides some basic hb info
func (*SystemDetails) Count ¶
func (sd *SystemDetails) Count() int
Count - no of components within a thing
func (*SystemDetails) InnerThings ¶
func (sd *SystemDetails) InnerThings() []Thing
InnerThings - returns inner things or empty slice
func (*SystemDetails) Path ¶
func (sd *SystemDetails) Path() string
Path - resource path for Devices
func (*SystemDetails) Unmarshal ¶
func (sd *SystemDetails) Unmarshal(data []byte) error
Unmarshal - tries to Unmarshal yaml first, then json into the Devices struct
type Thing ¶
type Thing interface { Unmarshal(data []byte) error Path() string Count() int // no of components within a thing InnerThings() []Thing // if Things is a aggregation of Things }
Thing - nouns that h7t act on
type Token ¶
type Token struct {
AccessToken string `json:"accessToken"`
}
func GetToken ¶
func GetToken(rc *resty.Client, ci ConnectionInfo) (t *Token, err error)
GetToken added for HB 3.0