v1

package
v0.0.0-...-a0c03a0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACIClient

type ACIClient struct {
	Log *logger.Logger
	// contains filtered or unexported fields
}

ACIClient represents an instance of the acigo ACI API client.

ACIClient implements the of.ACIClient interface.

func NewACIClient

func NewACIClient(cfg of.ACIClientConfig, log *logger.Logger) (*ACIClient, error)

NewACIClient returns a new instance of ACIClient configured by an of.ACIClientConfig struct.

func (*ACIClient) Faults

func (c *ACIClient) Faults() ([]of.Map, error)

Faults returns the API's "fault table" as a slice of of.Map objects.

func (*ACIClient) GetHost

func (c *ACIClient) GetHost() string

Get the current ACI host

func (*ACIClient) Login

func (c *ACIClient) Login() error

Login opens a new API session.

func (*ACIClient) Logout

func (c *ACIClient) Logout() error

Logout closes the API session.

func (*ACIClient) NodeList

func (c *ACIClient) NodeList() (map[string]map[string]interface{}, error)

NodeList retrieves the list of top level system elements (APICs, spines, leaves).

func (*ACIClient) SetHost

func (c *ACIClient) SetHost(host string)

Allow set the ACI host on runtime

type ACIFaultSeverityID

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

ACIFaultSeverityID represents a ACI fault's severity level ID as mapped inside the Observability Framework.

ACIFaultSeverityID implements the of.ACIFaultSeverityIDParser interface.

func NewACIFaultSeverityID

func NewACIFaultSeverityID(id int) (ACIFaultSeverityID, error)

NewACIFaultSeverityID returns a new instance of ACIFaultSeverityID.

func (ACIFaultSeverityID) Raw

Raw returns the ACIFaultSeverityID's equivalent ACIFaultSeverityRaw.

func (ACIFaultSeverityID) String

func (s ACIFaultSeverityID) String() string

String implements the fmt.Stringer interface.

type ACIFaultSeverityRaw

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

ACIFaultSeverityRaw represents a ACI fault's severity level string as mapped inside the Observability Framework.

ACIFaultSeverityRaw implements the of.ACIFaultSeverityRawParser interface.

func NewACIFaultSeverityRaw

func NewACIFaultSeverityRaw(s string) (ACIFaultSeverityRaw, error)

NewACIFaultSeverityRaw returns a new instance of ACIFaultSeverityRaw.

func (ACIFaultSeverityRaw) ID

ID returns the ACIFaultSeverityRaw's equivalent ACIFaultSeverityID.

func (ACIFaultSeverityRaw) String

func (s ACIFaultSeverityRaw) String() string

String implements the fmt.Stringer interface.

type FaultParser

type FaultParser struct {
	Fault of.ACIFaultRaw
	Log   *logger.Logger
}

func (*FaultParser) Created

func (f *FaultParser) Created() (time.Time, error)

Created returns the ACI API's created time for the fault in UTC timezone and as RFC3339 time format.

func (*FaultParser) LastTransition

func (f *FaultParser) LastTransition() (time.Time, error)

LastTransition returns the ACI API's last transition time for the fault in UTC timezone and as RFC3339 time format.

func (*FaultParser) SeverityID

func (f *FaultParser) SeverityID() (of.ACIFaultSeverityID, error)

ServerityID returns a numerical severity for the fault based on the return value from ACIFaultRawSeverityIDParser.

func (*FaultParser) SubID

func (f *FaultParser) SubID() (string, error)

SubID returns the fault's `sub_id`. The return value is result of pruning pattern `/fault-.*` from the fault's Distinguished Name (or DN).

Jump to

Keyboard shortcuts

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