dmiserver

package
Version: v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(arr []string, element string) bool

Contains tells whether arr contains element.

func DMKafkaPublisher added in v1.4.1

func DMKafkaPublisher(ctx context.Context, ch chan interface{}, topic string)

DMKafkaPublisher receives messages on ch and publish them to kafka on topic

func InitializeDMKafkaPublishers added in v1.4.1

func InitializeDMKafkaPublishers(NewAsyncProducer func([]string, *sarama.Config) (sarama.AsyncProducer, error), oltID int, msgBusEndPoint string) error

InitializeDMKafkaPublishers initializes metrics kafka publisher

func StartDmiAPIServer

func StartDmiAPIServer() (*grpc.Server, error)

StartDmiAPIServer starts a new grpc server for the Device Manager Interface

func StartEventsGenerator added in v1.4.3

func StartEventsGenerator(apiSrv *DmiAPIServer)

StartEventsGenerator initializes the event generator

func StartGeneratingMetrics added in v1.4.1

func StartGeneratingMetrics()

StartGeneratingMetrics starts the goroutine which submits metrics to the metrics channel

func StartMetricGenerator added in v1.4.1

func StartMetricGenerator(apiSrv *DmiAPIServer)

StartMetricGenerator starts the metric generator

func StopGeneratingMetrics added in v1.4.1

func StopGeneratingMetrics()

StopGeneratingMetrics stops the goroutine which submits metrics to the metrics channel

func StopMetricGenerator added in v1.4.1

func StopMetricGenerator()

StopMetricGenerator stops the generation of metrics and cleans up all local context

func UpdateEventConfig added in v1.4.3

func UpdateEventConfig(newEventCfg *dmi.EventCfg)

UpdateEventConfig Adds/Updates the passed event configuration

func UpdateMetricConfig added in v1.4.1

func UpdateMetricConfig(newCfg *dmi.MetricConfig)

UpdateMetricConfig Adds/Updates the passed metric configuration

Types

type DmiAPIServer

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

DmiAPIServer has the attributes for the Server handling the Device Management Interface

func (*DmiAPIServer) ActivateImage

ActivateImage Activates and runs the OLT with the image in the standby partition

func (*DmiAPIServer) CreateEvent added in v1.4.3

func (dms *DmiAPIServer) CreateEvent(ctx context.Context, evt *bbsim.DmiEvent) (*bbsim.DmiCreateEventResponse, error)

CreateEvent creates and the passed event if it's valid and sends it to the msg bus

func (*DmiAPIServer) DownloadImage

DownloadImage downloads and installs the image in the standby partition, returns the status/progress of the Install

func (*DmiAPIServer) GetHWComponentInfo

GetHWComponentInfo gets the details of a particular HW component

func (*DmiAPIServer) GetLogLevel added in v1.4.1

GetLogLevel Gets the configured log level for a certain entity on a certain device.

func (*DmiAPIServer) GetLoggableEntities added in v1.4.1

GetLoggableEntities Gets the entities of a device on which log can be configured.

func (*DmiAPIServer) GetLoggingEndpoint

func (dms *DmiAPIServer) GetLoggingEndpoint(_ context.Context, request *dmi.HardwareID) (*dmi.GetLoggingEndpointResponse, error)

GetLoggingEndpoint gets the configured location to which the logs are being shipped

func (*DmiAPIServer) GetManagedDevices

func (dms *DmiAPIServer) GetManagedDevices(context.Context, *empty.Empty) (*dmi.ManagedDevicesResponse, error)

GetManagedDevices returns an object containing a list of devices managed by this entity

func (*DmiAPIServer) GetMetric

GetMetric gets the instantenous value of a metric

func (*DmiAPIServer) GetMsgBusEndpoint

func (dms *DmiAPIServer) GetMsgBusEndpoint(context.Context, *empty.Empty) (*dmi.GetMsgBusEndpointResponse, error)

GetMsgBusEndpoint gets the configured location to which the events and metrics are being shipped

func (*DmiAPIServer) GetPhysicalInventory

GetPhysicalInventory gets the HW inventory details of the Device

func (*DmiAPIServer) GetSoftwareVersion

GetSoftwareVersion gets the software version information of the Active and Standby images

func (*DmiAPIServer) GetStartupConfigurationInfo added in v1.5.1

func (dms *DmiAPIServer) GetStartupConfigurationInfo(ctx context.Context, request *dmi.StartupConfigInfoRequest) (*dmi.StartupConfigInfoResponse, error)

GetStartupConfigurationInfo API is used to return the 'StartUp' config present on the device

func (*DmiAPIServer) ListEvents

func (dms *DmiAPIServer) ListEvents(ctx context.Context, req *dmi.HardwareID) (*dmi.ListEventsResponse, error)

ListEvents lists the supported events for the passed device

func (*DmiAPIServer) ListMetrics

func (dms *DmiAPIServer) ListMetrics(ctx context.Context, req *dmi.HardwareID) (*dmi.ListMetricsResponse, error)

ListMetrics lists the supported metrics for the passed device.

func (*DmiAPIServer) RevertToStandbyImage

RevertToStandbyImage marks the image in the Standby as Active and reboots the device, so that it boots from that image which was in the standby.

func (*DmiAPIServer) SetHWComponentInfo

SetHWComponentInfo sets the permissible attributes of a HW component

func (*DmiAPIServer) SetLogLevel added in v1.4.1

SetLogLevel Sets the log level of the device, for each given entity to a certain level.

func (*DmiAPIServer) SetLoggingEndpoint

SetLoggingEndpoint sets the location to which logs need to be shipped

func (*DmiAPIServer) SetMsgBusEndpoint

func (dms *DmiAPIServer) SetMsgBusEndpoint(ctx context.Context, request *dmi.SetMsgBusEndpointRequest) (*dmi.SetRemoteEndpointResponse, error)

SetMsgBusEndpoint sets the location of the Message Bus to which events and metrics are shipped

func (*DmiAPIServer) StartManagingDevice

StartManagingDevice establishes connection with the device and does checks to ascertain if the device with passed identity can be managed

func (*DmiAPIServer) StopManagingDevice

StopManagingDevice stops management of a device and cleans up any context and caches for that device

func (*DmiAPIServer) UpdateEventsConfiguration

func (dms *DmiAPIServer) UpdateEventsConfiguration(ctx context.Context, req *dmi.EventsConfigurationRequest) (*dmi.EventsConfigurationResponse, error)

UpdateEventsConfiguration updates the configuration of the list of events in the request

func (*DmiAPIServer) UpdateMetricsConfiguration

func (dms *DmiAPIServer) UpdateMetricsConfiguration(ctx context.Context, req *dmi.MetricsConfigurationRequest) (*dmi.MetricsConfigurationResponse, error)

UpdateMetricsConfiguration updates the configuration of the list of metrics in the request

func (*DmiAPIServer) UpdateStartupConfiguration added in v1.4.1

UpdateStartupConfiguration API can be used to let the devices pickup their properitary configuration which they need at startup.

type DmiEventsGenerator added in v1.4.3

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

DmiEventsGenerator has the attributes for generating events

type DmiMetricsGenerator added in v1.4.1

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

DmiMetricsGenerator has the attributes for generating metrics

type MetricGenerationFunc added in v1.4.1

type MetricGenerationFunc func(*dmi.Component, *DmiAPIServer) *dmi.Metric

MetricGenerationFunc to generate the metrics to the kafka bus

type MetricTriggerConfig added in v1.4.1

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

MetricTriggerConfig is the configuration of a metric and the time at which it will be exported

Jump to

Keyboard shortcuts

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