goovn

package module
v0.1.0-patch Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

GO OVN License GoDoc Travis CI Go Report Card

A Go library for OVN DB access using native OVSDB protocol. It is based on the OVSDB Library, but used own fork https://github.com/ebay/libovsdb.git with patches.

What is OVN?

OVN (Open Virtual Network) is a SDN solution built on top of OVS (Open vSwitch). The interface of OVN is its northbound DB which is an OVSDB database.

What is OVSDB?

OVSDB is a protocol for managing the configuration of OVS. It's defined in RFC 7047.

Why native OVSDB protocol?

There are projects accessing OVN DB based on the ovn-nbctl/sbctl CLI, which has some problems. Here are the majors ones and how native OVSDB protocol based approach solves them:

  • Performance problem. Every CLI command would trigger a separate OVSDB connection setup/teardown, initial OVSDB client cache population, etc., which would impact performance significantly. This library uses OVSDB protocol directly so that the overhead happens only once for all OVSDB operations.

  • Caching problem. When there is a change in desired state, which requires updates in OVN, we need to figure out first what's the current state in OVN, which requires either maintaining a client cache or executing a "list" command everytime. This library maintains an internal cache and ensures it is always up to date with the remote DB with the help of native OVSDB support.

  • String parsing problem. CLI based implementation needs extra conversion from the string output to Go internal data types, while it is not necessary with this library since OVSDB JSON RPC takes care of it.

Documentation

Index

Constants

View Source
const (
	DBNB string = "OVN_Northbound"
	DBSB string = "OVN_Southbound"
)
View Source
const (
	TableNBGlobal                 string = "NB_Global"
	TableLogicalSwitch            string = "Logical_Switch"
	TableLogicalSwitchPort        string = "Logical_Switch_Port"
	TableAddressSet               string = "Address_Set"
	TablePortGroup                string = "Port_Group"
	TableLoadBalancer             string = "Load_Balancer"
	TableACL                      string = "ACL"
	TableLogicalRouter            string = "Logical_Router"
	TableQoS                      string = "QoS"
	TableMeter                    string = "Meter"
	TableMeterBand                string = "Meter_Band"
	TableLogicalRouterPort        string = "Logical_Router_Port"
	TableLogicalRouterStaticRoute string = "Logical_Router_Static_Route"
	TableLogicalRouterPolicy      string = "Logical_Router_Policy"
	TableNAT                      string = "NAT"
	TableDHCPOptions              string = "DHCP_Options"
	TableConnection               string = "Connection"
	TableDNS                      string = "DNS"
	TableSSL                      string = "SSL"
	TableGatewayChassis           string = "Gateway_Chassis"
	TableChassis                  string = "Chassis"
	TableEncap                    string = "Encap"
	TableSBGlobal                 string = "SB_Global"
	TableChassisPrivate           string = "Chassis_Private"
)
View Source
const (
	OVS_RUNDIR   = "/var/run/openvswitch"
	OVNNB_SOCKET = "nb1.ovsdb"
	OVNSB_SOCKET = "sb1.ovsdb"
	LR           = "TEST_LR"
	LRP          = "TEST_LRP"
	LSW          = "TEST_LSW"
	LSP          = "TEST_LSP"
	LSP_SECOND   = "TEST_LSP_SECOND "
	ADDR         = "36:46:56:76:86:96 127.0.0.1"
	ADDR2        = "36:46:56:76:86:97 192.168.1.10"
	MATCH        = "outport == \"96d44061-1823-428b-a7ce-f473d10eb3d0\" && ip && ip.dst == 10.97.183.61"
	MATCH_SECOND = "outport == \"96d44061-1823-428b-a7ce-f473d10eb3d0\" && ip && ip.dst == 10.97.183.62"
	MATCH3       = "ip && ip.dst == 10.97.183.64"

	SKIP_TLS_VERIFY  = true
	SSL              = "ssl"
	UNIX             = "unix"
	FAKENOCHASSIS    = "fakenochassis"
	FAKENOSWITCH     = "fakenoswitch"
	FAKENOROUTER     = "fakenorouter"
	PG_TEST_PG1      = "TestPortGroup1"
	PG_TEST_PG2      = "TestPortGroup2"
	PG_TEST_LS1      = "TestLogicalSwitch"
	PG_TEST_LSP1     = "TestLogicalSwitchPort1"
	PG_TEST_LSP2     = "TestLogicalSwitchPort2"
	PG_TEST_LSP3     = "TestLogicalSwitchPort3"
	PG_TEST_LSP4     = "TestLogicalSwitchPort4"
	PG_TEST_KEY_1    = "mac_addr"
	PG_TEST_ID_1     = "00:01:02:03:04:05"
	PG_TEST_KEY_2    = "ip_addr"
	PG_TEST_ID_2     = "169.254.1.1"
	PG_TEST_KEY_3    = "foo1"
	PG_TEST_ID_3     = "bar1"
	ACL_NAME_1       = "aclName1"
	ACL_NAME_2       = "aclName2"
	ACL_NAME_3       = "aclName3"
	ACL_NAME_4       = "aclName4"
	ACL_NAME_5       = "aclName5"
	SEVERITY_INFO    = "info"
	SEVERITY_ALERT   = "alert"
	SEVERITY_WARNING = "warning"
	METER1           = "testMeter1"
	METER2           = "testMeter2"
	METER3           = "testMeter3"
	NONEXISTENT_UUID = "53be5050-87b2-49d4-9c74-bf645653a524"
)

Variables

View Source
var (
	// ErrorOption used when invalid args specified
	ErrorOption = errors.New("invalid option specified")
	// ErrorSchema used when something wrong in ovnnb
	ErrorSchema = errors.New("table schema error")
	// ErrorNotFound used when object not found in ovnnb
	ErrorNotFound = errors.New("object not found")
	// ErrorExist used when object already exists in ovnnb
	ErrorExist = errors.New("object exist")
	// ErrorNoChanges used when function called, but no changes
	ErrorNoChanges = errors.New("no changes requested")
	// ErrorDuplicateName used when multiple rows are found when searching by name
	ErrorDuplicateName = errors.New("duplicate name")
)

Functions

This section is empty.

Types

type ACL

type ACL struct {
	UUID       string
	Name       string
	Action     string
	Direction  string
	Match      string
	Priority   int
	Log        bool
	Meter      []string
	Severity   string
	ExternalID map[interface{}]interface{}
}

ACL ovnnb item

type AddressSet

type AddressSet struct {
	UUID       string
	Name       string
	Addresses  []string
	ExternalID map[interface{}]interface{}
}

AddressSet ovnnb item

type Chassis

type Chassis struct {
	UUID                string
	Encaps              []string
	ExternalID          map[interface{}]interface{}
	Hostname            string
	Name                string
	NbCfg               int
	TransportZones      []string
	VtepLogicalSwitches []string
}

Chassis table OVN SB

type ChassisPrivate

type ChassisPrivate struct {
	UUID       string
	ExternalID map[interface{}]interface{}
	Name       string
	NbCfg      int
}

Chassis_Private table OVN SB

type Client

type Client interface {
	// Get logical switch by name
	LSGet(ls string) ([]*LogicalSwitch, error)
	// Create ls named SWITCH
	LSAdd(ls string) (*OvnCommand, error)
	// Del ls and all its ports
	LSDel(ls string) (*OvnCommand, error)
	// Get all logical switches
	LSList() ([]*LogicalSwitch, error)
	// Add external_ids to logical switch
	LSExtIdsAdd(ls string, external_ids map[string]string) (*OvnCommand, error)
	// Del external_ids from logical_switch
	LSExtIdsDel(ls string, external_ids map[string]string) (*OvnCommand, error)
	// Link logical switch to router
	LinkSwitchToRouter(lsw, lsp, lr, lrp, lrpMac string, networks []string, externalIds map[string]string) (*OvnCommand, error)

	// Get logical switch port by name
	LSPGet(lsp string) (*LogicalSwitchPort, error)
	// Add logical port PORT on SWITCH
	LSPAdd(ls string, lsp string) (*OvnCommand, error)
	// Delete PORT from its attached switch
	LSPDel(lsp string) (*OvnCommand, error)
	// Set addressset per lport
	LSPSetAddress(lsp string, addresses ...string) (*OvnCommand, error)
	// Set port security per lport
	LSPSetPortSecurity(lsp string, security ...string) (*OvnCommand, error)
	// Set logical switch port type
	LSPSetType(lsp string, portType string) (*OvnCommand, error)
	// Get all lport by lswitch
	LSPList(ls string) ([]*LogicalSwitchPort, error)

	// Add LB to LSW
	LSLBAdd(ls string, lb string) (*OvnCommand, error)
	// Delete LB from LSW
	LSLBDel(ls string, lb string) (*OvnCommand, error)
	// List Load balancers for a LSW
	LSLBList(ls string) ([]*LoadBalancer, error)

	// Add ACL to entity (PORT_GROUP or LOGICAL_SWITCH)
	ACLAddEntity(entityType EntityType, entityName, aclName, direct, match, action string, priority int, external_ids map[string]string, logflag bool, meter, severity string) (*OvnCommand, error)
	// Deprecated in favor of ACLAddEntity(). Add ACL to logical switch.
	ACLAdd(ls, direct, match, action string, priority int, external_ids map[string]string, logflag bool, meter string, severity string) (*OvnCommand, error)
	// Set name for ACL
	ACLSetName(aclUUID, aclName string) (*OvnCommand, error)
	// Set match criteria for ACL
	ACLSetMatch(aclUUID, newMatch string) (*OvnCommand, error)
	// Set logging for ACL
	ACLSetLogging(aclUUID string, newLogflag bool, newMeter, newSeverity string) (*OvnCommand, error)
	// Delete acl from entity (PORT_GROUP or LOGICAL_SWITCH)
	ACLDelEntity(entityType EntityType, entityName, aclUUID string) (*OvnCommand, error)
	// Deprecated in favor of ACLDelEntity(). Delete acl from logical switch
	ACLDel(ls, direct, match string, priority int, external_ids map[string]string) (*OvnCommand, error)
	// Get all acl by entity
	ACLListEntity(entityType EntityType, entityName string) ([]*ACL, error)
	// Deprecated in favor of ACLListEntity(). Get all acl by logical switch
	ACLList(ls string) ([]*ACL, error)

	// Get AS
	ASGet(name string) (*AddressSet, error)
	// Update address set
	ASUpdate(name string, addrs []string, external_ids map[string]string) (*OvnCommand, error)
	// Add addressset
	ASAdd(name string, addrs []string, external_ids map[string]string) (*OvnCommand, error)
	// Delete addressset
	ASDel(name string) (*OvnCommand, error)
	// Get all AS
	ASList() ([]*AddressSet, error)

	// Get LR with given name
	LRGet(name string) ([]*LogicalRouter, error)
	// Add LR with given name
	LRAdd(name string, external_ids map[string]string) (*OvnCommand, error)
	// Delete LR with given name
	LRDel(name string) (*OvnCommand, error)
	// Get LRs
	LRList() ([]*LogicalRouter, error)

	// Add LRP with given name on given lr
	LRPAdd(lr string, lrp string, mac string, network []string, peer string, external_ids map[string]string) (*OvnCommand, error)
	// Delete LRP with given name on given lr
	LRPDel(lr string, lrp string) (*OvnCommand, error)
	// Get all lrp by lr
	LRPList(lr string) ([]*LogicalRouterPort, error)
	// Set LRP gateway chassis
	LRPSetGatewayChassis(lrp string, chassisMap map[string]int) (*OvnCommand, error)

	// Add LRSR with given ip_prefix on given lr
	LRSRAdd(lr string, ip_prefix string, nexthop string, output_port *string, policy *string, external_ids map[string]string) (*OvnCommand, error)
	// Delete LRSR with given ip_prefix, nexthop, outputPort and policy on given lr
	LRSRDel(lr string, prefix string, nexthop, outputPort, policy *string) (*OvnCommand, error)
	// Delete LRSR by uuid given lr
	LRSRDelByUUID(lr, uuid string) (*OvnCommand, error)
	// Get all LRSRs by lr
	LRSRList(lr string) ([]*LogicalRouterStaticRoute, error)

	// Add LRPolicy
	LRPolicyAdd(lr string, priority int, match string, action string, nexthop *string, nexthops []string, options map[string]string, external_ids map[string]string) (*OvnCommand, error)
	// Delete a LR policy by priority and optionally match
	LRPolicyDel(lr string, priority int, match *string) (*OvnCommand, error)
	// Delete a LR policy by UUID
	LRPolicyDelByUUID(lr string, uuid string) (*OvnCommand, error)
	// Delete all LRPolicies
	LRPolicyDelAll(lr string) (*OvnCommand, error)
	// Get all LRPolicies by LR
	LRPolicyList(lr string) ([]*LogicalRouterPolicy, error)

	// Add LB to LR
	LRLBAdd(lr string, lb string) (*OvnCommand, error)
	// Delete LB from LR
	LRLBDel(lr string, lb string) (*OvnCommand, error)
	// List Load balancers for a LR
	LRLBList(lr string) ([]*LoadBalancer, error)

	// Get LB with given name
	LBGet(name string) ([]*LoadBalancer, error)
	// Add LB
	LBAdd(name string, vipPort string, protocol string, addrs []string) (*OvnCommand, error)
	// Delete LB with given name
	LBDel(name string) (*OvnCommand, error)
	// Update existing LB
	LBUpdate(name string, vipPort string, protocol string, addrs []string) (*OvnCommand, error)
	// Set selection fields for LB session affinity
	LBSetSelectionFields(name string, selectionFields string) (*OvnCommand, error)
	// Get LBs
	LBList() ([]*LoadBalancer, error)

	// Set dhcp4_options uuid on lsp
	LSPSetDHCPv4Options(lsp string, options string) (*OvnCommand, error)
	// Get dhcp4_options from lsp
	LSPGetDHCPv4Options(lsp string) (*DHCPOptions, error)
	// Set dhcp6_options uuid on lsp
	LSPSetDHCPv6Options(lsp string, options string) (*OvnCommand, error)
	// Get dhcp6_options from lsp
	LSPGetDHCPv6Options(lsp string) (*DHCPOptions, error)
	// Set options in LSP
	LSPSetOptions(lsp string, options map[string]string) (*OvnCommand, error)
	// Get options from LSP
	LSPGetOptions(lsp string) (map[string]string, error)
	// Set dynamic addresses in LSP
	LSPSetDynamicAddresses(lsp string, address string) (*OvnCommand, error)
	// Get dynamic addresses from LSP
	LSPGetDynamicAddresses(lsp string) (string, error)
	// Set external_ids for LSP
	LSPSetExternalIds(lsp string, external_ids map[string]string) (*OvnCommand, error)
	// Get external_ids from LSP
	LSPGetExternalIds(lsp string) (map[string]string, error)
	// Add dhcp options for cidr and provided external_ids
	DHCPOptionsAdd(cidr string, options map[string]string, external_ids map[string]string) (*OvnCommand, error)
	// Set dhcp options and set external_ids for specific uuid
	DHCPOptionsSet(uuid string, options map[string]string, external_ids map[string]string) (*OvnCommand, error)
	// Del dhcp options via provided external_ids
	DHCPOptionsDel(uuid string) (*OvnCommand, error)
	// Get single dhcp via provided uuid
	DHCPOptionsGet(uuid string) (*DHCPOptions, error)
	// List dhcp options
	DHCPOptionsList() ([]*DHCPOptions, error)

	// Add qos rule
	QoSAdd(ls string, direction string, priority int, match string, action map[string]int, bandwidth map[string]int, external_ids map[string]string) (*OvnCommand, error)
	// Del qos rule, to delete wildcard specify priority -1 and string options as ""
	QoSDel(ls string, direction string, priority int, match string) (*OvnCommand, error)
	// Get qos rules by logical switch
	QoSList(ls string) ([]*QoS, error)

	//Add NAT to Logical Router
	LRNATAdd(lr string, ntype string, externalIp string, logicalIp string, external_ids map[string]string, logicalPortAndExternalMac ...string) (*OvnCommand, error)
	//Del NAT from Logical Router
	LRNATDel(lr string, ntype string, ip ...string) (*OvnCommand, error)
	// Get NAT List by Logical Router
	LRNATList(lr string) ([]*NAT, error)
	// Add Meter with a Meter Band
	MeterAdd(name, action string, rate int, unit string, external_ids map[string]string, burst int) (*OvnCommand, error)
	// Deletes meters
	MeterDel(name ...string) (*OvnCommand, error)
	// List Meters
	MeterList() ([]*Meter, error)
	// List Meter Bands
	MeterBandsList() ([]*MeterBand, error)
	// Exec command, support mul-commands in one transaction.
	Execute(cmds ...*OvnCommand) error
	// Same as Execute, but returns a UUID for each object created.
	ExecuteR(cmds ...*OvnCommand) ([]string, error)

	// Add chassis with given name
	ChassisAdd(name string, hostname string, etype []string, ip string, external_ids map[string]string,
		transport_zones []string, vtep_lswitches []string) (*OvnCommand, error)
	// Delete chassis with given name
	ChassisDel(chName string) (*OvnCommand, error)
	// Get chassis by hostname or name
	ChassisGet(chname string) ([]*Chassis, error)
	// List chassis
	ChassisList() ([]*Chassis, error)

	// Delete Chassis row from Chassis_Private with given name
	ChassisPrivateDel(chName string) (*OvnCommand, error)
	// List Chassis rows in chassis_private table
	ChassisPrivateList() ([]*ChassisPrivate, error)
	// Get Chassis row in chassis_private table by given name
	ChassisPrivateGet(chName string) ([]*ChassisPrivate, error)

	// Get encaps by chassis name
	EncapList(chname string) ([]*Encap, error)

	// Set NB_Global table options
	NBGlobalSetOptions(options map[string]string) (*OvnCommand, error)

	// Get NB_Global table options
	NBGlobalGetOptions() (map[string]string, error)

	// Set SB_Global table options
	SBGlobalSetOptions(options map[string]string) (*OvnCommand, error)

	// Get SB_Global table options
	SBGlobalGetOptions() (map[string]string, error)

	// Creates a new port group in the Port_Group table named "group" with optional "ports"  and "external_ids".
	PortGroupAdd(group string, ports []string, external_ids map[string]string) (*OvnCommand, error)
	// Sets "ports" and/or "external_ids" on the port group named "group". It is an error if group does not exist.
	PortGroupUpdate(group string, ports []string, external_ids map[string]string) (*OvnCommand, error)
	// Add port to port group.
	PortGroupAddPort(group string, port string) (*OvnCommand, error)
	// Remove port from port group.
	PortGroupRemovePort(group string, port string) (*OvnCommand, error)
	// Deletes port group "group". It is an error if "group" does not exist.
	PortGroupDel(group string) (*OvnCommand, error)
	// Get PortGroup data structure if it exists
	PortGroupGet(group string) (*PortGroup, error)

	// Close connection to OVN
	Close() error

	// GetSchema() returns ovn-db schema
	GetSchema() libovsdb.DatabaseSchema

	// AuxKeyValSet() sets keys/values for a column of OvsMap type, e.g., 'external_ids', 'other_config'.
	AuxKeyValSet(table string, rowName string, auxCol string, kv map[string]string) (*OvnCommand, error)
	// AuxKeyValDel() removes keys/values for a column of OvsMap type, e.g., 'external_ids', 'other_config'.
	// special value of 'nil' removes the given key regardless of its value
	AuxKeyValDel(table string, rowName string, auxCol string, kv map[string]*string) (*OvnCommand, error)
}

Client ovnnb/sb client Note: We can create different clients for ovn nb and sb each in future.

func NewClient

func NewClient(cfg *Config) (Client, error)

type Config

type Config struct {
	Db           string
	Addr         string
	TLSConfig    *tls.Config
	SignalCB     OVNSignal
	DisconnectCB OVNDisconnectedCallback // Callback that is called when disconnected, if "Reconnect" is false.
	Reconnect    bool                    // Automatically reconnect when disconnected
	TableCols    map[string][]string     // List of tables and their cols to be monitored
}

Config ovn nb and sb db client config

type DHCPOptions

type DHCPOptions struct {
	UUID       string
	CIDR       string
	Options    map[interface{}]interface{}
	ExternalID map[interface{}]interface{}
}

DHCPOptions ovnnb item

type Encap

type Encap struct {
	UUID        string
	ChassisName string
	Ip          string
	Options     map[interface{}]interface{}
	Encaptype   string
}

Encap table OVN SB

type EntityType

type EntityType string
const (
	PORT_GROUP     EntityType = "PORT_GROUP"
	LOGICAL_SWITCH EntityType = "LOGICAL_SWITCH"
)

type Execution

type Execution interface {
	//Excute multi-commands
	Execute(cmds ...*OvnCommand) error
}

Execution executes multiple ovnnb commands

type GatewayChassis

type GatewayChassis struct {
	UUID        string
	Name        string
	ChassisName string
	Priority    int
	Options     map[interface{}]interface{}
	ExternalID  map[interface{}]interface{}
}

GatewayChassis ovnnb item

type LoadBalancer

type LoadBalancer struct {
	UUID            string
	Name            string
	VIPs            map[interface{}]interface{}
	Protocol        string
	SelectionFields string
	ExternalID      map[interface{}]interface{}
}

LoadBalancer ovnnb item

type LogicalRouter

type LogicalRouter struct {
	UUID    string
	Name    string
	Enabled bool

	Ports        []string
	StaticRoutes []string
	NAT          []string
	LoadBalancer []string
	Policies     []string

	Options    map[interface{}]interface{}
	ExternalID map[interface{}]interface{}
}

LogicalRouter ovnnb item

type LogicalRouterPolicy

type LogicalRouterPolicy struct {
	UUID       string
	Priority   int
	Match      string
	Action     string
	Nexthop    *string
	NextHops   []string
	Options    map[interface{}]interface{}
	ExternalID map[interface{}]interface{}
}

LogicalRouterPolicy ovnnb item

type LogicalRouterPort

type LogicalRouterPort struct {
	UUID           string
	Name           string
	GatewayChassis []string
	Networks       []string
	MAC            string
	Enabled        bool
	IPv6RAConfigs  map[interface{}]interface{}
	Options        map[interface{}]interface{}
	Peer           string
	ExternalID     map[interface{}]interface{}
}

LogicalRouterPort ovnnb item

type LogicalRouterStaticRoute

type LogicalRouterStaticRoute struct {
	UUID       string
	IPPrefix   string
	Nexthop    string
	OutputPort *string
	Policy     *string
	ExternalID map[interface{}]interface{}
}

LogicalRouterStaticRoute ovnnb item

type LogicalSwitch

type LogicalSwitch struct {
	UUID         string
	Name         string
	Ports        []string
	LoadBalancer []string
	ACLs         []string
	QoSRules     []string
	DNSRecords   []string
	OtherConfig  map[interface{}]interface{}
	ExternalID   map[interface{}]interface{}
}

LogicalSwitch ovnnb item

type LogicalSwitchPort

type LogicalSwitchPort struct {
	UUID             string
	Name             string
	Type             string
	Options          map[interface{}]interface{}
	Addresses        []string
	DynamicAddresses string
	PortSecurity     []string
	DHCPv4Options    string
	DHCPv6Options    string
	ExternalID       map[interface{}]interface{}
}

LogicalSwitchPort ovnnb item

type Meter

type Meter struct {
	UUID        string
	Name        string                      `json:"name"`
	Unit        string                      `json:"unit"`
	Bands       []string                    `json:"bands"`
	ExternalIds map[interface{}]interface{} `json:"external_ids"`
}

type MeterBand

type MeterBand struct {
	UUID        string
	Action      string                      `json:"action"`
	Rate        int                         `json:"rate"`
	BurstSize   int                         `json:"burst_size"`
	ExternalIds map[interface{}]interface{} `json:"external_ids"`
}

type NAT

type NAT struct {
	UUID        string
	Type        string
	ExternalIP  string
	ExternalMAC string
	LogicalIP   string
	LogicalPort string
	ExternalID  map[interface{}]interface{}
}

NAT ovnnb item

type NBGlobalTableRow

type NBGlobalTableRow struct {
	UUID        string
	Options     map[interface{}]interface{}
	ExternalID  map[interface{}]interface{}
	Connections []string
	SSL         string
	IPSec       bool
}

type OVNDisconnectedCallback

type OVNDisconnectedCallback func()

OVNDisconnectedCallback executed when ovn client disconnects

type OVNNotifier

type OVNNotifier interface {
	Update(context interface{}, tableUpdates libovsdb.TableUpdates)
	Locked([]interface{})
	Stolen([]interface{})
	Echo([]interface{})
	Disconnected(client *libovsdb.OvsdbClient)
}

OVNNotifier ovnnb and ovnsb notifier

type OVNRow

type OVNRow map[string]interface{}

OVNRow ovn nb/sb row

type OVNSignal

type OVNSignal interface {
	OnLogicalSwitchCreate(ls *LogicalSwitch)
	OnLogicalSwitchDelete(ls *LogicalSwitch)

	OnLogicalPortCreate(lp *LogicalSwitchPort)
	OnLogicalPortDelete(lp *LogicalSwitchPort)

	OnLogicalRouterCreate(lr *LogicalRouter)
	OnLogicalRouterDelete(lr *LogicalRouter)

	OnLogicalRouterPortCreate(lrp *LogicalRouterPort)
	OnLogicalRouterPortDelete(lrp *LogicalRouterPort)

	OnLogicalRouterStaticRouteCreate(lrsr *LogicalRouterStaticRoute)
	OnLogicalRouterStaticRouteDelete(lrsr *LogicalRouterStaticRoute)

	OnACLCreate(acl *ACL)
	OnACLDelete(acl *ACL)

	OnDHCPOptionsCreate(dhcp *DHCPOptions)
	OnDHCPOptionsDelete(dhcp *DHCPOptions)

	OnQoSCreate(qos *QoS)
	OnQoSDelete(qos *QoS)

	OnLoadBalancerCreate(ls *LoadBalancer)
	OnLoadBalancerDelete(ls *LoadBalancer)

	OnMeterCreate(meter *Meter)
	OnMeterDelete(meter *Meter)

	OnMeterBandCreate(band *MeterBand)
	OnMeterBandDelete(band *MeterBand)

	// Create/delete chassis from south bound db
	OnChassisCreate(ch *Chassis)
	OnChassisDelete(ch *Chassis)

	// Create/delete encap from south bound db
	OnEncapCreate(ch *Encap)
	OnEncapDelete(ch *Encap)
}

OVNSignal notifies on changes to ovnnb

type OvnCommand

type OvnCommand struct {
	Operations []libovsdb.Operation
	Exe        Execution
	Results    [][]map[string]interface{}
}

OvnCommand ovnnb command

func (*OvnCommand) Execute

func (ocmd *OvnCommand) Execute() error

Execute sends command to ovnnb

type PortGroup

type PortGroup struct {
	UUID       string
	Name       string
	Ports      []string
	ACLs       []string
	ExternalID map[interface{}]interface{}
}

PortGroup ovnnb item

type QoS

type QoS struct {
	UUID       string
	Priority   int
	Direction  string
	Match      string
	Action     map[interface{}]interface{}
	Bandwidth  map[interface{}]interface{}
	ExternalID map[interface{}]interface{}
}

QoS ovnnb item

type SBGlobalTableRow

type SBGlobalTableRow struct {
	UUID        string
	Options     map[interface{}]interface{}
	ExternalID  map[interface{}]interface{}
	Connections []string
	SSL         string
	IPSec       bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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