model

package
v1.0.0-beta3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Severities list of valid event severities
	Severities = EnumValue{
		Enum: []string{"Indeterminate", "Normal", "Warning", "Minor", "Major", "Critical"},
	}

	// Destinations for logMsg
	Destinations = EnumValue{
		Enum: []string{"logndisplay", "displayonly", "logonly", "suppress", "donotpersist"},
	}
)
View Source
var AllowFqdnOnRequisitionedInterfaces = true

AllowFqdnOnRequisitionedInterfaces when this is true, if the content of an IP Address is a FQDN it will be translated into a valid IPv4

View Source
var SNMPAuthProtocols = &EnumValue{
	Enum: []string{"MD5", "SHA"},
}

SNMPAuthProtocols the Authentication Protocols enumeration

View Source
var SNMPPrivProtocols = &EnumValue{
	Enum: []string{"DES", "AES", "AES192", "AES256"},
}

SNMPPrivProtocols the Private Protocols enumeration

View Source
var SNMPVersions = &EnumValue{
	Enum:    []string{"v1", "v2c", "v3"},
	Default: "v2c",
}

SNMPVersions the SNMP version enumeration

View Source
var ScheduledTypes = EnumValue{
	Enum: []string{"specific", "daily", "weekly", "monthly"},
}

ScheduledTypes list of valid scheduled outage types

View Source
var WeekDays = EnumValue{
	Enum: []string{"monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"},
}

WeekDays list of valid week days

Functions

func IsValidScanInterval

func IsValidScanInterval(scanInterval string) bool

IsValidScanInterval checks if a given scan-interval is valid

Types

type Detector

type Detector struct {
	XMLName    xml.Name    `xml:"detector" json:"-" yaml:"-"`
	Name       string      `xml:"name,attr" json:"name" yaml:"name"`
	Class      string      `xml:"class,attr" json:"class" yaml:"class"`
	Parameters []Parameter `xml:"parameter,omitempty" json:"parameter,omitempty" yaml:"parameters,omitempty"`
}

Detector a provisioning detector

func (*Detector) Validate

func (p *Detector) Validate() error

Validate returns an error if the detector is invalid

type ElementList

type ElementList struct {
	Count   int      `json:"count" yaml:"count"`
	Element []string `json:"element" yaml:"element"`
}

ElementList a list of elements/strings

type EnumValue

type EnumValue struct {
	Enum    []string
	Default string
	// contains filtered or unexported fields
}

EnumValue a enumaration array of strings

func (EnumValue) EnumAsString

func (e EnumValue) EnumAsString() string

EnumAsString gets a CSV with all the values on the enum

func (*EnumValue) Set

func (e *EnumValue) Set(value string) error

Set sets a value of the enum

func (EnumValue) String

func (e EnumValue) String() string

String gets the value of the enum as string

type Event

type Event struct {
	SnmpMask      *Mask        `json:"mask,omitempty" json:"mask,omitempty"`
	Snmp          *SNMP        `json:"snmp,omitempty" json:"snmp,omitempty"`
	LogMessage    *LogMsg      `json:"logmsg,omitempty" json:"logmsg,omitempty"`
	UEI           string       `json:"uei" yaml:"uei"`
	Source        string       `json:"source" yaml:"source"`
	Time          string       `json:"time,omitempty" yaml:"time,omitempty"`
	Host          string       `json:"host,omitempty" yaml:"host,omitempty"`
	MasterStation string       `json:"master-station,omitempty" yaml:"masterStation,omitempty"`
	NodeID        int64        `json:"nodeid,omitempty" yaml:"nodeID,omitempty"`
	Interface     string       `json:"interface,omitempty" yaml:"interface,omitempty"`
	Service       string       `json:"service,omitempty" yaml:"service,omitempty"`
	IfIndex       int          `json:"ifindex,omitempty" yaml:"ifIndex,omitempty"`
	SnmpHost      string       `json:"snmphost,omitempty" yaml:"snmpHost,omitempty"`
	Parameters    []EventParam `json:"parms,omitempty" yaml:"parameters,omitempty"`
	Description   string       `json:"descr,omitempty" yaml:"description,omitempty"`
	Severity      string       `json:"severity,omitempty" yaml:"severity,omitempty"`
	PathOutage    string       `json:"pathoutage,omitempty" yaml:"pathOutage,omitempty"`
	OperInstruct  string       `json:"operinstruct,omitempty" yaml:"operInstruct,omitempty"`
}

Event an event object Time uses a string format. Example: "Saturday, July 13, 2019 2:13:43 PM GMT"

func (*Event) AddParameter

func (e *Event) AddParameter(key string, value string)

AddParameter adds a new parameter to the event

func (*Event) SetTime

func (e *Event) SetTime(date time.Time)

SetTime sets the string date based on a Time object

func (Event) Validate

func (e Event) Validate() error

Validate returns an error if the event object is invalid

type EventParam

type EventParam struct {
	Name  string `json:"parmName" yaml:"name"`
	Value string `json:"value" yaml:"value"`
}

EventParam an event parameter object

type ForeignSourceDef

type ForeignSourceDef struct {
	XMLName      xml.Name   `xml:"foreign-source" json:"-" yaml:"-"`
	Name         string     `xml:"name,attr" json:"name" yaml:"name"`
	DateStamp    *Time      `xml:"date-stamp,attr,omitempty" json:"date-stamp,omitempty" yaml:"dateStamp,omitempty"`
	ScanInterval string     `xml:"scan-interval" json:"scan-interval" yaml:"scanInterval"`
	Detectors    []Detector `xml:"detectors>detector" json:"detectors,omitempty" yaml:"detectors,omitempty"`
	Policies     []Policy   `xml:"policies>policy" json:"policies,omitempty" yaml:"policies,omitempty"`
}

ForeignSourceDef a foreign source definition

func (ForeignSourceDef) GetDetector

func (fs ForeignSourceDef) GetDetector(detectorID string) (*Detector, error)

GetDetector gets a detector by its name or class

func (ForeignSourceDef) GetPolicy

func (fs ForeignSourceDef) GetPolicy(policyID string) (*Policy, error)

GetPolicy gets a policy by its name or class

func (*ForeignSourceDef) Validate

func (fs *ForeignSourceDef) Validate() error

Validate returns an error if the node definition is invalid

type LogMsg

type LogMsg struct {
	Message     string `json:"value" yaml:"message"`
	Notify      bool   `json:"notify" yaml:"notify"`
	Destination string `json:"dest" yaml:"destination"`
}

LogMsg the event log message

func (*LogMsg) Validate

func (lm *LogMsg) Validate() error

Validate returns an error if the log message is invalid

type Mask

type Mask struct {
	Elements []MaskElement `json:"maskelement,omitempty" yaml:"maskElement,omitempty"`
}

Mask an event mask object

type MaskElement

type MaskElement struct {
	Name   string   `json:"mename" yaml:"mename"`
	Values []string `json:"mevalue" yaml:"mevalue"`
}

MaskElement an event mask element object

type MetaData

type MetaData struct {
	XMLName xml.Name `xml:"meta-data" json:"-" yaml:"-"`
	Key     string   `xml:"key" json:"key" yaml:"key"`
	Value   string   `xml:"value" json:"value" yaml:"value"`
	Context string   `xml:"context" json:"context" yaml:"context"`
}

MetaData a meta-data entry

func (*MetaData) Validate

func (obj *MetaData) Validate() error

Validate verify structure and apply defaults when needed

type MetaDataList

type MetaDataList struct {
	XMLName    xml.Name   `xml:"meta-data-list" json:"-" yaml:"-"`
	Count      int        `xml:"count,attr" json:"count" yaml:"count"`
	TotalCount int        `xml:"totalCount,attr" json:"totalCount" yaml:"totalCount"`
	Offset     int        `xml:"offset,attr" json:"offset" yaml:"offset"`
	Metadata   []MetaData `xml:"meta-data" json:"metaData" yaml:"metadata"`
}

MetaDataList a list of metadata

type MonitoringLocation

type MonitoringLocation struct {
	Tags                   []string `json:"tags,omitempty" yaml:"tags,omitempty"`
	GeoLocation            string   `json:"geolocation,omitempty" yaml:"geoLocation,omitempty"`
	Latitude               float64  `json:"latitude,omitempty" yaml:"latitude,omitempty"`
	Longitude              float64  `json:"longitude,omitempty" yaml:"longitude,omitempty"`
	LocationName           string   `json:"location-name,omitempty" yaml:"name,omitempty"`
	Priority               int      `json:"priority,omitempty" yaml:"priority,omitempty"`
	MonitoringArea         string   `json:"monitoring-area,omitempty" yaml:"monitoringArea,omitempty"`
	PollingPackageNames    []string `json:"polling-package-names,omitempty" yaml:"pollingPackageNames,omitempty"`
	CollectionPackageNames []string `json:"collection-package-names,omitempty" yaml:"collectionPackageNames,omitempty"`
}

MonitoringLocation an OpenNMS Location

type MonitoringLocationList

type MonitoringLocationList struct {
	Count      int                  `json:"count" yaml:"count"`
	TotalCount int                  `json:"totalCount" yaml:"totalCount"`
	Offset     int                  `json:"offset" yaml:"offset"`
	Locations  []MonitoringLocation `json:"location" yaml:"locations"`
}

MonitoringLocationList a list of monitoring locations

type NumericAttribute

type NumericAttribute struct {
	Name         string `json:"name" yaml:"-"`
	RelativePath string `json:"relativePath,omitempty" yaml:"relativePath,omitempty"`
	RrdFile      string `json:"rrdFile" yaml:"rrdFile"`
}

NumericAttribute a numeric attribute

type OnmsAlarm

type OnmsAlarm struct {
	// Inherit from Events
	ID                   int              `json:"id" yaml:"id"`
	UEI                  string           `json:"uei" yaml:"uei"`
	EventTime            *Time            `json:"time,omitempty" yaml:"time,omitempty"`
	EventHost            string           `json:"host,omitempty" yaml:"host,omitempty"`
	EventSource          string           `json:"source,omitempty" yaml:"source,omitempty"`
	CreateTime           *Time            `json:"createTime,omitempty" yaml:"createTime,omitempty"`
	SnmpHost             string           `json:"snmpHost,omitempty" yaml:"snmpHost,omitempty"`
	Snmp                 string           `json:"snmp,omitempty" yaml:"snmp,omitempty"`
	NodeID               int              `json:"nodeId,omitempty" yaml:"nodeId,omitempty"`
	NodeLabel            string           `json:"nodeLabel,omitempty" yaml:"nodeLabel,omitempty"`
	IPAddress            string           `json:"ipAddress,omitempty" yaml:"ipAddress,omitempty"`
	ServiceType          OnmsServiceType  `json:"serviceType,omitempty" yaml:"serviceType,omitempty"`
	IfIndex              int              `json:"ifIndex,omitempty" yaml:"ifIndex,omitempty"`
	Severity             string           `json:"severity,omitempty" yaml:"severity,omitempty"`
	Log                  string           `json:"log,omitempty" yaml:"log,omitempty"`
	LogGroup             string           `json:"logGroup,omitempty" yaml:"logGroup,omitempty"`
	LogMessage           string           `json:"logMessage,omitempty" yaml:"logMessage,omitempty"`
	Display              string           `json:"display,omitempty" yaml:"display,omitempty"`
	Description          string           `json:"description,omitempty" yaml:"description,omitempty"`
	PathOutage           string           `json:"pathOutage,omitempty" yaml:"pathOutage,omitempty"`
	Correlation          string           `json:"correlation,omitempty" yaml:"correlation,omitempty"`
	SuppressedCount      int              `json:"suppressedCount,omitempty" yaml:"suppressedCount,omitempty"`
	OperatorInstructions string           `json:"operatorInstructions,omitempty" yaml:"operatorInstructions,omitempty"`
	OperatorAction       string           `json:"operatorAction,omitempty" yaml:"operatorAction,omitempty"`
	AutoAction           string           `json:"autoAction,omitempty" yaml:"autoAction,omitempty"`
	Parameters           []OnmsEventParam `json:"parameters,omitempty" yaml:"parameters,omitempty"`
	// Alarm fields
	ReductionKey          string     `json:"reductionKey,omitempty" yaml:"reductionKey,omitempty"`
	ClearKey              string     `json:"clearKey,omitempty" yaml:"clearKey,omitempty"`
	Type                  int        `json:"type,omitempty" yaml:"type,omitempty"`
	Count                 int        `json:"count,omitempty" yaml:"count,omitempty"`
	TroubleTicketID       string     `json:"troubleTicket,omitempty" yaml:"troubleTicket,omitempty"`
	TroubleTicketState    string     `json:"troubleTicketState,omitempty" yaml:"troubleTicketState,omitempty"`
	SuppressedUntil       *Time      `json:"suppressedUntil,omitempty" yaml:"suppressedUntil,omitempty"`
	SuppressedBy          string     `json:"suppressedBy,omitempty" yaml:"suppressedBy,omitempty"`
	SuppressedTime        *Time      `json:"suppressedTime,omitempty" yaml:"suppressedTime,omitempty"`
	AckID                 int        `json:"ackId,omitempty" yaml:"ackId,omitempty"`
	AckUser               string     `json:"ackUser,omitempty" yaml:"ackUser,omitempty"`
	AckTime               *Time      `json:"ackTime,omitempty" yaml:"ackTime,omitempty"`
	ApplicationDN         string     `json:"applicationDN,omitempty" yaml:"applicationDN,omitempty"`
	ManagedObjectInstance string     `json:"managedObjectInstance,omitempty" yaml:"managedObjectInstance,omitempty"`
	ManagedObjectType     string     `json:"managedObjectType,omitempty" yaml:"managedObjectType,omitempty"`
	OssPrimaryKey         string     `json:"ossPrimaryKey,omitempty" yaml:"ossPrimaryKey,omitempty"`
	X733AlarmType         string     `json:"x733AlarmType,omitempty" yaml:"x733AlarmType,omitempty"`
	X733ProbableCause     int        `json:"x733ProbableCause,omitempty" yaml:"x733ProbableCause,omitempty"`
	QosAlarmState         string     `json:"qosAlarmState,omitempty" yaml:"qosAlarmState,omitempty"`
	FirstAutomationTime   *Time      `json:"firstAutomationTime,omitempty" yaml:"firstAutomationTime,omitempty"`
	LastAutomationTime    *Time      `json:"lastAutomationTime,omitempty" yaml:"lastAutomationTime,omitempty"`
	FirstEventTime        *Time      `json:"firstEventTime,omitempty" yaml:"firstEventTime,omitempty"`
	LastEventTime         *Time      `json:"lastEventTime,omitempty" yaml:"lastEventTime,omitempty"`
	LastEvent             *OnmsEvent `json:"lastEvent,omitempty" yaml:"-"`
}

OnmsAlarm OpenNMS alarm entity

type OnmsAlarmList

type OnmsAlarmList struct {
	Count      int         `json:"count" yaml:"count"`
	TotalCount int         `json:"totalCount" yaml:"totalCount"`
	Offset     int         `json:"offset" yaml:"offset"`
	Alarms     []OnmsAlarm `json:"alarm" yaml:"alarms"`
}

OnmsAlarmList a list of alarms

type OnmsAssetRecord

type OnmsAssetRecord struct {
	XMLName xml.Name `xml:"assetRecord" json:"-" yaml:"-"`
	ID      int      `xml:"id,attr,omitempty" json:"id,omitempty" yaml:"id,omitempty"`
	// Identification
	Description     string `xml:"description,omitempty" json:"description,omitempty" yaml:"description,omitempty"`
	Category        string `xml:"category,omitempty" json:"category,omitempty" yaml:"category,omitempty"`
	Manufacturer    string `xml:"manufacturer,omitempty" json:"manufacturer,omitempty" yaml:"manufacturer,omitempty"`
	ModelNumber     string `xml:"modelNumber,omitempty" json:"modelNumber,omitempty" yaml:"modelNumber,omitempty"`
	SerialNumber    string `xml:"serialNumber,omitempty" json:"serialNumber,omitempty" yaml:"serialNumber,omitempty"`
	AssetNumber     string `xml:"assetNumber,omitempty" json:"assetNumber,omitempty" yaml:"assetNumber,omitempty"`
	DateInstalled   *Time  `xml:"dateInstalled,omitempty" json:"dateInstalled,omitempty" yaml:"dateInstalled,omitempty"`
	OperatingSystem string `xml:"operatingSystem,omitempty" json:"operatingSystem,omitempty" yaml:"operatingSystem,omitempty"`
	// Location
	State          string  `xml:"state,omitempty" json:"state,omitempty" yaml:"state,omitempty"`
	Region         string  `xml:"region,omitempty" json:"region,omitempty" yaml:"region,omitempty"`
	Address1       string  `xml:"address1,omitempty" json:"address1,omitempty" yaml:"address1,omitempty"`
	Address2       string  `xml:"address2,omitempty" json:"address2,omitempty" yaml:"address2,omitempty"`
	City           string  `xml:"city,omitempty" json:"city,omitempty" yaml:"city,omitempty"`
	ZIP            string  `xml:"zip,omitempty" json:"zip,omitempty" yaml:"zip,omitempty"`
	Country        string  `xml:"country,omitempty" json:"country,omitempty" yaml:"country,omitempty"`
	Longitude      float32 `xml:"longitude,omitempty" json:"longitude,omitempty" yaml:"longitude,omitempty"`
	Latitude       float32 `xml:"latitude,omitempty" json:"latitude,omitempty" yaml:"latitude,omitempty"`
	Division       string  `xml:"division,omitempty" json:"division,omitempty" yaml:"division,omitempty"`
	Department     string  `xml:"department,omitempty" json:"department,omitempty" yaml:"department,omitempty"`
	Building       string  `xml:"building,omitempty" json:"building,omitempty" yaml:"building,omitempty"`
	Floor          string  `xml:"floor,omitempty" json:"floor,omitempty" yaml:"floor,omitempty"`
	Room           string  `xml:"room,omitempty" json:"room,omitempty" yaml:"room,omitempty"`
	Rack           string  `xml:"rack,omitempty" json:"rack,omitempty" yaml:"rack,omitempty"`
	RackUnitHeight string  `xml:"rackunitheight,omitempty" json:"rackunitheight,omitempty" yaml:"rackUnitHeight,omitempty"`
	Slot           string  `xml:"slot,omitempty" json:"slot,omitempty" yaml:"slot,omitempty"`
	Port           string  `xml:"port,omitempty" json:"port,omitempty" yaml:"port,omitempty"`
	CircuitID      string  `xml:"circuitId,omitempty" json:"circuitId,omitempty" yaml:"circuitId,omitempty"`
	Admin          string  `xml:"admin,omitempty" json:"admin,omitempty" yaml:"admin,omitempty"`
	// Vendor
	Vendor                  string `xml:"vendor,omitempty" json:"vendor,omitempty" yaml:"vendor,omitempty"`
	VendorPhone             string `xml:"vendorPhone,omitempty" json:"vendorPhone,omitempty" yaml:"vendorPhone,omitempty"`
	VendorFax               string `xml:"vendorFax,omitempty" json:"vendorFax,omitempty" yaml:"vendorFax,omitempty"`
	VendorAssetNumber       string `xml:"vendorAssetNumber,omitempty" json:"vendorAssetNumber,omitempty" yaml:"vendorAssetNumber,omitempty"`
	SupportPhone            string `xml:"supportPhone,omitempty" json:"supportPhone,omitempty" yaml:"supportPhone,omitempty"`
	Lease                   string `xml:"lease,omitempty" json:"lease,omitempty" yaml:"lease,omitempty"`
	LeaseExpires            *Time  `xml:"leaseExpires,omitempty" json:"leaseExpires,omitempty" yaml:"leaseExpires,omitempty"`
	MaintContract           string `xml:"maintcontract,omitempty" json:"maintcontract,omitempty" yaml:"maintcontract,omitempty"`
	MaintContractNumber     string `xml:"maintContractNumber,omitempty" json:"maintContractNumber,omitempty" yaml:"maintContractNumber,omitempty"`
	MaintContractExpiration *Time  `xml:"maintContractExpiration,omitempty" json:"maintContractExpiration,omitempty" yaml:"maintContractExpiration,omitempty"`
	// Hardware
	CPU                string `xml:"cpu,omitempty" json:"cpu,omitempty" yaml:"cpu,omitempty"`
	RAM                string `xml:"ram,omitempty" json:"ram,omitempty" yaml:"ram,omitempty"`
	AdditionalHardware string `xml:"additionalhardware,omitempty" json:"additionalhardware,omitempty" yaml:"additionalHardware,omitempty"`
	NumPowerSupplies   string `xml:"numpowersupplies,omitempty" json:"numpowersupplies,omitempty" yaml:"numPowerSupplies,omitempty"`
	InputPower         string `xml:"inputpower,omitempty" json:"inputpower,omitempty" yaml:"inputPower,omitempty"`
	StorageCtrl        string `xml:"storagectrl,omitempty" json:"storagectrl,omitempty" yaml:"storageCtrl,omitempty"`
	HDD1               string `xml:"hdd1,omitempty" json:"hdd1,omitempty" yaml:"hdd1,omitempty"`
	HDD2               string `xml:"hdd2,omitempty" json:"hdd2,omitempty" yaml:"hdd2,omitempty"`
	HDD3               string `xml:"hdd3,omitempty" json:"hdd3,omitempty" yaml:"hdd3,omitempty"`
	HDD4               string `xml:"hdd4,omitempty" json:"hdd4,omitempty" yaml:"hdd4,omitempty"`
	HDD5               string `xml:"hdd5,omitempty" json:"hdd5,omitempty" yaml:"hdd5,omitempty"`
	HDD6               string `xml:"hdd6,omitempty" json:"hdd6,omitempty" yaml:"hdd6,omitempty"`
	// Authentiation
	Username      string `xml:"username,omitempty" json:"username,omitempty" yaml:"username,omitempty"`
	Password      string `xml:"password,omitempty" json:"password,omitempty" yaml:"password,omitempty"`
	Enable        string `xml:"enable,omitempty" json:"enable,omitempty" yaml:"enable,omitempty"`
	AutoEnable    string `xml:"autoenable,omitempty" json:"autoenable,omitempty" yaml:"autoEnable,omitempty"`
	Connection    string `xml:"connection,omitempty" json:"connection,omitempty" yaml:"connection,omitempty"`
	SnmpCommunity string `xml:"snmpcommunity,omitempty" json:"snmpcommunity,omitempty" yaml:"snmpCommunity,omitempty"`
	// Categories
	DisplayCategory   string `xml:"displayCategory,omitempty" json:"displayCategory,omitempty" yaml:"displayCategory,omitempty"`
	NotifyCategory    string `xml:"notifyCategory,omitempty" json:"notifyCategory,omitempty" yaml:"notifyCategory,omitempty"`
	PollerCategory    string `xml:"pollerCategory,omitempty" json:"pollerCategory,omitempty" yaml:"pollerCategory,omitempty"`
	ThresholdCategory string `xml:"thresholdCategory,omitempty" json:"thresholdCategory,omitempty" yaml:"thresholdCategory,omitempty"`
	// VMWare
	VmwareManagedObjectID   string `xml:"vmwareManagedObjectId,omitempty" json:"vmwareManagedObjectId,omitempty" yaml:"vmwareManagedObjectId,omitempty"`
	VmwareManagedEntityType string `xml:"vmwareManagedEntityType,omitempty" json:"vmwareManagedEntityType,omitempty" yaml:"vmwareManagedEntityType,omitempty"`
	VmwareManagementServer  string `xml:"vmwareManagementServer,omitempty" json:"vmwareManagementServer,omitempty" yaml:"vmwareManagementServer,omitempty"`
	VmwareState             string `xml:"vmwareState,omitempty" json:"vmwareState,omitempty" yaml:"vmwareState,omitempty"`
	VmwareTopologyInfo      string `xml:"vmwareTopologyInfo,omitempty" json:"vmwareTopologyInfo,omitempty" yaml:"vmwareTopologyInfo,omitempty"`
	// General
	Comment               string `xml:"comment,omitempty" json:"comment,omitempty" yaml:"comment,omitempty"`
	LastModifiedBy        string `xml:"lastModifiedBy,omitempty" json:"lastModifiedBy,omitempty" yaml:"lastModifiedBy,omitempty"`
	LastModifiedDate      *Time  `xml:"lastModifiedDate,omitempty" json:"lastModifiedDate,omitempty" yaml:"lastModifiedDate,omitempty"`
	ManagedObjectType     string `xml:"managedObjectType,omitempty" json:"managedObjectType,omitempty" yaml:"managedObjectType,omitempty"`
	ManagedObjectInstance string `xml:"managedObjectInstance,omitempty" json:"managedObjectInstance,omitempty" yaml:"managedObjectInstance,omitempty"`
}

OnmsAssetRecord an entity that represents an OpenNMS asset record

type OnmsCategory

type OnmsCategory struct {
	XMLName xml.Name `xml:"category" json:"-" yaml:"-"`
	ID      int      `xml:"id,attr,omitempty" json:"id,omitempty" yaml:"id,omitempty"`
	Name    string   `xml:"name,attr" json:"name" yaml:"name"`
	Groups  []string `xml:"groups,omitempty" json:"groups,omitempty" yaml:"groups,omitempty"`
}

OnmsCategory an entity that represents an OpenNMS category

type OnmsCategoryList

type OnmsCategoryList struct {
	XMLName    xml.Name       `xml:"categories" json:"-" yaml:"-"`
	Count      int            `xml:"count,attr" json:"count" yaml:"count"`
	TotalCount int            `xml:"totalCount,attr" json:"totalCount" yaml:"totalCount"`
	Offset     int            `xml:"offset,attr" json:"offset" yaml:"offset"`
	Categories []OnmsCategory `xml:"category" json:"category" yaml:"categories"`
}

OnmsCategoryList a list of metadata

type OnmsEvent

type OnmsEvent struct {
	ID                   int              `json:"id" yaml:"id"`
	UEI                  string           `json:"uei" yaml:"uei"`
	EventTime            *Time            `json:"time,omitempty" yaml:"time,omitempty"`
	EventHost            string           `json:"host,omitempty" yaml:"host,omitempty"`
	EventSource          string           `json:"source,omitempty" yaml:"source,omitempty"`
	CreateTime           *Time            `json:"createTime,omitempty" yaml:"createTime,omitempty"`
	SnmpHost             string           `json:"snmpHost,omitempty" yaml:"snmpHost,omitempty"`
	Snmp                 string           `json:"snmp,omitempty" yaml:"snmp,omitempty"`
	NodeID               int              `json:"nodeId,omitempty" yaml:"nodeId,omitempty"`
	NodeLabel            string           `json:"nodeLabel,omitempty" yaml:"nodeLabel,omitempty"`
	IPAddress            string           `json:"ipAddress,omitempty" yaml:"ipAddress,omitempty"`
	ServiceType          OnmsServiceType  `json:"serviceType,omitempty" yaml:"serviceType,omitempty"`
	IfIndex              int              `json:"ifIndex,omitempty" yaml:"ifIndex,omitempty"`
	Severity             string           `json:"severity,omitempty" yaml:"severity,omitempty"`
	Log                  string           `json:"log,omitempty" yaml:"log,omitempty"`
	LogGroup             string           `json:"logGroup,omitempty" yaml:"logGroup,omitempty"`
	LogMessage           string           `json:"logMessage,omitempty" yaml:"logMessage,omitempty"`
	Display              string           `json:"display,omitempty" yaml:"display,omitempty"`
	Description          string           `json:"description,omitempty" yaml:"description,omitempty"`
	PathOutage           string           `json:"pathOutage,omitempty" yaml:"pathOutage,omitempty"`
	Correlation          string           `json:"correlation,omitempty" yaml:"correlation,omitempty"`
	SuppressedCount      int              `json:"suppressedCount,omitempty" yaml:"suppressedCount,omitempty"`
	OperatorInstructions string           `json:"operatorInstructions,omitempty" yaml:"operatorInstructions,omitempty"`
	OperatorAction       string           `json:"operatorAction,omitempty" yaml:"operatorAction,omitempty"`
	AutoAction           string           `json:"autoAction,omitempty" yaml:"autoAction,omitempty"`
	Parameters           []OnmsEventParam `json:"parameters,omitempty" yaml:"parameters,omitempty"`
}

OnmsEvent OpenNMS event entity

type OnmsEventList

type OnmsEventList struct {
	Count      int         `json:"count" yaml:"count"`
	TotalCount int         `json:"totalCount" yaml:"totalCount"`
	Offset     int         `json:"offset" yaml:"offset"`
	Events     []OnmsEvent `json:"event" yaml:"events"`
}

OnmsEventList a list of events

type OnmsEventParam

type OnmsEventParam struct {
	Name  string
	Value string
	Type  string
}

OnmsEventParam parameters of an OnmsEvent entity

type OnmsIPInterface

type OnmsIPInterface struct {
	XMLName               xml.Name               `xml:"ipInterface" json:"-" yaml:"-"`
	ID                    string                 `xml:"id,attr,omitempty" json:"id,omitempty" yaml:"id,omitempty"` // The JSON returns a string instead of an integer
	NodeID                int                    `xml:"nodeId,omitempty" json:"nodeId,omitempty" yaml:"-,omitempty"`
	IsManaged             string                 `xml:"isManaged,attr,omitempty" json:"isManaged,omitempty" yaml:"isManaged,omitempty"`
	IPAddress             string                 `xml:"ipAddress" json:"ipAddress" yaml:"ipAddress"`
	MonitoredServiceCount int                    `xml:"monitoredServiceCount,attr,omitempty" json:"monitoredServiceCount,omitempty" yaml:"monitoredServiceCount,omitempty"`
	IfIndex               int                    `xml:"ifIndex,attr,omitempty" json:"ifIndex,omitempty" yaml:"ifIndex,omitempty"`
	HostName              string                 `xml:"hostName,omitempty" json:"hostName,omitempty" yaml:"hostName,omitempty"`
	SnmpPrimary           string                 `xml:"snmpPrimary,attr,omitempty" json:"snmpPrimary,omitempty" yaml:"snmpPrimary,omitempty"`
	LastPoll              *Time                  `xml:"lastCapsdPoll,omitempty" json:"lastCapsdPoll,omitempty" yaml:"lastPoll,omitempty"`
	SNMPInterface         *OnmsSnmpInterface     `xml:"snmpInterface,omitempty" json:"snmpInterface,omitempty" yaml:"snmpInterface,omitempty"`
	IsDown                bool                   `xml:"isDown,attr,omitempty" json:"isDown,omitempty" yaml:"isDown,omitempty"`
	HasFlows              bool                   `xml:"hasFlows,attr,omitempty" json:"hasFlows,omitempty" yaml:"hasFlows,omitempty"` // DEPRECATED
	LastIngressFlow       *Time                  `xml:"lastIngressFlow,attr,omitempty" json:"lastIngressFlow,omitempty" yaml:"lastIngressFlow,omitempty"`
	LastEgressFlow        *Time                  `xml:"lastEgressFlow,attr,omitempty" json:"lastEgressFlow,omitempty" yaml:"lastEgressFlow,omitempty"`
	Services              []OnmsMonitoredService `xml:"services,attr,omitempty" json:"services,omitempty" yaml:"services,omitempty"`
	Meta                  []MetaData             `xml:"metaData,attr,omitempty" json:"metaData,omitempty" yaml:"metaData,omitempty"`
}

OnmsIPInterface an entity that represents an OpenNMS IP Interface

func (*OnmsIPInterface) ExtractBasic

func (obj *OnmsIPInterface) ExtractBasic() *OnmsIPInterface

ExtractBasic extracts core attributes only

func (*OnmsIPInterface) Validate

func (obj *OnmsIPInterface) Validate() error

Validate verify structure and apply defaults when needed

type OnmsIPInterfaceList

type OnmsIPInterfaceList struct {
	XMLName    xml.Name          `xml:"ipInterfaces" json:"-" yaml:"-"`
	Count      int               `xml:"count,attr" json:"count" yaml:"count"`
	TotalCount int               `xml:"totalCount,attr" json:"totalCount" yaml:"totalCount"`
	Offset     int               `xml:"offset,attr" json:"offset" yaml:"offset"`
	Interfaces []OnmsIPInterface `xml:"ipInterface" json:"ipInterface" yaml:"interfaces"`
}

OnmsIPInterfaceList a list of nodes

type OnmsInfo

type OnmsInfo struct {
	DisplayVersion     string                  `json:"displayVersion" yaml:"displayVersion"`
	Version            string                  `json:"version" yaml:"version"`
	PackageName        string                  `json:"packageName" yaml:"packageName"`
	PackageDescription string                  `json:"packageDescription" yaml:"packageDescription"`
	DatetimeFormat     *OnmsInfoDatetimeFormat `json:"datetimeformatConfig" yaml:"datetimeFormat"`
}

OnmsInfo provides information about the OpenNMS server

type OnmsInfoDatetimeFormat

type OnmsInfoDatetimeFormat struct {
	ZoneID string `json:"zoneId" yaml:"zoneId"`
	Format string `json:"datetimeformat" yaml:"format"`
}

OnmsInfoDatetimeFormat provides information about the time format

type OnmsMonitoredService

type OnmsMonitoredService struct {
	XMLName     xml.Name         `xml:"service" json:"-" yaml:"-"`
	ID          int              `xml:"id,attr,omitempty" json:"id,omitempty" yaml:"id,omitempty"`
	ServiceType *OnmsServiceType `xml:"serviceType" json:"serviceType" yaml:"serviceType"`
	Notify      string           `xml:"notify,omitempty" json:"notify,omitempty" yaml:"notify,omitempty"`
	Qualifier   string           `xml:"qualifier,omitempty" json:"qualifier,omitempty" yaml:"qualifier,omitempty"`
	Status      string           `xml:"status,attr,omitempty" json:"status,omitempty" yaml:"status,omitempty"`
	StatusLong  string           `xml:"statusLong,attr,omitempty" json:"statusLong,omitempty" yaml:"statusLong,omitempty"`
	LastGood    *Time            `xml:"lastGood,omitempty" json:"lastGood,omitempty" yaml:"lastGood,omitempty"`
	LastFail    *Time            `xml:"lastFail,omitempty" json:"lastFail,omitempty" yaml:"lastFail,omitempty"`
	Source      string           `xml:"source,attr,omitempty" json:"source,omitempty" yaml:"source,omitempty"`
	IsDown      bool             `xml:"down,attr,omitempty" json:"down,omitempty" yaml:"isDown,omitempty"`
	Meta        []MetaData       `xml:"metaData,attr,omitempty" json:"metaData,omitempty" yaml:"metaData,omitempty"`
}

OnmsMonitoredService an entity that represents an OpenNMS Monitored Service

func (*OnmsMonitoredService) Validate

func (obj *OnmsMonitoredService) Validate() error

Validate verify structure and apply defaults when needed

type OnmsMonitoredServiceList

type OnmsMonitoredServiceList struct {
	XMLName    xml.Name               `xml:"services" json:"-" yaml:"-"`
	Count      int                    `xml:"count,attr" json:"count" yaml:"count"`
	TotalCount int                    `xml:"totalCount,attr" json:"totalCount" yaml:"totalCount"`
	Offset     int                    `xml:"offset,attr" json:"offset" yaml:"offset"`
	Services   []OnmsMonitoredService `xml:"service" json:"service" yaml:"services"`
}

OnmsMonitoredServiceList a list of nodes

type OnmsNode

type OnmsNode struct {
	XMLName         xml.Name            `xml:"node" json:"-" yaml:"-"`
	ID              string              `xml:"id,attr,omitempty" json:"id,omitempty" yaml:"id,omitempty"` // The JSON returns a string instead of an integer
	Type            string              `xml:"type,attr,omitempty" json:"type,omitempty" yaml:"type,omitempty"`
	Label           string              `xml:"label,attr,omitempty" json:"label,omitempty" yaml:"label,omitempty"`
	LabelSource     string              `xml:"labelSource,omitempty" json:"labelSource,omitempty" yaml:"labelSource,omitempty"`
	ForeignSource   string              `xml:"foreignSource,attr,omitempty" json:"foreignSource,omitempty" yaml:"foreignSource,omitempty"`
	ForeignID       string              `xml:"foreignId,attr,omitempty" json:"foreignId,omitempty" yaml:"foreignId,omitempty"`
	Location        string              `xml:"location,attr,omitempty" json:"location,omitempty" yaml:"location,omitempty"`
	SysObjectID     string              `xml:"sysObjectId,omitempty" json:"sysObjectId,omitempty" yaml:"sysObjectId,omitempty"`
	SysName         string              `xml:"sysName,omitempty" json:"sysName,omitempty" yaml:"sysName,omitempty"`
	SysLocation     string              `xml:"sysLocation,omitempty" json:"sysLocation,omitempty" yaml:"sysLocation,omitempty"`
	SysDescription  string              `xml:"sysDescription,omitempty" json:"sysDescription,omitempty" yaml:"sysDescription,omitempty"`
	SysContact      string              `xml:"sysContact,omitempty" json:"sysContact,omitempty" yaml:"sysContact,omitempty"`
	HasFlows        bool                `xml:"hasFlows,attr,omitempty" json:"hasFlows,omitempty" yaml:"hasFlows,omitempty"` // DEPRECATED
	LastIngressFlow *Time               `xml:"lastIngressFlow,attr,omitempty" json:"lastIngressFlow,omitempty" yaml:"lastIngressFlow,omitempty"`
	LastEgressFlow  *Time               `xml:"lastEgressFlow,attr,omitempty" json:"lastEgressFlow,omitempty" yaml:"lastEgressFlow,omitempty"`
	CreateTime      *Time               `xml:"createTime,omitempty" json:"createTime,omitempty" yaml:"createTime,omitempty"`
	LastPoll        *Time               `xml:"lastCapsdPoll,omitempty" json:"lastCapsdPoll,omitempty" yaml:"lastPoll,omitempty"`
	AssetRecord     *OnmsAssetRecord    `xml:"assetRecord,omitempty" json:"assetRecord,omitempty" yaml:"assetRecord,omitempty"`
	Categories      []OnmsCategory      `xml:"categories,omitempty" json:"categories,omitempty" yaml:"categories,omitempty"`
	IPInterfaces    []OnmsIPInterface   `xml:"ipInterfaces,omitempty" json:"ipInterfaces,omitempty" yaml:"ipInterfaces,omitempty"`
	SNMPInterfaces  []OnmsSnmpInterface `xml:"snmpInterfaces,omitempty" json:"snmpInterfaces,omitempty" yaml:"snmpInterfaces,omitempty"`
	Meta            []MetaData          `xml:"metaData,attr,omitempty" json:"metaData,omitempty" yaml:"metaData,omitempty"`
}

OnmsNode an entity that represents an OpenNMS node

func (*OnmsNode) ExtractBasic

func (obj *OnmsNode) ExtractBasic() *OnmsNode

ExtractBasic extracts core attributes only

func (*OnmsNode) GetIPInterface

func (obj *OnmsNode) GetIPInterface(ipAddress string) *OnmsIPInterface

GetIPInterface gets a given IP interface by its address (nil if not found)

func (*OnmsNode) GetSnmpInterface

func (obj *OnmsNode) GetSnmpInterface(ifIndex int) *OnmsSnmpInterface

GetSnmpInterface gets a given SNMP interface by its ifIndex (nil if not found)

func (*OnmsNode) Validate

func (obj *OnmsNode) Validate() error

Validate verify structure and apply defaults when needed

type OnmsNodeList

type OnmsNodeList struct {
	XMLName    xml.Name   `xml:"nodes" json:"-" yaml:"-"`
	Count      int        `xml:"count,attr" json:"count" yaml:"count"`
	TotalCount int        `xml:"totalCount,attr" json:"totalCount" yaml:"totalCount"`
	Offset     int        `xml:"offset,attr" json:"offset" yaml:"offset"`
	Nodes      []OnmsNode `xml:"node" json:"node" yaml:"nodes"`
}

OnmsNodeList a list of nodes

type OnmsOutage

type OnmsOutage struct {
	ID                   int                   `json:"id" yaml:"id"`
	ForeignSource        string                `json:"foreignSource,omitempty" yaml:"foreignSource,omitempty"`
	ForeignID            string                `json:"foreignId,omitempty" yaml:"foreignId,omitempty"`
	NodeID               int                   `json:"nodeId,omitempty" yaml:"nodeId,omitempty"`
	NodeLabel            string                `json:"nodeLabel,omitempty" yaml:"nodeLabel,omitempty"`
	IPAddress            string                `json:"ipAddress,omitempty" yaml:"ipAddress,omitempty"`
	ServiceID            int                   `json:"serviceId,omitempty" yaml:"serviceId,omitempty"`
	Location             string                `json:"locationName,omitempty" yaml:"locationName,omitempty"`
	MonitoredService     *OnmsMonitoredService `json:"monitoredService,omitempty" yaml:"monitoredService,omitempty"`
	SuppressedBy         string                `json:"suppressedBy,omitempty" yaml:"suppressedBy,omitempty"`
	SuppressedTime       *Time                 `json:"suppressedTime,omitempty" yaml:"suppressedTime,omitempty"`
	ServiceLostTime      *Time                 `json:"ifLostService,omitempty" yaml:"ifLostService,omitempty"`
	ServiceRegainedTime  *Time                 `json:"ifRegainedService,omitempty" yaml:"ifRegainedService,omitempty"`
	ServiceLostEvent     *OnmsEvent            `json:"serviceLostEvent,omitempty" yaml:"-"`
	ServiceRegainedEvent *OnmsEvent            `json:"serviceRegainedEvent,omitempty" yaml:"-"`
}

OnmsOutage OpenNMS outage entity

type OnmsOutageList

type OnmsOutageList struct {
	Count      int          `json:"count" yaml:"count"`
	TotalCount int          `json:"totalCount" yaml:"totalCount"`
	Offset     int          `json:"offset" yaml:"offset"`
	Outages    []OnmsOutage `json:"outage" yaml:"outages"`
}

OnmsOutageList a list of outages

type OnmsServiceType

type OnmsServiceType struct {
	XMLName xml.Name `xml:"serviceType" json:"-" yaml:"-"`
	ID      int      `xml:"id,attr,omitempty" json:"id,omitempty" yaml:"id,omitempty"`
	Name    string   `xml:"name" json:"name" yaml:"name"`
}

OnmsServiceType an entity that represents an OpenNMS Monitored Service type

type OnmsSnmpInterface

type OnmsSnmpInterface struct {
	XMLName                 xml.Name `xml:"snmpInterface" json:"-" yaml:"-"`
	ID                      int      `xml:"id,attr,omitempty" json:"id,omitempty" yaml:"id,omitempty"`
	IfType                  int      `xml:"ifType,omitempty" json:"ifType,omitempty" yaml:"ifType,omitempty"`
	IfAlias                 string   `xml:"ifAlias,omitempty" json:"ifAlias,omitempty" yaml:"ifAlias,omitempty"`
	IfIndex                 int      `xml:"ifIndex,attr,omitempty" json:"ifIndex,omitempty" yaml:"ifIndex,omitempty"`
	IfDescr                 string   `xml:"ifDescr,omitempty" json:"ifDescr,omitempty" yaml:"ifDescr,omitempty"`
	IfName                  string   `xml:"ifName,omitempty" json:"ifName,omitempty" yaml:"ifName,omitempty"`
	PhysAddress             string   `xml:"physAddress,omitempty" json:"physAddress,omitempty" yaml:"physAddress,omitempty"`
	IfSpeed                 int64    `xml:"ifSpeed,omitempty" json:"ifSpeed,omitempty" yaml:"ifSpeed,omitempty"`
	IfAdminStatus           int      `xml:"ifAdminStatus,omitempty" json:"ifAdminStatus,omitempty" yaml:"ifAdminStatus,omitempty"`
	IfOperStatus            int      `xml:"ifOperStatus,omitempty" json:"ifOperStatus,omitempty" yaml:"ifOperStatus,omitempty"`
	Collect                 bool     `xml:"collect,attr,omitempty" json:"collect,omitempty" yaml:"collect,omitempty"`
	CollectFlag             string   `xml:"collectFlag,attr,omitempty" json:"collectFlag,omitempty" yaml:"collectFlag,omitempty"`
	CollectionUserSpecified bool     `xml:"collectionUserSpecified,omitempty" json:"collectionUserSpecified,omitempty" yaml:"collectionUserSpecified,omitempty"`
	Poll                    bool     `xml:"poll,attr,omitempty" json:"poll,omitempty" yaml:"poll,omitempty"`
	PollFlag                string   `xml:"pollFlag,attr,omitempty" json:"pollFlag,omitempty" yaml:"pollFlag,omitempty"`
	LastPoll                *Time    `xml:"lastCapsdPoll,omitempty" json:"lastCapsdPoll,omitempty" yaml:"lastPoll,omitempty"`
	HasFlows                bool     `xml:"hasFlows,attr,omitempty" json:"hasFlows,omitempty" yaml:"hasFlows,omitempty"` // DEPRECATED
	LastIngressFlow         *Time    `xml:"lastIngressFlow,attr,omitempty" json:"lastIngressFlow,omitempty" yaml:"lastIngressFlow,omitempty"`
	LastEgressFlow          *Time    `xml:"lastEgressFlow,attr,omitempty" json:"lastEgressFlow,omitempty" yaml:"lastEgressFlow,omitempty"`
}

OnmsSnmpInterface an entity that represents an OpenNMS SNMP Interface

func (*OnmsSnmpInterface) ExtractBasic

func (obj *OnmsSnmpInterface) ExtractBasic() *OnmsSnmpInterface

ExtractBasic extracts core attributes only

func (*OnmsSnmpInterface) Validate

func (obj *OnmsSnmpInterface) Validate() error

Validate verify structure and apply defaults when needed

type OnmsSnmpInterfaceList

type OnmsSnmpInterfaceList struct {
	XMLName    xml.Name            `xml:"snmpInterfaces" json:"-" yaml:"-"`
	Count      int                 `xml:"count,attr" json:"count" yaml:"count"`
	TotalCount int                 `xml:"totalCount,attr" json:"totalCount" yaml:"totalCount"`
	Offset     int                 `xml:"offset,attr" json:"offset" yaml:"offset"`
	Interfaces []OnmsSnmpInterface `xml:"snmpInterface" json:"snmpInterface" yaml:"interfaces"`
}

OnmsSnmpInterfaceList a list of nodes

type Parameter

type Parameter struct {
	XMLName xml.Name `xml:"parameter" json:"-" yaml:"-"`
	Key     string   `xml:"key,attr" json:"key" yaml:"key"`
	Value   string   `xml:"value,attr" json:"value" yaml:"value"`
}

Parameter a parameter for a detector or a policy

func FindParameter

func FindParameter(parameters []Parameter, paramName string) *Parameter

FindParameter finds a parameter by name on a slice of parameters

type Plugin

type Plugin struct {
	Name       string        `json:"name" yaml:"name"`
	Class      string        `json:"class" yaml:"class"`
	Parameters []PluginParam `json:"parameters,omitempty" yaml:"parameters,omitempty"`
}

Plugin a definition class for a detector or a policy

func (Plugin) FindParameter

func (p Plugin) FindParameter(paramName string) *PluginParam

FindParameter finds a parameter on the plugin

func (Plugin) VerifyParameters

func (p Plugin) VerifyParameters(parameters []Parameter) error

VerifyParameters verify detector/policy parameters

type PluginList

type PluginList struct {
	Count   int      `json:"count" yaml:"count"`
	Plugins []Plugin `json:"plugins,omitempty" yaml:"plugins,omitempty"`
}

PluginList a list of plugins

func (PluginList) FindPlugin

func (list PluginList) FindPlugin(cls string) *Plugin

FindPlugin finds a plugin by class name

type PluginParam

type PluginParam struct {
	Key      string   `json:"key" yaml:"key"`
	Required bool     `json:"required" yaml:"required"`
	Options  []string `json:"options,omitempty" yaml:"options,omitempty"`
}

PluginParam a parameter of a given plugin

type Policy

type Policy struct {
	XMLName    xml.Name    `xml:"policy" json:"-" yaml:"-"`
	Name       string      `xml:"name,attr" json:"name" yaml:"name"`
	Class      string      `xml:"class,attr" json:"class" yaml:"class"`
	Parameters []Parameter `xml:"parameter,omitempty" json:"parameter,omitempty" yaml:"parameters,omitempty"`
}

Policy a provisioning policy

func (*Policy) Validate

func (p *Policy) Validate() error

Validate returns an error if the policy is invalid

type Profile

type Profile struct {
	Name     string `yaml:"name"`
	URL      string `yaml:"url"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
	Insecure bool   `yaml:"insecure"`
	Timeout  int    `yaml:"timeout"`
}

Profile provides information about accessing a given OpenNMS server

func (*Profile) Validate

func (p *Profile) Validate() error

Validate verify required fields

type ProfilesConfig

type ProfilesConfig struct {
	Default  string    `yaml:"defaultProfile"`
	Profiles []Profile `yaml:"profiles,omitempty"`
}

ProfilesConfig provides information about the configured OpenNMS servers

func (ProfilesConfig) GetDefaultProfile

func (cfg ProfilesConfig) GetDefaultProfile() *Profile

GetDefaultProfile gets the default profile

func (ProfilesConfig) IsEmpty

func (cfg ProfilesConfig) IsEmpty() bool

IsEmpty checks if configuration is empty

type Requisition

type Requisition struct {
	XMLName    xml.Name          `xml:"model-import" json:"-" yaml:"-"`
	DateStamp  *Time             `xml:"date-stamp,attr,omitempty" json:"date-stamp,omitempty" yaml:"dateStamp,omitempty"`
	LastImport *Time             `xml:"last-import,attr,omitempty" json:"last-import,omitempty" yaml:"lastImport,omitempty"`
	Name       string            `xml:"foreign-source,attr" json:"foreign-source" yaml:"name"`
	Nodes      []RequisitionNode `xml:"node,omitempty" json:"node,omitempty" yaml:"nodes,omitempty"`
}

Requisition a requisition or set of nodes

func (*Requisition) AddNode

func (r *Requisition) AddNode(node *RequisitionNode)

AddNode add a node to the requisition

func (*Requisition) Validate

func (r *Requisition) Validate() error

Validate returns an error if the requisition definition is invalid

type RequisitionAsset

type RequisitionAsset struct {
	XMLName xml.Name `xml:"asset" json:"-" yaml:"-"`
	Name    string   `xml:"name,attr" json:"name" yaml:"name"`
	Value   string   `xml:"value,attr" json:"value" yaml:"value"`
}

RequisitionAsset a requisition node asset field

func (RequisitionAsset) Validate

func (a RequisitionAsset) Validate() error

Validate returns an error if asset field is invalid

type RequisitionCategory

type RequisitionCategory struct {
	XMLName xml.Name `xml:"category" json:"-" yaml:"-"`
	Name    string   `xml:"name,attr" json:"name" yaml:"name"`
}

RequisitionCategory a requisition node category

func (RequisitionCategory) Validate

func (c RequisitionCategory) Validate() error

Validate returns an error if the category is invalid

type RequisitionInterface

type RequisitionInterface struct {
	XMLName     xml.Name                      `xml:"interface" json:"-" yaml:"-"`
	IPAddress   string                        `xml:"ip-addr,attr" json:"ip-addr" yaml:"ipAddress"`
	Description string                        `xml:"descr,attr,omitempty" json:"descr,omitempty" yaml:"description,omitempty"`
	SnmpPrimary string                        `xml:"snmp-primary,attr,omitempty" json:"snmp-primary" yaml:"snmpPrimary"`
	Status      int                           `xml:"status,attr,omitempty" json:"status" yaml:"status"`
	Services    []RequisitionMonitoredService `xml:"monitored-service,omitempty" json:"monitored-service,omitempty" yaml:"services,omitempty"`
	MetaData    []RequisitionMetaData         `xml:"meta-data,omitempty" json:"meta-data,omitempty" yaml:"metaData,omitempty"`
}

RequisitionInterface an IP interface of a requisition node

func (*RequisitionInterface) AddMetaData

func (intf *RequisitionInterface) AddMetaData(key string, value string)

AddMetaData adds a meta-data entry to the interface

func (*RequisitionInterface) AddService

func (intf *RequisitionInterface) AddService(svc *RequisitionMonitoredService)

AddService add an service to the IP interface

func (*RequisitionInterface) DeleteMetaData

func (intf *RequisitionInterface) DeleteMetaData(key string)

DeleteMetaData deletes an existing meta-data entry from the IP interface

func (*RequisitionInterface) GetService

func (intf *RequisitionInterface) GetService(serviceName string) *RequisitionMonitoredService

GetService gets a given monitored service from the IP interface if exists

func (*RequisitionInterface) Merge

func (intf *RequisitionInterface) Merge(source RequisitionInterface) error

Merge merges the fields from the provided source

func (*RequisitionInterface) SetMetaData

func (intf *RequisitionInterface) SetMetaData(key string, value string)

SetMetaData adds or updates an existing meta-data entry on the IP interface

func (*RequisitionInterface) Validate

func (intf *RequisitionInterface) Validate() error

Validate returns an error if the interface definition is invalid

type RequisitionMetaData

type RequisitionMetaData struct {
	XMLName xml.Name `xml:"meta-data" json:"-" yaml:"-"`
	Key     string   `xml:"key,attr" json:"key" yaml:"key"`
	Value   string   `xml:"value,attr" json:"value" yaml:"value"`
	Context string   `xml:"context,attr,omitempty" json:"context,omitempty" yaml:"context,omitempty"`
}

RequisitionMetaData a meta-data entry

func (*RequisitionMetaData) Validate

func (m *RequisitionMetaData) Validate() error

Validate returns an error if asset field is invalid

type RequisitionMonitoredService

type RequisitionMonitoredService struct {
	XMLName  xml.Name              `xml:"monitored-service" json:"-" yaml:"-"`
	Name     string                `xml:"service-name,attr" json:"service-name" yaml:"name"`
	MetaData []RequisitionMetaData `xml:"meta-data,omitempty" json:"meta-data,omitempty" yaml:"metaData,omitempty"`
}

RequisitionMonitoredService an IP interface monitored service

func (*RequisitionMonitoredService) AddMetaData

func (s *RequisitionMonitoredService) AddMetaData(key string, value string)

AddMetaData adds a meta-data entry to the node

func (*RequisitionMonitoredService) DeleteMetaData

func (s *RequisitionMonitoredService) DeleteMetaData(key string)

DeleteMetaData deletes an existing meta-data entry from the service

func (*RequisitionMonitoredService) SetMetaData

func (s *RequisitionMonitoredService) SetMetaData(key string, value string)

SetMetaData adds or updates an existing meta-data entry on the service

func (RequisitionMonitoredService) Validate

func (s RequisitionMonitoredService) Validate() error

Validate returns an error if the service is invalid

type RequisitionNode

type RequisitionNode struct {
	XMLName             xml.Name               `xml:"node" json:"-" yaml:"-"`
	NodeLabel           string                 `xml:"node-label,attr" json:"node-label" yaml:"nodeLabel"`
	ForeignID           string                 `xml:"foreign-id,attr" json:"foreign-id" yaml:"foreignID"`
	Location            string                 `xml:"location,attr,omitempty" json:"location,omitempty" yaml:"location,omitempty"`
	City                string                 `xml:"city,attr,omitempty" json:"city,omitempty" yaml:"city,omitempty"`
	Building            string                 `xml:"building,attr,omitempty" json:"building,omitempty" yaml:"building,omitempty"`
	ParentForeignSource string                 `xml:"parent-foreign-source,attr,omitempty" json:"parent-foreign-source,omitempty" yaml:"parentForeignSource,omitempty"`
	ParentForeignID     string                 `xml:"parent-foreign-id,attr,omitempty" json:"parent-foreign-id,omitempty" yaml:"parentForeignID,omitempty"`
	ParentNodeLabel     string                 `xml:"parent-node-label,omitempty" json:"parent-node-label,omitempty" yaml:"parentNodeLabel,omitempty"`
	Interfaces          []RequisitionInterface `xml:"interface,omitempty" json:"interface,omitempty" yaml:"interfaces,omitempty"`
	Categories          []RequisitionCategory  `xml:"category,omitempty" json:"category,omitempty" yaml:"categories,omitempty"`
	Assets              []RequisitionAsset     `xml:"asset,omitempty" json:"asset,omitempty" yaml:"assets,omitempty"`
	MetaData            []RequisitionMetaData  `xml:"meta-data,omitempty" json:"meta-data,omitempty" yaml:"metaData,omitempty"`
}

RequisitionNode a requisitioned node

func (*RequisitionNode) AddInterface

func (n *RequisitionNode) AddInterface(intf *RequisitionInterface)

AddInterface add an IP interface to the node

func (*RequisitionNode) AddMetaData

func (n *RequisitionNode) AddMetaData(key string, value string)

AddMetaData adds a meta-data entry to the node

func (*RequisitionNode) DeleteMetaData

func (n *RequisitionNode) DeleteMetaData(key string)

DeleteMetaData deletes an existing meta-data entry from the node

func (*RequisitionNode) GetInterface

func (n *RequisitionNode) GetInterface(ipAddress string) *RequisitionInterface

GetInterface gets an existing IP interface from the node

func (*RequisitionNode) Merge

func (n *RequisitionNode) Merge(source RequisitionNode) error

Merge merges the fields from the provided source

func (*RequisitionNode) SetMetaData

func (n *RequisitionNode) SetMetaData(key string, value string)

SetMetaData adds or updates an existing meta-data entry on the node

func (*RequisitionNode) Validate

func (n *RequisitionNode) Validate() error

Validate returns an error if the node definition is invalid

type RequisitionStats

type RequisitionStats struct {
	Name       string   `json:"name" yaml:"name"`
	Count      int      `json:"count" yaml:"count"`
	ForeignIDs []string `json:"foreign-id" yaml:"foreignID"`
	LastImport *Time    `json:"last-imported,omitempty" yaml:"lastImport,omitempty"`
}

RequisitionStats statistics about the requisition

type RequisitionsList

type RequisitionsList struct {
	Count          int      `json:"count" yaml:"count"`
	ForeignSources []string `json:"foreign-source" yaml:"foreignSources"`
}

RequisitionsList a list of requisitions names

type RequisitionsStats

type RequisitionsStats struct {
	Count          int                `json:"count"`
	ForeignSources []RequisitionStats `json:"foreign-source"`
}

RequisitionsStats statistics about all the requisitions

func (RequisitionsStats) GetRequisitionStats

func (stats RequisitionsStats) GetRequisitionStats(foreignSource string) RequisitionStats

GetRequisitionStats gets the stats of a given requisition

type Resource

type Resource struct {
	ID                 string                      `json:"id" yaml:"id"`
	Label              string                      `json:"label" yaml:"label"`
	Name               string                      `json:"name" yaml:"name"`
	Link               string                      `json:"link" yaml:"link,omitempty"`
	TypeLabel          string                      `json:"typeLabel" yaml:"yypeLabel"`
	ParentID           string                      `json:"parentId" yaml:"parentId"`
	NumericAttributes  map[string]NumericAttribute `json:"rrdGraphAttributes,omitempty" yaml:"metrics,omitempty"`
	StringAttributes   map[string]string           `json:"stringPropertyAttributes,omitempty" yaml:"strings,omitempty"`
	ExternalAttributes map[string]string           `json:"externalValueAttributes,omitempty" yaml:"external,omitempty"`
	Children           *ResourceList               `json:"children,omitempty" yaml:"children,omitempty"`
}

Resource a resource object

type ResourceList

type ResourceList struct {
	Count     int        `json:"count" yaml:"count,omitempty"`
	Resources []Resource `json:"resource" yaml:"resources,omitempty"`
}

ResourceList a list of resources

func (ResourceList) Enumerate

func (list ResourceList) Enumerate(prefix string)

Enumerate shows the ID of each resource and its children

type SNMP

type SNMP struct {
	ID        string `json:"id" yaml:"id"`
	Version   string `json:"version,omitempty" yaml:"version,omitempty"`
	Specific  int    `json:"specific" yaml:"specific,omitempty"`
	Generic   int    `json:"generic" yaml:"generic,omitempty"`
	Community string `json:"community,omitempty" yaml:"community,omitempty"`
	Timestamp *Time  `json:"time-stamp,omitempty" yaml:"timeStamp,omitempty"`
}

SNMP an event SNMP object

type ScheduledInterface

type ScheduledInterface struct {
	Address string `json:"address" yaml:"address"`
}

ScheduledInterface represents an IP interface by its Address under a scheduled outage

type ScheduledNode

type ScheduledNode struct {
	ID string `json:"id" yaml:"id"`
}

ScheduledNode represents a node by its Node ID under a scheduled outage

type ScheduledOutage

type ScheduledOutage struct {
	Name       string               `json:"name" yaml:"name"`
	Type       string               `json:"type" yaml:"type"`
	Nodes      []ScheduledNode      `json:"node,omitempty" yaml:"nodes,omitempty"`
	Interfaces []ScheduledInterface `json:"interface,omitempty" yaml:"interfaces,omitempty"`
	Times      []ScheduledTime      `json:"time,omitempty" yaml:"times,omitempty"`
}

ScheduledOutage a scheduled outage

func (*ScheduledOutage) IsValid

func (o *ScheduledOutage) IsValid() error

IsValid verifies if the scheduled outage is correct

type ScheduledOutageList

type ScheduledOutageList struct {
	Outages []ScheduledOutage
}

ScheduledOutageList list of scheduled outages

type ScheduledTime

type ScheduledTime struct {
	Day    string `json:"day,omitempty" yaml:"day,omitempty"`
	Begins string `json:"begins" yaml:"begins"`
	Ends   string `json:"ends" yaml:"ends"`
}

ScheduledTime the time of a given scheduled outage (contents depend on the type)

func (*ScheduledTime) IsValid

func (sc *ScheduledTime) IsValid(scheduleType string) error

IsValid verifies if the schedule time is correct for a given type

type SnmpInfo

type SnmpInfo struct {
	Version         string `json:"version,omitempty" yaml:"version,omitempty"`
	Location        string `json:"location,omitempty" yaml:"location,omitempty"`
	Port            int    `json:"port,omitempty" yaml:"port,omitempty"`
	Retries         int    `json:"retries,omitempty" yaml:"retries,omitempty"`
	Timeout         int    `json:"timeout,omitempty" yaml:"timeout,omitempty"`
	Community       string `json:"community,omitempty" yaml:"community,omitempty"`
	ContextName     string `json:"contextName,omitempty" yaml:"contextName,omitempty"`
	SecurityLevel   int    `json:"securityLevel,omitempty" yaml:"securityLevel,omitempty"`
	SecurityName    string `json:"securityName,omitempty" yaml:"securityName,omitempty"`
	PrivProtocol    string `json:"privProtocol,omitempty" yaml:"privProtocol,omitempty"`
	PrivPassPhrase  string `json:"privPassPhrase,omitempty" yaml:"privPassPhrase,omitempty"`
	AuthProtocol    string `json:"authProtocol,omitempty" yaml:"authProtocol,omitempty"`
	AuthPassPhrase  string `json:"authPassPhrase,omitempty" yaml:"authPassPhrase,omitempty"`
	EngineID        string `json:"engineID,omitempty" yaml:"engineID,omitempty"`
	ContextEngineID string `json:"ContextEngineID,omitempty" yaml:"ContextEngineID,omitempty"`
	EnterpriseID    string `json:"enterpriseID,omitempty" yaml:"enterpriseID,omitempty"`
	MaxRequestSize  int    `json:"maxRequestSize,omitempty" yaml:"maxRequestSize,omitempty"`
	MaxRepetitions  int    `json:"maxRepetitions,omitempty" yaml:"maxRepetitions,omitempty"`
	MaxVarsPerPdu   int    `json:"maxVarsPerPdu,omitempty" yaml:"maxVarsPerPdu,omitempty"`
	ProxyHost       string `json:"proxyHost,omitempty" yaml:"proxyHost,omitempty"`
	TTL             int    `json:"ttl,omitempty" yaml:"ttl,omitempty"`
}

SnmpInfo SNMP Configuration for a give IP Interface; it provides partial information compared with what's available on snmp-config.xml

func (*SnmpInfo) Validate

func (s *SnmpInfo) Validate() error

Validate returns an error if the service is invalid

type Time

type Time struct {
	time.Time
}

Time an object to seamlessly manage times in multiple formats

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

MarshalJSON converts time object into timestamp in milliseconds

func (Time) MarshalXML

func (t Time) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML converts time object into time as string

func (Time) MarshalYAML

func (t Time) MarshalYAML() ([]byte, error)

MarshalYAML converts time object into time as string

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) error

UnmarshalJSON converts timestamp in milliseconds into time object

func (*Time) UnmarshalXML

func (t *Time) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML converts time string into time object

func (*Time) UnmarshalYAML

func (t *Time) UnmarshalYAML(data []byte) error

UnmarshalYAML converts time string into time object

Jump to

Keyboard shortcuts

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