ovnflow

package module
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: MIT Imports: 23 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/v2

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, OVN gateway, HA chassis group, and BFD table 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
OpenFlow native OpenFlow 1.5/1.3 negotiation, message codec, flow add/delete/dump primitives, fluent owned-rule builders without shelling out to ovs-ofctl, and live OVS endpoint integration gates
SD-WAN open Site/Link/Tunnel/Policy primitives with explicit Partial Mesh links, Hub-Spoke/Full Mesh planning, direct/relay/transit/auto path modes, disabled links, L2/L3 overlay modes, WireGuard/Geneve/VXLAN transports, Linux route/OVS tunnel/OpenFlow backend hooks, agent/control-plane primitives, and pluggable Apply backends
v2 intent platform-neutral VirtualNetwork, LogicalSwitchDNS, WorkloadAttachment, ProviderNetwork, SecurityPolicy, NetworkService, and QoSPolicy with owner/label metadata, dry-run/reconcile, typed get/inspect, and delete helpers
IPAM pure Go IPv4 CIDR planning, gateway/reserved/excluded address handling, allocation, release, availability, and overlap checks without running a persistent IPAM service
LinuxRouter optional Linux-only namespace router model with DNSMasq, SNAT/MASQUERADE/DNAT/port-forward/destination-map, firewall rules, fake executor tests, and a Linux command backend
Diagnostics read-only Diagnostics().Doctor checks for OVSDB connectivity, schema, table counts, port bindings, localnet ports, and OVS bridge mappings; Diagnostics().AuditOwnership, NetworkStatus, ProviderNetworkStatus, WorkloadPath, CleanupPlan, and AdoptPlan report owned resources, orphan/reference risks, and safe planning data
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
}

err = client.OpenFlow().
    WithEndpoint("tcp:127.0.0.1:6653").
    Bridge("br-ovnflow-it").
    EnsureFlow("allow-web").
    InPort(1).
    EthType(0x0800).
    IPv4Dst("10.20.0.10/32").
    TCPDst(80).
    Actions().Output(2).
    Execute(ctx)
if err != nil {
    return err
}

err = client.OVN().NB().
    VirtualNetwork("net-web").
    Ensure().
    WithCIDR("10.20.0.0/24").
    WithOwner("project", "alpha").
    WithDNS("net-web-dns", func(d *ovnflow.LogicalSwitchDNSBuilder) {
        d.AddRecord("api.service", "10.20.0.10", "10.20.0.11")
    }).
    Execute(ctx)
if err != nil {
    return err
}

err = client.SDWAN().
    Network("corp-wan").
    Ensure().
    Layer3().
    TopologyHubSpoke().
    WithTransport(ovnflow.SDWANTransportWireGuard).
    PathModeAuto().
    AddSite("edge-r", ovnflow.SDWANSite{Router: "edge-r", CIDRs: []string{"10.250.0.0/24"}, Relay: true}).
    AddSite("edge-a", ovnflow.SDWANSite{Router: "edge-a", CIDRs: []string{"10.10.0.0/16"}}).
    AddSite("edge-b", ovnflow.SDWANSite{Router: "edge-b", CIDRs: []string{"10.20.0.0/16"}}).
    AddLink(ovnflow.SDWANLink{From: "edge-a", To: "edge-b", PathMode: ovnflow.SDWANPathModeDirect}).
    Apply(ctx)
if err != nil {
    return err
}

agentPlane := ovnflow.NewInMemorySDWANControlPlane()
_, err = agentPlane.RegisterAgent(ctx, ovnflow.SDWANAgent{
    ID:   "edge-a-agent",
    Site: "edge-a",
    Capabilities: ovnflow.SDWANAgentCapabilities{
        Transports: []ovnflow.SDWANTransport{ovnflow.SDWANTransportWireGuard},
        Layers:     []ovnflow.SDWANLayer{ovnflow.SDWANLayerL3},
        Features:   []string{ovnflow.SDWANAgentFeatureWireGuard, ovnflow.SDWANAgentFeatureLinuxRoute},
    },
})
if err != nil {
    return err
}

linuxWAN, err := sdwanlinux.NewBackend(sdwanlinux.Config{
    LocalSite: "edge-a",
    OVS:       sdwanlinux.NewOVSManager(client.LocalOVS()),
    OpenFlow:  sdwanlinux.NewOpenFlowManager(client.OpenFlow().WithEndpoint("tcp:127.0.0.1:6653")),
})
if err != nil {
    return err
}
client.UseSDWANBackend(linuxWAN)

network, err := client.OVN().NB().VirtualNetwork("net-web").Get(ctx)
if err != nil {
    return err
}
_ = network

pool := ovnflow.IPAMPool{
    CIDR:     "10.20.0.0/24",
    Reserved: []string{"10.20.0.10"},
}
nextIP, err := pool.Allocate()
if err != nil {
    return err
}
_ = nextIP

err = client.OVN().NB().
    NetworkService("svc-web").
    Ensure().
    WithProtocol("tcp").
    WithOwner("project", "alpha").
    WithVIP("192.0.2.10", 80,
        ovnflow.ServiceBackend{Address: "10.20.0.10", Port: 8080},
        ovnflow.ServiceBackend{Address: "10.20.0.11", Port: 8080},
    ).
    Execute(ctx)
if err != nil {
    return err
}

err = client.OVN().NB().
    QoSPolicy("qos-web").
    Ensure().
    WithOwner("project", "alpha").
    AddRule(ovnflow.QoSRule{
        Name:      "limit-web",
        Direction: "from-lport",
        Priority:  100,
        Match:     `inport == "web-port"`,
        Rate:      1000000,
        Burst:     200000,
    }).
    Execute(ctx)
if err != nil {
    return err
}

err = client.ProviderNetwork("public-uplink").
    Ensure().
    WithPhysicalNetwork("physnet-public").
    OnLogicalSwitch("ls-public").
    WithLocalnetPort("ln-public").
    UseBridge("br-ex").
    WithOwner("project", "alpha").
    Execute(ctx)
if err != nil {
    return err
}

routerClient := linuxrouter.NewPlatformClientWithOVS(client.LocalOVS())
err = routerClient.Router("edge").Apply(ctx, linuxrouter.Router{
    Spec: linuxrouter.Spec{
        Namespace: "ovnflow-edge",
        Interfaces: []linuxrouter.Interface{{
            Name:    "lan0",
            Role:    linuxrouter.InterfaceLAN,
            Bridge:  "br-int",
            OVSPort: "edge-lan",
            Addresses: []string{"172.16.100.1/24"},
            InterfaceExternalIDs: map[string]string{
                "iface-id": "nsr-router-switch-00000001",
            },
        }},
    },
})
if err != nil {
    return err
}

report, err := client.Diagnostics().Doctor(ctx, ovnflow.DoctorOptions{})
if err != nil {
    return err
}
for _, finding := range report.Findings {
    log.Printf("%s %s: %s", finding.Severity, finding.Component, finding.Message)
}

audit, err := client.Diagnostics().AuditOwnership(ctx, ovnflow.OwnershipAuditOptions{
    Owner: ovnflow.OwnerRef{Kind: "project", Name: "alpha"},
})
if err != nil {
    return err
}
for _, finding := range audit.Findings {
    log.Printf("%s %s: %s", finding.Severity, finding.Code, finding.Message)
}

status, err := client.NetworkStatus(ctx, "net-web")
if err != nil {
    return err
}
_ = status

cleanup, err := client.CleanupPlan(ctx, ovnflow.CleanupPlanOptions{
    Owner: ovnflow.OwnerRef{Kind: "project", Name: "alpha"},
})
if err != nil {
    return err
}
_ = cleanup

The SDK stays neutral: platform concepts such as tenants, organizations, departments, users, approval flows, quotas, schedulers, and HA election belong in the caller's control plane. Map them onto OwnerRef, Labels, and ordinary metadata when calling ovnflow.

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 ./...

v2 schema and mutation gates are also available:

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

Live OpenFlow checks require ovs-vswitchd and an OpenFlow endpoint:

$env:OVNFLOW_OPENFLOW_ADDR="tcp:172.27.192.120:6653"
$env:OVNFLOW_OPENFLOW_CHECKS="1"
go test -tags=integration -run 'TestIntegrationOpenFlow(Endpoint|FluentEndpoint)Lifecycle' ./...

Linux SD-WAN backend checks are explicit gates. OVS tunnel checks use OVSDB; WireGuard and Linux route checks require root or CAP_NET_ADMIN:

OVNFLOW_SDWAN_BACKEND_CHECKS=1 OVNFLOW_OVS_TUNNEL_CHECKS=1 OVNFLOW_OPENFLOW_CHECKS=1 \
  go test -tags=integration -run 'TestIntegrationSDWAN(OVSTunnel|OpenFlowHook)Lifecycle' ./sdwanlinux

sudo -E env OVNFLOW_SDWAN_BACKEND_CHECKS=1 OVNFLOW_SDWAN_PRIVILEGED_CHECKS=1 \
  OVNFLOW_WIREGUARD_CHECKS=1 OVNFLOW_LINUX_ROUTE_CHECKS=1 \
  go test -tags=integration -run TestIntegrationSDWANWireGuardLinuxRouteLifecycle ./sdwanlinux

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. The delivered v2.0.0 high-level, platform-neutral intent APIs are recorded in v2.0 acceptance. The v2.1 implementation boundary is in v2.1 plan. The native OpenFlow and SD-WAN foundation boundary is in v2.2 plan. The v2.3 production backend scope is in v2.3 plan. Future v2.x candidates and deeper hardening work are tracked in roadmap.

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/v2"
)

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/v2"
)

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/v2"
)

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:
	}
}
Example (V2IntentLifecycle)
package main

import (
	"context"

	"github.com/firstmeet/ovnflow/v2"
)

func main() {
	ctx := context.Background()
	client, err := ovnflow.Connect(ctx, ovnflow.ConfigFromEnv())
	if err != nil {
		return
	}
	defer client.Close()

	nb := client.OVN().NB()
	_ = nb.VirtualNetwork("net-web").
		Ensure().
		WithCIDR("10.20.0.0/24").
		WithGateway("10.20.0.1").
		WithOwner("project", "alpha").
		WithLabel("env", "prod").
		WithDNS("net-web-dns", func(d *ovnflow.LogicalSwitchDNSBuilder) {
			d.AddRecord("api.service", "10.20.0.10", "10.20.0.11")
		}).
		Execute(ctx)

	_ = nb.WorkloadAttachment("vm-1001-eth0").
		Ensure().
		OnNetwork("net-web").
		WithWorkload("vm-1001").
		WithInterface("eth0").
		WithMAC("00:16:3e:11:22:33").
		WithIP("10.20.0.10").
		WithOwner("project", "alpha").
		Execute(ctx)

	_ = nb.SecurityPolicy("pg-web").
		Ensure().
		ForSubject("pg-web").
		WithOwner("project", "alpha").
		AddRule(ovnflow.SecurityRule{
			Name:     "allow-http",
			Action:   "allow",
			Protocol: "tcp",
			CIDRs:    []string{"10.20.0.0/24"},
			Ports:    []int{80},
		}).
		Execute(ctx)

	_, _ = nb.VirtualNetwork("net-web").Get(ctx)
	_ = nb.WorkloadAttachment("vm-1001-eth0").Delete(ctx)
	_ = nb.LogicalSwitchDNS("net-web-dns").Delete(ctx)
	_ = nb.SecurityPolicy("pg-web").Delete(ctx)
	_ = nb.VirtualNetwork("net-web").Delete(ctx)
}

Index

Examples

Constants

View Source
const (
	DoctorInfo    DoctorSeverity = "info"
	DoctorWarning DoctorSeverity = "warning"
	DoctorError   DoctorSeverity = "error"

	DiagnosticPass DiagnosticStatus = "pass"
	DiagnosticWarn DiagnosticStatus = "warn"
	DiagnosticFail DiagnosticStatus = "fail"
	DiagnosticSkip DiagnosticStatus = "skip"

	DiagnosticCheckConnections   DiagnosticCheck = "connections"
	DiagnosticCheckSchema        DiagnosticCheck = "schema"
	DiagnosticCheckCounts        DiagnosticCheck = "counts"
	DiagnosticCheckBindings      DiagnosticCheck = "bindings"
	DiagnosticCheckBridgeMapping DiagnosticCheck = "bridge_mappings"
	DiagnosticCheckHeavyTables   DiagnosticCheck = "heavy_tables"
)
View Source
const (
	EnvV2SchemaChecks        = "OVNFLOW_V2_SCHEMA_CHECKS"
	EnvV2MutationChecks      = "OVNFLOW_V2_MUTATION_CHECKS"
	EnvLinuxRouterChecks     = "OVNFLOW_LINUX_ROUTER_CHECKS"
	EnvLinuxRouterNATBackend = "OVNFLOW_NAT_BACKEND"
	EnvOpenFlowChecks        = "OVNFLOW_OPENFLOW_CHECKS"
	EnvSDWANBackendChecks    = "OVNFLOW_SDWAN_BACKEND_CHECKS"
	EnvSDWANPrivilegedChecks = "OVNFLOW_SDWAN_PRIVILEGED_CHECKS"
	EnvWireGuardChecks       = "OVNFLOW_WIREGUARD_CHECKS"
	EnvOVSTunnelChecks       = "OVNFLOW_OVS_TUNNEL_CHECKS"
	EnvLinuxRouteChecks      = "OVNFLOW_LINUX_ROUTE_CHECKS"

	NATBackendAuto     = "auto"
	NATBackendNFTables = "nftables"
	NATBackendIPTables = "iptables"
)
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"

	// EnvOpenFlowAddr points at an OpenFlow controller endpoint exposed by OVS,
	// for example tcp:127.0.0.1:6653.
	EnvOpenFlowAddr = "OVNFLOW_OPENFLOW_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"
)
View Source
const (
	OpenFlowPortAny        uint32 = 0xffffffff
	OpenFlowGroupAny       uint32 = 0xffffffff
	OpenFlowControllerPort uint32 = 0xfffffffd
)
View Source
const (
	ExternalIDPrefix = "ovnflow.io/"

	ExternalIDManagedByKey  = ExternalIDPrefix + "managed-by"
	ExternalIDAPIVersionKey = ExternalIDPrefix + "api-version"
	ExternalIDKindKey       = ExternalIDPrefix + "kind"
	ExternalIDNameKey       = ExternalIDPrefix + "name"
	ExternalIDOwnerKindKey  = ExternalIDPrefix + "owner-kind"
	ExternalIDOwnerNameKey  = ExternalIDPrefix + "owner-name"
	ExternalIDOwnerIDKey    = ExternalIDPrefix + "owner-id"
	ExternalIDLabelPrefix   = ExternalIDPrefix + "label/"
)
View Source
const (
	SDWANAgentFeatureWireGuard  = "wireguard"
	SDWANAgentFeatureLinuxRoute = "linux-route"
	SDWANAgentFeatureOVSTunnel  = "ovs-tunnel"
	SDWANAgentFeatureOpenFlow   = "openflow"
)

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}
	ErrUnsupported        = &Error{Kind: ErrorUnsupported}
	ErrPermissionDenied   = &Error{Kind: ErrorPermissionDenied}
	ErrAmbiguous          = &Error{Kind: ErrorAmbiguous}
	ErrOwnershipViolation = &Error{Kind: ErrorOwnershipViolation}
	ErrBackendUnavailable = &Error{Kind: ErrorBackendUnavailable}
)

Functions

func DecodeExternalIDLabelKey

func DecodeExternalIDLabelKey(externalIDKey string) (string, bool)

func EnvGateEnabled

func EnvGateEnabled(value string) bool

func ExternalIDLabelKey

func ExternalIDLabelKey(labelKey string) string

ExternalIDLabelKey encodes an arbitrary label key as an external_ids key. The suffix is raw URL-safe base64 without padding.

func FormatBridgeMappings

func FormatBridgeMappings(mappings map[string]string) string

func IsKind

func IsKind(err error, kind ErrorKind) bool

IsKind reports whether err is an ovnflow error of kind.

func IsReservedExternalIDKey

func IsReservedExternalIDKey(key string) bool

func MarshalOpenFlowMessage added in v2.2.0

func MarshalOpenFlowMessage(msg OpenFlowMessage) ([]byte, error)

func OwnershipMatches

func OwnershipMatches(externalIDs map[string]string, owner OwnerRef) bool

func ParseBridgeMappings

func ParseBridgeMappings(raw string) (map[string]string, error)

func ParseOpenFlowMultipartReply added in v2.2.0

func ParseOpenFlowMultipartReply(msg OpenFlowMessage) (uint16, uint16, []byte, error)

func ValidNATBackend

func ValidNATBackend(value string) bool

func WriteOpenFlowMessage added in v2.2.0

func WriteOpenFlowMessage(w io.Writer, msg OpenFlowMessage) error

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 AdoptCandidate added in v2.1.0

type AdoptCandidate struct {
	Database          string                 `json:"database"`
	Table             string                 `json:"table"`
	UUID              string                 `json:"uuid,omitempty"`
	Kind              string                 `json:"kind,omitempty"`
	Name              string                 `json:"name,omitempty"`
	Owner             OwnerRef               `json:"owner"`
	Owned             bool                   `json:"owned"`
	MarkerComplete    bool                   `json:"marker_complete"`
	Risk              CleanupRisk            `json:"risk"`
	RecommendedAction CleanupAction          `json:"recommended_action"`
	Reasons           []string               `json:"reasons,omitempty"`
	Resource          OwnershipAuditResource `json:"resource"`
}

type AdoptPlan added in v2.1.0

type AdoptPlan struct {
	Candidates []AdoptCandidate        `json:"candidates"`
	Findings   []OwnershipAuditFinding `json:"findings,omitempty"`
	ReadOnly   bool                    `json:"read_only"`
}

func NewAdoptPlanFromAudit added in v2.1.0

func NewAdoptPlanFromAudit(audit *OwnershipAuditReport, opts AdoptPlanOptions) *AdoptPlan

func (*AdoptPlan) ExecutableCandidates added in v2.1.0

func (p *AdoptPlan) ExecutableCandidates() []AdoptCandidate

type AdoptPlanOptions added in v2.1.0

type AdoptPlanOptions struct {
	Audit *OwnershipAuditReport
	Owner OwnerRef
	Kinds []string
	Names []string
}

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 CleanupAction added in v2.1.0

type CleanupAction string
const (
	CleanupActionKeep         CleanupAction = "keep"
	CleanupActionReview       CleanupAction = "review"
	CleanupActionDeleteOwned  CleanupAction = "delete_owned"
	AdoptActionImport         CleanupAction = "import"
	AdoptActionCompleteMarker CleanupAction = "complete_marker"
)

type CleanupCandidate added in v2.1.0

type CleanupCandidate struct {
	Database          string                 `json:"database"`
	Table             string                 `json:"table"`
	UUID              string                 `json:"uuid,omitempty"`
	Kind              string                 `json:"kind,omitempty"`
	Name              string                 `json:"name,omitempty"`
	Owner             OwnerRef               `json:"owner"`
	Owned             bool                   `json:"owned"`
	MarkerComplete    bool                   `json:"marker_complete"`
	Risk              CleanupRisk            `json:"risk"`
	RecommendedAction CleanupAction          `json:"recommended_action"`
	Reasons           []string               `json:"reasons,omitempty"`
	Resource          OwnershipAuditResource `json:"resource"`
}

type CleanupPlan added in v2.1.0

type CleanupPlan struct {
	Candidates []CleanupCandidate      `json:"candidates"`
	Findings   []OwnershipAuditFinding `json:"findings,omitempty"`
	ReadOnly   bool                    `json:"read_only"`
}

func NewCleanupPlanFromAudit added in v2.1.0

func NewCleanupPlanFromAudit(audit *OwnershipAuditReport, opts CleanupPlanOptions) *CleanupPlan

func (*CleanupPlan) ExecutableCandidates added in v2.1.0

func (p *CleanupPlan) ExecutableCandidates() []CleanupCandidate

type CleanupPlanOptions added in v2.1.0

type CleanupPlanOptions struct {
	Audit *OwnershipAuditReport
	Owner OwnerRef
	Kinds []string
	Names []string
}

type CleanupRisk added in v2.1.0

type CleanupRisk string
const (
	CleanupRiskLow    CleanupRisk = "low"
	CleanupRiskMedium CleanupRisk = "medium"
	CleanupRiskHigh   CleanupRisk = "high"
)

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) AdoptPlan added in v2.1.0

func (c *Client) AdoptPlan(ctx context.Context, opts AdoptPlanOptions) (*AdoptPlan, error)

func (*Client) CleanupPlan added in v2.1.0

func (c *Client) CleanupPlan(ctx context.Context, opts CleanupPlanOptions) (*CleanupPlan, error)

func (*Client) Close

func (c *Client) Close()

Close closes all underlying OVSDB connections.

func (*Client) Diagnostics

func (c *Client) Diagnostics() *Diagnostics

func (*Client) Doctor

func (c *Client) Doctor() *Doctor

func (*Client) LocalOVS

func (c *Client) LocalOVS() *OVSClient

LocalOVS returns the local Open_vSwitch API.

func (*Client) NetworkStatus added in v2.1.0

func (c *Client) NetworkStatus(ctx context.Context, name string) (*NetworkStatus, error)

func (*Client) OVN

func (c *Client) OVN() OVN

OVN returns OVN Northbound and Southbound APIs.

func (*Client) OpenFlow added in v2.2.0

func (c *Client) OpenFlow() *OpenFlowClient

OpenFlow returns native OpenFlow APIs for local Open_vSwitch bridges.

func (*Client) ProviderNetwork

func (c *Client) ProviderNetwork(name string) *ProviderNetworkRef

func (*Client) ProviderNetworkStatus added in v2.1.0

func (c *Client) ProviderNetworkStatus(ctx context.Context, name string) (*ProviderNetworkStatus, error)

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.

func (*Client) SDWAN added in v2.2.0

func (c *Client) SDWAN() *SDWANClient

func (*Client) UseSDWANBackend added in v2.2.0

func (c *Client) UseSDWANBackend(backend SDWANBackend) *Client

UseSDWANBackend sets the backend used by Client.SDWAN.

func (*Client) WorkloadAttachment

func (c *Client) WorkloadAttachment(name string) *WorkloadAttachmentRef

func (*Client) WorkloadPath added in v2.1.0

func (c *Client) WorkloadPath(ctx context.Context, name string) (*WorkloadPathStatus, error)

type Config

type Config struct {
	OVSAddr   string
	OVNNBAddr string
	OVNSBAddr string
	OpenFlow  OpenFlowConfig
	SDWAN     SDWANBackend
}

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 DNSRecord

type DNSRecord struct {
	Domain string
	IPs    []string
}

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 DiagnosticCheck

type DiagnosticCheck string

type DiagnosticCheckResult

type DiagnosticCheckResult struct {
	Name    DiagnosticCheck  `json:"name"`
	Status  DiagnosticStatus `json:"status"`
	Message string           `json:"message,omitempty"`
}

type DiagnosticStatus

type DiagnosticStatus string

type Diagnostics

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

func (*Diagnostics) AuditOwnership

func (*Diagnostics) Doctor

func (d *Diagnostics) Doctor(ctx context.Context, opts DoctorOptions) (*DoctorReport, error)

type Diff

type Diff struct {
	Resource string
	Name     string
	Changes  []DiffChange
}

func (Diff) Empty

func (d Diff) Empty() bool

type DiffChange

type DiffChange struct {
	Path   string
	Before any
	After  any
}

type Doctor

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

func (*Doctor) Run

func (d *Doctor) Run(ctx context.Context) (*DoctorReport, error)

type DoctorDatabaseReport

type DoctorDatabaseReport struct {
	Name          string `json:"name"`
	Address       string `json:"address,omitempty"`
	SchemaVersion string `json:"schema_version,omitempty"`
	Connected     bool   `json:"connected"`
	Error         string `json:"error,omitempty"`
}

type DoctorFinding

type DoctorFinding struct {
	Severity  DoctorSeverity    `json:"severity"`
	Component string            `json:"component"`
	Code      string            `json:"code"`
	Message   string            `json:"message"`
	Details   map[string]string `json:"details,omitempty"`
}

type DoctorNorthboundReport

type DoctorNorthboundReport struct {
	LogicalSwitches       int `json:"logical_switches"`
	LogicalSwitchPorts    int `json:"logical_switch_ports"`
	LogicalRouters        int `json:"logical_routers"`
	LogicalRouterPorts    int `json:"logical_router_ports"`
	ACLs                  int `json:"acls"`
	NATs                  int `json:"nats"`
	LoadBalancers         int `json:"load_balancers"`
	DNSRecords            int `json:"dns_records"`
	DHCPOptions           int `json:"dhcp_options"`
	ProviderLocalnetPorts int `json:"provider_localnet_ports"`
}

type DoctorOVSReport

type DoctorOVSReport struct {
	Bridges        int               `json:"bridges"`
	Ports          int               `json:"ports"`
	Interfaces     int               `json:"interfaces"`
	BridgeMappings map[string]string `json:"bridge_mappings,omitempty"`
	Managers       int               `json:"managers"`
	Controllers    int               `json:"controllers"`
}

type DoctorOptions

type DoctorOptions struct {
	Checks       []DiagnosticCheck
	IncludeHeavy bool
}

type DoctorReport

type DoctorReport struct {
	Databases  map[string]DoctorDatabaseReport `json:"databases"`
	TableRows  map[string]map[string]int       `json:"table_rows"`
	Checks     []DiagnosticCheckResult         `json:"checks"`
	Northbound DoctorNorthboundReport          `json:"northbound"`
	Southbound DoctorSouthboundReport          `json:"southbound"`
	OVS        DoctorOVSReport                 `json:"ovs"`
	Findings   []DoctorFinding                 `json:"findings"`
}

type DoctorSeverity

type DoctorSeverity string

type DoctorSouthboundReport

type DoctorSouthboundReport struct {
	Chassis             int `json:"chassis"`
	Datapaths           int `json:"datapaths"`
	PortBindings        int `json:"port_bindings"`
	BoundPortBindings   int `json:"bound_port_bindings"`
	UnboundPortBindings int `json:"unbound_port_bindings"`
	LogicalFlows        int `json:"logical_flows"`
	ServiceMonitors     int `json:"service_monitors"`
}

type DryRunResult

type DryRunResult struct {
	Plan Plan
	Diff Diff
}

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"
	ErrorUnsupported        ErrorKind = "unsupported"
	ErrorPermissionDenied   ErrorKind = "permission_denied"
	ErrorAmbiguous          ErrorKind = "ambiguous"
	ErrorOwnershipViolation ErrorKind = "ownership_violation"
	ErrorBackendUnavailable ErrorKind = "backend_unavailable"
)

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 IPAMPool added in v2.1.0

type IPAMPool struct {
	CIDR      string
	Gateway   string
	Reserved  []string
	Allocated []string
	Excluded  []string
}

IPAMPool describes an in-memory IPv4 address pool for preflight planning.

Gateway defaults to the first usable address in CIDR when omitted. Reserved and Excluded addresses are never allocated. Allocated is updated by Allocate and Release, but no state is persisted outside this struct.

func NewIPAMPool added in v2.1.0

func NewIPAMPool(cidr string) *IPAMPool

NewIPAMPool returns a pool with the requested CIDR. The pool is validated by planning and allocation helpers so callers can build it incrementally.

func (*IPAMPool) Allocate added in v2.1.0

func (pool *IPAMPool) Allocate(requested ...string) (string, error)

Allocate reserves the requested IPv4 address, or the next sequential address when requested is omitted. The returned address is appended to pool.Allocated.

func (IPAMPool) Available added in v2.1.0

func (pool IPAMPool) Available() (int, error)

Available reports the number of currently allocatable IPv4 addresses.

func (IPAMPool) Contains added in v2.1.0

func (pool IPAMPool) Contains(ip string) (bool, error)

Contains reports whether ip is inside pool.CIDR.

func (IPAMPool) Overlaps added in v2.1.0

func (pool IPAMPool) Overlaps(cidr string) (bool, error)

Overlaps reports whether cidr intersects pool.CIDR.

func (*IPAMPool) Release added in v2.1.0

func (pool *IPAMPool) Release(ip string) error

Release removes ip from pool.Allocated.

type IPAllocationPlan added in v2.1.0

type IPAllocationPlan struct {
	PoolCIDR  string
	Gateway   string
	Reserved  []string
	Allocated []string
	Excluded  []string
	Available int
	Next      string
}

IPAllocationPlan is a snapshot of an IPAMPool's effective allocation state.

func PlanIPAllocation added in v2.1.0

func PlanIPAllocation(pool IPAMPool) (IPAllocationPlan, error)

PlanIPAllocation validates pool and returns its effective gateway, exclusions, availability count, and next sequential allocation candidate.

type InMemorySDWANBackend added in v2.2.0

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

func NewInMemorySDWANBackend added in v2.2.0

func NewInMemorySDWANBackend() *InMemorySDWANBackend

func (*InMemorySDWANBackend) ApplySDWAN added in v2.2.0

func (b *InMemorySDWANBackend) ApplySDWAN(_ context.Context, network SDWANNetwork, plan SDWANApplyPlan) error

func (*InMemorySDWANBackend) DeleteSDWAN added in v2.2.0

func (b *InMemorySDWANBackend) DeleteSDWAN(_ context.Context, name string) error

func (*InMemorySDWANBackend) GetSDWAN added in v2.2.0

func (b *InMemorySDWANBackend) GetSDWAN(_ context.Context, name string) (*SDWANNetwork, error)

func (*InMemorySDWANBackend) LastPlan added in v2.2.0

func (b *InMemorySDWANBackend) LastPlan(name string) (SDWANApplyPlan, bool)

type InMemorySDWANControlPlane added in v2.3.0

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

func NewInMemorySDWANControlPlane added in v2.3.0

func NewInMemorySDWANControlPlane() *InMemorySDWANControlPlane

func (*InMemorySDWANControlPlane) AckAssignment added in v2.3.0

func (*InMemorySDWANControlPlane) AssignSDWAN added in v2.3.0

func (c *InMemorySDWANControlPlane) AssignSDWAN(_ context.Context, agentID string, network SDWANNetwork, plan SDWANApplyPlan) (*SDWANAssignment, error)

func (*InMemorySDWANControlPlane) GetAgent added in v2.3.0

func (*InMemorySDWANControlPlane) GetAssignment added in v2.3.0

func (*InMemorySDWANControlPlane) Heartbeat added in v2.3.0

func (*InMemorySDWANControlPlane) ListAgents added in v2.3.0

func (*InMemorySDWANControlPlane) ListAssignments added in v2.3.0

func (c *InMemorySDWANControlPlane) ListAssignments(_ context.Context, agentID string) ([]SDWANAssignment, error)

func (*InMemorySDWANControlPlane) RegisterAgent added in v2.3.0

func (c *InMemorySDWANControlPlane) RegisterAgent(_ context.Context, agent SDWANAgent) (*SDWANAgent, error)

type InspectResult

type InspectResult struct {
	Resource string
	Name     string
	Status   any
}

type IntegrationConfig

type IntegrationConfig struct {
	OVSAddr        string
	OVNNBAddr      string
	OVNSBAddr      string
	OpenFlowAddr   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 IntentAction

type IntentAction string
const (
	IntentActionEnsure  IntentAction = "ensure"
	IntentActionDelete  IntentAction = "delete"
	IntentActionInspect IntentAction = "inspect"
	IntentActionPatch   IntentAction = "patch"
)

type IntentPlanner

type IntentPlanner interface {
	Plan(context.Context) (Plan, error)
}

type Labels

type Labels map[string]string

Labels carries portable grouping metadata without embedding private platform concepts in the SDK.

func (Labels) Validate

func (l Labels) Validate() error

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

func (b *LogicalSwitchBuilder) AddLocalnetPort(name, networkName string) *LogicalSwitchPortBuilder

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 LogicalSwitchDNS

type LogicalSwitchDNS struct {
	Name    string
	Records []DNSRecord
	Owner   OwnerRef
	Labels  Labels
}

func (LogicalSwitchDNS) RecordMap

func (d LogicalSwitchDNS) RecordMap() map[string][]string

func (LogicalSwitchDNS) Validate

func (d LogicalSwitchDNS) Validate() error

type LogicalSwitchDNSBuilder

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

func (*LogicalSwitchDNSBuilder) AddRecord

func (b *LogicalSwitchDNSBuilder) AddRecord(domain string, ips ...string) *LogicalSwitchDNSBuilder

func (*LogicalSwitchDNSBuilder) DryRun

func (*LogicalSwitchDNSBuilder) Plan

func (*LogicalSwitchDNSBuilder) Reconcile

func (*LogicalSwitchDNSBuilder) Validate

func (b *LogicalSwitchDNSBuilder) Validate() error

func (*LogicalSwitchDNSBuilder) WithLabel

func (b *LogicalSwitchDNSBuilder) WithLabel(key, value string) *LogicalSwitchDNSBuilder

func (*LogicalSwitchDNSBuilder) WithOwner

func (b *LogicalSwitchDNSBuilder) WithOwner(kind, name string) *LogicalSwitchDNSBuilder

type LogicalSwitchDNSPatch

type LogicalSwitchDNSPatch struct {
	ReplaceRecords bool
	Records        []DNSRecord
	AddRecords     []DNSRecord
	RemoveDomains  []string
	Owner          *OwnerRef
	Labels         Labels
	RemoveLabels   []string
}

type LogicalSwitchDNSRef

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

func (*LogicalSwitchDNSRef) Apply

func (*LogicalSwitchDNSRef) Delete

func (r *LogicalSwitchDNSRef) Delete(ctx context.Context) error

func (*LogicalSwitchDNSRef) Ensure

func (*LogicalSwitchDNSRef) Get

func (*LogicalSwitchDNSRef) Inspect

func (*LogicalSwitchDNSRef) Patch

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

func (p *LogicalSwitchPortBuilder) AsLocalnet(networkName string) *LogicalSwitchPortBuilder

func (*LogicalSwitchPortBuilder) Execute

func (*LogicalSwitchPortBuilder) WithAddress

func (p *LogicalSwitchPortBuilder) WithAddress(mac, ip string) *LogicalSwitchPortBuilder

func (*LogicalSwitchPortBuilder) WithAddresses

func (p *LogicalSwitchPortBuilder) WithAddresses(addresses ...string) *LogicalSwitchPortBuilder

func (*LogicalSwitchPortBuilder) WithExternalID

func (p *LogicalSwitchPortBuilder) WithExternalID(key, value string) *LogicalSwitchPortBuilder

func (*LogicalSwitchPortBuilder) WithIP

func (*LogicalSwitchPortBuilder) WithMac

func (*LogicalSwitchPortBuilder) WithOption

func (p *LogicalSwitchPortBuilder) WithOption(key, value string) *LogicalSwitchPortBuilder

func (*LogicalSwitchPortBuilder) WithType

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

func (n *NBClient) LogicalSwitchDNS(name string) *LogicalSwitchDNSRef

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) NetworkService added in v2.1.0

func (n *NBClient) NetworkService(name string) *NetworkServiceRef

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) QoSPolicy added in v2.1.0

func (n *NBClient) QoSPolicy(name string) *QoSPolicyRef

func (*NBClient) SSL

func (n *NBClient) SSL() *TableRef

func (*NBClient) SecurityPolicy

func (n *NBClient) SecurityPolicy(name string) *SecurityPolicyRef

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

func (*NBClient) VirtualNetwork

func (n *NBClient) VirtualNetwork(name string) *VirtualNetworkRef

func (*NBClient) WorkloadAttachment

func (n *NBClient) WorkloadAttachment(name string) *WorkloadAttachmentRef

type NetworkService added in v2.1.0

type NetworkService struct {
	Name           string
	VIPs           []ServiceVIP
	Protocol       string
	AttachToRouter string
	Owner          OwnerRef
	Labels         Labels
}

func (NetworkService) Validate added in v2.1.0

func (s NetworkService) Validate() error

type NetworkServiceBuilder added in v2.1.0

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

func (*NetworkServiceBuilder) AttachToRouter added in v2.1.0

func (b *NetworkServiceBuilder) AttachToRouter(name string) *NetworkServiceBuilder

func (*NetworkServiceBuilder) DryRun added in v2.1.0

func (*NetworkServiceBuilder) Execute added in v2.1.0

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

func (*NetworkServiceBuilder) Plan added in v2.1.0

func (*NetworkServiceBuilder) Reconcile added in v2.1.0

func (*NetworkServiceBuilder) Validate added in v2.1.0

func (b *NetworkServiceBuilder) Validate() error

func (*NetworkServiceBuilder) WithLabel added in v2.1.0

func (b *NetworkServiceBuilder) WithLabel(key, value string) *NetworkServiceBuilder

func (*NetworkServiceBuilder) WithOwner added in v2.1.0

func (b *NetworkServiceBuilder) WithOwner(kind, name string) *NetworkServiceBuilder

func (*NetworkServiceBuilder) WithOwnerID added in v2.1.0

func (b *NetworkServiceBuilder) WithOwnerID(kind, id string) *NetworkServiceBuilder

func (*NetworkServiceBuilder) WithProtocol added in v2.1.0

func (b *NetworkServiceBuilder) WithProtocol(protocol string) *NetworkServiceBuilder

func (*NetworkServiceBuilder) WithVIP added in v2.1.0

func (b *NetworkServiceBuilder) WithVIP(address string, port int, backends ...ServiceBackend) *NetworkServiceBuilder

func (*NetworkServiceBuilder) WithVIPString added in v2.1.0

func (b *NetworkServiceBuilder) WithVIPString(vip string, backends ...string) *NetworkServiceBuilder

type NetworkServiceDeleteBuilder added in v2.1.0

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

func (*NetworkServiceDeleteBuilder) Execute added in v2.1.0

func (*NetworkServiceDeleteBuilder) Plan added in v2.1.0

type NetworkServiceRef added in v2.1.0

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

func (*NetworkServiceRef) Apply added in v2.1.0

func (r *NetworkServiceRef) Apply(ctx context.Context, service NetworkService) error

func (*NetworkServiceRef) Delete added in v2.1.0

func (*NetworkServiceRef) Ensure added in v2.1.0

func (*NetworkServiceRef) Get added in v2.1.0

func (*NetworkServiceRef) Patch added in v2.1.0

type NetworkStatus added in v2.1.0

type NetworkStatus struct {
	Name      string                `json:"name"`
	State     ResourceStatusState   `json:"state"`
	Network   *VirtualNetwork       `json:"network,omitempty"`
	Doctor    *DoctorReport         `json:"doctor,omitempty"`
	Ownership *OwnershipAuditReport `json:"ownership,omitempty"`
	Findings  []StatusFinding       `json:"findings,omitempty"`
	Degraded  bool                  `json:"degraded"`
	ReadOnly  bool                  `json:"read_only"`
}

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

func (o *OVSClient) DeleteBridgeMapping(ctx context.Context, physicalNetwork, bridge string) error

func (*OVSClient) EnsureBridgeMapping

func (o *OVSClient) EnsureBridgeMapping(ctx context.Context, physicalNetwork, bridge string) error

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

func (o *OVSClient) GetBridgeMappings(ctx context.Context) (map[string]string, error)

func (*OVSClient) GetInterface

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

func (*OVSClient) GetInterfaceByUUID added in v2.0.1

func (o *OVSClient) GetInterfaceByUUID(ctx context.Context, uuid string) (*OVSInterface, error)

func (*OVSClient) GetOpenVSwitch

func (o *OVSClient) GetOpenVSwitch(ctx context.Context) (*OpenVSwitch, 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 OpenFlowAction added in v2.2.0

type OpenFlowAction struct {
	Type  OpenFlowActionType
	Port  uint32
	Field string
	Value string
}

type OpenFlowActionType added in v2.2.0

type OpenFlowActionType string
const (
	OpenFlowActionOutput   OpenFlowActionType = "output"
	OpenFlowActionSetField OpenFlowActionType = "set_field"
)

type OpenFlowActionsBuilder added in v2.2.0

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

func (*OpenFlowActionsBuilder) Output added in v2.2.0

func (*OpenFlowActionsBuilder) SetField added in v2.2.0

func (a *OpenFlowActionsBuilder) SetField(field, value string) *OpenFlowRuleBuilder

type OpenFlowBridgeRef added in v2.2.0

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

func (*OpenFlowBridgeRef) DeleteFlow added in v2.2.0

func (r *OpenFlowBridgeRef) DeleteFlow(name string) *OpenFlowRuleBuilder

func (*OpenFlowBridgeRef) EnsureFlow added in v2.2.0

func (r *OpenFlowBridgeRef) EnsureFlow(name string) *OpenFlowRuleBuilder

type OpenFlowClient added in v2.2.0

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

func NewOpenFlowClient added in v2.2.0

func NewOpenFlowClient(config OpenFlowConfig) *OpenFlowClient

func NewOpenFlowClientWithDialer added in v2.2.0

func NewOpenFlowClientWithDialer(config OpenFlowConfig, dialer OpenFlowDialer) *OpenFlowClient

func (*OpenFlowClient) AutoConfigureBridgeController added in v2.2.0

func (c *OpenFlowClient) AutoConfigureBridgeController(target string) *OpenFlowClient

func (*OpenFlowClient) Bridge added in v2.2.0

func (c *OpenFlowClient) Bridge(name string) *OpenFlowBridgeRef

func (*OpenFlowClient) ConfigureBridgeController added in v2.2.0

func (c *OpenFlowClient) ConfigureBridgeController(ctx context.Context, bridge string) error

func (*OpenFlowClient) Dial added in v2.2.0

func (*OpenFlowClient) WithDialer added in v2.2.0

func (c *OpenFlowClient) WithDialer(dialer OpenFlowDialer) *OpenFlowClient

func (*OpenFlowClient) WithEndpoint added in v2.2.0

func (c *OpenFlowClient) WithEndpoint(endpoint string) *OpenFlowClient

func (*OpenFlowClient) WithVersions added in v2.2.0

func (c *OpenFlowClient) WithVersions(versions ...OpenFlowVersion) *OpenFlowClient

type OpenFlowConfig added in v2.2.0

type OpenFlowConfig struct {
	Endpoint                      string
	Versions                      []OpenFlowVersion
	AutoConfigureBridgeController bool
	ControllerTarget              string
	ConnectTimeout                time.Duration
}

type OpenFlowDialer added in v2.2.0

type OpenFlowDialer interface {
	DialContext(ctx context.Context, network, address string) (net.Conn, error)
}

type OpenFlowFeatures added in v2.2.0

type OpenFlowFeatures struct {
	Version      OpenFlowVersion
	XID          uint32
	DatapathID   uint64
	Buffers      uint32
	Tables       uint8
	AuxiliaryID  uint8
	Capabilities uint32
}

func ParseOpenFlowFeatures added in v2.2.0

func ParseOpenFlowFeatures(msg OpenFlowMessage) (OpenFlowFeatures, error)

type OpenFlowFlow added in v2.2.0

type OpenFlowFlow struct {
	Name         string
	Bridge       string
	Cookie       uint64
	CookieMask   uint64
	TableID      uint8
	Priority     uint16
	IdleTimeout  uint16
	HardTimeout  uint16
	Importance   uint16
	Match        OpenFlowMatch
	Instructions []OpenFlowInstruction
	Actions      []OpenFlowAction
	Owner        OwnerRef
	Labels       Labels
}

type OpenFlowFlowStatsRequest added in v2.2.0

type OpenFlowFlowStatsRequest struct {
	TableID    *uint8
	OutPort    uint32
	OutGroup   uint32
	Cookie     uint64
	CookieMask uint64
	Match      OpenFlowMatch
}

type OpenFlowInstruction added in v2.2.0

type OpenFlowInstruction struct {
	GotoTable     *uint8
	ClearActions  bool
	WriteMetadata *OpenFlowMetadata
	Actions       []OpenFlowAction
}

type OpenFlowMatch added in v2.2.0

type OpenFlowMatch struct {
	InPort   *uint32
	Metadata *OpenFlowMetadata
	EthSrc   string
	EthDst   string
	EthType  *uint16
	VLANVID  *uint16
	IPProto  *uint8
	IPv4Src  string
	IPv4Dst  string
	TCPSrc   *uint16
	TCPDst   *uint16
	UDPSrc   *uint16
	UDPDst   *uint16
}

func ParseOpenFlowMatch added in v2.2.0

func ParseOpenFlowMatch(data []byte) (OpenFlowMatch, error)

type OpenFlowMessage added in v2.2.0

type OpenFlowMessage struct {
	Version OpenFlowVersion
	Type    uint8
	XID     uint32
	Body    []byte
}

func MarshalOpenFlowFlowMod added in v2.2.0

func MarshalOpenFlowFlowMod(version OpenFlowVersion, xid uint32, command uint8, flow OpenFlowFlow) (OpenFlowMessage, error)

func MarshalOpenFlowFlowStatsRequest added in v2.2.0

func MarshalOpenFlowFlowStatsRequest(version OpenFlowVersion, xid uint32, request OpenFlowFlowStatsRequest) (OpenFlowMessage, error)

func OpenFlowFeaturesRequest added in v2.2.0

func OpenFlowFeaturesRequest(version OpenFlowVersion, xid uint32) (OpenFlowMessage, error)

func OpenFlowHelloMessage added in v2.2.0

func OpenFlowHelloMessage(version OpenFlowVersion, xid uint32, versions ...OpenFlowVersion) (OpenFlowMessage, error)

func ParseOpenFlowMessage added in v2.2.0

func ParseOpenFlowMessage(data []byte) (OpenFlowMessage, error)

func ReadOpenFlowMessage added in v2.2.0

func ReadOpenFlowMessage(r io.Reader) (OpenFlowMessage, error)

type OpenFlowMetadata added in v2.2.0

type OpenFlowMetadata struct {
	Value uint64
	Mask  uint64
}

type OpenFlowProtocolError added in v2.2.0

type OpenFlowProtocolError struct {
	Version OpenFlowVersion
	XID     uint32
	Type    uint16
	Code    uint16
	Data    []byte
}

func ParseOpenFlowProtocolError added in v2.2.0

func ParseOpenFlowProtocolError(msg OpenFlowMessage) (*OpenFlowProtocolError, error)

func (*OpenFlowProtocolError) Error added in v2.2.0

func (e *OpenFlowProtocolError) Error() string

type OpenFlowRuleBuilder added in v2.2.0

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

func (*OpenFlowRuleBuilder) Actions added in v2.2.0

func (*OpenFlowRuleBuilder) Cookie added in v2.2.0

func (b *OpenFlowRuleBuilder) Cookie(cookie uint64) *OpenFlowRuleBuilder

func (*OpenFlowRuleBuilder) CookieMask added in v2.2.0

func (b *OpenFlowRuleBuilder) CookieMask(mask uint64) *OpenFlowRuleBuilder

func (*OpenFlowRuleBuilder) DryRun added in v2.2.0

func (*OpenFlowRuleBuilder) EthType added in v2.2.0

func (b *OpenFlowRuleBuilder) EthType(value uint16) *OpenFlowRuleBuilder

func (*OpenFlowRuleBuilder) Execute added in v2.2.0

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

func (*OpenFlowRuleBuilder) Flow added in v2.2.0

func (*OpenFlowRuleBuilder) IPProto added in v2.2.0

func (b *OpenFlowRuleBuilder) IPProto(proto uint8) *OpenFlowRuleBuilder

func (*OpenFlowRuleBuilder) IPv4Dst added in v2.2.0

func (*OpenFlowRuleBuilder) IPv4Src added in v2.2.0

func (*OpenFlowRuleBuilder) InPort added in v2.2.0

func (*OpenFlowRuleBuilder) Plan added in v2.2.0

func (b *OpenFlowRuleBuilder) Plan(ctx context.Context) (Plan, error)

func (*OpenFlowRuleBuilder) Priority added in v2.2.0

func (b *OpenFlowRuleBuilder) Priority(priority uint16) *OpenFlowRuleBuilder

func (*OpenFlowRuleBuilder) TCPDst added in v2.2.0

func (*OpenFlowRuleBuilder) TCPSrc added in v2.2.0

func (*OpenFlowRuleBuilder) Table added in v2.2.0

func (*OpenFlowRuleBuilder) UDPDst added in v2.2.0

func (*OpenFlowRuleBuilder) UDPSrc added in v2.2.0

func (*OpenFlowRuleBuilder) Validate added in v2.2.0

func (b *OpenFlowRuleBuilder) Validate() error

func (*OpenFlowRuleBuilder) WithLabel added in v2.2.0

func (b *OpenFlowRuleBuilder) WithLabel(key, value string) *OpenFlowRuleBuilder

func (*OpenFlowRuleBuilder) WithOwner added in v2.2.0

func (b *OpenFlowRuleBuilder) WithOwner(kind, name string) *OpenFlowRuleBuilder

type OpenFlowRuleRef added in v2.2.0

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

type OpenFlowSession added in v2.2.0

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

func (*OpenFlowSession) AddFlow added in v2.2.0

func (s *OpenFlowSession) AddFlow(ctx context.Context, flow OpenFlowFlow) error

func (*OpenFlowSession) Close added in v2.2.0

func (s *OpenFlowSession) Close() error

func (*OpenFlowSession) DeleteFlow added in v2.2.0

func (s *OpenFlowSession) DeleteFlow(ctx context.Context, flow OpenFlowFlow) error

func (*OpenFlowSession) DumpFlows added in v2.2.0

func (*OpenFlowSession) Handshake added in v2.2.0

func (s *OpenFlowSession) Handshake(ctx context.Context) error

func (*OpenFlowSession) ModifyFlowStrict added in v2.2.0

func (s *OpenFlowSession) ModifyFlowStrict(ctx context.Context, flow OpenFlowFlow) error

func (*OpenFlowSession) Version added in v2.2.0

func (s *OpenFlowSession) Version() OpenFlowVersion

type OpenFlowVersion added in v2.2.0

type OpenFlowVersion uint8
const (
	OpenFlow13 OpenFlowVersion = 0x04
	OpenFlow15 OpenFlowVersion = 0x06
)

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 OwnerRef

type OwnerRef struct {
	Kind string
	Name string
	ID   string
}

OwnerRef identifies the neutral controller or platform object that owns an ovnflow-managed resource. Kind is required; either Name or ID must be set.

func (OwnerRef) ExternalIDs

func (o OwnerRef) ExternalIDs(labels Labels) (map[string]string, error)

ExternalIDs returns reserved ovnflow external_ids for ownership and labels.

func (OwnerRef) Validate

func (o OwnerRef) Validate() error

type OwnershipAuditFinding

type OwnershipAuditFinding struct {
	Severity DoctorSeverity    `json:"severity"`
	Code     string            `json:"code"`
	Database string            `json:"database,omitempty"`
	Table    string            `json:"table,omitempty"`
	Object   string            `json:"object,omitempty"`
	Message  string            `json:"message"`
	Details  map[string]string `json:"details,omitempty"`
}

type OwnershipAuditOptions

type OwnershipAuditOptions struct {
	Owner OwnerRef
	Kinds []string
	Names []string
}

type OwnershipAuditReport

type OwnershipAuditReport struct {
	Summary   OwnershipAuditSummary    `json:"summary"`
	Resources []OwnershipAuditResource `json:"resources"`
	Findings  []OwnershipAuditFinding  `json:"findings"`
}

type OwnershipAuditResource

type OwnershipAuditResource struct {
	Database    string            `json:"database"`
	Table       string            `json:"table"`
	UUID        string            `json:"uuid,omitempty"`
	Name        string            `json:"name,omitempty"`
	Kind        string            `json:"kind,omitempty"`
	Owner       OwnerRef          `json:"owner"`
	Labels      Labels            `json:"labels,omitempty"`
	ExternalIDs map[string]string `json:"external_ids,omitempty"`
}

type OwnershipAuditSummary

type OwnershipAuditSummary struct {
	OwnedResources int `json:"owned_resources"`
	Findings       int `json:"findings"`
	Errors         int `json:"errors"`
	Warnings       int `json:"warnings"`
}

type Plan

type Plan struct {
	Operations []PlannedOperation
	Warnings   []string
}

func (Plan) Empty

func (p Plan) Empty() bool

type PlannedOperation

type PlannedOperation struct {
	Action      IntentAction
	Resource    string
	Name        string
	Description string
}

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 ProviderNetwork

type ProviderNetwork struct {
	Name            string
	PhysicalNetwork string
	LogicalSwitch   string
	LocalnetPort    string
	Bridge          string
	Owner           OwnerRef
	Labels          Labels
}

func (ProviderNetwork) Validate

func (p ProviderNetwork) Validate() error

type ProviderNetworkBuilder

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

func (*ProviderNetworkBuilder) DryRun

func (*ProviderNetworkBuilder) Execute

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

func (*ProviderNetworkBuilder) OnLogicalSwitch

func (b *ProviderNetworkBuilder) OnLogicalSwitch(name string) *ProviderNetworkBuilder

func (*ProviderNetworkBuilder) Plan

func (*ProviderNetworkBuilder) Reconcile

func (*ProviderNetworkBuilder) UseBridge

func (*ProviderNetworkBuilder) Validate

func (b *ProviderNetworkBuilder) Validate() error

func (*ProviderNetworkBuilder) WithBridge

func (*ProviderNetworkBuilder) WithLabel

func (b *ProviderNetworkBuilder) WithLabel(key, value string) *ProviderNetworkBuilder

func (*ProviderNetworkBuilder) WithLocalnetPort

func (b *ProviderNetworkBuilder) WithLocalnetPort(name string) *ProviderNetworkBuilder

func (*ProviderNetworkBuilder) WithLogicalSwitch

func (b *ProviderNetworkBuilder) WithLogicalSwitch(name string) *ProviderNetworkBuilder

func (*ProviderNetworkBuilder) WithOwner

func (b *ProviderNetworkBuilder) WithOwner(kind, name string) *ProviderNetworkBuilder

func (*ProviderNetworkBuilder) WithPhysicalNetwork

func (b *ProviderNetworkBuilder) WithPhysicalNetwork(name string) *ProviderNetworkBuilder

type ProviderNetworkPatch

type ProviderNetworkPatch struct {
	PhysicalNetwork *string
	LogicalSwitch   *string
	LocalnetPort    *string
	Bridge          *string
	Owner           *OwnerRef
	Labels          Labels
	RemoveLabels    []string
}

type ProviderNetworkRef

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

func (*ProviderNetworkRef) Apply

func (r *ProviderNetworkRef) Apply(ctx context.Context, network ProviderNetwork) error

func (*ProviderNetworkRef) Delete

func (r *ProviderNetworkRef) Delete(ctx context.Context) error

func (*ProviderNetworkRef) Ensure

func (*ProviderNetworkRef) Get

func (*ProviderNetworkRef) Inspect

func (*ProviderNetworkRef) Patch

type ProviderNetworkStatus added in v2.1.0

type ProviderNetworkStatus struct {
	Name      string                `json:"name"`
	State     ResourceStatusState   `json:"state"`
	Network   *ProviderNetwork      `json:"network,omitempty"`
	Doctor    *DoctorReport         `json:"doctor,omitempty"`
	Ownership *OwnershipAuditReport `json:"ownership,omitempty"`
	Findings  []StatusFinding       `json:"findings,omitempty"`
	Degraded  bool                  `json:"degraded"`
	ReadOnly  bool                  `json:"read_only"`
}

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 QoSPolicy added in v2.1.0

type QoSPolicy struct {
	Name   string
	Rules  []QoSRule
	Owner  OwnerRef
	Labels Labels
}

QoSPolicy is an intent-level QoS policy composed of OVN QoS rules.

func (QoSPolicy) Validate added in v2.1.0

func (p QoSPolicy) Validate() error

type QoSPolicyBuilder added in v2.1.0

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

QoSPolicyBuilder builds QoS policy intent operations.

func (*QoSPolicyBuilder) AddRule added in v2.1.0

func (b *QoSPolicyBuilder) AddRule(rule QoSRule) *QoSPolicyBuilder

func (*QoSPolicyBuilder) DryRun added in v2.1.0

func (*QoSPolicyBuilder) Execute added in v2.1.0

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

func (*QoSPolicyBuilder) Plan added in v2.1.0

func (b *QoSPolicyBuilder) Plan(ctx context.Context) (Plan, error)

func (*QoSPolicyBuilder) Reconcile added in v2.1.0

func (b *QoSPolicyBuilder) Reconcile(ctx context.Context) (ReconcileResult, error)

func (*QoSPolicyBuilder) Validate added in v2.1.0

func (b *QoSPolicyBuilder) Validate() error

func (*QoSPolicyBuilder) WithLabel added in v2.1.0

func (b *QoSPolicyBuilder) WithLabel(key, value string) *QoSPolicyBuilder

func (*QoSPolicyBuilder) WithOwner added in v2.1.0

func (b *QoSPolicyBuilder) WithOwner(kind, name string) *QoSPolicyBuilder

type QoSPolicyPatch added in v2.1.0

type QoSPolicyPatch struct {
	ReplaceRules bool
	Rules        []QoSRule
	AddRules     []QoSRule
	RemoveRules  []string
	Owner        *OwnerRef
	Labels       Labels
	RemoveLabels []string
}

QoSPolicyPatch describes incremental QoS policy edits.

type QoSPolicyRef added in v2.1.0

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

QoSPolicyRef identifies a QoS policy intent by name.

func (*QoSPolicyRef) Apply added in v2.1.0

func (r *QoSPolicyRef) Apply(ctx context.Context, policy QoSPolicy) error

func (*QoSPolicyRef) Delete added in v2.1.0

func (r *QoSPolicyRef) Delete(ctx context.Context) error

func (*QoSPolicyRef) Ensure added in v2.1.0

func (r *QoSPolicyRef) Ensure() *QoSPolicyBuilder

func (*QoSPolicyRef) Get added in v2.1.0

func (r *QoSPolicyRef) Get(ctx context.Context) (*QoSPolicy, error)

func (*QoSPolicyRef) Patch added in v2.1.0

func (r *QoSPolicyRef) Patch(ctx context.Context, patch QoSPolicyPatch) (*QoSPolicy, error)

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 QoSRule added in v2.1.0

type QoSRule struct {
	Name      string
	Direction string
	Priority  int
	Match     string
	Rate      int
	Burst     int
	DSCP      *int
	Mark      *int
	Switch    string
}

QoSRule describes one OVN QoS rule without exposing OVN transaction details.

func (QoSRule) Validate added in v2.1.0

func (r QoSRule) Validate(policy string) error

type RBACPermissionEvent

type RBACPermissionEvent struct {
	Type EventType
	Old  *SBRBACPermission
	New  *SBRBACPermission
}

type RBACRoleEvent

type RBACRoleEvent struct {
	Type EventType
	Old  *SBRBACRole
	New  *SBRBACRole
}

type ReconcileResult

type ReconcileResult struct {
	Plan    Plan
	Diff    Diff
	Applied bool
}

type ResourceStatusState added in v2.1.0

type ResourceStatusState string
const (
	ResourceStatusPresent  ResourceStatusState = "present"
	ResourceStatusMissing  ResourceStatusState = "missing"
	ResourceStatusDegraded ResourceStatusState = "degraded"
)

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 SDWANAgent added in v2.3.0

type SDWANAgent struct {
	ID           string
	Site         string
	Endpoint     string
	Capabilities SDWANAgentCapabilities
	Labels       Labels
	Status       SDWANAgentStatus
}

func (SDWANAgent) Validate added in v2.3.0

func (a SDWANAgent) Validate() error

type SDWANAgentCapabilities added in v2.3.0

type SDWANAgentCapabilities struct {
	Transports []SDWANTransport
	Layers     []SDWANLayer
	Features   []string
	Attributes map[string]string
}

type SDWANAgentHeartbeat added in v2.3.0

type SDWANAgentHeartbeat struct {
	AgentID    string
	Site       string
	Status     SDWANAgentStatus
	Observed   []SDWANLinkStatus
	Attributes map[string]string
	At         time.Time
}

type SDWANAgentStatus added in v2.3.0

type SDWANAgentStatus struct {
	State      ResourceStatusState
	Message    string
	LastSeen   time.Time
	Observed   []SDWANLinkStatus
	Findings   []StatusFinding
	Generation int
	Attributes map[string]string
}

func (SDWANAgentStatus) Validate added in v2.3.0

func (s SDWANAgentStatus) Validate() error

type SDWANApplyPlan added in v2.2.0

type SDWANApplyPlan struct {
	Network    string
	Operations []SDWANOperation
}

type SDWANAssignment added in v2.3.0

type SDWANAssignment struct {
	ID         string
	AgentID    string
	Network    string
	Site       string
	Generation int
	Desired    SDWANNetwork
	Plan       SDWANApplyPlan
	Status     SDWANAssignmentStatus
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

type SDWANAssignmentStatus added in v2.3.0

type SDWANAssignmentStatus struct {
	State      SDWANAssignmentStatusState
	Message    string
	AppliedAt  time.Time
	Findings   []StatusFinding
	Attributes map[string]string
}

func (SDWANAssignmentStatus) Validate added in v2.3.0

func (s SDWANAssignmentStatus) Validate() error

type SDWANAssignmentStatusState added in v2.3.0

type SDWANAssignmentStatusState string
const (
	SDWANAssignmentPending  SDWANAssignmentStatusState = "pending"
	SDWANAssignmentApplied  SDWANAssignmentStatusState = "applied"
	SDWANAssignmentRejected SDWANAssignmentStatusState = "rejected"
	SDWANAssignmentFailed   SDWANAssignmentStatusState = "failed"
)

type SDWANBackend added in v2.2.0

type SDWANBackend interface {
	GetSDWAN(context.Context, string) (*SDWANNetwork, error)
	ApplySDWAN(context.Context, SDWANNetwork, SDWANApplyPlan) error
	DeleteSDWAN(context.Context, string) error
}

type SDWANClient added in v2.2.0

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

func NewSDWANClient added in v2.2.0

func NewSDWANClient(backend SDWANBackend) *SDWANClient

func (*SDWANClient) Network added in v2.2.0

func (c *SDWANClient) Network(name string) *SDWANNetworkRef

func (*SDWANClient) WithBackend added in v2.2.0

func (c *SDWANClient) WithBackend(backend SDWANBackend) *SDWANClient

WithBackend returns an SD-WAN client that uses backend.

type SDWANControlPlane added in v2.3.0

type SDWANDeleteBuilder added in v2.2.0

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

func (*SDWANDeleteBuilder) Execute added in v2.2.0

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

func (*SDWANDeleteBuilder) Plan added in v2.2.0

func (b *SDWANDeleteBuilder) Plan(ctx context.Context) (Plan, error)

type SDWANLayer added in v2.2.0

type SDWANLayer string
const (
	SDWANLayerL3 SDWANLayer = "l3"
	SDWANLayerL2 SDWANLayer = "l2"
)
type SDWANLink struct {
	Name       string
	From       string
	To         string
	Transport  SDWANTransport
	PathMode   SDWANPathMode
	EndpointA  string
	EndpointB  string
	AllowedIPs []string
	Cost       int
	Enabled    bool
	Disabled   bool
	Attributes map[string]string
}

func (SDWANLink) StableName added in v2.2.0

func (l SDWANLink) StableName() string

func (SDWANLink) Validate added in v2.2.0

func (l SDWANLink) Validate(sites map[string]bool, fallback SDWANTransport) error

type SDWANLinkStatus added in v2.2.0

type SDWANLinkStatus struct {
	Name      string
	From      string
	To        string
	Transport SDWANTransport
	PathMode  SDWANPathMode
	Ready     bool
}

type SDWANNetwork added in v2.2.0

type SDWANNetwork struct {
	Name      string
	Layer     SDWANLayer
	Topology  SDWANTopology
	Transport SDWANTransport
	PathMode  SDWANPathMode
	Sites     []SDWANSite
	Links     []SDWANLink
	Policies  []SDWANPolicy
	Owner     OwnerRef
	Labels    Labels
	Status    SDWANStatus
}

func (SDWANNetwork) Validate added in v2.2.0

func (n SDWANNetwork) Validate() error

type SDWANNetworkBuilder added in v2.2.0

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

func (*SDWANNetworkBuilder) AddPolicy added in v2.2.0

func (b *SDWANNetworkBuilder) AddPolicy(name string, policy SDWANPolicy) *SDWANNetworkBuilder

func (*SDWANNetworkBuilder) AddSite added in v2.2.0

func (b *SDWANNetworkBuilder) AddSite(name string, site SDWANSite) *SDWANNetworkBuilder

func (*SDWANNetworkBuilder) Apply added in v2.2.0

func (b *SDWANNetworkBuilder) Apply(ctx context.Context) error

func (*SDWANNetworkBuilder) ApplyPlan added in v2.2.0

func (*SDWANNetworkBuilder) DryRun added in v2.2.0

func (*SDWANNetworkBuilder) Execute added in v2.2.0

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

func (*SDWANNetworkBuilder) Layer2 added in v2.2.0

func (*SDWANNetworkBuilder) Layer3 added in v2.2.0

func (*SDWANNetworkBuilder) PathModeAuto added in v2.4.0

func (b *SDWANNetworkBuilder) PathModeAuto() *SDWANNetworkBuilder

func (*SDWANNetworkBuilder) PathModeDirect added in v2.4.0

func (b *SDWANNetworkBuilder) PathModeDirect() *SDWANNetworkBuilder

func (*SDWANNetworkBuilder) PathModeRelay added in v2.4.0

func (b *SDWANNetworkBuilder) PathModeRelay() *SDWANNetworkBuilder

func (*SDWANNetworkBuilder) PathModeTransit added in v2.4.0

func (b *SDWANNetworkBuilder) PathModeTransit() *SDWANNetworkBuilder

func (*SDWANNetworkBuilder) Plan added in v2.2.0

func (b *SDWANNetworkBuilder) Plan(ctx context.Context) (Plan, error)

func (*SDWANNetworkBuilder) Reconcile added in v2.2.0

func (*SDWANNetworkBuilder) TopologyFullMesh added in v2.2.0

func (b *SDWANNetworkBuilder) TopologyFullMesh() *SDWANNetworkBuilder

func (*SDWANNetworkBuilder) TopologyHubSpoke added in v2.2.0

func (b *SDWANNetworkBuilder) TopologyHubSpoke() *SDWANNetworkBuilder

func (*SDWANNetworkBuilder) TopologyPartialMesh added in v2.2.0

func (b *SDWANNetworkBuilder) TopologyPartialMesh() *SDWANNetworkBuilder

func (*SDWANNetworkBuilder) Validate added in v2.2.0

func (b *SDWANNetworkBuilder) Validate() error

func (*SDWANNetworkBuilder) WithLabel added in v2.2.0

func (b *SDWANNetworkBuilder) WithLabel(key, value string) *SDWANNetworkBuilder

func (*SDWANNetworkBuilder) WithLayer added in v2.2.0

func (b *SDWANNetworkBuilder) WithLayer(layer SDWANLayer) *SDWANNetworkBuilder

func (*SDWANNetworkBuilder) WithLinkAttribute added in v2.3.0

func (b *SDWANNetworkBuilder) WithLinkAttribute(linkName, key, value string) *SDWANNetworkBuilder

func (*SDWANNetworkBuilder) WithOwner added in v2.2.0

func (b *SDWANNetworkBuilder) WithOwner(kind, name string) *SDWANNetworkBuilder

func (*SDWANNetworkBuilder) WithPathMode added in v2.4.0

func (b *SDWANNetworkBuilder) WithPathMode(mode SDWANPathMode) *SDWANNetworkBuilder

func (*SDWANNetworkBuilder) WithSiteAttribute added in v2.3.0

func (b *SDWANNetworkBuilder) WithSiteAttribute(siteName, key, value string) *SDWANNetworkBuilder

func (*SDWANNetworkBuilder) WithTransport added in v2.2.0

func (b *SDWANNetworkBuilder) WithTransport(transport SDWANTransport) *SDWANNetworkBuilder

type SDWANNetworkRef added in v2.2.0

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

func (*SDWANNetworkRef) Delete added in v2.2.0

func (r *SDWANNetworkRef) Delete() *SDWANDeleteBuilder

func (*SDWANNetworkRef) Ensure added in v2.2.0

func (r *SDWANNetworkRef) Ensure() *SDWANNetworkBuilder

func (*SDWANNetworkRef) Get added in v2.2.0

type SDWANOperation added in v2.2.0

type SDWANOperation struct {
	Action      IntentAction
	Resource    string
	Name        string
	Description string
}

type SDWANPathMode added in v2.4.0

type SDWANPathMode string
const (
	SDWANPathModeDirect  SDWANPathMode = "direct"
	SDWANPathModeRelay   SDWANPathMode = "relay"
	SDWANPathModeTransit SDWANPathMode = "transit"
	SDWANPathModeAuto    SDWANPathMode = "auto"
)

type SDWANPolicy added in v2.2.0

type SDWANPolicy struct {
	Name        string
	Layer       SDWANLayer
	SourceSite  string
	DestSite    string
	SourceCIDRs []string
	DestCIDRs   []string
	PreferLinks []string
	AvoidLinks  []string
	Priority    int
}

func (SDWANPolicy) Validate added in v2.2.0

func (p SDWANPolicy) Validate(sites map[string]bool) error

type SDWANSite added in v2.2.0

type SDWANSite struct {
	Name       string
	Router     string
	CIDRs      []string
	Endpoint   string
	PublicKey  string
	Role       string
	Attributes map[string]string
	L2Segments []string
	Transit    bool
	Relay      bool
}

func (SDWANSite) Validate added in v2.2.0

func (s SDWANSite) Validate(layer SDWANLayer) error

type SDWANSiteStatus added in v2.2.0

type SDWANSiteStatus struct {
	Name  string
	Ready bool
}

type SDWANStatus added in v2.2.0

type SDWANStatus struct {
	State        ResourceStatusState
	Sites        []SDWANSiteStatus
	Links        []SDWANLinkStatus
	Findings     []StatusFinding
	LastApplied  int
	ResourceHash string
}

type SDWANTopology added in v2.2.0

type SDWANTopology string
const (
	SDWANTopologyPartialMesh SDWANTopology = "partial-mesh"
	SDWANTopologyHubSpoke    SDWANTopology = "hub-spoke"
	SDWANTopologyFullMesh    SDWANTopology = "full-mesh"
)

type SDWANTransport added in v2.2.0

type SDWANTransport string
const (
	SDWANTransportWireGuard SDWANTransport = "wireguard"
	SDWANTransportGeneve    SDWANTransport = "geneve"
	SDWANTransportVXLAN     SDWANTransport = "vxlan"
)

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 SecurityPolicy

type SecurityPolicy struct {
	Name    string
	Subject string
	Rules   []SecurityRule
	Owner   OwnerRef
	Labels  Labels
}

func (SecurityPolicy) Validate

func (p SecurityPolicy) Validate() error

type SecurityPolicyBuilder

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

func (*SecurityPolicyBuilder) AddRule

func (*SecurityPolicyBuilder) DryRun

func (*SecurityPolicyBuilder) Execute

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

func (*SecurityPolicyBuilder) ForSubject

func (b *SecurityPolicyBuilder) ForSubject(subject string) *SecurityPolicyBuilder

func (*SecurityPolicyBuilder) Plan

func (*SecurityPolicyBuilder) Reconcile

func (*SecurityPolicyBuilder) Validate

func (b *SecurityPolicyBuilder) Validate() error

func (*SecurityPolicyBuilder) WithLabel

func (b *SecurityPolicyBuilder) WithLabel(key, value string) *SecurityPolicyBuilder

func (*SecurityPolicyBuilder) WithOwner

func (b *SecurityPolicyBuilder) WithOwner(kind, name string) *SecurityPolicyBuilder

type SecurityPolicyPatch

type SecurityPolicyPatch struct {
	Subject      *string
	ReplaceRules bool
	Rules        []SecurityRule
	AddRules     []SecurityRule
	RemoveRules  []string
	Owner        *OwnerRef
	Labels       Labels
	RemoveLabels []string
}

type SecurityPolicyRef

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

func (*SecurityPolicyRef) Apply

func (r *SecurityPolicyRef) Apply(ctx context.Context, policy SecurityPolicy) error

func (*SecurityPolicyRef) Delete

func (r *SecurityPolicyRef) Delete(ctx context.Context) error

func (*SecurityPolicyRef) Ensure

func (*SecurityPolicyRef) Get

func (*SecurityPolicyRef) Inspect

func (*SecurityPolicyRef) Patch

type SecurityRule

type SecurityRule struct {
	Name        string
	Action      string
	Direction   string
	Protocol    string
	CIDRs       []string
	Ports       []int
	Established bool
}

type ServiceBackend added in v2.1.0

type ServiceBackend struct {
	Address string
	Port    int
}

func (ServiceBackend) String added in v2.1.0

func (b ServiceBackend) String() string

func (ServiceBackend) Validate added in v2.1.0

func (b ServiceBackend) Validate() error

type ServiceMonitorEvent

type ServiceMonitorEvent struct {
	Type EventType
	Old  *SBServiceMonitor
	New  *SBServiceMonitor
}

type ServicePatch added in v2.1.0

type ServicePatch struct {
	ReplaceVIPs    bool
	VIPs           []ServiceVIP
	AddVIPs        []ServiceVIP
	RemoveVIPs     []string
	Protocol       *string
	AttachToRouter *string
	Owner          *OwnerRef
	Labels         Labels
	RemoveLabels   []string
}

type ServicePort added in v2.1.0

type ServicePort struct {
	Protocol string
	Port     int
}

type ServiceVIP added in v2.1.0

type ServiceVIP struct {
	Address  string
	Port     int
	Backends []ServiceBackend
}

func (ServiceVIP) BackendsString added in v2.1.0

func (v ServiceVIP) BackendsString() string

func (ServiceVIP) String added in v2.1.0

func (v ServiceVIP) String() string

func (ServiceVIP) Validate added in v2.1.0

func (v ServiceVIP) Validate() error

type StatusFinding added in v2.1.0

type StatusFinding struct {
	Severity  DoctorSeverity    `json:"severity"`
	Component string            `json:"component,omitempty"`
	Code      string            `json:"code"`
	Message   string            `json:"message"`
	Details   map[string]string `json:"details,omitempty"`
}

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.

type VirtualNetwork

type VirtualNetwork struct {
	Name    string
	CIDRs   []string
	Gateway string
	DNS     LogicalSwitchDNS
	Owner   OwnerRef
	Labels  Labels
}

func (VirtualNetwork) Validate

func (v VirtualNetwork) Validate() error

type VirtualNetworkBuilder

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

func (*VirtualNetworkBuilder) DryRun

func (*VirtualNetworkBuilder) Execute

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

func (*VirtualNetworkBuilder) Plan

func (*VirtualNetworkBuilder) Reconcile

func (*VirtualNetworkBuilder) Validate

func (b *VirtualNetworkBuilder) Validate() error

func (*VirtualNetworkBuilder) WithCIDR

func (*VirtualNetworkBuilder) WithDNS

func (b *VirtualNetworkBuilder) WithDNS(name string, configure func(*LogicalSwitchDNSBuilder)) *VirtualNetworkBuilder

func (*VirtualNetworkBuilder) WithGateway

func (*VirtualNetworkBuilder) WithLabel

func (b *VirtualNetworkBuilder) WithLabel(key, value string) *VirtualNetworkBuilder

func (*VirtualNetworkBuilder) WithOwner

func (b *VirtualNetworkBuilder) WithOwner(kind, name string) *VirtualNetworkBuilder

type VirtualNetworkPatch

type VirtualNetworkPatch struct {
	AddCIDRs     []string
	RemoveCIDRs  []string
	Gateway      *string
	DNS          *LogicalSwitchDNS
	Owner        *OwnerRef
	Labels       Labels
	RemoveLabels []string
}

type VirtualNetworkRef

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

func (*VirtualNetworkRef) Apply

func (r *VirtualNetworkRef) Apply(ctx context.Context, network VirtualNetwork) error

func (*VirtualNetworkRef) Delete

func (r *VirtualNetworkRef) Delete(ctx context.Context) error

func (*VirtualNetworkRef) Ensure

func (*VirtualNetworkRef) Get

func (*VirtualNetworkRef) Inspect

func (*VirtualNetworkRef) Patch

type WorkloadAttachment

type WorkloadAttachment struct {
	Name          string
	Network       string
	Workload      string
	InterfaceName string
	MAC           string
	IPs           []string
	LocalOVS      WorkloadLocalOVS
	Owner         OwnerRef
	Labels        Labels
}

func (WorkloadAttachment) Validate

func (w WorkloadAttachment) Validate() error

type WorkloadAttachmentBuilder

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

func (*WorkloadAttachmentBuilder) DryRun

func (*WorkloadAttachmentBuilder) Execute

func (*WorkloadAttachmentBuilder) OnNetwork

func (*WorkloadAttachmentBuilder) Plan

func (*WorkloadAttachmentBuilder) Reconcile

func (*WorkloadAttachmentBuilder) SyncLocalOVS

func (*WorkloadAttachmentBuilder) Validate

func (b *WorkloadAttachmentBuilder) Validate() error

func (*WorkloadAttachmentBuilder) WithIP

func (*WorkloadAttachmentBuilder) WithInterface

func (*WorkloadAttachmentBuilder) WithLabel

func (*WorkloadAttachmentBuilder) WithMAC

func (*WorkloadAttachmentBuilder) WithOVSInterface

func (b *WorkloadAttachmentBuilder) WithOVSInterface(name string) *WorkloadAttachmentBuilder

func (*WorkloadAttachmentBuilder) WithOVSInterfaceType

func (b *WorkloadAttachmentBuilder) WithOVSInterfaceType(kind string) *WorkloadAttachmentBuilder

func (*WorkloadAttachmentBuilder) WithOVSOption

func (b *WorkloadAttachmentBuilder) WithOVSOption(key, value string) *WorkloadAttachmentBuilder

func (*WorkloadAttachmentBuilder) WithOVSPort

func (*WorkloadAttachmentBuilder) WithOwner

func (*WorkloadAttachmentBuilder) WithWorkload

type WorkloadAttachmentPatch

type WorkloadAttachmentPatch struct {
	Network       *string
	Workload      *string
	InterfaceName *string
	MAC           *string
	AddIPs        []string
	RemoveIPs     []string
	Owner         *OwnerRef
	Labels        Labels
	RemoveLabels  []string
}

type WorkloadAttachmentRef

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

func (*WorkloadAttachmentRef) Apply

func (r *WorkloadAttachmentRef) Apply(ctx context.Context, attachment WorkloadAttachment) error

func (*WorkloadAttachmentRef) Delete

func (r *WorkloadAttachmentRef) Delete(ctx context.Context) error

func (*WorkloadAttachmentRef) DetachLocalOVS

func (r *WorkloadAttachmentRef) DetachLocalOVS(ctx context.Context) error

func (*WorkloadAttachmentRef) Ensure

func (*WorkloadAttachmentRef) Get

func (*WorkloadAttachmentRef) Inspect

func (*WorkloadAttachmentRef) Patch

type WorkloadLocalOVS

type WorkloadLocalOVS struct {
	Bridge        string
	PortName      string
	InterfaceName string
	InterfaceType string
	Options       map[string]string
}

func (WorkloadLocalOVS) Empty

func (o WorkloadLocalOVS) Empty() bool

func (WorkloadLocalOVS) Validate

func (o WorkloadLocalOVS) Validate() error

type WorkloadPathStatus added in v2.1.0

type WorkloadPathStatus struct {
	Name       string                `json:"name"`
	State      ResourceStatusState   `json:"state"`
	Attachment *WorkloadAttachment   `json:"attachment,omitempty"`
	Doctor     *DoctorReport         `json:"doctor,omitempty"`
	Ownership  *OwnershipAuditReport `json:"ownership,omitempty"`
	Findings   []StatusFinding       `json:"findings,omitempty"`
	Degraded   bool                  `json:"degraded"`
	ReadOnly   bool                  `json:"read_only"`
}

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