ovnflow

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: MIT Imports: 17 Imported by: 0

README

ovnflow

ovnflow is a fluent Go SDK for OVN and Open vSwitch. The SDK core uses libovsdb for production OVSDB connections, runtime schema discovery, watches, and transactions.

go get github.com/firstmeet/ovnflow

The current SDK surface covers:

Area Coverage
OVN Northbound logical switch/port plus router, router port, ACL, NAT, load balancer, DHCP, DNS, QoS, meter, port group, address set, gateway/HA/BFD builders
OVN Southbound typed list/get/watch for chassis, port binding, datapath, logical flow, MAC/FDB, multicast, service monitor, RBAC, meter, DNS, and BFD
Open_vSwitch bridge/port/interface lifecycle plus controller, manager, mirror, QoS, queue, flow table, NetFlow, sFlow, IPFIX, SSL, and AutoAttach fluent table APIs
Runtime schema-aware TableRef create/ensure/update/delete/get/list/watch with optional columns and map/set mutations
ctx := context.Background()
client, err := ovnflow.Connect(ctx, ovnflow.ConfigFromEnv())
if err != nil {
    return err
}
defer client.Close()

err = 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)
if err != nil {
    return err
}

err = client.LocalOVS().
    Bridge("br-ovnflow-it").
    AddPort("vnet0").
    WithInterfaceType("internal").
    WithExternalID("vm-id", "uuid-1234").
    Execute(ctx)
if err != nil {
    return err
}

err = client.LocalOVS().
    Bridge("br-ovnflow-it").
    Ensure().
    WithMirror("mirror-web", func(m *ovnflow.TableBuilder) {
        m.WithMirrorSelectAll().
            WithExternalID("owner", "web")
    }).
    WithNetFlow("nf-web", func(nf *ovnflow.TableBuilder) {
        nf.WithSamplingTarget("127.0.0.1:2055").
            WithExternalID("owner", "web")
    }).
    WithIPFIX("ipfix-web", func(ipfix *ovnflow.TableBuilder) {
        ipfix.WithSamplingTarget("127.0.0.1:4739")
    }).
    Execute(ctx)
if err != nil {
    return err
}

Normal tests are local and dependency-free:

go test ./...

Integration tests connect to OVN/OVS OVSDB services over TCP:

$env:OVNFLOW_OVS_ADDR="tcp:172.27.192.120:6640"
$env:OVNFLOW_OVN_NB_ADDR="tcp:172.27.192.120:6641"
$env:OVNFLOW_OVN_SB_ADDR="tcp:172.27.192.120:6642"
go test -tags=integration ./...

Optional v1.0 readiness checks are also integration-tagged. They are read-only and validate the NB, SB, and OVS runtime schemas:

$env:OVNFLOW_V1_SCHEMA_CHECKS="1"
go test -tags=integration ./...

CI and release validation set OVNFLOW_REQUIRE_INTEGRATION=1, which turns missing or unreachable endpoints into test failures instead of skips.

Runnable examples live under examples/:

go run ./examples/logical_switch
go run ./examples/local_ovs
go run ./examples/southbound_watch

See Windows + WSL integration tests for WSL listener setup, safety settings, and Docker/CI notes.

See v1.0 hardening and API stability for the current release gates and stable surface. The v0.1 scope and v0.2 scope documents are historical compatibility notes.

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)
}
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)
}
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:
	}
}

Index

Examples

Constants

View Source
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"
)
View Source
const (
	DefaultIntegrationResourcePrefix = "ovnflow-it-"
	DefaultIntegrationBridge         = "br-ovnflow-it"
)

Variables

View Source
var (
	ErrAlreadyExists = &Error{Kind: ErrorAlreadyExists}
	ErrNotFound      = &Error{Kind: ErrorNotFound}
	ErrConflict      = &Error{Kind: ErrorConflict}
	ErrUnavailable   = &Error{Kind: ErrorUnavailable}
	ErrInvalidSchema = &Error{Kind: ErrorInvalidSchema}
	ErrTimeout       = &Error{Kind: ErrorTimeout}
	ErrCanceled      = &Error{Kind: ErrorCanceled}
	ErrPartial       = &Error{Kind: ErrorPartial}
	ErrValidation    = &Error{Kind: ErrorValidation}
)

Functions

func IsKind

func IsKind(err error, kind ErrorKind) bool

IsKind reports whether err is an ovnflow error of kind.

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) Execute

func (b *ACLBuilder) Execute(ctx context.Context) error

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) Execute

func (b *AddressSetBuilder) Execute(ctx context.Context) error

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) Execute

func (b *BFDBuilder) Execute(ctx context.Context) error

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 BFDEvent

type BFDEvent struct {
	Type EventType
	Old  *SBBFD
	New  *SBBFD
}

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) Execute

func (b *BridgeBuilder) Execute(ctx context.Context) error

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 ChassisEvent struct {
	Type EventType
	Old  *SBChassis
	New  *SBChassis
}

type Client

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

Client is the public SDK entrypoint.

func Connect

func Connect(ctx context.Context, cfg Config) (*Client, error)

Connect creates and connects all configured OVN/OVS clients.

func (*Client) Close

func (c *Client) Close()

Close closes all underlying OVSDB connections.

func (*Client) LocalOVS

func (c *Client) LocalOVS() *OVSClient

LocalOVS returns the local Open_vSwitch API.

func (*Client) OVN

func (c *Client) OVN() OVN

OVN returns OVN Northbound and Southbound APIs.

func (*Client) RawNB

func (c *Client) RawNB() ovsclient.Client

RawNB returns the underlying libovsdb client for OVN Northbound.

func (*Client) RawOVS

func (c *Client) RawOVS() ovsclient.Client

RawOVS returns the underlying libovsdb client for Open_vSwitch.

func (*Client) RawSB

func (c *Client) RawSB() ovsclient.Client

RawSB returns the underlying libovsdb client for OVN Southbound.

type Config

type Config struct {
	OVSAddr   string
	OVNNBAddr string
	OVNSBAddr string
}

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) Execute

func (b *DNSBuilder) Execute(ctx context.Context) error

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 DNSEvent

type DNSEvent struct {
	Type EventType
	Old  *SBDNS
	New  *SBDNS
}

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.

func (*Error) Error

func (e *Error) Error() string

func (*Error) Is

func (e *Error) Is(target error) bool

func (*Error) Unwrap

func (e *Error) Unwrap() error

type ErrorKind

type ErrorKind string

ErrorKind classifies errors returned by ovnflow.

const (
	ErrorAlreadyExists ErrorKind = "already_exists"
	ErrorNotFound      ErrorKind = "not_found"
	ErrorConflict      ErrorKind = "conflict"
	ErrorUnavailable   ErrorKind = "unavailable"
	ErrorInvalidSchema ErrorKind = "invalid_schema"
	ErrorTimeout       ErrorKind = "timeout"
	ErrorCanceled      ErrorKind = "canceled"
	ErrorPartial       ErrorKind = "partial_success"
	ErrorValidation    ErrorKind = "validation"
)

func KindOf

func KindOf(err error) ErrorKind

KindOf returns the ovnflow error kind, if present.

type EventType

type EventType string
const (
	EventInitial EventType = "initial"
	EventAdd     EventType = "add"
	EventUpdate  EventType = "update"
	EventDelete  EventType = "delete"
)

type FDBEvent

type FDBEvent struct {
	Type EventType
	Old  *SBFDB
	New  *SBFDB
}

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 (*GatewayChassisRef) Delete

func (*GatewayChassisRef) Ensure

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) Execute

func (b *HAChassisBuilder) Execute(ctx context.Context) error

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 (*HAChassisGroupRef) Delete

func (*HAChassisGroupRef) Ensure

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 (*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 (*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

type LogicalRouterPortRef

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

LogicalRouterPortRef identifies one Logical_Router_Port row by name.

func (*LogicalRouterPortRef) Create

func (*LogicalRouterPortRef) Delete

func (*LogicalRouterPortRef) Ensure

type LogicalRouterRef

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

LogicalRouterRef identifies one Logical_Router row by name.

func (*LogicalRouterRef) Create

func (*LogicalRouterRef) Delete

func (*LogicalRouterRef) Ensure

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 (*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 (*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 (*LogicalSwitchPortBuilder) WithMac

type LogicalSwitchRef

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

func (*LogicalSwitchRef) Create

func (*LogicalSwitchRef) Delete

func (*LogicalSwitchRef) Ensure

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) Execute

func (b *MeterBandBuilder) Execute(ctx context.Context) error

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) Execute

func (b *MeterBuilder) Execute(ctx context.Context) error

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 MeterEvent struct {
	Type EventType
	Old  *SBMeter
	New  *SBMeter
}

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) Execute

func (b *NATBuilder) Execute(ctx context.Context) error

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) ACL

func (n *NBClient) ACL(name string) *ACLRef

func (*NBClient) ACLByMatch

func (n *NBClient) ACLByMatch(direction string, priority int, match string) *ACLRef

func (*NBClient) AddressSet

func (n *NBClient) AddressSet(name string) *AddressSetRef

func (*NBClient) BFD

func (n *NBClient) BFD(logicalPort, dstIP string) *BFDRef

func (*NBClient) Connection

func (n *NBClient) Connection(target string) *TableRef

func (*NBClient) DHCPOptions

func (n *NBClient) DHCPOptions(cidr string) *DHCPOptionsRef

func (*NBClient) DNS

func (n *NBClient) DNS(name string) *DNSRef

func (*NBClient) ForwardingGroup

func (n *NBClient) ForwardingGroup(name string) *TableRef

func (*NBClient) GatewayChassis

func (n *NBClient) GatewayChassis(name string) *GatewayChassisRef

func (*NBClient) GetACL

func (n *NBClient) GetACL(ctx context.Context, direction string, priority int, match string) (*ACL, error)

func (*NBClient) GetAddressSet

func (n *NBClient) GetAddressSet(ctx context.Context, name string) (*AddressSet, error)

func (*NBClient) GetBFD

func (n *NBClient) GetBFD(ctx context.Context, logicalPort, dstIP string) (*BFD, error)

func (*NBClient) GetDHCPOptions

func (n *NBClient) GetDHCPOptions(ctx context.Context, cidr string) (*DHCPOptions, error)

func (*NBClient) GetDNS

func (n *NBClient) GetDNS(ctx context.Context, name string) (*DNS, error)

func (*NBClient) GetGatewayChassis

func (n *NBClient) GetGatewayChassis(ctx context.Context, name string) (*GatewayChassis, error)

func (*NBClient) GetHAChassis

func (n *NBClient) GetHAChassis(ctx context.Context, chassisName string) (*HAChassis, error)

func (*NBClient) GetHAChassisGroup

func (n *NBClient) GetHAChassisGroup(ctx context.Context, name string) (*HAChassisGroup, error)

func (*NBClient) GetLoadBalancer

func (n *NBClient) GetLoadBalancer(ctx context.Context, name string) (*LoadBalancer, error)

func (*NBClient) GetLogicalRouter

func (n *NBClient) GetLogicalRouter(ctx context.Context, name string) (*LogicalRouter, error)

func (*NBClient) GetLogicalRouterPort

func (n *NBClient) GetLogicalRouterPort(ctx context.Context, name string) (*LogicalRouterPort, error)

func (*NBClient) GetLogicalSwitch

func (n *NBClient) GetLogicalSwitch(ctx context.Context, name string) (*LogicalSwitch, error)

GetLogicalSwitch returns a logical switch by name.

func (*NBClient) GetLogicalSwitchPort

func (n *NBClient) GetLogicalSwitchPort(ctx context.Context, name string) (*LogicalSwitchPort, error)

func (*NBClient) GetMeter

func (n *NBClient) GetMeter(ctx context.Context, name string) (*Meter, error)

func (*NBClient) GetMeterBand

func (n *NBClient) GetMeterBand(ctx context.Context, name string) (*MeterBand, error)

func (*NBClient) GetNAT

func (n *NBClient) GetNAT(ctx context.Context, kind, logicalIP string) (*NAT, error)

func (*NBClient) GetPortGroup

func (n *NBClient) GetPortGroup(ctx context.Context, name string) (*PortGroup, error)

func (*NBClient) GetQoS

func (n *NBClient) GetQoS(ctx context.Context, direction string, priority int, match string) (*QoS, error)

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) Meter

func (n *NBClient) Meter(name string) *MeterRef

func (*NBClient) MeterBand

func (n *NBClient) MeterBand(name string) *MeterBandRef

func (*NBClient) NAT

func (n *NBClient) NAT(name string) *NATRef

func (*NBClient) NATByLogicalIP

func (n *NBClient) NATByLogicalIP(kind, logicalIP string) *NATRef

func (*NBClient) NBGlobal

func (n *NBClient) NBGlobal() *TableRef

func (*NBClient) PortGroup

func (n *NBClient) PortGroup(name string) *PortGroupRef

func (*NBClient) QoS

func (n *NBClient) QoS(name string) *QoSRef

func (*NBClient) QoSByMatch

func (n *NBClient) QoSByMatch(direction string, priority int, match string) *QoSRef

func (*NBClient) SSL

func (n *NBClient) SSL() *TableRef

func (*NBClient) Table

func (n *NBClient) Table(table string) *TableRef

Table exposes the full runtime OVN Northbound schema through the fluent API.

func (*NBClient) TableBy

func (n *NBClient) TableBy(table, column, value string) *TableRef

TableBy exposes a runtime OVN Northbound table row selected by column=value.

func (*NBClient) TableLogicalSwitchPort

func (n *NBClient) TableLogicalSwitchPort(name string) *TableRef

type OVN

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

OVN groups OVN APIs.

func (OVN) NB

func (o OVN) NB() *NBClient

func (OVN) SB

func (o OVN) SB() *SBClient

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 (o *OVSClient) AutoAttach(systemName string) *TableRef

func (*OVSClient) Bridge

func (o *OVSClient) Bridge(name string) *BridgeRef

func (*OVSClient) Controller

func (o *OVSClient) Controller(target string) *TableRef

func (*OVSClient) FlowTable

func (o *OVSClient) FlowTable(name string) *TableRef

func (*OVSClient) GetBridge

func (o *OVSClient) GetBridge(ctx context.Context, name string) (*OVSBridge, error)

func (*OVSClient) GetInterface

func (o *OVSClient) GetInterface(ctx context.Context, name string) (*OVSInterface, error)

func (*OVSClient) GetPort

func (o *OVSClient) GetPort(ctx context.Context, name string) (*OVSPort, error)

func (*OVSClient) IPFIX

func (o *OVSClient) IPFIX(name string) *TableRef

func (*OVSClient) Interface

func (o *OVSClient) Interface(name string) *TableRef

func (*OVSClient) ListBridges

func (o *OVSClient) ListBridges(ctx context.Context) ([]OVSBridge, error)

func (*OVSClient) ListInterfaces

func (o *OVSClient) ListInterfaces(ctx context.Context) ([]OVSInterface, error)

func (*OVSClient) ListPorts

func (o *OVSClient) ListPorts(ctx context.Context) ([]OVSPort, error)

func (*OVSClient) Manager

func (o *OVSClient) Manager(target string) *TableRef

func (*OVSClient) Mirror

func (o *OVSClient) Mirror(name string) *TableRef

func (*OVSClient) NetFlow

func (o *OVSClient) NetFlow(name string) *TableRef

func (*OVSClient) OpenVSwitch

func (o *OVSClient) OpenVSwitch() *TableRef

func (*OVSClient) Port

func (o *OVSClient) Port(name string) *TableRef

func (*OVSClient) QoS

func (o *OVSClient) QoS(name string) *TableRef

func (*OVSClient) Queue

func (o *OVSClient) Queue(name string) *TableRef

func (*OVSClient) SFlow

func (o *OVSClient) SFlow(name string) *TableRef

func (*OVSClient) SSL

func (o *OVSClient) SSL() *TableRef

func (*OVSClient) Table

func (o *OVSClient) Table(table string) *TableRef

Table exposes the full runtime Open_vSwitch schema through the fluent API.

func (*OVSClient) TableBy

func (o *OVSClient) TableBy(table, column, value string) *TableRef

TableBy exposes a runtime Open_vSwitch table row selected by column=value.

func (*OVSClient) WatchBridges

func (o *OVSClient) WatchBridges(ctx context.Context) (<-chan RowEvent, <-chan error)

func (*OVSClient) WatchInterfaces

func (o *OVSClient) WatchInterfaces(ctx context.Context) (<-chan RowEvent, <-chan error)

func (*OVSClient) WatchPorts

func (o *OVSClient) WatchPorts(ctx context.Context) (<-chan RowEvent, <-chan error)

func (*OVSClient) WatchTable

func (o *OVSClient) WatchTable(ctx context.Context, table string) (<-chan RowEvent, <-chan error)

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) Execute

func (p *OVSPortBuilder) Execute(ctx context.Context) error

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) Execute

func (b *PortGroupBuilder) Execute(ctx context.Context) error

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) Execute

func (b *QoSBuilder) Execute(ctx context.Context) error

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 Row

type Row map[string]any

Row is a dynamic OVSDB row returned by the table-level fluent API.

type RowEvent

type RowEvent struct {
	Type EventType
	Old  Row
	New  Row
	// contains filtered or unexported fields
}

RowEvent is emitted by table-level watches.

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) BFD

func (s *SBClient) BFD(logicalPort string) *TableRef

func (*SBClient) Chassis

func (s *SBClient) Chassis(name string) *TableRef

func (*SBClient) Connection

func (s *SBClient) Connection(target string) *TableRef

func (*SBClient) DNS

func (s *SBClient) DNS(name string) *TableRef

func (*SBClient) Datapath

func (s *SBClient) Datapath(uuid string) *TableRef

func (*SBClient) Encap

func (s *SBClient) Encap(ip string) *TableRef

func (*SBClient) FDB

func (s *SBClient) FDB(mac string) *TableRef

func (*SBClient) GetBFD

func (s *SBClient) GetBFD(ctx context.Context, logicalPort, dstIP string, srcPort, disc int) (*SBBFD, error)

func (*SBClient) GetChassis

func (s *SBClient) GetChassis(ctx context.Context, name string) (*SBChassis, error)

func (*SBClient) GetDNS

func (s *SBClient) GetDNS(ctx context.Context, uuid string) (*SBDNS, error)

func (*SBClient) GetDatapath

func (s *SBClient) GetDatapath(ctx context.Context, tunnelKey int) (*SBDatapathBinding, error)

func (*SBClient) GetDatapathByUUID

func (s *SBClient) GetDatapathByUUID(ctx context.Context, uuid string) (*SBDatapathBinding, error)

func (*SBClient) GetFDB

func (s *SBClient) GetFDB(ctx context.Context, mac string, dpKey int) (*SBFDB, error)

func (*SBClient) GetLogicalFlow

func (s *SBClient) GetLogicalFlow(ctx context.Context, uuid string) (*SBLogicalFlow, error)

func (*SBClient) GetMACBinding

func (s *SBClient) GetMACBinding(ctx context.Context, logicalPort, ip string) (*SBMACBinding, error)

func (*SBClient) GetMeter

func (s *SBClient) GetMeter(ctx context.Context, name string) (*SBMeter, error)

func (*SBClient) GetMeterBand

func (s *SBClient) GetMeterBand(ctx context.Context, uuid string) (*SBMeterBand, error)

func (*SBClient) GetMulticastGroup

func (s *SBClient) GetMulticastGroup(ctx context.Context, datapath string, tunnelKey int) (*SBMulticastGroup, error)

func (*SBClient) GetPortBinding

func (s *SBClient) GetPortBinding(ctx context.Context, logicalPort string) (*SBPortBinding, error)

func (*SBClient) GetRBACPermission

func (s *SBClient) GetRBACPermission(ctx context.Context, uuid string) (*SBRBACPermission, error)

func (*SBClient) GetRBACRole

func (s *SBClient) GetRBACRole(ctx context.Context, name string) (*SBRBACRole, error)

func (*SBClient) GetServiceMonitor

func (s *SBClient) GetServiceMonitor(ctx context.Context, logicalPort, ip, protocol string, port int) (*SBServiceMonitor, error)

func (*SBClient) ListBFD

func (s *SBClient) ListBFD(ctx context.Context) ([]SBBFD, error)

func (*SBClient) ListChassis

func (s *SBClient) ListChassis(ctx context.Context) ([]SBChassis, error)

func (*SBClient) ListDNS

func (s *SBClient) ListDNS(ctx context.Context) ([]SBDNS, error)

func (*SBClient) ListDatapaths

func (s *SBClient) ListDatapaths(ctx context.Context) ([]SBDatapathBinding, error)

func (*SBClient) ListFDB

func (s *SBClient) ListFDB(ctx context.Context) ([]SBFDB, 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) ListMeters

func (s *SBClient) ListMeters(ctx context.Context) ([]SBMeter, 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 (s *SBClient) LogicalFlow(uuid string) *TableRef

func (*SBClient) MACBinding

func (s *SBClient) MACBinding(logicalPort string) *TableRef

func (*SBClient) Meter

func (s *SBClient) Meter(name string) *TableRef

func (*SBClient) MulticastGroup

func (s *SBClient) MulticastGroup(name string) *TableRef

func (*SBClient) PortBinding

func (s *SBClient) PortBinding(logicalPort string) *TableRef

func (*SBClient) RBACPermission

func (s *SBClient) RBACPermission(uuid string) *TableRef

func (*SBClient) RBACRole

func (s *SBClient) RBACRole(name string) *TableRef

func (*SBClient) SBGlobal

func (s *SBClient) SBGlobal() *TableRef

func (*SBClient) SSL

func (s *SBClient) SSL() *TableRef

func (*SBClient) ServiceMonitor

func (s *SBClient) ServiceMonitor(logicalPort string) *TableRef

func (*SBClient) Table

func (s *SBClient) Table(table string) *TableRef

Table exposes the full runtime OVN Southbound schema through the fluent API.

func (*SBClient) TableBy

func (s *SBClient) TableBy(table, column, value string) *TableRef

TableBy exposes a runtime OVN Southbound table row selected by column=value.

func (*SBClient) WatchBFD

func (s *SBClient) WatchBFD(ctx context.Context) (<-chan BFDEvent, <-chan error)

func (*SBClient) WatchChassis

func (s *SBClient) WatchChassis(ctx context.Context) (<-chan ChassisEvent, <-chan error)

func (*SBClient) WatchDNS

func (s *SBClient) WatchDNS(ctx context.Context) (<-chan DNSEvent, <-chan error)

func (*SBClient) WatchDatapaths

func (s *SBClient) WatchDatapaths(ctx context.Context) (<-chan DatapathEvent, <-chan error)

func (*SBClient) WatchFDB

func (s *SBClient) WatchFDB(ctx context.Context) (<-chan FDBEvent, <-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)

func (*SBClient) WatchTable

func (s *SBClient) WatchTable(ctx context.Context, table string) (<-chan RowEvent, <-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) Get

func (r *TableRef) Get(ctx context.Context) (Row, error)

Get selects one row by this reference identity.

func (*TableRef) List

func (r *TableRef) List(ctx context.Context) ([]Row, error)

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) Watch

func (r *TableRef) Watch(ctx context.Context) (<-chan RowEvent, <-chan error)

Watch subscribes to table changes through libovsdb monitor/cache events.

func (*TableRef) Where

func (r *TableRef) Where(column string, value any) *TableRef

Where adds an equality condition to this table reference.

func (*TableRef) WhereCondition

func (r *TableRef) WhereCondition(column string, fn libovsdb.ConditionFunction, value any) *TableRef

WhereCondition adds a condition to this table reference.

func (*TableRef) WhereConditions

func (r *TableRef) WhereConditions(conditions ...libovsdb.Condition) *TableRef

WhereConditions adds prebuilt OVSDB conditions to this table reference.

Directories

Path Synopsis
examples
local_ovs command
logical_switch command
internal

Jump to

Keyboard shortcuts

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