device

package
v0.7.19 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: Apache-2.0 Imports: 3 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

This section is empty.

Functions

func ToObject

func ToObject(device *Device) *topo.Object

ToObject converts topology object entity to local device

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

	// arbitrary mapping of attribute keys/values
	Attributes map[string]string

	// revision of the underlying Object
	Revision topo.Revision
}

Device structure provide a shim for topo.Object

func ToDevice

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

ToDevice converts local device structure to topology object entity

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
)

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