events

package
v7.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Overview

* Copyright 2020-2024 Open Networking Foundation (ONF) and the ONF Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* Copyright 2020-2024 Open Networking Foundation (ONF) and the ONF Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

View Source
const EVENT_THRESHOLD = 1000

TODO: Make configurable through helm chart

Variables

This section is empty.

Functions

func CreateDeviceDeletedEvent

func CreateDeviceDeletedEvent(serialNumber string, deviceID string, parentID string,
	onuId uint32, parentPonPort uint32, isRoot bool) *voltha.DeviceEvent

CreateDeviceDeletedEvent forms and returns a new DeviceState Event

func CreateDeviceStateChangeEvent

func CreateDeviceStateChangeEvent(serialNumber string, deviceID string, parentID string,
	prevOperStatus common.OperStatus_Types, prevConnStatus common.ConnectStatus_Types, prevAdminStatus common.AdminState_Types,
	operStatus common.OperStatus_Types, connStatus common.ConnectStatus_Types, adminStatus common.AdminState_Types,
	parentPort uint32, isRoot bool) *voltha.DeviceEvent

CreateDeviceStateChangeEvent forms and returns a new DeviceStateChange Event

Types

type ContextType

type ContextType string
const (
	// ContextAdminState is for the admin state of the Device in the context of the event
	ContextAdminState ContextType = "admin-state"
	// ContextConnectState is for the connect state of the Device in the context of the event
	ContextConnectState ContextType = "connect-state"
	// ContextOperState is for the operational state of the Device in the context of the event
	ContextOperState ContextType = "oper-state"
	// ContextPrevdminState is for the previous admin state of the Device in the context of the event
	ContextPrevAdminState ContextType = "prev-admin-state"
	// ContextPrevConnectState is for the previous connect state of the Device in the context of the event
	ContextPrevConnectState ContextType = "prev-connect-state"
	// ContextPrevOperState is for the previous operational state of the Device in the context of the event
	ContextPrevOperState ContextType = "prev-oper-state"
	// ContextDeviceID is for the previous operational state of the Device in the context of the event
	ContextDeviceID ContextType = "id"
	// ContextParentID is for the parent id in the context of the event
	ContextParentID ContextType = "parent-id"
	// ContextSerialNumber is for the serial number of the Device in the context of the event
	ContextSerialNumber ContextType = "serial-number"
	// ContextIsRoot is for the root flag of Device in the context of the event
	ContextIsRoot ContextType = "is-root"
	// ContextParentPort is for the parent interface id of child in the context of the event
	ContextParentPort ContextType = "parent-port"
	//ContextPonID is the PON ID the Child device is connected to
	ContextPonID ContextType = "pon-id"
	//ContextOnuID is the Onu ID of the child device
	ContextOnuID ContextType = "onu-id"
	//ContextParentSerialNum is the serila number of the parent device
	ContextParentSerialNum ContextType = "olt-serial-number"
)

type EventAction

type EventAction string
const (
	Raise EventAction = "RAISE_EVENT"
	Clear EventAction = "CLEAR_EVENT"
)

type EventName

type EventName string
const (
	DeviceStateChangeEvent EventName = "DEVICE_STATE_CHANGE"
	OltDeviceStateDeleted  EventName = "OLT_DELETED_RAISE_EVENT"
	OnuDeviceStateDeleted  EventName = "ONU_DELETED_RAISE_EVENT"
)

type EventProxy

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

func NewEventProxy

func NewEventProxy(opts ...EventProxyOption) *EventProxy

func (*EventProxy) EnableLivenessChannel

func (ep *EventProxy) EnableLivenessChannel(ctx context.Context, enable bool) chan bool

func (*EventProxy) SendDeviceEvent

func (ep *EventProxy) SendDeviceEvent(ctx context.Context, deviceEvent *voltha.DeviceEvent, category eventif.EventCategory, subCategory eventif.EventSubCategory, raisedTs int64) error

Send out device events

func (*EventProxy) SendDeviceEventWithKey

func (ep *EventProxy) SendDeviceEventWithKey(ctx context.Context, deviceEvent *voltha.DeviceEvent, category eventif.EventCategory, subCategory eventif.EventSubCategory, raisedTs int64, key string) error

Send out device events with key

func (*EventProxy) SendKpiEvent

func (ep *EventProxy) SendKpiEvent(ctx context.Context, id string, kpiEvent *voltha.KpiEvent2, category eventif.EventCategory, subCategory eventif.EventSubCategory, raisedTs int64) error

SendKpiEvent is to send kpi events to voltha.event topic

func (*EventProxy) SendLiveness

func (ep *EventProxy) SendLiveness(ctx context.Context) error

func (*EventProxy) SendRPCEvent

func (ep *EventProxy) SendRPCEvent(ctx context.Context, id string, rpcEvent *voltha.RPCEvent, category eventif.EventCategory, subCategory *eventif.EventSubCategory, raisedTs int64) error

Send out rpc events

func (*EventProxy) Start

func (ep *EventProxy) Start() error

Start the event proxy

func (*EventProxy) Stop

func (ep *EventProxy) Stop()

type EventProxyOption

type EventProxyOption func(*EventProxy)

func MsgClient

func MsgClient(client kafka.Client) EventProxyOption

func MsgTopic

func MsgTopic(topic kafka.Topic) EventProxyOption

type EventQueue

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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