goovn

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LSWITCH     string = "Logical_Switch"
	LPORT       string = "Logical_Switch_Port"
	ACLS        string = "ACL"
	LB          string = "Load_Balancer"
	Address_Set string = "Address_Set"
)
View Source
const (
	UNIX string = "unix"
	TCP  string = "tcp"
)
View Source
const (
	//random seed.
	MAX_TRANSACTION = 1000
)
View Source
const (
	NBDB string = "OVN_Northbound"
)
View Source
const (
	OVNLOGLEVEL = 4
)

Variables

This section is empty.

Functions

func SetCallBack

func SetCallBack(callback OVNSignal)

Types

type ACL

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

type AddressSet

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

type Execution

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

type LoadBalancer

type LoadBalancer struct {
	UUID string
	Name string

	ExternalID map[interface{}]interface{}
	// contains filtered or unexported fields
}

type LogcalPort

type LogcalPort struct {
	UUID         string
	Name         string
	Addresses    []string
	PortSecurity []string
}

type LogicalSwitch

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

type OVNDB

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

func (*OVNDB) ACLAdd

func (odb *OVNDB) ACLAdd(lsw, direct, match, action string, priority int, external_ids map[string]string, logflag bool, meter string) *OvnCommand

func (*OVNDB) ACLDel

func (odb *OVNDB) ACLDel(lsw, direct, match string, priority int, external_ids map[string]string) *OvnCommand

func (*OVNDB) ASAdd

func (odb *OVNDB) ASAdd(name string, addrs []string, external_ids map[string]string) *OvnCommand

func (*OVNDB) ASDel

func (odb *OVNDB) ASDel(name string) *OvnCommand

func (*OVNDB) ASUpdate

func (odb *OVNDB) ASUpdate(name string, addrs []string, external_ids map[string]string) *OvnCommand

func (*OVNDB) Execute

func (odb *OVNDB) Execute(cmds ...*OvnCommand) error

func (*OVNDB) GetACLsBySwitch

func (odb *OVNDB) GetACLsBySwitch(lsw string) []*ACL

func (*OVNDB) GetASByName

func (odb *OVNDB) GetASByName(name string) *AddressSet

func (*OVNDB) GetAddressSets

func (odb *OVNDB) GetAddressSets() []*AddressSet

func (*OVNDB) GetLB

func (odb *OVNDB) GetLB(name string) []*LoadBalancer

func (*OVNDB) GetLogicPortsBySwitch

func (odb *OVNDB) GetLogicPortsBySwitch(lsw string) []*LogcalPort

func (*OVNDB) GetLogicSwitches

func (odb *OVNDB) GetLogicSwitches() []*LogicalSwitch

func (*OVNDB) LBAdd

func (odb *OVNDB) LBAdd(name string, vipPort string, protocol string, addrs []string) *OvnCommand

func (*OVNDB) LBDel

func (odb *OVNDB) LBDel(name string) *OvnCommand

func (*OVNDB) LBUpdate

func (odb *OVNDB) LBUpdate(name string, vipPort string, protocol string, addrs []string) *OvnCommand

func (*OVNDB) LSPAdd

func (odb *OVNDB) LSPAdd(lsw string, lsp string) *OvnCommand

func (*OVNDB) LSPDel

func (odb *OVNDB) LSPDel(lsp string) *OvnCommand

func (*OVNDB) LSPSetAddress

func (odb *OVNDB) LSPSetAddress(lsp string, addresses ...string) *OvnCommand

func (*OVNDB) LSPSetPortSecurity

func (odb *OVNDB) LSPSetPortSecurity(lsp string, security ...string) *OvnCommand

func (*OVNDB) LSSetOpt

func (odb *OVNDB) LSSetOpt(lsp string, options map[string]string) *OvnCommand

func (*OVNDB) LSWAdd

func (odb *OVNDB) LSWAdd(lsw string) *OvnCommand

func (*OVNDB) LSWDel

func (odb *OVNDB) LSWDel(lsw string) *OvnCommand

func (*OVNDB) LSWList

func (odb *OVNDB) LSWList() *OvnCommand

func (*OVNDB) SetCallBack

func (odb *OVNDB) SetCallBack(callback OVNSignal)

type OVNDBApi

type OVNDBApi interface {
	// Create a logical switch named SWITCH
	LSWAdd(lsw string) *OvnCommand
	//delete SWITCH and all its ports
	LSWDel(lsw string) *OvnCommand
	// Print the names of all logical switches
	LSWList() *OvnCommand
	// Add logical port PORT on SWITCH
	LSPAdd(lsw, lsp string) *OvnCommand
	// Delete PORT from its attached switch
	LSPDel(lsp string) *OvnCommand
	// Set addressset per lport
	LSPSetAddress(lsp string, addresses ...string) *OvnCommand
	// Set port security per lport
	LSPSetPortSecurity(lsp string, security ...string) *OvnCommand
	// Add ACL
	ACLAdd(lsw, direct, match, action string, priority int, external_ids map[string]string, logflag bool, meter string) *OvnCommand
	// Delete acl
	ACLDel(lsw, direct, match string, priority int, external_ids map[string]string) *OvnCommand
	// Update address set
	ASUpdate(name string, addrs []string, external_ids map[string]string) *OvnCommand
	// Add addressset
	ASAdd(name string, addrs []string, external_ids map[string]string) *OvnCommand
	// Delete addressset
	ASDel(name string) *OvnCommand
	// Add LB
	LBAdd(name string, vipPort string, protocol string, addrs []string) *OvnCommand
	// Delete LB with given name
	LBDel(name string) *OvnCommand
	// Update existing LB
	LBUpdate(name string, vipPort string, protocol string, addrs []string) *OvnCommand

	// Set options in lswtich
	LSSetOpt(lsp string, options map[string]string) *OvnCommand
	// Exec command, support mul-commands in one transaction.
	Execute(cmds ...*OvnCommand) error

	// Get all logical switches
	GetLogicSwitches() []*LogicalSwitch
	// Get all lport by lswitch
	GetLogicPortsBySwitch(lsw string) []*LogcalPort
	// Get all acl by lswitch
	GetACLsBySwitch(lsw string) []*ACL

	GetAddressSets() []*AddressSet
	GetASByName(name string) *AddressSet
	// Get LB with given name
	GetLB(name string) []*LoadBalancer

	SetCallBack(callback OVNSignal)
}

North bound api set

func GetInstance

func GetInstance(socketfile string, protocol string, server string, port int, callback OVNSignal) OVNDBApi

type OVNNotifier

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

Notifier

type OVNRow

type OVNRow map[string]interface{}

type OVNSignal

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

	OnLogicalPortCreate(lp *LogcalPort)
	OnLogicalPortDelete(lp *LogcalPort)

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

type OvnCommand

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

func (*OvnCommand) Execute

func (ocmd *OvnCommand) Execute() error

Jump to

Keyboard shortcuts

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