Documentation
¶
Overview ¶
Package ovnflow provides a fluent Go SDK for OVN and Open vSwitch.
The SDK uses github.com/ovn-kubernetes/libovsdb for all production OVSDB connections, schema discovery, and transactions. The stable API covers distributed-virtualization control-plane paths that are painful to express with shell commands: OVN Northbound topology, policy, service, DHCP/DNS, QoS, meter, group, HA, gateway, and BFD builders; OVN Southbound typed reads and watches for the main runtime tables; and local Open_vSwitch bridge, port, interface, controller, manager, mirror, QoS, queue, sampling, SSL, and AutoAttach configuration.
Dynamic TableRef helpers remain available for version-specific schema columns.
Normal tests are local and do not require OVN, OVS, WSL, or Docker. Integration tests are enabled explicitly with the integration build tag and read TCP endpoints from environment variables.
Example (LocalOVSAddInternalPort) ¶
package main
import (
"context"
"github.com/firstmeet/ovnflow"
)
func main() {
ctx := context.Background()
client, err := ovnflow.Connect(ctx, ovnflow.ConfigFromEnv())
if err != nil {
return
}
defer client.Close()
_ = client.LocalOVS().
Bridge("br-ovnflow-it").
AddPort("vnet0").
WithInterfaceType("internal").
WithExternalID("vm-id", "uuid-1234").
Execute(ctx)
}
Output:
Example (LogicalSwitchCreate) ¶
package main
import (
"context"
"github.com/firstmeet/ovnflow"
)
func main() {
ctx := context.Background()
client, err := ovnflow.Connect(ctx, ovnflow.Config{
OVSAddr: "tcp:127.0.0.1:6640",
OVNNBAddr: "tcp:127.0.0.1:6641",
OVNSBAddr: "tcp:127.0.0.1:6642",
})
if err != nil {
return
}
defer client.Close()
_ = client.OVN().NB().
LogicalSwitch("ls-web").
Create().
WithSubnet("192.168.1.0/24").
AddPort("port-vm1").
WithMac("00:11:22:33:44:55").
WithIP("192.168.1.10").
Execute(ctx)
}
Output:
Example (OvnSBWatchPortBindings) ¶
package main
import (
"context"
"github.com/firstmeet/ovnflow"
)
func main() {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
client, err := ovnflow.Connect(ctx, ovnflow.ConfigFromEnv())
if err != nil {
return
}
defer client.Close()
events, errs := client.OVN().SB().WatchPortBindings(ctx)
select {
case <-events:
case <-errs:
}
}
Output:
Index ¶
- Constants
- Variables
- func IsKind(err error, kind ErrorKind) bool
- type ACL
- type ACLBuilder
- func (b *ACLBuilder) Execute(ctx context.Context) error
- func (b *ACLBuilder) WithAction(action string) *ACLBuilder
- func (b *ACLBuilder) WithDirection(direction string) *ACLBuilder
- func (b *ACLBuilder) WithExternalID(key, value string) *ACLBuilder
- func (b *ACLBuilder) WithLabel(label int) *ACLBuilder
- func (b *ACLBuilder) WithLog(log bool) *ACLBuilder
- func (b *ACLBuilder) WithMatch(match string) *ACLBuilder
- func (b *ACLBuilder) WithMeter(meter string) *ACLBuilder
- func (b *ACLBuilder) WithOption(key, value string) *ACLBuilder
- func (b *ACLBuilder) WithPriority(priority int) *ACLBuilder
- func (b *ACLBuilder) WithSeverity(severity string) *ACLBuilder
- func (b *ACLBuilder) WithTier(tier int) *ACLBuilder
- type ACLRef
- type AddressSet
- type AddressSetBuilder
- func (b *AddressSetBuilder) Execute(ctx context.Context) error
- func (b *AddressSetBuilder) WithAddress(address string) *AddressSetBuilder
- func (b *AddressSetBuilder) WithAddresses(addresses ...string) *AddressSetBuilder
- func (b *AddressSetBuilder) WithExternalID(key, value string) *AddressSetBuilder
- type AddressSetRef
- type BFD
- type BFDBuilder
- func (b *BFDBuilder) Execute(ctx context.Context) error
- func (b *BFDBuilder) WithDetectMult(value int) *BFDBuilder
- func (b *BFDBuilder) WithExternalID(key, value string) *BFDBuilder
- func (b *BFDBuilder) WithMinRx(value int) *BFDBuilder
- func (b *BFDBuilder) WithMinTx(value int) *BFDBuilder
- func (b *BFDBuilder) WithOption(key, value string) *BFDBuilder
- func (b *BFDBuilder) WithStatus(status string) *BFDBuilder
- type BFDEvent
- type BFDRef
- type BridgeBuilder
- func (b *BridgeBuilder) AddPort(name string) *OVSPortBuilder
- func (b *BridgeBuilder) Execute(ctx context.Context) error
- func (b *BridgeBuilder) WithAutoAttach(systemName string, configure func(*TableBuilder)) *BridgeBuilder
- func (b *BridgeBuilder) WithControllerTarget(target string) *BridgeBuilder
- func (b *BridgeBuilder) WithDatapathType(kind string) *BridgeBuilder
- func (b *BridgeBuilder) WithExternalID(key, value string) *BridgeBuilder
- func (b *BridgeBuilder) WithFailMode(mode string) *BridgeBuilder
- func (b *BridgeBuilder) WithFlowTable(tableID int, name string, configure func(*TableBuilder)) *BridgeBuilder
- func (b *BridgeBuilder) WithIPFIX(name string, configure func(*TableBuilder)) *BridgeBuilder
- func (b *BridgeBuilder) WithMirror(name string, configure func(*TableBuilder)) *BridgeBuilder
- func (b *BridgeBuilder) WithNetFlow(name string, configure func(*TableBuilder)) *BridgeBuilder
- func (b *BridgeBuilder) WithSFlow(name string, configure func(*TableBuilder)) *BridgeBuilder
- type BridgeRef
- type ChassisEvent
- type Client
- type Config
- type DHCPOptions
- type DHCPOptionsBuilder
- type DHCPOptionsRef
- type DNS
- type DNSBuilder
- type DNSEvent
- type DNSRef
- type DatapathEvent
- type Error
- type ErrorKind
- type EventType
- type FDBEvent
- type GatewayChassis
- type GatewayChassisBuilder
- func (b *GatewayChassisBuilder) Execute(ctx context.Context) error
- func (b *GatewayChassisBuilder) WithChassisName(name string) *GatewayChassisBuilder
- func (b *GatewayChassisBuilder) WithExternalID(key, value string) *GatewayChassisBuilder
- func (b *GatewayChassisBuilder) WithOption(key, value string) *GatewayChassisBuilder
- func (b *GatewayChassisBuilder) WithPriority(priority int) *GatewayChassisBuilder
- type GatewayChassisRef
- type HAChassis
- type HAChassisBuilder
- type HAChassisGroup
- type HAChassisGroupBuilder
- type HAChassisGroupRef
- type HAChassisRef
- type IntegrationConfig
- type LoadBalancer
- type LoadBalancerBuilder
- func (b *LoadBalancerBuilder) AttachToRouter(name string) *LoadBalancerBuilder
- func (b *LoadBalancerBuilder) Execute(ctx context.Context) error
- func (b *LoadBalancerBuilder) WithExternalID(key, value string) *LoadBalancerBuilder
- func (b *LoadBalancerBuilder) WithHealthCheckUUID(uuid string) *LoadBalancerBuilder
- func (b *LoadBalancerBuilder) WithIPPortMapping(endpoint, mapping string) *LoadBalancerBuilder
- func (b *LoadBalancerBuilder) WithOption(key, value string) *LoadBalancerBuilder
- func (b *LoadBalancerBuilder) WithProtocol(protocol string) *LoadBalancerBuilder
- func (b *LoadBalancerBuilder) WithSelectionField(field string) *LoadBalancerBuilder
- func (b *LoadBalancerBuilder) WithVIP(vip, backends string) *LoadBalancerBuilder
- type LoadBalancerRef
- type LogicalFlowEvent
- type LogicalRouter
- type LogicalRouterBuilder
- func (b *LogicalRouterBuilder) Execute(ctx context.Context) error
- func (b *LogicalRouterBuilder) WithExternalID(key, value string) *LogicalRouterBuilder
- func (b *LogicalRouterBuilder) WithLoadBalancerUUID(uuid string) *LogicalRouterBuilder
- func (b *LogicalRouterBuilder) WithNATUUID(uuid string) *LogicalRouterBuilder
- func (b *LogicalRouterBuilder) WithOption(key, value string) *LogicalRouterBuilder
- func (b *LogicalRouterBuilder) WithPortUUID(uuid string) *LogicalRouterBuilder
- type LogicalRouterPort
- type LogicalRouterPortBuilder
- func (b *LogicalRouterPortBuilder) AttachToRouter(name string) *LogicalRouterPortBuilder
- func (b *LogicalRouterPortBuilder) Execute(ctx context.Context) error
- func (b *LogicalRouterPortBuilder) WithEnabled(enabled bool) *LogicalRouterPortBuilder
- func (b *LogicalRouterPortBuilder) WithExternalID(key, value string) *LogicalRouterPortBuilder
- func (b *LogicalRouterPortBuilder) WithGatewayChassis(name, chassisName string, priority int) *LogicalRouterPortBuilder
- func (b *LogicalRouterPortBuilder) WithGatewayChassisExternalID(key, value string) *LogicalRouterPortBuilder
- func (b *LogicalRouterPortBuilder) WithGatewayChassisOption(key, value string) *LogicalRouterPortBuilder
- func (b *LogicalRouterPortBuilder) WithGatewayChassisUUID(uuid string) *LogicalRouterPortBuilder
- func (b *LogicalRouterPortBuilder) WithHAChassis(chassisName string, priority int) *LogicalRouterPortBuilder
- func (b *LogicalRouterPortBuilder) WithHAChassisExternalID(key, value string) *LogicalRouterPortBuilder
- func (b *LogicalRouterPortBuilder) WithHAChassisGroup(name string) *LogicalRouterPortBuilder
- func (b *LogicalRouterPortBuilder) WithHAChassisGroupExternalID(key, value string) *LogicalRouterPortBuilder
- func (b *LogicalRouterPortBuilder) WithHAChassisGroupUUID(uuid string) *LogicalRouterPortBuilder
- func (b *LogicalRouterPortBuilder) WithIPv6Prefix(prefix string) *LogicalRouterPortBuilder
- func (b *LogicalRouterPortBuilder) WithIPv6RAConfig(key, value string) *LogicalRouterPortBuilder
- func (b *LogicalRouterPortBuilder) WithMAC(mac string) *LogicalRouterPortBuilder
- func (b *LogicalRouterPortBuilder) WithNetwork(network string) *LogicalRouterPortBuilder
- func (b *LogicalRouterPortBuilder) WithNetworks(networks ...string) *LogicalRouterPortBuilder
- func (b *LogicalRouterPortBuilder) WithOption(key, value string) *LogicalRouterPortBuilder
- func (b *LogicalRouterPortBuilder) WithPeer(peer string) *LogicalRouterPortBuilder
- type LogicalRouterPortRef
- type LogicalRouterRef
- type LogicalSwitch
- type LogicalSwitchBuilder
- func (b *LogicalSwitchBuilder) AddPort(name string) *LogicalSwitchPortBuilder
- func (b *LogicalSwitchBuilder) Execute(ctx context.Context) error
- func (b *LogicalSwitchBuilder) WithExternalID(key, value string) *LogicalSwitchBuilder
- func (b *LogicalSwitchBuilder) WithSubnet(cidr string) *LogicalSwitchBuilder
- type LogicalSwitchPort
- type LogicalSwitchPortBuilder
- func (p *LogicalSwitchPortBuilder) Execute(ctx context.Context) error
- func (p *LogicalSwitchPortBuilder) WithAddress(mac, ip string) *LogicalSwitchPortBuilder
- func (p *LogicalSwitchPortBuilder) WithExternalID(key, value string) *LogicalSwitchPortBuilder
- func (p *LogicalSwitchPortBuilder) WithIP(ip string) *LogicalSwitchPortBuilder
- func (p *LogicalSwitchPortBuilder) WithMac(mac string) *LogicalSwitchPortBuilder
- type LogicalSwitchRef
- type MACBindingEvent
- type Meter
- type MeterBand
- type MeterBandBuilder
- func (b *MeterBandBuilder) Execute(ctx context.Context) error
- func (b *MeterBandBuilder) WithAction(action string) *MeterBandBuilder
- func (b *MeterBandBuilder) WithBurstSize(size int) *MeterBandBuilder
- func (b *MeterBandBuilder) WithExternalID(key, value string) *MeterBandBuilder
- func (b *MeterBandBuilder) WithRate(rate int) *MeterBandBuilder
- type MeterBandEvent
- type MeterBandRef
- type MeterBuilder
- func (b *MeterBuilder) Execute(ctx context.Context) error
- func (b *MeterBuilder) WithBand(action string, rate int) *MeterBuilder
- func (b *MeterBuilder) WithBandExternalID(key, value string) *MeterBuilder
- func (b *MeterBuilder) WithBandUUID(uuid string) *MeterBuilder
- func (b *MeterBuilder) WithExternalID(key, value string) *MeterBuilder
- func (b *MeterBuilder) WithFair(fair bool) *MeterBuilder
- func (b *MeterBuilder) WithNamedBand(name, action string, rate int) *MeterBuilder
- func (b *MeterBuilder) WithUnit(unit string) *MeterBuilder
- type MeterEvent
- type MeterRef
- type MulticastGroupEvent
- type NAT
- type NATBuilder
- func (b *NATBuilder) AttachToRouter(name string) *NATBuilder
- func (b *NATBuilder) Execute(ctx context.Context) error
- func (b *NATBuilder) WithAllowedExternalIPsUUID(uuid string) *NATBuilder
- func (b *NATBuilder) WithExemptedExternalIPsUUID(uuid string) *NATBuilder
- func (b *NATBuilder) WithExternalID(key, value string) *NATBuilder
- func (b *NATBuilder) WithExternalIP(ip string) *NATBuilder
- func (b *NATBuilder) WithExternalMAC(mac string) *NATBuilder
- func (b *NATBuilder) WithExternalPortRange(portRange string) *NATBuilder
- func (b *NATBuilder) WithGatewayPortUUID(uuid string) *NATBuilder
- func (b *NATBuilder) WithLogicalIP(ip string) *NATBuilder
- func (b *NATBuilder) WithLogicalPort(port string) *NATBuilder
- func (b *NATBuilder) WithMatch(match string) *NATBuilder
- func (b *NATBuilder) WithOption(key, value string) *NATBuilder
- func (b *NATBuilder) WithPriority(priority int) *NATBuilder
- func (b *NATBuilder) WithType(kind string) *NATBuilder
- type NATRef
- type NBClient
- func (n *NBClient) ACL(name string) *ACLRef
- func (n *NBClient) ACLByMatch(direction string, priority int, match string) *ACLRef
- func (n *NBClient) AddressSet(name string) *AddressSetRef
- func (n *NBClient) BFD(logicalPort, dstIP string) *BFDRef
- func (n *NBClient) Connection(target string) *TableRef
- func (n *NBClient) DHCPOptions(cidr string) *DHCPOptionsRef
- func (n *NBClient) DNS(name string) *DNSRef
- func (n *NBClient) ForwardingGroup(name string) *TableRef
- func (n *NBClient) GatewayChassis(name string) *GatewayChassisRef
- func (n *NBClient) GetACL(ctx context.Context, direction string, priority int, match string) (*ACL, error)
- func (n *NBClient) GetAddressSet(ctx context.Context, name string) (*AddressSet, error)
- func (n *NBClient) GetBFD(ctx context.Context, logicalPort, dstIP string) (*BFD, error)
- func (n *NBClient) GetDHCPOptions(ctx context.Context, cidr string) (*DHCPOptions, error)
- func (n *NBClient) GetDNS(ctx context.Context, name string) (*DNS, error)
- func (n *NBClient) GetGatewayChassis(ctx context.Context, name string) (*GatewayChassis, error)
- func (n *NBClient) GetHAChassis(ctx context.Context, chassisName string) (*HAChassis, error)
- func (n *NBClient) GetHAChassisGroup(ctx context.Context, name string) (*HAChassisGroup, error)
- func (n *NBClient) GetLoadBalancer(ctx context.Context, name string) (*LoadBalancer, error)
- func (n *NBClient) GetLogicalRouter(ctx context.Context, name string) (*LogicalRouter, error)
- func (n *NBClient) GetLogicalRouterPort(ctx context.Context, name string) (*LogicalRouterPort, error)
- func (n *NBClient) GetLogicalSwitch(ctx context.Context, name string) (*LogicalSwitch, error)
- func (n *NBClient) GetLogicalSwitchPort(ctx context.Context, name string) (*LogicalSwitchPort, error)
- func (n *NBClient) GetMeter(ctx context.Context, name string) (*Meter, error)
- func (n *NBClient) GetMeterBand(ctx context.Context, name string) (*MeterBand, error)
- func (n *NBClient) GetNAT(ctx context.Context, kind, logicalIP string) (*NAT, error)
- func (n *NBClient) GetPortGroup(ctx context.Context, name string) (*PortGroup, error)
- func (n *NBClient) GetQoS(ctx context.Context, direction string, priority int, match string) (*QoS, error)
- func (n *NBClient) HAChassis(chassisName string) *HAChassisRef
- func (n *NBClient) HAChassisGroup(name string) *HAChassisGroupRef
- func (n *NBClient) ListLogicalSwitchPorts(ctx context.Context) ([]LogicalSwitchPort, error)
- func (n *NBClient) ListLogicalSwitches(ctx context.Context) ([]LogicalSwitch, error)
- func (n *NBClient) LoadBalancer(name string) *LoadBalancerRef
- func (n *NBClient) LogicalRouter(name string) *LogicalRouterRef
- func (n *NBClient) LogicalRouterPort(name string) *LogicalRouterPortRef
- func (n *NBClient) LogicalSwitch(name string) *LogicalSwitchRef
- func (n *NBClient) Meter(name string) *MeterRef
- func (n *NBClient) MeterBand(name string) *MeterBandRef
- func (n *NBClient) NAT(name string) *NATRef
- func (n *NBClient) NATByLogicalIP(kind, logicalIP string) *NATRef
- func (n *NBClient) NBGlobal() *TableRef
- func (n *NBClient) PortGroup(name string) *PortGroupRef
- func (n *NBClient) QoS(name string) *QoSRef
- func (n *NBClient) QoSByMatch(direction string, priority int, match string) *QoSRef
- func (n *NBClient) SSL() *TableRef
- func (n *NBClient) Table(table string) *TableRef
- func (n *NBClient) TableBy(table, column, value string) *TableRef
- func (n *NBClient) TableLogicalSwitchPort(name string) *TableRef
- type OVN
- type OVSAutoAttach
- type OVSBridge
- type OVSClient
- func (o *OVSClient) AutoAttach(systemName string) *TableRef
- func (o *OVSClient) Bridge(name string) *BridgeRef
- func (o *OVSClient) Controller(target string) *TableRef
- func (o *OVSClient) FlowTable(name string) *TableRef
- func (o *OVSClient) GetBridge(ctx context.Context, name string) (*OVSBridge, error)
- func (o *OVSClient) GetInterface(ctx context.Context, name string) (*OVSInterface, error)
- func (o *OVSClient) GetPort(ctx context.Context, name string) (*OVSPort, error)
- func (o *OVSClient) IPFIX(name string) *TableRef
- func (o *OVSClient) Interface(name string) *TableRef
- func (o *OVSClient) ListBridges(ctx context.Context) ([]OVSBridge, error)
- func (o *OVSClient) ListInterfaces(ctx context.Context) ([]OVSInterface, error)
- func (o *OVSClient) ListPorts(ctx context.Context) ([]OVSPort, error)
- func (o *OVSClient) Manager(target string) *TableRef
- func (o *OVSClient) Mirror(name string) *TableRef
- func (o *OVSClient) NetFlow(name string) *TableRef
- func (o *OVSClient) OpenVSwitch() *TableRef
- func (o *OVSClient) Port(name string) *TableRef
- func (o *OVSClient) QoS(name string) *TableRef
- func (o *OVSClient) Queue(name string) *TableRef
- func (o *OVSClient) SFlow(name string) *TableRef
- func (o *OVSClient) SSL() *TableRef
- func (o *OVSClient) Table(table string) *TableRef
- func (o *OVSClient) TableBy(table, column, value string) *TableRef
- func (o *OVSClient) WatchBridges(ctx context.Context) (<-chan RowEvent, <-chan error)
- func (o *OVSClient) WatchInterfaces(ctx context.Context) (<-chan RowEvent, <-chan error)
- func (o *OVSClient) WatchPorts(ctx context.Context) (<-chan RowEvent, <-chan error)
- func (o *OVSClient) WatchTable(ctx context.Context, table string) (<-chan RowEvent, <-chan error)
- type OVSController
- type OVSFlowTable
- type OVSIPFIX
- type OVSInterface
- type OVSManager
- type OVSMirror
- type OVSNetFlow
- type OVSPort
- type OVSPortBuilder
- func (p *OVSPortBuilder) Execute(ctx context.Context) error
- func (p *OVSPortBuilder) WithExternalID(key, value string) *OVSPortBuilder
- func (p *OVSPortBuilder) WithInterfaceExternalID(key, value string) *OVSPortBuilder
- func (p *OVSPortBuilder) WithInterfaceName(name string) *OVSPortBuilder
- func (p *OVSPortBuilder) WithInterfaceOption(key, value string) *OVSPortBuilder
- func (p *OVSPortBuilder) WithInterfaceType(kind string) *OVSPortBuilder
- func (p *OVSPortBuilder) WithOption(key, value string) *OVSPortBuilder
- type OVSQoS
- type OVSQueue
- type OVSSFlow
- type OVSSSL
- type OpenVSwitch
- type PortBindingEvent
- type PortGroup
- type PortGroupBuilder
- func (b *PortGroupBuilder) Execute(ctx context.Context) error
- func (b *PortGroupBuilder) WithACL(direction string, priority int, match, action string) *PortGroupBuilder
- func (b *PortGroupBuilder) WithACLExternalID(key, value string) *PortGroupBuilder
- func (b *PortGroupBuilder) WithACLUUID(uuid string) *PortGroupBuilder
- func (b *PortGroupBuilder) WithExternalID(key, value string) *PortGroupBuilder
- func (b *PortGroupBuilder) WithPortUUID(uuid string) *PortGroupBuilder
- type PortGroupRef
- type QoS
- type QoSBuilder
- func (b *QoSBuilder) AttachToSwitch(name string) *QoSBuilder
- func (b *QoSBuilder) Execute(ctx context.Context) error
- func (b *QoSBuilder) WithBurst(burst int) *QoSBuilder
- func (b *QoSBuilder) WithDSCP(value int) *QoSBuilder
- func (b *QoSBuilder) WithDirection(direction string) *QoSBuilder
- func (b *QoSBuilder) WithExternalID(key, value string) *QoSBuilder
- func (b *QoSBuilder) WithMark(value int) *QoSBuilder
- func (b *QoSBuilder) WithMatch(match string) *QoSBuilder
- func (b *QoSBuilder) WithPriority(priority int) *QoSBuilder
- func (b *QoSBuilder) WithRate(rate int) *QoSBuilder
- type QoSRef
- type RBACPermissionEvent
- type RBACRoleEvent
- type Row
- type RowEvent
- type SBBFD
- type SBChassis
- type SBClient
- func (s *SBClient) BFD(logicalPort string) *TableRef
- func (s *SBClient) Chassis(name string) *TableRef
- func (s *SBClient) Connection(target string) *TableRef
- func (s *SBClient) DNS(name string) *TableRef
- func (s *SBClient) Datapath(uuid string) *TableRef
- func (s *SBClient) Encap(ip string) *TableRef
- func (s *SBClient) FDB(mac string) *TableRef
- func (s *SBClient) GetBFD(ctx context.Context, logicalPort, dstIP string, srcPort, disc int) (*SBBFD, error)
- func (s *SBClient) GetChassis(ctx context.Context, name string) (*SBChassis, error)
- func (s *SBClient) GetDNS(ctx context.Context, uuid string) (*SBDNS, error)
- func (s *SBClient) GetDatapath(ctx context.Context, tunnelKey int) (*SBDatapathBinding, error)
- func (s *SBClient) GetDatapathByUUID(ctx context.Context, uuid string) (*SBDatapathBinding, error)
- func (s *SBClient) GetFDB(ctx context.Context, mac string, dpKey int) (*SBFDB, error)
- func (s *SBClient) GetLogicalFlow(ctx context.Context, uuid string) (*SBLogicalFlow, error)
- func (s *SBClient) GetMACBinding(ctx context.Context, logicalPort, ip string) (*SBMACBinding, error)
- func (s *SBClient) GetMeter(ctx context.Context, name string) (*SBMeter, error)
- func (s *SBClient) GetMeterBand(ctx context.Context, uuid string) (*SBMeterBand, error)
- func (s *SBClient) GetMulticastGroup(ctx context.Context, datapath string, tunnelKey int) (*SBMulticastGroup, error)
- func (s *SBClient) GetPortBinding(ctx context.Context, logicalPort string) (*SBPortBinding, error)
- func (s *SBClient) GetRBACPermission(ctx context.Context, uuid string) (*SBRBACPermission, error)
- func (s *SBClient) GetRBACRole(ctx context.Context, name string) (*SBRBACRole, error)
- func (s *SBClient) GetServiceMonitor(ctx context.Context, logicalPort, ip, protocol string, port int) (*SBServiceMonitor, error)
- func (s *SBClient) ListBFD(ctx context.Context) ([]SBBFD, error)
- func (s *SBClient) ListChassis(ctx context.Context) ([]SBChassis, error)
- func (s *SBClient) ListDNS(ctx context.Context) ([]SBDNS, error)
- func (s *SBClient) ListDatapaths(ctx context.Context) ([]SBDatapathBinding, error)
- func (s *SBClient) ListFDB(ctx context.Context) ([]SBFDB, error)
- func (s *SBClient) ListLogicalFlows(ctx context.Context) ([]SBLogicalFlow, error)
- func (s *SBClient) ListMACBindings(ctx context.Context) ([]SBMACBinding, error)
- func (s *SBClient) ListMeterBands(ctx context.Context) ([]SBMeterBand, error)
- func (s *SBClient) ListMeters(ctx context.Context) ([]SBMeter, error)
- func (s *SBClient) ListMulticastGroups(ctx context.Context) ([]SBMulticastGroup, error)
- func (s *SBClient) ListPortBindings(ctx context.Context) ([]SBPortBinding, error)
- func (s *SBClient) ListRBACPermissions(ctx context.Context) ([]SBRBACPermission, error)
- func (s *SBClient) ListRBACRoles(ctx context.Context) ([]SBRBACRole, error)
- func (s *SBClient) ListServiceMonitors(ctx context.Context) ([]SBServiceMonitor, error)
- func (s *SBClient) LogicalFlow(uuid string) *TableRef
- func (s *SBClient) MACBinding(logicalPort string) *TableRef
- func (s *SBClient) Meter(name string) *TableRef
- func (s *SBClient) MulticastGroup(name string) *TableRef
- func (s *SBClient) PortBinding(logicalPort string) *TableRef
- func (s *SBClient) RBACPermission(uuid string) *TableRef
- func (s *SBClient) RBACRole(name string) *TableRef
- func (s *SBClient) SBGlobal() *TableRef
- func (s *SBClient) SSL() *TableRef
- func (s *SBClient) ServiceMonitor(logicalPort string) *TableRef
- func (s *SBClient) Table(table string) *TableRef
- func (s *SBClient) TableBy(table, column, value string) *TableRef
- func (s *SBClient) WatchBFD(ctx context.Context) (<-chan BFDEvent, <-chan error)
- func (s *SBClient) WatchChassis(ctx context.Context) (<-chan ChassisEvent, <-chan error)
- func (s *SBClient) WatchDNS(ctx context.Context) (<-chan DNSEvent, <-chan error)
- func (s *SBClient) WatchDatapaths(ctx context.Context) (<-chan DatapathEvent, <-chan error)
- func (s *SBClient) WatchFDB(ctx context.Context) (<-chan FDBEvent, <-chan error)
- func (s *SBClient) WatchLogicalFlows(ctx context.Context) (<-chan LogicalFlowEvent, <-chan error)
- func (s *SBClient) WatchMACBindings(ctx context.Context) (<-chan MACBindingEvent, <-chan error)
- func (s *SBClient) WatchMeterBands(ctx context.Context) (<-chan MeterBandEvent, <-chan error)
- func (s *SBClient) WatchMeters(ctx context.Context) (<-chan MeterEvent, <-chan error)
- func (s *SBClient) WatchMulticastGroups(ctx context.Context) (<-chan MulticastGroupEvent, <-chan error)
- func (s *SBClient) WatchPortBindings(ctx context.Context) (<-chan PortBindingEvent, <-chan error)
- func (s *SBClient) WatchRBACPermissions(ctx context.Context) (<-chan RBACPermissionEvent, <-chan error)
- func (s *SBClient) WatchRBACRoles(ctx context.Context) (<-chan RBACRoleEvent, <-chan error)
- func (s *SBClient) WatchServiceMonitors(ctx context.Context) (<-chan ServiceMonitorEvent, <-chan error)
- func (s *SBClient) WatchTable(ctx context.Context, table string) (<-chan RowEvent, <-chan error)
- type SBDNS
- type SBDatapathBinding
- type SBFDB
- type SBLogicalFlow
- type SBMACBinding
- type SBMeter
- type SBMeterBand
- type SBMulticastGroup
- type SBPortBinding
- type SBRBACPermission
- type SBRBACRole
- type SBServiceMonitor
- type SchemaRegistry
- func (s *SchemaRegistry) Columns(table string) []string
- func (s *SchemaRegistry) Database() string
- func (s *SchemaRegistry) HasColumn(table, column string) bool
- func (s *SchemaRegistry) HasTable(table string) bool
- func (s *SchemaRegistry) ReferenceColumnInfos(table, refTable string) []referenceColumnInfo
- func (s *SchemaRegistry) ReferenceColumns(table, refTable string) []string
- func (s *SchemaRegistry) RequireColumns(table string, columns ...string) error
- func (s *SchemaRegistry) RequireConditionColumns(table string, conditions ...libovsdb.Condition) error
- func (s *SchemaRegistry) RequireTable(table string) error
- func (s *SchemaRegistry) Tables() []string
- func (s *SchemaRegistry) Version() string
- type ServiceMonitorEvent
- type TableBuilder
- func (b *TableBuilder) DeleteMap(column string, values map[string]string) *TableBuilder
- func (b *TableBuilder) DeleteSet(column string, values ...any) *TableBuilder
- func (b *TableBuilder) DeleteUUIDSet(column string, uuids ...string) *TableBuilder
- func (b *TableBuilder) Execute(ctx context.Context) error
- func (b *TableBuilder) MutateMap(column string, values map[string]string) *TableBuilder
- func (b *TableBuilder) MutateSet(column string, values ...any) *TableBuilder
- func (b *TableBuilder) MutateUUIDSet(column string, uuids ...string) *TableBuilder
- func (b *TableBuilder) SelectColumns(columns ...string) *TableBuilder
- func (b *TableBuilder) WithACL(direction string, priority int, match, action string) *TableBuilder
- func (b *TableBuilder) WithAction(action string) *TableBuilder
- func (b *TableBuilder) WithAddressSetAddresses(addresses ...string) *TableBuilder
- func (b *TableBuilder) WithAddresses(addresses ...string) *TableBuilder
- func (b *TableBuilder) WithBFDLogicalPort(port string) *TableBuilder
- func (b *TableBuilder) WithBFDStatus(status string) *TableBuilder
- func (b *TableBuilder) WithChassis(uuid string) *TableBuilder
- func (b *TableBuilder) WithColumn(column string, value any) *TableBuilder
- func (b *TableBuilder) WithController(target string) *TableBuilder
- func (b *TableBuilder) WithDHCPOption(key, value string) *TableBuilder
- func (b *TableBuilder) WithDNSRecord(name, value string) *TableBuilder
- func (b *TableBuilder) WithDatapath(uuid string) *TableBuilder
- func (b *TableBuilder) WithDirection(direction string) *TableBuilder
- func (b *TableBuilder) WithEncap(kind, ip string) *TableBuilder
- func (b *TableBuilder) WithExternalID(key, value string) *TableBuilder
- func (b *TableBuilder) WithGatewayPriority(priority int) *TableBuilder
- func (b *TableBuilder) WithLogicalPort(port string) *TableBuilder
- func (b *TableBuilder) WithMAC(mac string) *TableBuilder
- func (b *TableBuilder) WithManager(target string) *TableBuilder
- func (b *TableBuilder) WithMatch(match string) *TableBuilder
- func (b *TableBuilder) WithMirrorSelectAll() *TableBuilder
- func (b *TableBuilder) WithNAT(kind, logicalIP, externalIP string) *TableBuilder
- func (b *TableBuilder) WithName(name string) *TableBuilder
- func (b *TableBuilder) WithNetworks(networks ...string) *TableBuilder
- func (b *TableBuilder) WithOption(key, value string) *TableBuilder
- func (b *TableBuilder) WithOptionalColumn(column string, value any) *TableBuilder
- func (b *TableBuilder) WithPortGroupPorts(portUUIDs ...string) *TableBuilder
- func (b *TableBuilder) WithPriority(priority int) *TableBuilder
- func (b *TableBuilder) WithQoSType(kind string) *TableBuilder
- func (b *TableBuilder) WithQueueDSCP(dscp int) *TableBuilder
- func (b *TableBuilder) WithQueueOtherConfig(key, value string) *TableBuilder
- func (b *TableBuilder) WithRouterPort(mac string, networks ...string) *TableBuilder
- func (b *TableBuilder) WithSamplingTarget(target string) *TableBuilder
- func (b *TableBuilder) WithTarget(target string) *TableBuilder
- func (b *TableBuilder) WithTier(tier int) *TableBuilder
- func (b *TableBuilder) WithType(kind string) *TableBuilder
- func (b *TableBuilder) WithUUIDRef(column, uuid string) *TableBuilder
- func (b *TableBuilder) WithUUIDSet(column string, uuids ...string) *TableBuilder
- func (b *TableBuilder) WithVIP(vip, backends string) *TableBuilder
- type TableRef
- func (r *TableRef) AddUUID(column, uuid string) *TableBuilder
- func (r *TableRef) Create() *TableBuilder
- func (r *TableRef) Delete() *TableBuilder
- func (r *TableRef) DeleteUUID(column, uuid string) *TableBuilder
- func (r *TableRef) Ensure() *TableBuilder
- func (r *TableRef) Get(ctx context.Context) (Row, error)
- func (r *TableRef) List(ctx context.Context) ([]Row, error)
- func (r *TableRef) Update() *TableBuilder
- func (r *TableRef) Watch(ctx context.Context) (<-chan RowEvent, <-chan error)
- func (r *TableRef) Where(column string, value any) *TableRef
- func (r *TableRef) WhereCondition(column string, fn libovsdb.ConditionFunction, value any) *TableRef
- func (r *TableRef) WhereConditions(conditions ...libovsdb.Condition) *TableRef
Examples ¶
Constants ¶
const ( // EnvOVSAddr points at the Open_vSwitch OVSDB endpoint, for example // tcp:172.27.192.120:6640. EnvOVSAddr = "OVNFLOW_OVS_ADDR" // EnvOVNNBAddr points at the OVN Northbound OVSDB endpoint, for example // tcp:172.27.192.120:6641. EnvOVNNBAddr = "OVNFLOW_OVN_NB_ADDR" // EnvOVNSBAddr points at the OVN Southbound OVSDB endpoint, for example // tcp:172.27.192.120:6642. EnvOVNSBAddr = "OVNFLOW_OVN_SB_ADDR" // EnvTestResourcePrefix controls the prefix used for all integration-test // rows created in OVN and OVS. EnvTestResourcePrefix = "OVNFLOW_TEST_PREFIX" // EnvTestBridge controls the dedicated OVS bridge used by integration tests. EnvTestBridge = "OVNFLOW_TEST_BRIDGE" // EnvAllowBRInt must be set to a truthy value before integration tests are // allowed to target br-int directly. EnvAllowBRInt = "OVNFLOW_ALLOW_BR_INT" // EnvRequireIntegration turns endpoint/SDK connection skips into failures. // CI and release gates should enable it so regressions cannot hide behind // skipped integration tests. EnvRequireIntegration = "OVNFLOW_REQUIRE_INTEGRATION" )
const ( DefaultIntegrationResourcePrefix = "ovnflow-it-" DefaultIntegrationBridge = "br-ovnflow-it" )
Variables ¶
var ( ErrAlreadyExists = &Error{Kind: ErrorAlreadyExists} ErrNotFound = &Error{Kind: ErrorNotFound} ErrConflict = &Error{Kind: ErrorConflict} ErrInvalidSchema = &Error{Kind: ErrorInvalidSchema} ErrTimeout = &Error{Kind: ErrorTimeout} ErrCanceled = &Error{Kind: ErrorCanceled} ErrPartial = &Error{Kind: ErrorPartial} ErrValidation = &Error{Kind: ErrorValidation} )
Functions ¶
Types ¶
type ACL ¶
type ACL struct {
UUID string `ovsdb:"_uuid"`
Name *string `ovsdb:"name"`
Priority int `ovsdb:"priority"`
Direction string `ovsdb:"direction"`
Match string `ovsdb:"match"`
Action string `ovsdb:"action"`
Log bool `ovsdb:"log"`
Meter *string `ovsdb:"meter"`
Severity *string `ovsdb:"severity"`
Label int `ovsdb:"label"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
Tier int
Options map[string]string
}
ACL is an OVN Northbound ACL model. Version-specific fields are decoded by the runtime fluent layer and intentionally left out of the libovsdb cache model so older schemas can still connect.
type ACLBuilder ¶
type ACLBuilder struct {
// contains filtered or unexported fields
}
ACLBuilder builds ACL operations.
func (*ACLBuilder) WithAction ¶
func (b *ACLBuilder) WithAction(action string) *ACLBuilder
func (*ACLBuilder) WithDirection ¶
func (b *ACLBuilder) WithDirection(direction string) *ACLBuilder
func (*ACLBuilder) WithExternalID ¶
func (b *ACLBuilder) WithExternalID(key, value string) *ACLBuilder
func (*ACLBuilder) WithLabel ¶
func (b *ACLBuilder) WithLabel(label int) *ACLBuilder
func (*ACLBuilder) WithLog ¶
func (b *ACLBuilder) WithLog(log bool) *ACLBuilder
func (*ACLBuilder) WithMatch ¶
func (b *ACLBuilder) WithMatch(match string) *ACLBuilder
func (*ACLBuilder) WithMeter ¶
func (b *ACLBuilder) WithMeter(meter string) *ACLBuilder
func (*ACLBuilder) WithOption ¶
func (b *ACLBuilder) WithOption(key, value string) *ACLBuilder
func (*ACLBuilder) WithPriority ¶
func (b *ACLBuilder) WithPriority(priority int) *ACLBuilder
func (*ACLBuilder) WithSeverity ¶
func (b *ACLBuilder) WithSeverity(severity string) *ACLBuilder
func (*ACLBuilder) WithTier ¶
func (b *ACLBuilder) WithTier(tier int) *ACLBuilder
type ACLRef ¶
type ACLRef struct {
// contains filtered or unexported fields
}
ACLRef identifies an ACL row by direction, priority, match, and optional name.
func (*ACLRef) Create ¶
func (r *ACLRef) Create() *ACLBuilder
func (*ACLRef) Delete ¶
func (r *ACLRef) Delete() *ACLBuilder
func (*ACLRef) Ensure ¶
func (r *ACLRef) Ensure() *ACLBuilder
type AddressSet ¶
type AddressSet struct {
UUID string `ovsdb:"_uuid"`
Name string `ovsdb:"name"`
Addresses []string `ovsdb:"addresses"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
}
AddressSet is an OVN Northbound Address_Set model.
type AddressSetBuilder ¶
type AddressSetBuilder struct {
// contains filtered or unexported fields
}
AddressSetBuilder builds Address_Set operations.
func (*AddressSetBuilder) WithAddress ¶
func (b *AddressSetBuilder) WithAddress(address string) *AddressSetBuilder
func (*AddressSetBuilder) WithAddresses ¶
func (b *AddressSetBuilder) WithAddresses(addresses ...string) *AddressSetBuilder
func (*AddressSetBuilder) WithExternalID ¶
func (b *AddressSetBuilder) WithExternalID(key, value string) *AddressSetBuilder
type AddressSetRef ¶
type AddressSetRef struct {
// contains filtered or unexported fields
}
AddressSetRef identifies one Address_Set row by name.
func (*AddressSetRef) Create ¶
func (r *AddressSetRef) Create() *AddressSetBuilder
func (*AddressSetRef) Delete ¶
func (r *AddressSetRef) Delete() *AddressSetBuilder
func (*AddressSetRef) Ensure ¶
func (r *AddressSetRef) Ensure() *AddressSetBuilder
type BFD ¶
type BFD struct {
UUID string `ovsdb:"_uuid"`
LogicalPort string `ovsdb:"logical_port"`
DstIP string `ovsdb:"dst_ip"`
MinTx *int `ovsdb:"min_tx"`
MinRx *int `ovsdb:"min_rx"`
DetectMult *int `ovsdb:"detect_mult"`
Status *string `ovsdb:"status"`
Options map[string]string `ovsdb:"options"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
}
BFD is an OVN Northbound BFD model.
type BFDBuilder ¶
type BFDBuilder struct {
// contains filtered or unexported fields
}
BFDBuilder builds BFD operations.
func (*BFDBuilder) WithDetectMult ¶
func (b *BFDBuilder) WithDetectMult(value int) *BFDBuilder
func (*BFDBuilder) WithExternalID ¶
func (b *BFDBuilder) WithExternalID(key, value string) *BFDBuilder
func (*BFDBuilder) WithMinRx ¶
func (b *BFDBuilder) WithMinRx(value int) *BFDBuilder
func (*BFDBuilder) WithMinTx ¶
func (b *BFDBuilder) WithMinTx(value int) *BFDBuilder
func (*BFDBuilder) WithOption ¶
func (b *BFDBuilder) WithOption(key, value string) *BFDBuilder
func (*BFDBuilder) WithStatus ¶
func (b *BFDBuilder) WithStatus(status string) *BFDBuilder
type BFDRef ¶
type BFDRef struct {
// contains filtered or unexported fields
}
BFDRef identifies one BFD row by logical_port and dst_ip.
func (*BFDRef) Create ¶
func (r *BFDRef) Create() *BFDBuilder
func (*BFDRef) Delete ¶
func (r *BFDRef) Delete() *BFDBuilder
func (*BFDRef) Ensure ¶
func (r *BFDRef) Ensure() *BFDBuilder
type BridgeBuilder ¶
type BridgeBuilder struct {
// contains filtered or unexported fields
}
func (*BridgeBuilder) AddPort ¶
func (b *BridgeBuilder) AddPort(name string) *OVSPortBuilder
func (*BridgeBuilder) WithAutoAttach ¶
func (b *BridgeBuilder) WithAutoAttach(systemName string, configure func(*TableBuilder)) *BridgeBuilder
func (*BridgeBuilder) WithControllerTarget ¶
func (b *BridgeBuilder) WithControllerTarget(target string) *BridgeBuilder
func (*BridgeBuilder) WithDatapathType ¶
func (b *BridgeBuilder) WithDatapathType(kind string) *BridgeBuilder
func (*BridgeBuilder) WithExternalID ¶
func (b *BridgeBuilder) WithExternalID(key, value string) *BridgeBuilder
func (*BridgeBuilder) WithFailMode ¶
func (b *BridgeBuilder) WithFailMode(mode string) *BridgeBuilder
func (*BridgeBuilder) WithFlowTable ¶
func (b *BridgeBuilder) WithFlowTable(tableID int, name string, configure func(*TableBuilder)) *BridgeBuilder
func (*BridgeBuilder) WithIPFIX ¶
func (b *BridgeBuilder) WithIPFIX(name string, configure func(*TableBuilder)) *BridgeBuilder
func (*BridgeBuilder) WithMirror ¶
func (b *BridgeBuilder) WithMirror(name string, configure func(*TableBuilder)) *BridgeBuilder
func (*BridgeBuilder) WithNetFlow ¶
func (b *BridgeBuilder) WithNetFlow(name string, configure func(*TableBuilder)) *BridgeBuilder
func (*BridgeBuilder) WithSFlow ¶
func (b *BridgeBuilder) WithSFlow(name string, configure func(*TableBuilder)) *BridgeBuilder
type BridgeRef ¶
type BridgeRef struct {
// contains filtered or unexported fields
}
func (*BridgeRef) AddPort ¶
func (r *BridgeRef) AddPort(name string) *OVSPortBuilder
func (*BridgeRef) Delete ¶
func (r *BridgeRef) Delete() *BridgeBuilder
func (*BridgeRef) DeletePort ¶
func (r *BridgeRef) DeletePort(name string) *BridgeBuilder
func (*BridgeRef) Ensure ¶
func (r *BridgeRef) Ensure() *BridgeBuilder
type ChassisEvent ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the public SDK entrypoint.
type Config ¶
Config configures the three OVSDB connections used by ovnflow.
func ConfigFromEnv ¶
func ConfigFromEnv() Config
ConfigFromEnv loads the SDK configuration from the same environment variables used by the Windows + WSL integration tests.
type DHCPOptions ¶
type DHCPOptions struct {
UUID string `ovsdb:"_uuid"`
CIDR string `ovsdb:"cidr"`
Options map[string]string `ovsdb:"options"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
}
DHCPOptions is an OVN Northbound DHCP_Options model.
type DHCPOptionsBuilder ¶
type DHCPOptionsBuilder struct {
// contains filtered or unexported fields
}
DHCPOptionsBuilder builds DHCP_Options operations.
func (*DHCPOptionsBuilder) Execute ¶
func (b *DHCPOptionsBuilder) Execute(ctx context.Context) error
func (*DHCPOptionsBuilder) WithExternalID ¶
func (b *DHCPOptionsBuilder) WithExternalID(key, value string) *DHCPOptionsBuilder
func (*DHCPOptionsBuilder) WithOption ¶
func (b *DHCPOptionsBuilder) WithOption(key, value string) *DHCPOptionsBuilder
type DHCPOptionsRef ¶
type DHCPOptionsRef struct {
// contains filtered or unexported fields
}
DHCPOptionsRef identifies one DHCP_Options row by cidr.
func (*DHCPOptionsRef) Create ¶
func (r *DHCPOptionsRef) Create() *DHCPOptionsBuilder
func (*DHCPOptionsRef) Delete ¶
func (r *DHCPOptionsRef) Delete() *DHCPOptionsBuilder
func (*DHCPOptionsRef) Ensure ¶
func (r *DHCPOptionsRef) Ensure() *DHCPOptionsBuilder
type DNS ¶
type DNS struct {
UUID string `ovsdb:"_uuid"`
Records map[string]string `ovsdb:"records"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
Options map[string]string
}
DNS is an OVN Northbound DNS model.
type DNSBuilder ¶
type DNSBuilder struct {
// contains filtered or unexported fields
}
DNSBuilder builds DNS operations.
func (*DNSBuilder) WithExternalID ¶
func (b *DNSBuilder) WithExternalID(key, value string) *DNSBuilder
func (*DNSBuilder) WithOption ¶
func (b *DNSBuilder) WithOption(key, value string) *DNSBuilder
func (*DNSBuilder) WithRecord ¶
func (b *DNSBuilder) WithRecord(name, value string) *DNSBuilder
type DNSRef ¶
type DNSRef struct {
// contains filtered or unexported fields
}
DNSRef identifies one DNS row by external_ids name when supplied.
func (*DNSRef) Create ¶
func (r *DNSRef) Create() *DNSBuilder
func (*DNSRef) Delete ¶
func (r *DNSRef) Delete() *DNSBuilder
func (*DNSRef) Ensure ¶
func (r *DNSRef) Ensure() *DNSBuilder
type DatapathEvent ¶
type DatapathEvent struct {
Type EventType
Old *SBDatapathBinding
New *SBDatapathBinding
}
type Error ¶
type Error struct {
Kind ErrorKind
Database string
Table string
Operation string
Object string
Message string
Err error
}
Error is a typed error suitable for controller retry and branching logic.
type ErrorKind ¶
type ErrorKind string
ErrorKind classifies errors returned by ovnflow.
const ( ErrorAlreadyExists ErrorKind = "already_exists" ErrorNotFound ErrorKind = "not_found" ErrorConflict ErrorKind = "conflict" ErrorInvalidSchema ErrorKind = "invalid_schema" ErrorTimeout ErrorKind = "timeout" ErrorCanceled ErrorKind = "canceled" ErrorPartial ErrorKind = "partial_success" ErrorValidation ErrorKind = "validation" )
type GatewayChassis ¶
type GatewayChassis struct {
UUID string `ovsdb:"_uuid"`
Name string `ovsdb:"name"`
ChassisName string `ovsdb:"chassis_name"`
Priority int `ovsdb:"priority"`
Options map[string]string `ovsdb:"options"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
}
GatewayChassis is an OVN Northbound Gateway_Chassis model.
type GatewayChassisBuilder ¶
type GatewayChassisBuilder struct {
// contains filtered or unexported fields
}
GatewayChassisBuilder builds Gateway_Chassis operations.
func (*GatewayChassisBuilder) Execute ¶
func (b *GatewayChassisBuilder) Execute(ctx context.Context) error
func (*GatewayChassisBuilder) WithChassisName ¶
func (b *GatewayChassisBuilder) WithChassisName(name string) *GatewayChassisBuilder
func (*GatewayChassisBuilder) WithExternalID ¶
func (b *GatewayChassisBuilder) WithExternalID(key, value string) *GatewayChassisBuilder
func (*GatewayChassisBuilder) WithOption ¶
func (b *GatewayChassisBuilder) WithOption(key, value string) *GatewayChassisBuilder
func (*GatewayChassisBuilder) WithPriority ¶
func (b *GatewayChassisBuilder) WithPriority(priority int) *GatewayChassisBuilder
type GatewayChassisRef ¶
type GatewayChassisRef struct {
// contains filtered or unexported fields
}
GatewayChassisRef identifies one Gateway_Chassis row by name.
func (*GatewayChassisRef) Create ¶
func (r *GatewayChassisRef) Create() *GatewayChassisBuilder
func (*GatewayChassisRef) Delete ¶
func (r *GatewayChassisRef) Delete() *GatewayChassisBuilder
func (*GatewayChassisRef) Ensure ¶
func (r *GatewayChassisRef) Ensure() *GatewayChassisBuilder
type HAChassis ¶
type HAChassis struct {
UUID string `ovsdb:"_uuid"`
ChassisName string `ovsdb:"chassis_name"`
Priority int `ovsdb:"priority"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
}
HAChassis is an OVN Northbound HA_Chassis model.
type HAChassisBuilder ¶
type HAChassisBuilder struct {
// contains filtered or unexported fields
}
HAChassisBuilder builds HA_Chassis operations.
func (*HAChassisBuilder) WithExternalID ¶
func (b *HAChassisBuilder) WithExternalID(key, value string) *HAChassisBuilder
func (*HAChassisBuilder) WithPriority ¶
func (b *HAChassisBuilder) WithPriority(priority int) *HAChassisBuilder
type HAChassisGroup ¶
type HAChassisGroup struct {
UUID string `ovsdb:"_uuid"`
Name string `ovsdb:"name"`
HAChassis []string `ovsdb:"ha_chassis"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
}
HAChassisGroup is an OVN Northbound HA_Chassis_Group model.
type HAChassisGroupBuilder ¶
type HAChassisGroupBuilder struct {
// contains filtered or unexported fields
}
HAChassisGroupBuilder builds HA_Chassis_Group operations.
func (*HAChassisGroupBuilder) Execute ¶
func (b *HAChassisGroupBuilder) Execute(ctx context.Context) error
func (*HAChassisGroupBuilder) WithExternalID ¶
func (b *HAChassisGroupBuilder) WithExternalID(key, value string) *HAChassisGroupBuilder
func (*HAChassisGroupBuilder) WithHAChassisUUID ¶
func (b *HAChassisGroupBuilder) WithHAChassisUUID(uuid string) *HAChassisGroupBuilder
type HAChassisGroupRef ¶
type HAChassisGroupRef struct {
// contains filtered or unexported fields
}
HAChassisGroupRef identifies one HA_Chassis_Group row by name.
func (*HAChassisGroupRef) Create ¶
func (r *HAChassisGroupRef) Create() *HAChassisGroupBuilder
func (*HAChassisGroupRef) Delete ¶
func (r *HAChassisGroupRef) Delete() *HAChassisGroupBuilder
func (*HAChassisGroupRef) Ensure ¶
func (r *HAChassisGroupRef) Ensure() *HAChassisGroupBuilder
type HAChassisRef ¶
type HAChassisRef struct {
// contains filtered or unexported fields
}
HAChassisRef identifies one HA_Chassis row by chassis_name.
func (*HAChassisRef) Create ¶
func (r *HAChassisRef) Create() *HAChassisBuilder
func (*HAChassisRef) Delete ¶
func (r *HAChassisRef) Delete() *HAChassisBuilder
func (*HAChassisRef) Ensure ¶
func (r *HAChassisRef) Ensure() *HAChassisBuilder
type IntegrationConfig ¶
type IntegrationConfig struct {
OVSAddr string
OVNNBAddr string
OVNSBAddr string
ResourcePrefix string
BridgeName string
AllowBRInt bool
Require bool
}
IntegrationConfig contains the environment-driven settings shared by all integration tests. It deliberately avoids hard-coded WSL addresses because WSL IP addresses can change after restart.
func LoadIntegrationConfigFromEnv ¶
func LoadIntegrationConfigFromEnv() IntegrationConfig
LoadIntegrationConfigFromEnv reads the Windows + WSL integration-test configuration from environment variables.
func (IntegrationConfig) MissingEndpoints ¶
func (c IntegrationConfig) MissingEndpoints() []string
MissingEndpoints returns the required endpoint environment variables that are not configured. Integration tests should skip when this list is non-empty.
func (IntegrationConfig) ShouldRequireEndpoints ¶
func (c IntegrationConfig) ShouldRequireEndpoints() bool
ShouldRequireEndpoints reports whether integration endpoint failures should fail the test process instead of being reported as skips.
func (IntegrationConfig) Validate ¶
func (c IntegrationConfig) Validate() error
Validate rejects configuration that could accidentally target production-like OVS resources.
type LoadBalancer ¶
type LoadBalancer struct {
UUID string `ovsdb:"_uuid"`
Name string `ovsdb:"name"`
VIPs map[string]string `ovsdb:"vips"`
Protocol *string `ovsdb:"protocol"`
SelectionFields []string `ovsdb:"selection_fields"`
IPPortMappings map[string]string `ovsdb:"ip_port_mappings"`
HealthCheck []string `ovsdb:"health_check"`
Options map[string]string `ovsdb:"options"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
}
LoadBalancer is an OVN Northbound Load_Balancer model.
type LoadBalancerBuilder ¶
type LoadBalancerBuilder struct {
// contains filtered or unexported fields
}
LoadBalancerBuilder builds Load_Balancer operations.
func (*LoadBalancerBuilder) AttachToRouter ¶
func (b *LoadBalancerBuilder) AttachToRouter(name string) *LoadBalancerBuilder
func (*LoadBalancerBuilder) Execute ¶
func (b *LoadBalancerBuilder) Execute(ctx context.Context) error
func (*LoadBalancerBuilder) WithExternalID ¶
func (b *LoadBalancerBuilder) WithExternalID(key, value string) *LoadBalancerBuilder
func (*LoadBalancerBuilder) WithHealthCheckUUID ¶
func (b *LoadBalancerBuilder) WithHealthCheckUUID(uuid string) *LoadBalancerBuilder
func (*LoadBalancerBuilder) WithIPPortMapping ¶
func (b *LoadBalancerBuilder) WithIPPortMapping(endpoint, mapping string) *LoadBalancerBuilder
func (*LoadBalancerBuilder) WithOption ¶
func (b *LoadBalancerBuilder) WithOption(key, value string) *LoadBalancerBuilder
func (*LoadBalancerBuilder) WithProtocol ¶
func (b *LoadBalancerBuilder) WithProtocol(protocol string) *LoadBalancerBuilder
func (*LoadBalancerBuilder) WithSelectionField ¶
func (b *LoadBalancerBuilder) WithSelectionField(field string) *LoadBalancerBuilder
func (*LoadBalancerBuilder) WithVIP ¶
func (b *LoadBalancerBuilder) WithVIP(vip, backends string) *LoadBalancerBuilder
type LoadBalancerRef ¶
type LoadBalancerRef struct {
// contains filtered or unexported fields
}
LoadBalancerRef identifies one Load_Balancer row by name.
func (*LoadBalancerRef) Create ¶
func (r *LoadBalancerRef) Create() *LoadBalancerBuilder
func (*LoadBalancerRef) Delete ¶
func (r *LoadBalancerRef) Delete() *LoadBalancerBuilder
func (*LoadBalancerRef) Ensure ¶
func (r *LoadBalancerRef) Ensure() *LoadBalancerBuilder
type LogicalFlowEvent ¶
type LogicalFlowEvent struct {
Type EventType
Old *SBLogicalFlow
New *SBLogicalFlow
}
type LogicalRouter ¶
type LogicalRouter struct {
UUID string `ovsdb:"_uuid"`
Name string `ovsdb:"name"`
Ports []string `ovsdb:"ports"`
StaticRoutes []string `ovsdb:"static_routes"`
NAT []string `ovsdb:"nat"`
LoadBalancers []string `ovsdb:"load_balancer"`
Options map[string]string `ovsdb:"options"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
}
LogicalRouter is an OVN Northbound Logical_Router model.
type LogicalRouterBuilder ¶
type LogicalRouterBuilder struct {
// contains filtered or unexported fields
}
LogicalRouterBuilder builds Logical_Router operations.
func (*LogicalRouterBuilder) Execute ¶
func (b *LogicalRouterBuilder) Execute(ctx context.Context) error
func (*LogicalRouterBuilder) WithExternalID ¶
func (b *LogicalRouterBuilder) WithExternalID(key, value string) *LogicalRouterBuilder
func (*LogicalRouterBuilder) WithLoadBalancerUUID ¶
func (b *LogicalRouterBuilder) WithLoadBalancerUUID(uuid string) *LogicalRouterBuilder
func (*LogicalRouterBuilder) WithNATUUID ¶
func (b *LogicalRouterBuilder) WithNATUUID(uuid string) *LogicalRouterBuilder
func (*LogicalRouterBuilder) WithOption ¶
func (b *LogicalRouterBuilder) WithOption(key, value string) *LogicalRouterBuilder
func (*LogicalRouterBuilder) WithPortUUID ¶
func (b *LogicalRouterBuilder) WithPortUUID(uuid string) *LogicalRouterBuilder
type LogicalRouterPort ¶
type LogicalRouterPort struct {
UUID string `ovsdb:"_uuid"`
Name string `ovsdb:"name"`
MAC string `ovsdb:"mac"`
Networks []string `ovsdb:"networks"`
GatewayChassis []string `ovsdb:"gateway_chassis"`
HAChassisGroup *string `ovsdb:"ha_chassis_group"`
Peer *string `ovsdb:"peer"`
Enabled *bool `ovsdb:"enabled"`
IPv6Prefix []string `ovsdb:"ipv6_prefix"`
IPv6RAConfigs map[string]string `ovsdb:"ipv6_ra_configs"`
Options map[string]string `ovsdb:"options"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
}
LogicalRouterPort is an OVN Northbound Logical_Router_Port model.
type LogicalRouterPortBuilder ¶
type LogicalRouterPortBuilder struct {
// contains filtered or unexported fields
}
LogicalRouterPortBuilder builds Logical_Router_Port operations.
func (*LogicalRouterPortBuilder) AttachToRouter ¶
func (b *LogicalRouterPortBuilder) AttachToRouter(name string) *LogicalRouterPortBuilder
func (*LogicalRouterPortBuilder) Execute ¶
func (b *LogicalRouterPortBuilder) Execute(ctx context.Context) error
func (*LogicalRouterPortBuilder) WithEnabled ¶
func (b *LogicalRouterPortBuilder) WithEnabled(enabled bool) *LogicalRouterPortBuilder
func (*LogicalRouterPortBuilder) WithExternalID ¶
func (b *LogicalRouterPortBuilder) WithExternalID(key, value string) *LogicalRouterPortBuilder
func (*LogicalRouterPortBuilder) WithGatewayChassis ¶
func (b *LogicalRouterPortBuilder) WithGatewayChassis(name, chassisName string, priority int) *LogicalRouterPortBuilder
func (*LogicalRouterPortBuilder) WithGatewayChassisExternalID ¶
func (b *LogicalRouterPortBuilder) WithGatewayChassisExternalID(key, value string) *LogicalRouterPortBuilder
func (*LogicalRouterPortBuilder) WithGatewayChassisOption ¶
func (b *LogicalRouterPortBuilder) WithGatewayChassisOption(key, value string) *LogicalRouterPortBuilder
func (*LogicalRouterPortBuilder) WithGatewayChassisUUID ¶
func (b *LogicalRouterPortBuilder) WithGatewayChassisUUID(uuid string) *LogicalRouterPortBuilder
func (*LogicalRouterPortBuilder) WithHAChassis ¶
func (b *LogicalRouterPortBuilder) WithHAChassis(chassisName string, priority int) *LogicalRouterPortBuilder
func (*LogicalRouterPortBuilder) WithHAChassisExternalID ¶
func (b *LogicalRouterPortBuilder) WithHAChassisExternalID(key, value string) *LogicalRouterPortBuilder
func (*LogicalRouterPortBuilder) WithHAChassisGroup ¶
func (b *LogicalRouterPortBuilder) WithHAChassisGroup(name string) *LogicalRouterPortBuilder
func (*LogicalRouterPortBuilder) WithHAChassisGroupExternalID ¶
func (b *LogicalRouterPortBuilder) WithHAChassisGroupExternalID(key, value string) *LogicalRouterPortBuilder
func (*LogicalRouterPortBuilder) WithHAChassisGroupUUID ¶
func (b *LogicalRouterPortBuilder) WithHAChassisGroupUUID(uuid string) *LogicalRouterPortBuilder
func (*LogicalRouterPortBuilder) WithIPv6Prefix ¶
func (b *LogicalRouterPortBuilder) WithIPv6Prefix(prefix string) *LogicalRouterPortBuilder
func (*LogicalRouterPortBuilder) WithIPv6RAConfig ¶
func (b *LogicalRouterPortBuilder) WithIPv6RAConfig(key, value string) *LogicalRouterPortBuilder
func (*LogicalRouterPortBuilder) WithMAC ¶
func (b *LogicalRouterPortBuilder) WithMAC(mac string) *LogicalRouterPortBuilder
func (*LogicalRouterPortBuilder) WithNetwork ¶
func (b *LogicalRouterPortBuilder) WithNetwork(network string) *LogicalRouterPortBuilder
func (*LogicalRouterPortBuilder) WithNetworks ¶
func (b *LogicalRouterPortBuilder) WithNetworks(networks ...string) *LogicalRouterPortBuilder
func (*LogicalRouterPortBuilder) WithOption ¶
func (b *LogicalRouterPortBuilder) WithOption(key, value string) *LogicalRouterPortBuilder
func (*LogicalRouterPortBuilder) WithPeer ¶
func (b *LogicalRouterPortBuilder) WithPeer(peer string) *LogicalRouterPortBuilder
type LogicalRouterPortRef ¶
type LogicalRouterPortRef struct {
// contains filtered or unexported fields
}
LogicalRouterPortRef identifies one Logical_Router_Port row by name.
func (*LogicalRouterPortRef) Create ¶
func (r *LogicalRouterPortRef) Create() *LogicalRouterPortBuilder
func (*LogicalRouterPortRef) Delete ¶
func (r *LogicalRouterPortRef) Delete() *LogicalRouterPortBuilder
func (*LogicalRouterPortRef) Ensure ¶
func (r *LogicalRouterPortRef) Ensure() *LogicalRouterPortBuilder
type LogicalRouterRef ¶
type LogicalRouterRef struct {
// contains filtered or unexported fields
}
LogicalRouterRef identifies one Logical_Router row by name.
func (*LogicalRouterRef) Create ¶
func (r *LogicalRouterRef) Create() *LogicalRouterBuilder
func (*LogicalRouterRef) Delete ¶
func (r *LogicalRouterRef) Delete() *LogicalRouterBuilder
func (*LogicalRouterRef) Ensure ¶
func (r *LogicalRouterRef) Ensure() *LogicalRouterBuilder
type LogicalSwitch ¶
type LogicalSwitch struct {
UUID string `ovsdb:"_uuid"`
Name string `ovsdb:"name"`
Ports []string `ovsdb:"ports"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
OtherConfig map[string]string `ovsdb:"other_config"`
}
LogicalSwitch is the v0.1 OVN Northbound Logical_Switch model.
type LogicalSwitchBuilder ¶
type LogicalSwitchBuilder struct {
// contains filtered or unexported fields
}
func (*LogicalSwitchBuilder) AddPort ¶
func (b *LogicalSwitchBuilder) AddPort(name string) *LogicalSwitchPortBuilder
func (*LogicalSwitchBuilder) Execute ¶
func (b *LogicalSwitchBuilder) Execute(ctx context.Context) error
Execute commits the logical switch operation.
func (*LogicalSwitchBuilder) WithExternalID ¶
func (b *LogicalSwitchBuilder) WithExternalID(key, value string) *LogicalSwitchBuilder
func (*LogicalSwitchBuilder) WithSubnet ¶
func (b *LogicalSwitchBuilder) WithSubnet(cidr string) *LogicalSwitchBuilder
type LogicalSwitchPort ¶
type LogicalSwitchPort struct {
UUID string `ovsdb:"_uuid"`
Name string `ovsdb:"name"`
Addresses []string `ovsdb:"addresses"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
Options map[string]string `ovsdb:"options"`
Type string `ovsdb:"type"`
}
LogicalSwitchPort is the v0.1 OVN Northbound Logical_Switch_Port model.
type LogicalSwitchPortBuilder ¶
type LogicalSwitchPortBuilder struct {
// contains filtered or unexported fields
}
func (*LogicalSwitchPortBuilder) Execute ¶
func (p *LogicalSwitchPortBuilder) Execute(ctx context.Context) error
func (*LogicalSwitchPortBuilder) WithAddress ¶
func (p *LogicalSwitchPortBuilder) WithAddress(mac, ip string) *LogicalSwitchPortBuilder
func (*LogicalSwitchPortBuilder) WithExternalID ¶
func (p *LogicalSwitchPortBuilder) WithExternalID(key, value string) *LogicalSwitchPortBuilder
func (*LogicalSwitchPortBuilder) WithIP ¶
func (p *LogicalSwitchPortBuilder) WithIP(ip string) *LogicalSwitchPortBuilder
func (*LogicalSwitchPortBuilder) WithMac ¶
func (p *LogicalSwitchPortBuilder) WithMac(mac string) *LogicalSwitchPortBuilder
type LogicalSwitchRef ¶
type LogicalSwitchRef struct {
// contains filtered or unexported fields
}
func (*LogicalSwitchRef) Create ¶
func (r *LogicalSwitchRef) Create() *LogicalSwitchBuilder
func (*LogicalSwitchRef) Delete ¶
func (r *LogicalSwitchRef) Delete() *LogicalSwitchBuilder
func (*LogicalSwitchRef) Ensure ¶
func (r *LogicalSwitchRef) Ensure() *LogicalSwitchBuilder
type MACBindingEvent ¶
type MACBindingEvent struct {
Type EventType
Old *SBMACBinding
New *SBMACBinding
}
type Meter ¶
type Meter struct {
UUID string `ovsdb:"_uuid"`
Name string `ovsdb:"name"`
Unit string `ovsdb:"unit"`
Bands []string `ovsdb:"bands"`
Fair *bool `ovsdb:"fair"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
}
Meter is an OVN Northbound Meter model.
type MeterBand ¶
type MeterBand struct {
UUID string `ovsdb:"_uuid"`
Action string `ovsdb:"action"`
Rate int `ovsdb:"rate"`
BurstSize int `ovsdb:"burst_size"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
}
MeterBand is an OVN Northbound Meter_Band model.
type MeterBandBuilder ¶
type MeterBandBuilder struct {
// contains filtered or unexported fields
}
MeterBandBuilder builds Meter_Band operations.
func (*MeterBandBuilder) WithAction ¶
func (b *MeterBandBuilder) WithAction(action string) *MeterBandBuilder
func (*MeterBandBuilder) WithBurstSize ¶
func (b *MeterBandBuilder) WithBurstSize(size int) *MeterBandBuilder
func (*MeterBandBuilder) WithExternalID ¶
func (b *MeterBandBuilder) WithExternalID(key, value string) *MeterBandBuilder
func (*MeterBandBuilder) WithRate ¶
func (b *MeterBandBuilder) WithRate(rate int) *MeterBandBuilder
type MeterBandEvent ¶
type MeterBandEvent struct {
Type EventType
Old *SBMeterBand
New *SBMeterBand
}
type MeterBandRef ¶
type MeterBandRef struct {
// contains filtered or unexported fields
}
MeterBandRef identifies Meter_Band rows by an SDK supplied external ID.
func (*MeterBandRef) Create ¶
func (r *MeterBandRef) Create() *MeterBandBuilder
func (*MeterBandRef) Delete ¶
func (r *MeterBandRef) Delete() *MeterBandBuilder
func (*MeterBandRef) Ensure ¶
func (r *MeterBandRef) Ensure() *MeterBandBuilder
type MeterBuilder ¶
type MeterBuilder struct {
// contains filtered or unexported fields
}
MeterBuilder builds Meter operations.
func (*MeterBuilder) WithBand ¶
func (b *MeterBuilder) WithBand(action string, rate int) *MeterBuilder
func (*MeterBuilder) WithBandExternalID ¶
func (b *MeterBuilder) WithBandExternalID(key, value string) *MeterBuilder
func (*MeterBuilder) WithBandUUID ¶
func (b *MeterBuilder) WithBandUUID(uuid string) *MeterBuilder
func (*MeterBuilder) WithExternalID ¶
func (b *MeterBuilder) WithExternalID(key, value string) *MeterBuilder
func (*MeterBuilder) WithFair ¶
func (b *MeterBuilder) WithFair(fair bool) *MeterBuilder
func (*MeterBuilder) WithNamedBand ¶
func (b *MeterBuilder) WithNamedBand(name, action string, rate int) *MeterBuilder
func (*MeterBuilder) WithUnit ¶
func (b *MeterBuilder) WithUnit(unit string) *MeterBuilder
type MeterEvent ¶
type MeterRef ¶
type MeterRef struct {
// contains filtered or unexported fields
}
MeterRef identifies one Meter row by name.
func (*MeterRef) Create ¶
func (r *MeterRef) Create() *MeterBuilder
func (*MeterRef) Delete ¶
func (r *MeterRef) Delete() *MeterBuilder
func (*MeterRef) Ensure ¶
func (r *MeterRef) Ensure() *MeterBuilder
type MulticastGroupEvent ¶
type MulticastGroupEvent struct {
Type EventType
Old *SBMulticastGroup
New *SBMulticastGroup
}
type NAT ¶
type NAT struct {
UUID string `ovsdb:"_uuid"`
Type string `ovsdb:"type"`
LogicalIP string `ovsdb:"logical_ip"`
ExternalIP string `ovsdb:"external_ip"`
LogicalPort *string `ovsdb:"logical_port"`
ExternalMAC *string `ovsdb:"external_mac"`
ExternalPortRange string `ovsdb:"external_port_range"`
AllowedExtIPs *string `ovsdb:"allowed_ext_ips"`
ExemptedExtIPs *string `ovsdb:"exempted_ext_ips"`
Match string `ovsdb:"match"`
Priority int `ovsdb:"priority"`
Options map[string]string `ovsdb:"options"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
GatewayPort *string
}
NAT is an OVN Northbound NAT model.
type NATBuilder ¶
type NATBuilder struct {
// contains filtered or unexported fields
}
NATBuilder builds NAT operations.
func (*NATBuilder) AttachToRouter ¶
func (b *NATBuilder) AttachToRouter(name string) *NATBuilder
func (*NATBuilder) WithAllowedExternalIPsUUID ¶
func (b *NATBuilder) WithAllowedExternalIPsUUID(uuid string) *NATBuilder
func (*NATBuilder) WithExemptedExternalIPsUUID ¶
func (b *NATBuilder) WithExemptedExternalIPsUUID(uuid string) *NATBuilder
func (*NATBuilder) WithExternalID ¶
func (b *NATBuilder) WithExternalID(key, value string) *NATBuilder
func (*NATBuilder) WithExternalIP ¶
func (b *NATBuilder) WithExternalIP(ip string) *NATBuilder
func (*NATBuilder) WithExternalMAC ¶
func (b *NATBuilder) WithExternalMAC(mac string) *NATBuilder
func (*NATBuilder) WithExternalPortRange ¶
func (b *NATBuilder) WithExternalPortRange(portRange string) *NATBuilder
func (*NATBuilder) WithGatewayPortUUID ¶
func (b *NATBuilder) WithGatewayPortUUID(uuid string) *NATBuilder
func (*NATBuilder) WithLogicalIP ¶
func (b *NATBuilder) WithLogicalIP(ip string) *NATBuilder
func (*NATBuilder) WithLogicalPort ¶
func (b *NATBuilder) WithLogicalPort(port string) *NATBuilder
func (*NATBuilder) WithMatch ¶
func (b *NATBuilder) WithMatch(match string) *NATBuilder
func (*NATBuilder) WithOption ¶
func (b *NATBuilder) WithOption(key, value string) *NATBuilder
func (*NATBuilder) WithPriority ¶
func (b *NATBuilder) WithPriority(priority int) *NATBuilder
func (*NATBuilder) WithType ¶
func (b *NATBuilder) WithType(kind string) *NATBuilder
type NATRef ¶
type NATRef struct {
// contains filtered or unexported fields
}
NATRef identifies a NAT row by type and logical_ip.
func (*NATRef) Create ¶
func (r *NATRef) Create() *NATBuilder
func (*NATRef) Delete ¶
func (r *NATRef) Delete() *NATBuilder
func (*NATRef) Ensure ¶
func (r *NATRef) Ensure() *NATBuilder
type NBClient ¶
type NBClient struct {
// contains filtered or unexported fields
}
NBClient provides OVN Northbound fluent APIs.
func (*NBClient) ACLByMatch ¶
func (*NBClient) AddressSet ¶
func (n *NBClient) AddressSet(name string) *AddressSetRef
func (*NBClient) Connection ¶
func (*NBClient) DHCPOptions ¶
func (n *NBClient) DHCPOptions(cidr string) *DHCPOptionsRef
func (*NBClient) ForwardingGroup ¶
func (*NBClient) GatewayChassis ¶
func (n *NBClient) GatewayChassis(name string) *GatewayChassisRef
func (*NBClient) GetAddressSet ¶
func (*NBClient) GetDHCPOptions ¶
func (*NBClient) GetGatewayChassis ¶
func (*NBClient) GetHAChassis ¶
func (*NBClient) GetHAChassisGroup ¶
func (*NBClient) GetLoadBalancer ¶
func (*NBClient) GetLogicalRouter ¶
func (*NBClient) GetLogicalRouterPort ¶
func (*NBClient) GetLogicalSwitch ¶
GetLogicalSwitch returns a logical switch by name.
func (*NBClient) GetLogicalSwitchPort ¶
func (*NBClient) GetMeterBand ¶
func (*NBClient) GetPortGroup ¶
func (*NBClient) HAChassis ¶
func (n *NBClient) HAChassis(chassisName string) *HAChassisRef
func (*NBClient) HAChassisGroup ¶
func (n *NBClient) HAChassisGroup(name string) *HAChassisGroupRef
func (*NBClient) ListLogicalSwitchPorts ¶
func (n *NBClient) ListLogicalSwitchPorts(ctx context.Context) ([]LogicalSwitchPort, error)
func (*NBClient) ListLogicalSwitches ¶
func (n *NBClient) ListLogicalSwitches(ctx context.Context) ([]LogicalSwitch, error)
func (*NBClient) LoadBalancer ¶
func (n *NBClient) LoadBalancer(name string) *LoadBalancerRef
func (*NBClient) LogicalRouter ¶
func (n *NBClient) LogicalRouter(name string) *LogicalRouterRef
func (*NBClient) LogicalRouterPort ¶
func (n *NBClient) LogicalRouterPort(name string) *LogicalRouterPortRef
func (*NBClient) LogicalSwitch ¶
func (n *NBClient) LogicalSwitch(name string) *LogicalSwitchRef
func (*NBClient) MeterBand ¶
func (n *NBClient) MeterBand(name string) *MeterBandRef
func (*NBClient) NATByLogicalIP ¶
func (*NBClient) PortGroup ¶
func (n *NBClient) PortGroup(name string) *PortGroupRef
func (*NBClient) QoSByMatch ¶
func (*NBClient) Table ¶
Table exposes the full runtime OVN Northbound schema through the fluent API.
func (*NBClient) TableBy ¶
TableBy exposes a runtime OVN Northbound table row selected by column=value.
func (*NBClient) TableLogicalSwitchPort ¶
type OVSAutoAttach ¶
type OVSAutoAttach struct {
UUID string `ovsdb:"_uuid"`
SystemName string `ovsdb:"system_name"`
SystemDescription string `ovsdb:"system_description"`
Mappings map[int]int `ovsdb:"mappings"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
}
OVSAutoAttach is the Open_vSwitch AutoAttach model.
type OVSBridge ¶
type OVSBridge struct {
UUID string `ovsdb:"_uuid"`
Name string `ovsdb:"name"`
Ports []string `ovsdb:"ports"`
Controllers []string `ovsdb:"controller"`
Mirrors []string `ovsdb:"mirrors"`
NetFlow *string `ovsdb:"netflow"`
SFlow *string `ovsdb:"sflow"`
IPFIX *string `ovsdb:"ipfix"`
FlowTables map[int]string `ovsdb:"flow_tables"`
AutoAttach *string `ovsdb:"auto_attach"`
FailMode *string `ovsdb:"fail_mode"`
DatapathType string `ovsdb:"datapath_type"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
OtherConfig map[string]string `ovsdb:"other_config"`
}
OVSBridge is the Open_vSwitch Bridge model.
type OVSClient ¶
type OVSClient struct {
// contains filtered or unexported fields
}
OVSClient provides local Open_vSwitch fluent APIs.
func (*OVSClient) AutoAttach ¶
func (*OVSClient) Controller ¶
func (*OVSClient) GetInterface ¶
func (*OVSClient) ListBridges ¶
func (*OVSClient) ListInterfaces ¶
func (o *OVSClient) ListInterfaces(ctx context.Context) ([]OVSInterface, error)
func (*OVSClient) OpenVSwitch ¶
func (*OVSClient) Table ¶
Table exposes the full runtime Open_vSwitch schema through the fluent API.
func (*OVSClient) TableBy ¶
TableBy exposes a runtime Open_vSwitch table row selected by column=value.
func (*OVSClient) WatchBridges ¶
func (*OVSClient) WatchInterfaces ¶
func (*OVSClient) WatchPorts ¶
type OVSController ¶
type OVSController struct {
UUID string `ovsdb:"_uuid"`
Target string `ovsdb:"target"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
OtherConfig map[string]string `ovsdb:"other_config"`
}
OVSController is the Open_vSwitch Controller model.
type OVSFlowTable ¶
type OVSFlowTable struct {
UUID string `ovsdb:"_uuid"`
Name string `ovsdb:"name"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
}
OVSFlowTable is the Open_vSwitch Flow_Table model.
type OVSIPFIX ¶
type OVSIPFIX struct {
UUID string `ovsdb:"_uuid"`
Targets []string `ovsdb:"targets"`
Sampling int `ovsdb:"sampling"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
OtherConfig map[string]string `ovsdb:"other_config"`
}
OVSIPFIX is the Open_vSwitch IPFIX model.
type OVSInterface ¶
type OVSInterface struct {
UUID string `ovsdb:"_uuid"`
Name string `ovsdb:"name"`
Type string `ovsdb:"type"`
Options map[string]string `ovsdb:"options"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
OtherConfig map[string]string `ovsdb:"other_config"`
}
OVSInterface is the Open_vSwitch Interface model.
type OVSManager ¶
type OVSManager struct {
UUID string `ovsdb:"_uuid"`
Target string `ovsdb:"target"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
OtherConfig map[string]string `ovsdb:"other_config"`
}
OVSManager is the Open_vSwitch Manager model.
type OVSMirror ¶
type OVSMirror struct {
UUID string `ovsdb:"_uuid"`
Name string `ovsdb:"name"`
SelectAll bool `ovsdb:"select_all"`
SelectSrcPort []string `ovsdb:"select_src_port"`
SelectDstPort []string `ovsdb:"select_dst_port"`
OutputPort *string `ovsdb:"output_port"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
}
OVSMirror is the Open_vSwitch Mirror model.
type OVSNetFlow ¶
type OVSNetFlow struct {
UUID string `ovsdb:"_uuid"`
Targets []string `ovsdb:"targets"`
EngineType int `ovsdb:"engine_type"`
EngineID int `ovsdb:"engine_id"`
ActiveTimeout int `ovsdb:"active_timeout"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
}
OVSNetFlow is the Open_vSwitch NetFlow model.
type OVSPort ¶
type OVSPort struct {
UUID string `ovsdb:"_uuid"`
Name string `ovsdb:"name"`
Interfaces []string `ovsdb:"interfaces"`
QoS *string `ovsdb:"qos"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
OtherConfig map[string]string `ovsdb:"other_config"`
}
OVSPort is the Open_vSwitch Port model.
type OVSPortBuilder ¶
type OVSPortBuilder struct {
// contains filtered or unexported fields
}
func (*OVSPortBuilder) WithExternalID ¶
func (p *OVSPortBuilder) WithExternalID(key, value string) *OVSPortBuilder
func (*OVSPortBuilder) WithInterfaceExternalID ¶
func (p *OVSPortBuilder) WithInterfaceExternalID(key, value string) *OVSPortBuilder
func (*OVSPortBuilder) WithInterfaceName ¶
func (p *OVSPortBuilder) WithInterfaceName(name string) *OVSPortBuilder
func (*OVSPortBuilder) WithInterfaceOption ¶
func (p *OVSPortBuilder) WithInterfaceOption(key, value string) *OVSPortBuilder
func (*OVSPortBuilder) WithInterfaceType ¶
func (p *OVSPortBuilder) WithInterfaceType(kind string) *OVSPortBuilder
func (*OVSPortBuilder) WithOption ¶
func (p *OVSPortBuilder) WithOption(key, value string) *OVSPortBuilder
type OVSQoS ¶
type OVSQoS struct {
UUID string `ovsdb:"_uuid"`
Type string `ovsdb:"type"`
Queues map[int]string `ovsdb:"queues"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
OtherConfig map[string]string `ovsdb:"other_config"`
}
OVSQoS is the Open_vSwitch QoS model.
type OVSQueue ¶
type OVSQueue struct {
UUID string `ovsdb:"_uuid"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
OtherConfig map[string]string `ovsdb:"other_config"`
}
OVSQueue is the Open_vSwitch Queue model.
type OVSSFlow ¶
type OVSSFlow struct {
UUID string `ovsdb:"_uuid"`
Agent string `ovsdb:"agent"`
Targets []string `ovsdb:"targets"`
Header int `ovsdb:"header"`
Sampling int `ovsdb:"sampling"`
Polling int `ovsdb:"polling"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
}
OVSSFlow is the Open_vSwitch sFlow model.
type OVSSSL ¶
type OVSSSL struct {
UUID string `ovsdb:"_uuid"`
PrivateKey string `ovsdb:"private_key"`
Certificate string `ovsdb:"certificate"`
CACert string `ovsdb:"ca_cert"`
BootstrapCACert bool `ovsdb:"bootstrap_ca_cert"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
}
OVSSSL is the Open_vSwitch SSL model.
type OpenVSwitch ¶
type OpenVSwitch struct {
UUID string `ovsdb:"_uuid"`
Bridges []string `ovsdb:"bridges"`
Managers []string `ovsdb:"manager_options"`
SSL *string `ovsdb:"ssl"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
OtherConfig map[string]string `ovsdb:"other_config"`
}
OpenVSwitch is the Open_vSwitch root table model.
type PortBindingEvent ¶
type PortBindingEvent struct {
Type EventType
Old *SBPortBinding
New *SBPortBinding
}
type PortGroup ¶
type PortGroup struct {
UUID string `ovsdb:"_uuid"`
Name string `ovsdb:"name"`
Ports []string `ovsdb:"ports"`
ACLs []string `ovsdb:"acls"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
}
PortGroup is an OVN Northbound Port_Group model.
type PortGroupBuilder ¶
type PortGroupBuilder struct {
// contains filtered or unexported fields
}
PortGroupBuilder builds Port_Group operations.
func (*PortGroupBuilder) WithACL ¶
func (b *PortGroupBuilder) WithACL(direction string, priority int, match, action string) *PortGroupBuilder
func (*PortGroupBuilder) WithACLExternalID ¶
func (b *PortGroupBuilder) WithACLExternalID(key, value string) *PortGroupBuilder
func (*PortGroupBuilder) WithACLUUID ¶
func (b *PortGroupBuilder) WithACLUUID(uuid string) *PortGroupBuilder
func (*PortGroupBuilder) WithExternalID ¶
func (b *PortGroupBuilder) WithExternalID(key, value string) *PortGroupBuilder
func (*PortGroupBuilder) WithPortUUID ¶
func (b *PortGroupBuilder) WithPortUUID(uuid string) *PortGroupBuilder
type PortGroupRef ¶
type PortGroupRef struct {
// contains filtered or unexported fields
}
PortGroupRef identifies one Port_Group row by name.
func (*PortGroupRef) Create ¶
func (r *PortGroupRef) Create() *PortGroupBuilder
func (*PortGroupRef) Delete ¶
func (r *PortGroupRef) Delete() *PortGroupBuilder
func (*PortGroupRef) Ensure ¶
func (r *PortGroupRef) Ensure() *PortGroupBuilder
type QoS ¶
type QoS struct {
UUID string `ovsdb:"_uuid"`
Priority int `ovsdb:"priority"`
Direction string `ovsdb:"direction"`
Match string `ovsdb:"match"`
Action map[string]int `ovsdb:"action"`
Bandwidth map[string]int `ovsdb:"bandwidth"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
}
QoS is an OVN Northbound QoS model.
type QoSBuilder ¶
type QoSBuilder struct {
// contains filtered or unexported fields
}
QoSBuilder builds QoS operations.
func (*QoSBuilder) AttachToSwitch ¶
func (b *QoSBuilder) AttachToSwitch(name string) *QoSBuilder
func (*QoSBuilder) WithBurst ¶
func (b *QoSBuilder) WithBurst(burst int) *QoSBuilder
func (*QoSBuilder) WithDSCP ¶
func (b *QoSBuilder) WithDSCP(value int) *QoSBuilder
func (*QoSBuilder) WithDirection ¶
func (b *QoSBuilder) WithDirection(direction string) *QoSBuilder
func (*QoSBuilder) WithExternalID ¶
func (b *QoSBuilder) WithExternalID(key, value string) *QoSBuilder
func (*QoSBuilder) WithMark ¶
func (b *QoSBuilder) WithMark(value int) *QoSBuilder
func (*QoSBuilder) WithMatch ¶
func (b *QoSBuilder) WithMatch(match string) *QoSBuilder
func (*QoSBuilder) WithPriority ¶
func (b *QoSBuilder) WithPriority(priority int) *QoSBuilder
func (*QoSBuilder) WithRate ¶
func (b *QoSBuilder) WithRate(rate int) *QoSBuilder
type QoSRef ¶
type QoSRef struct {
// contains filtered or unexported fields
}
QoSRef identifies one QoS row by direction, priority, and match.
func (*QoSRef) Create ¶
func (r *QoSRef) Create() *QoSBuilder
func (*QoSRef) Delete ¶
func (r *QoSRef) Delete() *QoSBuilder
func (*QoSRef) Ensure ¶
func (r *QoSRef) Ensure() *QoSBuilder
type RBACPermissionEvent ¶
type RBACPermissionEvent struct {
Type EventType
Old *SBRBACPermission
New *SBRBACPermission
}
type RBACRoleEvent ¶
type RBACRoleEvent struct {
Type EventType
Old *SBRBACRole
New *SBRBACRole
}
type SBBFD ¶
type SBBFD struct {
UUID string `ovsdb:"_uuid"`
SrcPort int `ovsdb:"src_port"`
Disc int `ovsdb:"disc"`
LogicalPort string `ovsdb:"logical_port"`
DstIP string `ovsdb:"dst_ip"`
MinTx int `ovsdb:"min_tx"`
MinRx int `ovsdb:"min_rx"`
DetectMult int `ovsdb:"detect_mult"`
Status string `ovsdb:"status"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
Options map[string]string `ovsdb:"options"`
}
SBBFD is an OVN Southbound BFD model.
type SBChassis ¶
type SBChassis struct {
UUID string `ovsdb:"_uuid"`
Name string `ovsdb:"name"`
Hostname string `ovsdb:"hostname"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
Encaps []string `ovsdb:"encaps"`
NbCfg int `ovsdb:"nb_cfg"`
OtherConfig map[string]string `ovsdb:"other_config"`
}
SBChassis is a minimal OVN Southbound Chassis model.
type SBClient ¶
type SBClient struct {
// contains filtered or unexported fields
}
SBClient exposes OVN Southbound APIs.
func (*SBClient) Connection ¶
func (*SBClient) GetChassis ¶
func (*SBClient) GetDatapath ¶
func (*SBClient) GetDatapathByUUID ¶
func (*SBClient) GetLogicalFlow ¶
func (*SBClient) GetMACBinding ¶
func (*SBClient) GetMeterBand ¶
func (*SBClient) GetMulticastGroup ¶
func (*SBClient) GetPortBinding ¶
func (*SBClient) GetRBACPermission ¶
func (*SBClient) GetRBACRole ¶
func (*SBClient) GetServiceMonitor ¶
func (*SBClient) ListChassis ¶
func (*SBClient) ListDatapaths ¶
func (s *SBClient) ListDatapaths(ctx context.Context) ([]SBDatapathBinding, error)
func (*SBClient) ListLogicalFlows ¶
func (s *SBClient) ListLogicalFlows(ctx context.Context) ([]SBLogicalFlow, error)
func (*SBClient) ListMACBindings ¶
func (s *SBClient) ListMACBindings(ctx context.Context) ([]SBMACBinding, error)
func (*SBClient) ListMeterBands ¶
func (s *SBClient) ListMeterBands(ctx context.Context) ([]SBMeterBand, error)
func (*SBClient) ListMulticastGroups ¶
func (s *SBClient) ListMulticastGroups(ctx context.Context) ([]SBMulticastGroup, error)
func (*SBClient) ListPortBindings ¶
func (s *SBClient) ListPortBindings(ctx context.Context) ([]SBPortBinding, error)
func (*SBClient) ListRBACPermissions ¶
func (s *SBClient) ListRBACPermissions(ctx context.Context) ([]SBRBACPermission, error)
func (*SBClient) ListRBACRoles ¶
func (s *SBClient) ListRBACRoles(ctx context.Context) ([]SBRBACRole, error)
func (*SBClient) ListServiceMonitors ¶
func (s *SBClient) ListServiceMonitors(ctx context.Context) ([]SBServiceMonitor, error)
func (*SBClient) LogicalFlow ¶
func (*SBClient) MACBinding ¶
func (*SBClient) MulticastGroup ¶
func (*SBClient) PortBinding ¶
func (*SBClient) RBACPermission ¶
func (*SBClient) ServiceMonitor ¶
func (*SBClient) Table ¶
Table exposes the full runtime OVN Southbound schema through the fluent API.
func (*SBClient) TableBy ¶
TableBy exposes a runtime OVN Southbound table row selected by column=value.
func (*SBClient) WatchChassis ¶
func (s *SBClient) WatchChassis(ctx context.Context) (<-chan ChassisEvent, <-chan error)
func (*SBClient) WatchDatapaths ¶
func (s *SBClient) WatchDatapaths(ctx context.Context) (<-chan DatapathEvent, <-chan error)
func (*SBClient) WatchLogicalFlows ¶
func (s *SBClient) WatchLogicalFlows(ctx context.Context) (<-chan LogicalFlowEvent, <-chan error)
func (*SBClient) WatchMACBindings ¶
func (s *SBClient) WatchMACBindings(ctx context.Context) (<-chan MACBindingEvent, <-chan error)
func (*SBClient) WatchMeterBands ¶
func (s *SBClient) WatchMeterBands(ctx context.Context) (<-chan MeterBandEvent, <-chan error)
func (*SBClient) WatchMeters ¶
func (s *SBClient) WatchMeters(ctx context.Context) (<-chan MeterEvent, <-chan error)
func (*SBClient) WatchMulticastGroups ¶
func (s *SBClient) WatchMulticastGroups(ctx context.Context) (<-chan MulticastGroupEvent, <-chan error)
func (*SBClient) WatchPortBindings ¶
func (s *SBClient) WatchPortBindings(ctx context.Context) (<-chan PortBindingEvent, <-chan error)
func (*SBClient) WatchRBACPermissions ¶
func (s *SBClient) WatchRBACPermissions(ctx context.Context) (<-chan RBACPermissionEvent, <-chan error)
func (*SBClient) WatchRBACRoles ¶
func (s *SBClient) WatchRBACRoles(ctx context.Context) (<-chan RBACRoleEvent, <-chan error)
func (*SBClient) WatchServiceMonitors ¶
func (s *SBClient) WatchServiceMonitors(ctx context.Context) (<-chan ServiceMonitorEvent, <-chan error)
type SBDNS ¶
type SBDNS struct {
UUID string `ovsdb:"_uuid"`
Records map[string]string `ovsdb:"records"`
Datapaths []string `ovsdb:"datapaths"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
}
SBDNS is an OVN Southbound DNS model.
type SBDatapathBinding ¶
type SBDatapathBinding struct {
UUID string `ovsdb:"_uuid"`
TunnelKey int `ovsdb:"tunnel_key"`
LoadBalancers []string `ovsdb:"load_balancers"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
}
SBDatapathBinding is a minimal OVN Southbound Datapath_Binding model.
type SBFDB ¶
type SBFDB struct {
UUID string `ovsdb:"_uuid"`
MAC string `ovsdb:"mac"`
DPKey int `ovsdb:"dp_key"`
PortKey int `ovsdb:"port_key"`
}
SBFDB is an OVN Southbound FDB model.
type SBLogicalFlow ¶
type SBLogicalFlow struct {
UUID string `ovsdb:"_uuid"`
LogicalDatapath *string `ovsdb:"logical_datapath"`
LogicalDPGroup *string `ovsdb:"logical_dp_group"`
Pipeline string `ovsdb:"pipeline"`
TableID int `ovsdb:"table_id"`
Priority int `ovsdb:"priority"`
Match string `ovsdb:"match"`
Actions string `ovsdb:"actions"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
}
SBLogicalFlow is an OVN Southbound Logical_Flow model.
type SBMACBinding ¶
type SBMACBinding struct {
UUID string `ovsdb:"_uuid"`
LogicalPort string `ovsdb:"logical_port"`
IP string `ovsdb:"ip"`
MAC string `ovsdb:"mac"`
Datapath string `ovsdb:"datapath"`
}
SBMACBinding is an OVN Southbound MAC_Binding model.
type SBMeter ¶
type SBMeter struct {
UUID string `ovsdb:"_uuid"`
Name string `ovsdb:"name"`
Unit string `ovsdb:"unit"`
Bands []string `ovsdb:"bands"`
}
SBMeter is an OVN Southbound Meter model.
type SBMeterBand ¶
type SBMeterBand struct {
UUID string `ovsdb:"_uuid"`
Action string `ovsdb:"action"`
Rate int `ovsdb:"rate"`
BurstSize int `ovsdb:"burst_size"`
}
SBMeterBand is an OVN Southbound Meter_Band model.
type SBMulticastGroup ¶
type SBMulticastGroup struct {
UUID string `ovsdb:"_uuid"`
Datapath string `ovsdb:"datapath"`
Name string `ovsdb:"name"`
TunnelKey int `ovsdb:"tunnel_key"`
Ports []string `ovsdb:"ports"`
}
SBMulticastGroup is an OVN Southbound Multicast_Group model.
type SBPortBinding ¶
type SBPortBinding struct {
UUID string `ovsdb:"_uuid"`
LogicalPort string `ovsdb:"logical_port"`
Type string `ovsdb:"type"`
Chassis *string `ovsdb:"chassis"`
Datapath string `ovsdb:"datapath"`
TunnelKey int `ovsdb:"tunnel_key"`
ParentPort *string `ovsdb:"parent_port"`
Tag *int `ovsdb:"tag"`
VirtualParent *string `ovsdb:"virtual_parent"`
Encap *string `ovsdb:"encap"`
GatewayChassis []string `ovsdb:"gateway_chassis"`
HAChassisGroup *string `ovsdb:"ha_chassis_group"`
MAC []string `ovsdb:"mac"`
NatAddresses []string `ovsdb:"nat_addresses"`
Up *bool `ovsdb:"up"`
Options map[string]string `ovsdb:"options"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
}
SBPortBinding is a minimal OVN Southbound Port_Binding model.
type SBRBACPermission ¶
type SBRBACPermission struct {
UUID string `ovsdb:"_uuid"`
Table string `ovsdb:"table"`
Authorization []string `ovsdb:"authorization"`
InsertDelete bool `ovsdb:"insert_delete"`
Update []string `ovsdb:"update"`
}
SBRBACPermission is an OVN Southbound RBAC_Permission model.
type SBRBACRole ¶
type SBRBACRole struct {
UUID string `ovsdb:"_uuid"`
Name string `ovsdb:"name"`
Permissions map[string]string `ovsdb:"permissions"`
}
SBRBACRole is an OVN Southbound RBAC_Role model.
type SBServiceMonitor ¶
type SBServiceMonitor struct {
UUID string `ovsdb:"_uuid"`
IP string `ovsdb:"ip"`
Protocol *string `ovsdb:"protocol"`
Port int `ovsdb:"port"`
LogicalPort string `ovsdb:"logical_port"`
SrcMAC string `ovsdb:"src_mac"`
SrcIP string `ovsdb:"src_ip"`
Status *string `ovsdb:"status"`
Options map[string]string `ovsdb:"options"`
ExternalIDs map[string]string `ovsdb:"external_ids"`
}
SBServiceMonitor is an OVN Southbound Service_Monitor model.
type SchemaRegistry ¶
type SchemaRegistry struct {
// contains filtered or unexported fields
}
SchemaRegistry captures the runtime capabilities advertised by an OVN/OVS database. Builders use it to fail fast for required columns and to skip optional version-specific columns.
func (*SchemaRegistry) Columns ¶
func (s *SchemaRegistry) Columns(table string) []string
Columns returns the schema columns for table, including _uuid first.
func (*SchemaRegistry) Database ¶
func (s *SchemaRegistry) Database() string
Database returns the OVSDB database name represented by the registry.
func (*SchemaRegistry) HasColumn ¶
func (s *SchemaRegistry) HasColumn(table, column string) bool
HasColumn reports whether table.column exists in the runtime schema.
func (*SchemaRegistry) HasTable ¶
func (s *SchemaRegistry) HasTable(table string) bool
HasTable reports whether the runtime schema contains table.
func (*SchemaRegistry) ReferenceColumnInfos ¶
func (s *SchemaRegistry) ReferenceColumnInfos(table, refTable string) []referenceColumnInfo
func (*SchemaRegistry) ReferenceColumns ¶
func (s *SchemaRegistry) ReferenceColumns(table, refTable string) []string
func (*SchemaRegistry) RequireColumns ¶
func (s *SchemaRegistry) RequireColumns(table string, columns ...string) error
RequireColumns returns ErrorInvalidSchema when any required column is missing.
func (*SchemaRegistry) RequireConditionColumns ¶
func (s *SchemaRegistry) RequireConditionColumns(table string, conditions ...libovsdb.Condition) error
func (*SchemaRegistry) RequireTable ¶
func (s *SchemaRegistry) RequireTable(table string) error
RequireTable returns ErrorInvalidSchema when table is unavailable.
func (*SchemaRegistry) Tables ¶
func (s *SchemaRegistry) Tables() []string
func (*SchemaRegistry) Version ¶
func (s *SchemaRegistry) Version() string
Version returns the runtime OVSDB schema version.
type ServiceMonitorEvent ¶
type ServiceMonitorEvent struct {
Type EventType
Old *SBServiceMonitor
New *SBServiceMonitor
}
type TableBuilder ¶
type TableBuilder struct {
// contains filtered or unexported fields
}
TableBuilder builds a single-row table operation. Map and set mutations use OVSDB mutate by default so external controller-owned keys are preserved.
func (*TableBuilder) DeleteMap ¶
func (b *TableBuilder) DeleteMap(column string, values map[string]string) *TableBuilder
DeleteMap removes map entries from column.
func (*TableBuilder) DeleteSet ¶
func (b *TableBuilder) DeleteSet(column string, values ...any) *TableBuilder
DeleteSet removes one or more set values from column.
func (*TableBuilder) DeleteUUIDSet ¶
func (b *TableBuilder) DeleteUUIDSet(column string, uuids ...string) *TableBuilder
DeleteUUIDSet removes UUID references from a set column.
func (*TableBuilder) Execute ¶
func (b *TableBuilder) Execute(ctx context.Context) error
Execute commits the configured operation.
func (*TableBuilder) MutateMap ¶
func (b *TableBuilder) MutateMap(column string, values map[string]string) *TableBuilder
MutateMap inserts map entries into column.
func (*TableBuilder) MutateSet ¶
func (b *TableBuilder) MutateSet(column string, values ...any) *TableBuilder
MutateSet inserts one or more set values into column.
func (*TableBuilder) MutateUUIDSet ¶
func (b *TableBuilder) MutateUUIDSet(column string, uuids ...string) *TableBuilder
MutateUUIDSet inserts UUID references into a set column.
func (*TableBuilder) SelectColumns ¶
func (b *TableBuilder) SelectColumns(columns ...string) *TableBuilder
SelectColumns constrains columns used by Get/List helpers chained from tests and future extensions.
func (*TableBuilder) WithACL ¶
func (b *TableBuilder) WithACL(direction string, priority int, match, action string) *TableBuilder
func (*TableBuilder) WithAction ¶
func (b *TableBuilder) WithAction(action string) *TableBuilder
WithAction sets an action column.
func (*TableBuilder) WithAddressSetAddresses ¶
func (b *TableBuilder) WithAddressSetAddresses(addresses ...string) *TableBuilder
func (*TableBuilder) WithAddresses ¶
func (b *TableBuilder) WithAddresses(addresses ...string) *TableBuilder
WithAddresses sets an OVSDB set of string addresses.
func (*TableBuilder) WithBFDLogicalPort ¶
func (b *TableBuilder) WithBFDLogicalPort(port string) *TableBuilder
func (*TableBuilder) WithBFDStatus ¶
func (b *TableBuilder) WithBFDStatus(status string) *TableBuilder
func (*TableBuilder) WithChassis ¶
func (b *TableBuilder) WithChassis(uuid string) *TableBuilder
func (*TableBuilder) WithColumn ¶
func (b *TableBuilder) WithColumn(column string, value any) *TableBuilder
WithColumn sets a column in the insert/update row.
func (*TableBuilder) WithController ¶
func (b *TableBuilder) WithController(target string) *TableBuilder
func (*TableBuilder) WithDHCPOption ¶
func (b *TableBuilder) WithDHCPOption(key, value string) *TableBuilder
func (*TableBuilder) WithDNSRecord ¶
func (b *TableBuilder) WithDNSRecord(name, value string) *TableBuilder
func (*TableBuilder) WithDatapath ¶
func (b *TableBuilder) WithDatapath(uuid string) *TableBuilder
func (*TableBuilder) WithDirection ¶
func (b *TableBuilder) WithDirection(direction string) *TableBuilder
WithDirection sets a direction column, commonly from-lport or to-lport.
func (*TableBuilder) WithEncap ¶
func (b *TableBuilder) WithEncap(kind, ip string) *TableBuilder
func (*TableBuilder) WithExternalID ¶
func (b *TableBuilder) WithExternalID(key, value string) *TableBuilder
WithExternalID mutates external_ids without replacing existing keys.
func (*TableBuilder) WithGatewayPriority ¶
func (b *TableBuilder) WithGatewayPriority(priority int) *TableBuilder
func (*TableBuilder) WithLogicalPort ¶
func (b *TableBuilder) WithLogicalPort(port string) *TableBuilder
WithLogicalPort sets logical_port.
func (*TableBuilder) WithMAC ¶
func (b *TableBuilder) WithMAC(mac string) *TableBuilder
func (*TableBuilder) WithManager ¶
func (b *TableBuilder) WithManager(target string) *TableBuilder
func (*TableBuilder) WithMatch ¶
func (b *TableBuilder) WithMatch(match string) *TableBuilder
WithMatch sets a match expression column.
func (*TableBuilder) WithMirrorSelectAll ¶
func (b *TableBuilder) WithMirrorSelectAll() *TableBuilder
func (*TableBuilder) WithNAT ¶
func (b *TableBuilder) WithNAT(kind, logicalIP, externalIP string) *TableBuilder
func (*TableBuilder) WithName ¶
func (b *TableBuilder) WithName(name string) *TableBuilder
WithName sets the conventional name column.
func (*TableBuilder) WithNetworks ¶
func (b *TableBuilder) WithNetworks(networks ...string) *TableBuilder
WithNetworks sets an OVSDB set of network CIDRs.
func (*TableBuilder) WithOption ¶
func (b *TableBuilder) WithOption(key, value string) *TableBuilder
WithOption mutates options without replacing existing keys.
func (*TableBuilder) WithOptionalColumn ¶
func (b *TableBuilder) WithOptionalColumn(column string, value any) *TableBuilder
WithOptionalColumn sets a column only if the runtime schema supports it.
func (*TableBuilder) WithPortGroupPorts ¶
func (b *TableBuilder) WithPortGroupPorts(portUUIDs ...string) *TableBuilder
func (*TableBuilder) WithPriority ¶
func (b *TableBuilder) WithPriority(priority int) *TableBuilder
WithPriority sets a priority column.
func (*TableBuilder) WithQoSType ¶
func (b *TableBuilder) WithQoSType(kind string) *TableBuilder
func (*TableBuilder) WithQueueDSCP ¶
func (b *TableBuilder) WithQueueDSCP(dscp int) *TableBuilder
func (*TableBuilder) WithQueueOtherConfig ¶
func (b *TableBuilder) WithQueueOtherConfig(key, value string) *TableBuilder
func (*TableBuilder) WithRouterPort ¶
func (b *TableBuilder) WithRouterPort(mac string, networks ...string) *TableBuilder
func (*TableBuilder) WithSamplingTarget ¶
func (b *TableBuilder) WithSamplingTarget(target string) *TableBuilder
func (*TableBuilder) WithTarget ¶
func (b *TableBuilder) WithTarget(target string) *TableBuilder
WithTarget sets target, used by OVSDB Connection and Manager-like tables.
func (*TableBuilder) WithTier ¶
func (b *TableBuilder) WithTier(tier int) *TableBuilder
WithTier sets a tier column when supported by newer schemas.
func (*TableBuilder) WithType ¶
func (b *TableBuilder) WithType(kind string) *TableBuilder
WithType sets the conventional type column.
func (*TableBuilder) WithUUIDRef ¶
func (b *TableBuilder) WithUUIDRef(column, uuid string) *TableBuilder
WithUUIDRef sets a UUID reference column.
func (*TableBuilder) WithUUIDSet ¶
func (b *TableBuilder) WithUUIDSet(column string, uuids ...string) *TableBuilder
WithUUIDSet sets a UUID set column.
func (*TableBuilder) WithVIP ¶
func (b *TableBuilder) WithVIP(vip, backends string) *TableBuilder
type TableRef ¶
type TableRef struct {
// contains filtered or unexported fields
}
TableRef is a runtime-schema-aware fluent handle for any OVSDB table. Typed NB/SB/OVS APIs are thin wrappers over this for less common tables.
func (*TableRef) AddUUID ¶
func (r *TableRef) AddUUID(column, uuid string) *TableBuilder
func (*TableRef) Create ¶
func (r *TableRef) Create() *TableBuilder
Create starts an insert operation.
func (*TableRef) Delete ¶
func (r *TableRef) Delete() *TableBuilder
Delete starts a delete operation.
func (*TableRef) DeleteUUID ¶
func (r *TableRef) DeleteUUID(column, uuid string) *TableBuilder
func (*TableRef) Ensure ¶
func (r *TableRef) Ensure() *TableBuilder
Ensure starts an idempotent create-or-mutate operation.
func (*TableRef) List ¶
List selects rows from this table. Identity and explicit Where conditions are both honored; an empty reference returns the full table.
func (*TableRef) Update ¶
func (r *TableRef) Update() *TableBuilder
Update starts a mutate/update operation for an existing row.
func (*TableRef) WhereCondition ¶
func (r *TableRef) WhereCondition(column string, fn libovsdb.ConditionFunction, value any) *TableRef
WhereCondition adds a condition to this table reference.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
local_ovs
command
|
|
|
logical_switch
command
|
|
|
southbound_watch
command
|
|
|
internal
|
|