Documentation ¶
Index ¶
- func Contains(arr []string, element string) bool
- func DMKafkaPublisher(ctx context.Context, ch chan interface{}, topic string)
- func InitializeDMKafkaPublishers(NewAsyncProducer func([]string, *sarama.Config) (sarama.AsyncProducer, error), ...) error
- func PluginTransceiverComponent(transId uint32, dms *DmiAPIServer) error
- func PlugoutTransceiverComponent(transId uint32, dms *DmiAPIServer) error
- func StartDmiAPIServer() (*grpc.Server, error)
- func StartEventsGenerator(apiSrv *DmiAPIServer)
- func StartGeneratingMetrics()
- func StartMetricGenerator(apiSrv *DmiAPIServer)
- func StopGeneratingMetrics()
- func StopMetricGenerator()
- func UpdateEventConfig(newEventCfg *dmi.EventCfg)
- func UpdateMetricConfig(newCfg *dmi.MetricConfig)
- type DmiAPIServer
- func (dms *DmiAPIServer) ActivateImage(req *dmi.HardwareID, ...) error
- func (dms *DmiAPIServer) CreateEvent(ctx context.Context, evt *bbsim.DmiEvent) (*bbsim.DmiResponse, error)
- func (dms *DmiAPIServer) DownloadImage(req *dmi.DownloadImageRequest, ...) error
- func (dms *DmiAPIServer) GetHWComponentInfo(req *dmi.HWComponentInfoGetRequest, ...) error
- func (dms *DmiAPIServer) GetLogLevel(context.Context, *dmi.GetLogLevelRequest) (*dmi.GetLogLevelResponse, error)
- func (dms *DmiAPIServer) GetLoggableEntities(context.Context, *dmi.GetLoggableEntitiesRequest) (*dmi.GetLogLevelResponse, error)
- func (dms *DmiAPIServer) GetLoggingEndpoint(_ context.Context, request *dmi.HardwareID) (*dmi.GetLoggingEndpointResponse, error)
- func (dms *DmiAPIServer) GetManagedDevices(context.Context, *empty.Empty) (*dmi.ManagedDevicesResponse, error)
- func (dms *DmiAPIServer) GetMetric(ctx context.Context, req *dmi.GetMetricRequest) (*dmi.GetMetricResponse, error)
- func (dms *DmiAPIServer) GetMsgBusEndpoint(context.Context, *empty.Empty) (*dmi.GetMsgBusEndpointResponse, error)
- func (dms *DmiAPIServer) GetPhysicalInventory(req *dmi.PhysicalInventoryRequest, ...) error
- func (dms *DmiAPIServer) GetSoftwareVersion(ctx context.Context, req *dmi.HardwareID) (*dmi.GetSoftwareVersionInformationResponse, error)
- func (dms *DmiAPIServer) GetStartupConfigurationInfo(ctx context.Context, request *dmi.StartupConfigInfoRequest) (*dmi.StartupConfigInfoResponse, error)
- func (s DmiAPIServer) GetTransceivers(ctx context.Context, req *bbsim.DmiEmpty) (*bbsim.Transceivers, error)
- func (dms *DmiAPIServer) HeartbeatCheck(context.Context, *empty.Empty) (*dmi.Heartbeat, error)
- func (dms *DmiAPIServer) ListEvents(ctx context.Context, req *dmi.HardwareID) (*dmi.ListEventsResponse, error)
- func (dms *DmiAPIServer) ListMetrics(ctx context.Context, req *dmi.HardwareID) (*dmi.ListMetricsResponse, error)
- func (s DmiAPIServer) PlugInTransceiver(ctx context.Context, req *bbsim.TransceiverRequest) (*bbsim.DmiResponse, error)
- func (s DmiAPIServer) PlugOutTransceiver(ctx context.Context, req *bbsim.TransceiverRequest) (*bbsim.DmiResponse, error)
- func (dms *DmiAPIServer) RebootDevice(context.Context, *dmi.RebootDeviceRequest) (*dmi.RebootDeviceResponse, error)
- func (dms *DmiAPIServer) RevertToStandbyImage(req *dmi.HardwareID, ...) error
- func (dms *DmiAPIServer) SetHWComponentInfo(context.Context, *dmi.HWComponentInfoSetRequest) (*dmi.HWComponentInfoSetResponse, error)
- func (dms *DmiAPIServer) SetLogLevel(context.Context, *dmi.SetLogLevelRequest) (*dmi.SetLogLevelResponse, error)
- func (dms *DmiAPIServer) SetLoggingEndpoint(_ context.Context, request *dmi.SetLoggingEndpointRequest) (*dmi.SetRemoteEndpointResponse, error)
- func (dms *DmiAPIServer) SetMsgBusEndpoint(ctx context.Context, request *dmi.SetMsgBusEndpointRequest) (*dmi.SetRemoteEndpointResponse, error)
- func (dms *DmiAPIServer) StartManagingDevice(req *dmi.ModifiableComponent, ...) error
- func (dms *DmiAPIServer) StopManagingDevice(ctx context.Context, req *dmi.StopManagingDeviceRequest) (*dmi.StopManagingDeviceResponse, error)
- func (dms *DmiAPIServer) StreamEvents(req *empty.Empty, srv dmi.NativeEventsManagementService_StreamEventsServer) error
- func (dms *DmiAPIServer) StreamMetrics(req *empty.Empty, srv dmi.NativeMetricsManagementService_StreamMetricsServer) error
- func (dms *DmiAPIServer) UpdateEventsConfiguration(ctx context.Context, req *dmi.EventsConfigurationRequest) (*dmi.EventsConfigurationResponse, error)
- func (dms *DmiAPIServer) UpdateMetricsConfiguration(ctx context.Context, req *dmi.MetricsConfigurationRequest) (*dmi.MetricsConfigurationResponse, error)
- func (dms *DmiAPIServer) UpdateStartupConfiguration(request *dmi.ConfigRequest, ...) error
- type DmiEventsGenerator
- type DmiMetricsGenerator
- type MetricGenerationFunc
- type MetricTriggerConfig
- type Transceiver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DMKafkaPublisher ¶ added in v1.4.1
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 PluginTransceiverComponent ¶ added in v1.12.5
func PluginTransceiverComponent(transId uint32, dms *DmiAPIServer) error
func PlugoutTransceiverComponent ¶ added in v1.12.5
func PlugoutTransceiverComponent(transId uint32, dms *DmiAPIServer) error
func StartDmiAPIServer ¶
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
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 { Transceivers []*Transceiver // contains filtered or unexported fields }
DmiAPIServer has the attributes for the Server handling the Device Management Interface
func (*DmiAPIServer) ActivateImage ¶
func (dms *DmiAPIServer) ActivateImage(req *dmi.HardwareID, stream dmi.NativeSoftwareManagementService_ActivateImageServer) error
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.DmiResponse, error)
CreateEvent creates and the passed event if it's valid and sends it to the msg bus
func (*DmiAPIServer) DownloadImage ¶
func (dms *DmiAPIServer) DownloadImage(req *dmi.DownloadImageRequest, stream dmi.NativeSoftwareManagementService_DownloadImageServer) error
DownloadImage downloads and installs the image in the standby partition, returns the status/progress of the Install
func (*DmiAPIServer) GetHWComponentInfo ¶
func (dms *DmiAPIServer) GetHWComponentInfo(req *dmi.HWComponentInfoGetRequest, stream dmi.NativeHWManagementService_GetHWComponentInfoServer) error
GetHWComponentInfo gets the details of a particular HW component
func (*DmiAPIServer) GetLogLevel ¶ added in v1.4.1
func (dms *DmiAPIServer) GetLogLevel(context.Context, *dmi.GetLogLevelRequest) (*dmi.GetLogLevelResponse, error)
GetLogLevel Gets the configured log level for a certain entity on a certain device.
func (*DmiAPIServer) GetLoggableEntities ¶ added in v1.4.1
func (dms *DmiAPIServer) GetLoggableEntities(context.Context, *dmi.GetLoggableEntitiesRequest) (*dmi.GetLogLevelResponse, error)
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 ¶
func (dms *DmiAPIServer) GetMetric(ctx context.Context, req *dmi.GetMetricRequest) (*dmi.GetMetricResponse, error)
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 ¶
func (dms *DmiAPIServer) GetPhysicalInventory(req *dmi.PhysicalInventoryRequest, stream dmi.NativeHWManagementService_GetPhysicalInventoryServer) error
GetPhysicalInventory gets the HW inventory details of the Device
func (*DmiAPIServer) GetSoftwareVersion ¶
func (dms *DmiAPIServer) GetSoftwareVersion(ctx context.Context, req *dmi.HardwareID) (*dmi.GetSoftwareVersionInformationResponse, error)
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) GetTransceivers ¶ added in v1.12.5
func (s DmiAPIServer) GetTransceivers(ctx context.Context, req *bbsim.DmiEmpty) (*bbsim.Transceivers, error)
func (*DmiAPIServer) HeartbeatCheck ¶ added in v1.10.4
Performs the heartbeat check
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) PlugInTransceiver ¶ added in v1.12.5
func (s DmiAPIServer) PlugInTransceiver(ctx context.Context, req *bbsim.TransceiverRequest) (*bbsim.DmiResponse, error)
PlugInTransceiver plugs in the transceiver by its ID
func (DmiAPIServer) PlugOutTransceiver ¶ added in v1.12.5
func (s DmiAPIServer) PlugOutTransceiver(ctx context.Context, req *bbsim.TransceiverRequest) (*bbsim.DmiResponse, error)
PlugOutTransceiver plugs out the transceiver by its ID
func (*DmiAPIServer) RebootDevice ¶ added in v1.10.4
func (dms *DmiAPIServer) RebootDevice(context.Context, *dmi.RebootDeviceRequest) (*dmi.RebootDeviceResponse, error)
Performs the reboot of the device
func (*DmiAPIServer) RevertToStandbyImage ¶
func (dms *DmiAPIServer) RevertToStandbyImage(req *dmi.HardwareID, stream dmi.NativeSoftwareManagementService_RevertToStandbyImageServer) error
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 ¶
func (dms *DmiAPIServer) SetHWComponentInfo(context.Context, *dmi.HWComponentInfoSetRequest) (*dmi.HWComponentInfoSetResponse, error)
SetHWComponentInfo sets the permissible attributes of a HW component
func (*DmiAPIServer) SetLogLevel ¶ added in v1.4.1
func (dms *DmiAPIServer) SetLogLevel(context.Context, *dmi.SetLogLevelRequest) (*dmi.SetLogLevelResponse, error)
SetLogLevel Sets the log level of the device, for each given entity to a certain level.
func (*DmiAPIServer) SetLoggingEndpoint ¶
func (dms *DmiAPIServer) SetLoggingEndpoint(_ context.Context, request *dmi.SetLoggingEndpointRequest) (*dmi.SetRemoteEndpointResponse, error)
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 ¶
func (dms *DmiAPIServer) StartManagingDevice(req *dmi.ModifiableComponent, stream dmi.NativeHWManagementService_StartManagingDeviceServer) error
StartManagingDevice establishes connection with the device and does checks to ascertain if the device with passed identity can be managed
func (*DmiAPIServer) StopManagingDevice ¶
func (dms *DmiAPIServer) StopManagingDevice(ctx context.Context, req *dmi.StopManagingDeviceRequest) (*dmi.StopManagingDeviceResponse, error)
StopManagingDevice stops management of a device and cleans up any context and caches for that device
func (*DmiAPIServer) StreamEvents ¶ added in v1.10.4
func (dms *DmiAPIServer) StreamEvents(req *empty.Empty, srv dmi.NativeEventsManagementService_StreamEventsServer) error
Initiates the server streaming of the events
func (*DmiAPIServer) StreamMetrics ¶ added in v1.10.4
func (dms *DmiAPIServer) StreamMetrics(req *empty.Empty, srv dmi.NativeMetricsManagementService_StreamMetricsServer) error
Initiates the server streaming of the metrics
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
func (dms *DmiAPIServer) UpdateStartupConfiguration(request *dmi.ConfigRequest, stream dmi.NativeSoftwareManagementService_UpdateStartupConfigurationServer) error
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
type Transceiver ¶ added in v1.12.5
type Transceiver struct { ID uint32 Uuid string Name string Pons []*devices.PonPort Technology dmi.TransceiverType //Setting this bool will prevent the transceiver //from being plugged out while already out, and //plugged in while already in, but won't prevent //the associated PONs from being enabled in other //ways while the transceiver is plugged out PluggedIn bool }