device

package
v0.9.8 Latest Latest
Warning

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

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

Documentation

Overview

Package device contains a shim definition of Device to insulate the onos-config subsystem from the deprecation of onos-topo/api/device.

Index

Constants

This section is empty.

Variables

View Source
var ListresponsetypeName = map[int32]string{
	0: "NONE",
	1: "ADDED",
	2: "UPDATED",
	3: "REMOVED",
}

ListresponsetypeName - map of enumerations

Functions

func ToObject

func ToObject(device *Device) *topo.Object

ToObject converts local device to a topology object entity.

Types

type Credentials

type Credentials struct {
	// user with which to connect to the device
	User string
	// password for connecting to the device
	Password string
}

Credentials is the device credentials

type Device

type Device struct {
	// globally unique device identifier; maps to Object.ID
	ID ID

	// host:port of the device
	Address string
	// device target
	Target string
	// device software version
	Version string

	// timeout indicates the device request timeout
	Timeout *time.Duration
	// credentials for connecting to the device
	Credentials Credentials
	// TLS configuration for connecting to the device
	TLS TLSConfig

	// type of the device
	Type Type
	// role for the device
	Role Role

	Protocols []*topo.ProtocolState
	// user-friendly tag
	Displayname string

	// Mastership state
	MastershipTerm uint64
	MasterKey      string

	// revision of the underlying Object
	Revision topo.Revision

	// Backing entity
	Object *topo.Object
}

Device structure provide a shim for topo.Object

func ToDevice

func ToDevice(object *topo.Object) (*Device, error)

ToDevice converts topology object entity to a local device object

type ID

type ID topo.ID

ID represents device globally unique ID

type ListResponse

type ListResponse struct {
	// type of the event
	Type ListResponseType
	// device is the device on which the event occurred
	Device *Device
}

ListResponse carries a single device event

type ListResponseType

type ListResponseType int32

ListResponseType is a device event type

const (
	// ListResponseNONE obviously
	ListResponseNONE ListResponseType = 0
	// ListResponseADDED obviously
	ListResponseADDED ListResponseType = 1
	// ListResponseUPDATED obviously
	ListResponseUPDATED ListResponseType = 2
	// ListResponseREMOVED obviously
	ListResponseREMOVED ListResponseType = 3
)

func (ListResponseType) String added in v0.7.24

func (x ListResponseType) String() string

String - convert to string

type Role

type Role string

Role represents device role in the network

type TLSConfig

type TLSConfig struct {
	// name of the device's CA certificate
	CaCert string
	// name of the device's certificate
	Cert string
	// name of the device's TLS key
	Key string
	// indicates whether to connect to the device over plaintext
	Plain bool
	// indicates whether to connect to the device with insecure communication
	Insecure bool
}

TLSConfig contains information pertinent to establishing a secure connection

type Type

type Type string

Type represents device type

Jump to

Keyboard shortcuts

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