ovn

package
v6.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TCPFIN = 0x001
	TCPSYN = 0x002
	TCPRST = 0x004
	TCPPSH = 0x008
	TCPACK = 0x010
	TCPURG = 0x020
	TCPECE = 0x040
	TCPCWR = 0x080
	TCPNS  = 0x100
)

OVS TCP Flags from OVS lib/packets.h.

Variables

View Source
var ErrExists = fmt.Errorf("object already exists")

ErrExists indicates that a DB record already exists.

View Source
var ErrNotFound = ovsdbClient.ErrNotFound

ErrNotFound indicates that a DB record doesn't exist.

View Source
var ErrNotManaged = fmt.Errorf("object not incus-managed")

ErrNotManaged indicates that a DB record wasn't created by Incus.

Functions

This section is empty.

Types

type ICNB

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

ICNB client.

func NewICNB

func NewICNB(dbAddr string, sslCACert string, sslClientCert string, sslClientKey string) (*ICNB, error)

NewICNB initializes new OVN client for Northbound IC operations.

func (*ICNB) CreateTransitSwitch

func (o *ICNB) CreateTransitSwitch(ctx context.Context, name string, mayExist bool) error

CreateTransitSwitch creates a new managed transit switch.

func (*ICNB) CreateTransitSwitchAllocation added in v6.0.2

func (o *ICNB) CreateTransitSwitchAllocation(ctx context.Context, switchName string, azName string) (*net.IPNet, *net.IPNet, error)

CreateTransitSwitchAllocation creates a new allocation on the switch.

func (*ICNB) DeleteTransitSwitch

func (o *ICNB) DeleteTransitSwitch(ctx context.Context, name string, force bool) error

DeleteTransitSwitch deletes an existing transit switch. The force parameter is required to delete a transit switch which wasn't created by Incus.

func (*ICNB) DeleteTransitSwitchAllocation added in v6.0.2

func (o *ICNB) DeleteTransitSwitchAllocation(ctx context.Context, switchName string, azName string) error

DeleteTransitSwitchAllocation removes a current allocation from the switch.

type ICSB

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

ICSB client.

func NewICSB

func NewICSB(dbAddr string, sslCACert string, sslClientCert string, sslClientKey string) (*ICSB, error)

NewICSB initializes new OVN client for Southbound IC operations.

func (*ICSB) GetGateways

func (o *ICSB) GetGateways(ctx context.Context, name string) ([]string, error)

GetGateways returns a slice of gateways for the specified availability zone.

type NB

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

NB client.

func NewNB

func NewNB(dbAddr string, sslCACert string, sslClientCert string, sslClientKey string) (*NB, error)

NewNB initializes new OVN client for Northbound operations.

func (*NB) CleanupLogicalSwitchPort added in v6.0.2

func (o *NB) CleanupLogicalSwitchPort(ctx context.Context, portName OVNSwitchPort, switchName OVNSwitch, switchPortGroupName OVNPortGroup, dnsUUID OVNDNSUUID) error

CleanupLogicalSwitchPort deletes the named logical switch port and its associated config.

func (*NB) ClearPortGroupPortACLRules added in v6.0.2

func (o *NB) ClearPortGroupPortACLRules(ctx context.Context, portGroupName OVNPortGroup, portName OVNSwitchPort) error

ClearPortGroupPortACLRules clears any rules assigned to the logical switch port in the specified port group.

func (*NB) CreateAddressSet added in v6.0.2

func (o *NB) CreateAddressSet(ctx context.Context, addressSetPrefix OVNAddressSet, addresses ...net.IPNet) error

CreateAddressSet creates address sets for IP versions 4 and 6 in the format "<addressSetPrefix>_ip<IP version>". Populates them with the relevant addresses supplied.

func (*NB) CreateChassisGroup

func (o *NB) CreateChassisGroup(ctx context.Context, haChassisGroupName OVNChassisGroup, mayExist bool) error

CreateChassisGroup adds a new HA chassis group. If mayExist is true, then an existing resource of the same name is not treated as an error.

func (*NB) CreateLoadBalancer added in v6.0.2

func (o *NB) CreateLoadBalancer(ctx context.Context, loadBalancerName OVNLoadBalancer, routerName OVNRouter, switchName OVNSwitch, vips ...OVNLoadBalancerVIP) error

CreateLoadBalancer creates a new load balancer (if doesn't exist) on the specified router and switch. Providing an empty set of vips will delete the load balancer.

func (*NB) CreateLogicalRouter

func (o *NB) CreateLogicalRouter(ctx context.Context, routerName OVNRouter, mayExist bool) error

CreateLogicalRouter adds a named logical router. If mayExist is true, then an existing resource of the same name is not treated as an error.

func (*NB) CreateLogicalRouterNAT

func (o *NB) CreateLogicalRouterNAT(ctx context.Context, routerName OVNRouter, natType string, intNet *net.IPNet, extIP net.IP, intIP net.IP, stateless bool, mayExist bool) error

CreateLogicalRouterNAT adds an SNAT or DNAT rule to a logical router to translate packets from intNet to extIP.

func (*NB) CreateLogicalRouterPeering added in v6.0.2

func (o *NB) CreateLogicalRouterPeering(ctx context.Context, opts OVNRouterPeering) error

CreateLogicalRouterPeering applies a peering relationship between two logical routers.

func (*NB) CreateLogicalRouterPort

func (o *NB) CreateLogicalRouterPort(ctx context.Context, routerName OVNRouter, portName OVNRouterPort, mac net.HardwareAddr, gatewayMTU uint32, ipAddr []*net.IPNet, haChassisGroupName OVNChassisGroup, mayExist bool) error

CreateLogicalRouterPort adds a named logical router port to a logical router.

func (*NB) CreateLogicalRouterRoute added in v6.0.2

func (o *NB) CreateLogicalRouterRoute(ctx context.Context, routerName OVNRouter, mayExist bool, routes ...OVNRouterRoute) error

CreateLogicalRouterRoute adds a static route to the logical router.

func (*NB) CreateLogicalSwitch

func (o *NB) CreateLogicalSwitch(ctx context.Context, switchName OVNSwitch, mayExist bool) error

CreateLogicalSwitch adds a named logical switch. If mayExist is true, then an existing resource of the same name is not treated as an error.

func (*NB) CreateLogicalSwitchPort

func (o *NB) CreateLogicalSwitchPort(ctx context.Context, switchName OVNSwitch, portName OVNSwitchPort, opts *OVNSwitchPortOpts, mayExist bool) error

CreateLogicalSwitchPort adds a named logical switch port to a logical switch, and sets options if provided. If mayExist is true, then an existing resource of the same name is not treated as an error.

func (*NB) CreatePortGroup added in v6.0.2

func (o *NB) CreatePortGroup(ctx context.Context, projectID int64, portGroupName OVNPortGroup, associatedPortGroup OVNPortGroup, associatedSwitch OVNSwitch, initialPortMembers ...OVNSwitchPort) error

CreatePortGroup creates a new port group and optionally adds logical switch ports to the group.

func (*NB) DeleteAddressSet added in v6.0.2

func (o *NB) DeleteAddressSet(ctx context.Context, addressSetPrefix OVNAddressSet) error

DeleteAddressSet deletes address sets for IP versions 4 and 6 in the format "<addressSetPrefix>_ip<IP version>".

func (*NB) DeleteChassisGroup

func (o *NB) DeleteChassisGroup(ctx context.Context, haChassisGroupName OVNChassisGroup) error

DeleteChassisGroup deletes an HA chassis group.

func (*NB) DeleteLoadBalancer added in v6.0.2

func (o *NB) DeleteLoadBalancer(ctx context.Context, loadBalancerNames ...OVNLoadBalancer) error

DeleteLoadBalancer deletes the specified load balancer(s).

func (*NB) DeleteLogicalRouter

func (o *NB) DeleteLogicalRouter(ctx context.Context, routerName OVNRouter) error

DeleteLogicalRouter deletes a named logical router.

func (*NB) DeleteLogicalRouterNAT

func (o *NB) DeleteLogicalRouterNAT(ctx context.Context, routerName OVNRouter, natType string, all bool, extIPs ...net.IP) error

DeleteLogicalRouterNAT deletes all NAT rules of a particular type from a logical router.

func (*NB) DeleteLogicalRouterPeering added in v6.0.2

func (o *NB) DeleteLogicalRouterPeering(ctx context.Context, opts OVNRouterPeering) error

DeleteLogicalRouterPeering deletes a peering relationship between two logical routers. Requires LocalRouter, LocalRouterPort, TargetRouter and TargetRouterPort opts fields to be populated.

func (*NB) DeleteLogicalRouterPort

func (o *NB) DeleteLogicalRouterPort(ctx context.Context, routerName OVNRouter, portName OVNRouterPort) error

DeleteLogicalRouterPort deletes a named logical router port from a logical router.

func (*NB) DeleteLogicalRouterRoute added in v6.0.2

func (o *NB) DeleteLogicalRouterRoute(ctx context.Context, routerName OVNRouter, prefixes ...net.IPNet) error

DeleteLogicalRouterRoute deletes a static route from the logical router.

func (*NB) DeleteLogicalSwitch added in v6.0.2

func (o *NB) DeleteLogicalSwitch(ctx context.Context, switchName OVNSwitch) error

DeleteLogicalSwitch deletes a named logical switch.

func (*NB) DeleteLogicalSwitchDHCPOption added in v6.0.2

func (o *NB) DeleteLogicalSwitchDHCPOption(ctx context.Context, switchName OVNSwitch, uuids ...OVNDHCPOptionsUUID) error

DeleteLogicalSwitchDHCPOption deletes the specified DHCP options defined for a switch.

func (*NB) DeleteLogicalSwitchPort

func (o *NB) DeleteLogicalSwitchPort(ctx context.Context, switchName OVNSwitch, portName OVNSwitchPort) error

DeleteLogicalSwitchPort deletes a named logical switch port.

func (*NB) DeleteLogicalSwitchPortDNS added in v6.0.2

func (o *NB) DeleteLogicalSwitchPortDNS(ctx context.Context, switchName OVNSwitch, dnsUUID OVNDNSUUID, destroyEntry bool) error

DeleteLogicalSwitchPortDNS removes DNS records from a switch port. If destroyEntry the DNS entry record itself is also removed, otherwise it is just cleared but left in place.

func (*NB) DeletePortGroup added in v6.0.2

func (o *NB) DeletePortGroup(ctx context.Context, portGroupNames ...OVNPortGroup) error

DeletePortGroup deletes port groups along with their ACL rules.

func (*NB) GetLogicalRouter added in v6.0.2

func (o *NB) GetLogicalRouter(ctx context.Context, routerName OVNRouter) (*ovnNB.LogicalRouter, error)

GetLogicalRouter gets the OVN database record for the router.

func (*NB) GetLogicalRouterPort

func (o *NB) GetLogicalRouterPort(ctx context.Context, portName OVNRouterPort) (*ovnNB.LogicalRouterPort, error)

GetLogicalRouterPort gets the OVN database record for the logical router port.

func (*NB) GetLogicalRouterPortHardwareAddress added in v6.0.2

func (o *NB) GetLogicalRouterPortHardwareAddress(ctx context.Context, ovnRouterPort OVNRouterPort) (string, error)

GetLogicalRouterPortHardwareAddress gets the hardware address of the logical router port.

func (*NB) GetLogicalRouterRoutes added in v6.0.2

func (o *NB) GetLogicalRouterRoutes(ctx context.Context, routerName OVNRouter) ([]OVNRouterRoute, error)

GetLogicalRouterRoutes returns a list of static routes in the main route table of the logical router.

func (*NB) GetLogicalSwitch

func (o *NB) GetLogicalSwitch(ctx context.Context, switchName OVNSwitch) (*ovnNB.LogicalSwitch, error)

GetLogicalSwitch gets the OVN database record for the switch.

func (*NB) GetLogicalSwitchDHCPOptions added in v6.0.2

func (o *NB) GetLogicalSwitchDHCPOptions(ctx context.Context, switchName OVNSwitch) ([]OVNDHCPOptsSet, error)

GetLogicalSwitchDHCPOptions retrieves the existing DHCP options defined for a logical switch.

func (*NB) GetLogicalSwitchDHCPv4Revervations added in v6.0.2

func (o *NB) GetLogicalSwitchDHCPv4Revervations(ctx context.Context, switchName OVNSwitch) ([]iprange.Range, error)

GetLogicalSwitchDHCPv4Revervations gets the DHCPv4 IP reservations.

func (*NB) GetLogicalSwitchIPs added in v6.0.2

func (o *NB) GetLogicalSwitchIPs(ctx context.Context, switchName OVNSwitch) (map[OVNSwitchPort][]net.IP, error)

GetLogicalSwitchIPs returns a list of IPs associated to each port connected to switch.

func (*NB) GetLogicalSwitchPortDNS added in v6.0.2

func (o *NB) GetLogicalSwitchPortDNS(ctx context.Context, portName OVNSwitchPort) (OVNDNSUUID, string, []net.IP, error)

GetLogicalSwitchPortDNS returns the logical switch port DNS info (UUID, name and IPs).

func (*NB) GetLogicalSwitchPortDynamicIPs added in v6.0.2

func (o *NB) GetLogicalSwitchPortDynamicIPs(ctx context.Context, portName OVNSwitchPort) ([]net.IP, error)

GetLogicalSwitchPortDynamicIPs returns a list of dynamc IPs for a switch port.

func (*NB) GetLogicalSwitchPortIPs added in v6.0.2

func (o *NB) GetLogicalSwitchPortIPs(ctx context.Context, portName OVNSwitchPort) ([]net.IP, error)

GetLogicalSwitchPortIPs returns a list of IPs for a switch port.

func (*NB) GetLogicalSwitchPortLocation added in v6.0.2

func (o *NB) GetLogicalSwitchPortLocation(ctx context.Context, portName OVNSwitchPort) (string, error)

GetLogicalSwitchPortLocation returns the last set location of a logical switch port.

func (*NB) GetLogicalSwitchPortUUID added in v6.0.2

func (o *NB) GetLogicalSwitchPortUUID(ctx context.Context, portName OVNSwitchPort) (OVNSwitchPortUUID, error)

GetLogicalSwitchPortUUID returns the logical switch port UUID.

func (*NB) GetLogicalSwitchPorts added in v6.0.2

func (o *NB) GetLogicalSwitchPorts(ctx context.Context, switchName OVNSwitch) (map[OVNSwitchPort]OVNSwitchPortUUID, error)

GetLogicalSwitchPorts returns a map of logical switch ports (name and UUID) for a switch. Includes non-instance ports, such as the router port.

func (*NB) GetName

func (o *NB) GetName(ctx context.Context) (string, error)

GetName returns the OVN AZ name.

func (*NB) GetPortGroupInfo added in v6.0.2

func (o *NB) GetPortGroupInfo(ctx context.Context, portGroupName OVNPortGroup) (OVNPortGroupUUID, bool, error)

GetPortGroupInfo returns the port group UUID or empty string if port doesn't exist, and whether the port group has any ACL rules defined on it.

func (*NB) GetPortGroupsByProject added in v6.0.2

func (o *NB) GetPortGroupsByProject(ctx context.Context, projectID int64) ([]OVNPortGroup, error)

GetPortGroupsByProject finds the port groups that are associated to the project ID.

func (*NB) SetChassisGroupPriority

func (o *NB) SetChassisGroupPriority(ctx context.Context, haChassisGroupName OVNChassisGroup, chassisID string, priority int) error

SetChassisGroupPriority sets a given priority for the chassis ID in the chassis group..

func (*NB) UpdateAddressSetAdd added in v6.0.2

func (o *NB) UpdateAddressSetAdd(ctx context.Context, addressSetPrefix OVNAddressSet, addresses ...net.IPNet) error

UpdateAddressSetAdd adds the supplied addresses to the address sets. If the set is missing, it will get automatically created. The address set name used is "<addressSetPrefix>_ip<IP version>", e.g. "foo_ip4".

func (*NB) UpdateAddressSetRemove added in v6.0.2

func (o *NB) UpdateAddressSetRemove(ctx context.Context, addressSetPrefix OVNAddressSet, addresses ...net.IPNet) error

UpdateAddressSetRemove removes the supplied addresses from the address set. The address set name used is "<addressSetPrefix>_ip<IP version>", e.g. "foo_ip4".

func (*NB) UpdateLogicalRouterPolicy added in v6.0.2

func (o *NB) UpdateLogicalRouterPolicy(ctx context.Context, routerName OVNRouter, policies ...OVNRouterPolicy) error

UpdateLogicalRouterPolicy removes any existing policies and applies the new policies to the specified router.

func (*NB) UpdateLogicalRouterPort added in v6.0.2

func (o *NB) UpdateLogicalRouterPort(ctx context.Context, portName OVNRouterPort, ipv6ra *OVNIPv6RAOpts) error

UpdateLogicalRouterPort updates properties of a logical router port.

func (*NB) UpdateLogicalSwitchACLRules added in v6.0.2

func (o *NB) UpdateLogicalSwitchACLRules(ctx context.Context, switchName OVNSwitch, aclRules ...OVNACLRule) error

UpdateLogicalSwitchACLRules applies a set of rules to the specified logical switch. Any existing rules are removed.

func (*NB) UpdateLogicalSwitchDHCPv4Options added in v6.0.2

func (o *NB) UpdateLogicalSwitchDHCPv4Options(ctx context.Context, switchName OVNSwitch, uuid OVNDHCPOptionsUUID, subnet *net.IPNet, opts *OVNDHCPv4Opts) error

UpdateLogicalSwitchDHCPv4Options creates or updates a DHCPv4 option set associated with the specified switchName and subnet. If uuid is non-empty then the record that exists with that ID is updated, otherwise a new record is created.

func (*NB) UpdateLogicalSwitchDHCPv4Revervations added in v6.0.2

func (o *NB) UpdateLogicalSwitchDHCPv4Revervations(ctx context.Context, switchName OVNSwitch, reservedIPs []iprange.Range) error

UpdateLogicalSwitchDHCPv4Revervations sets the DHCPv4 IP reservations.

func (*NB) UpdateLogicalSwitchDHCPv6Options added in v6.0.2

func (o *NB) UpdateLogicalSwitchDHCPv6Options(ctx context.Context, switchName OVNSwitch, uuid OVNDHCPOptionsUUID, subnet *net.IPNet, opts *OVNDHCPv6Opts) error

UpdateLogicalSwitchDHCPv6Options creates or updates a DHCPv6 option set associated with the specified switchName and subnet. If uuid is non-empty then the record that exists with that ID is updated, otherwise a new record is created.

func (*NB) UpdateLogicalSwitchIPAllocation added in v6.0.2

func (o *NB) UpdateLogicalSwitchIPAllocation(ctx context.Context, switchName OVNSwitch, opts *OVNIPAllocationOpts) error

UpdateLogicalSwitchIPAllocation sets the IP allocation config on the logical switch.

func (*NB) UpdateLogicalSwitchPortDNS added in v6.0.2

func (o *NB) UpdateLogicalSwitchPortDNS(ctx context.Context, switchName OVNSwitch, portName OVNSwitchPort, dnsName string, dnsIPs []net.IP) (OVNDNSUUID, error)

UpdateLogicalSwitchPortDNS sets up the switch port DNS records for the DNS name. Returns the DNS record UUID, IPv4 and IPv6 addresses used for DNS records.

func (*NB) UpdateLogicalSwitchPortLinkProviderNetwork added in v6.0.2

func (o *NB) UpdateLogicalSwitchPortLinkProviderNetwork(ctx context.Context, switchPortName OVNSwitchPort, extNetworkName string) error

UpdateLogicalSwitchPortLinkProviderNetwork links a logical switch port to a provider network.

func (*NB) UpdateLogicalSwitchPortLinkRouter added in v6.0.2

func (o *NB) UpdateLogicalSwitchPortLinkRouter(ctx context.Context, switchPortName OVNSwitchPort, routerPortName OVNRouterPort) error

UpdateLogicalSwitchPortLinkRouter links a logical switch port to a logical router port.

func (*NB) UpdateLogicalSwitchPortOptions added in v6.0.2

func (o *NB) UpdateLogicalSwitchPortOptions(ctx context.Context, portName OVNSwitchPort, options map[string]string) error

UpdateLogicalSwitchPortOptions sets the options for a logical switch port.

func (*NB) UpdatePortGroupACLRules added in v6.0.2

func (o *NB) UpdatePortGroupACLRules(ctx context.Context, portGroupName OVNPortGroup, matchReplace map[string]string, aclRules ...OVNACLRule) error

UpdatePortGroupACLRules applies a set of rules to the specified port group. Any existing rules are removed.

func (*NB) UpdatePortGroupMembers added in v6.0.2

func (o *NB) UpdatePortGroupMembers(ctx context.Context, addMembers map[OVNPortGroup][]OVNSwitchPortUUID, removeMembers map[OVNPortGroup][]OVNSwitchPortUUID) error

UpdatePortGroupMembers adds/removes logical switch ports (by UUID) to/from existing port groups.

func (*NB) UpdatePortGroupPortACLRules added in v6.0.2

func (o *NB) UpdatePortGroupPortACLRules(ctx context.Context, portGroupName OVNPortGroup, portName OVNSwitchPort, aclRules ...OVNACLRule) error

UpdatePortGroupPortACLRules applies a set of rules for the logical switch port in the specified port group. Any existing rules for that logical switch port in the port group are removed.

type OVNACLRule

type OVNACLRule struct {
	Direction string // Either "from-lport" or "to-lport".
	Action    string // Either "allow-related", "allow", "drop", or "reject".
	Match     string // Match criteria. See OVN Southbound database's Logical_Flow table match column usage.
	Priority  int    // Priority (between 0 and 32767, inclusive). Higher values take precedence.
	Log       bool   // Whether or not to log matched packets.
	LogName   string // Log label name (requires Log be true).
}

OVNACLRule represents an ACL rule that can be added to a logical switch or port group.

type OVNAddressSet

type OVNAddressSet string

OVNAddressSet OVN address set for ACLs.

type OVNChassisGroup

type OVNChassisGroup string

OVNChassisGroup OVN HA chassis group name.

type OVNDHCPOptionsUUID

type OVNDHCPOptionsUUID string

OVNDHCPOptionsUUID DHCP Options set UUID.

type OVNDHCPOptsSet

type OVNDHCPOptsSet struct {
	UUID OVNDHCPOptionsUUID
	CIDR *net.IPNet
}

OVNDHCPOptsSet is an existing DHCP options set in the northbound database.

type OVNDHCPv4Opts

type OVNDHCPv4Opts struct {
	ServerID           net.IP
	ServerMAC          net.HardwareAddr
	Router             net.IP
	RecursiveDNSServer []net.IP
	DomainName         string
	LeaseTime          time.Duration
	MTU                uint32
	Netmask            string
	DNSSearchList      []string
}

OVNDHCPv4Opts IPv4 DHCP options that can be applied to a switch port.

type OVNDHCPv6Opts

type OVNDHCPv6Opts struct {
	ServerID           net.HardwareAddr
	RecursiveDNSServer []net.IP
	DNSSearchList      []string
}

OVNDHCPv6Opts IPv6 DHCP option set that can be created (and then applied to a switch port by resulting ID).

type OVNDNSUUID

type OVNDNSUUID string

OVNDNSUUID OVN DNS record UUID.

type OVNIPAllocationOpts

type OVNIPAllocationOpts struct {
	PrefixIPv4  *net.IPNet
	PrefixIPv6  *net.IPNet
	ExcludeIPv4 []iprange.Range
}

OVNIPAllocationOpts defines IP allocation settings that can be applied to a logical switch.

type OVNIPv6AddressMode

type OVNIPv6AddressMode string

OVNIPv6AddressMode IPv6 router advertisement address mode.

const OVNIPv6AddressModeDHCPStateful OVNIPv6AddressMode = "dhcpv6_stateful"

OVNIPv6AddressModeDHCPStateful IPv6 DHCPv6 stateful mode.

const OVNIPv6AddressModeDHCPStateless OVNIPv6AddressMode = "dhcpv6_stateless"

OVNIPv6AddressModeDHCPStateless IPv6 DHCPv6 stateless mode.

const OVNIPv6AddressModeSLAAC OVNIPv6AddressMode = "slaac"

OVNIPv6AddressModeSLAAC IPv6 SLAAC mode.

type OVNIPv6RAOpts

type OVNIPv6RAOpts struct {
	SendPeriodic       bool
	AddressMode        OVNIPv6AddressMode
	MinInterval        time.Duration
	MaxInterval        time.Duration
	RecursiveDNSServer net.IP
	DNSSearchList      []string
	MTU                uint32
}

OVNIPv6RAOpts IPv6 router advertisements options that can be applied to a router.

type OVNLoadBalancer

type OVNLoadBalancer string

OVNLoadBalancer OVN load balancer name.

type OVNLoadBalancerHealthCheck added in v6.0.2

type OVNLoadBalancerHealthCheck struct {
	Interval     int
	Timeout      int
	SuccessCount int
	FailureCount int

	CheckerIPV4 net.IP
	CheckerIPV6 net.IP
}

OVNLoadBalancerHealthCheck represents an OVN load balancer health checker.

type OVNLoadBalancerTarget

type OVNLoadBalancerTarget struct {
	Address net.IP
	Port    uint64
}

OVNLoadBalancerTarget represents an OVN load balancer Virtual IP target.

type OVNLoadBalancerVIP

type OVNLoadBalancerVIP struct {
	HealthCheck   *OVNLoadBalancerHealthCheck
	Protocol      string // Either "tcp" or "udp". But only applies to port based VIPs.
	ListenAddress net.IP
	ListenPort    uint64
	Targets       []OVNLoadBalancerTarget
}

OVNLoadBalancerVIP represents a OVN load balancer Virtual IP entry.

type OVNPortGroup

type OVNPortGroup string

OVNPortGroup OVN port group name.

type OVNPortGroupUUID

type OVNPortGroupUUID string

OVNPortGroupUUID OVN port group UUID.

type OVNRouter

type OVNRouter string

OVNRouter OVN router name.

type OVNRouterPeering

type OVNRouterPeering struct {
	LocalRouter        OVNRouter
	LocalRouterPort    OVNRouterPort
	LocalRouterPortMAC net.HardwareAddr
	LocalRouterPortIPs []net.IPNet
	LocalRouterRoutes  []net.IPNet

	TargetRouter        OVNRouter
	TargetRouterPort    OVNRouterPort
	TargetRouterPortMAC net.HardwareAddr
	TargetRouterPortIPs []net.IPNet
	TargetRouterRoutes  []net.IPNet
}

OVNRouterPeering represents a the configuration of a peering connection between two OVN logical routers.

type OVNRouterPolicy

type OVNRouterPolicy struct {
	Priority int
	Match    string
	Action   string
	NextHop  net.IP
}

OVNRouterPolicy represents a router policy.

type OVNRouterPort

type OVNRouterPort string

OVNRouterPort OVN router port name.

type OVNRouterRoute

type OVNRouterRoute struct {
	Prefix  net.IPNet
	NextHop net.IP
	Port    OVNRouterPort
	Discard bool
}

OVNRouterRoute represents a static route added to a logical router.

type OVNSwitch

type OVNSwitch string

OVNSwitch OVN switch name.

type OVNSwitchPort

type OVNSwitchPort string

OVNSwitchPort OVN switch port name.

type OVNSwitchPortOpts

type OVNSwitchPortOpts struct {
	MAC          net.HardwareAddr   // Optional, if nil will be set to dynamic.
	IPV4         string             // Optional, if empty, allocate an address, if "none" then disable allocation.
	IPV6         string             // Optional, if empty, allocate an address, if "none" then disable allocation.
	DHCPv4OptsID OVNDHCPOptionsUUID // Optional, if empty, no DHCPv4 enabled on port.
	DHCPv6OptsID OVNDHCPOptionsUUID // Optional, if empty, no DHCPv6 enabled on port.
	Parent       OVNSwitchPort      // Optional, if set a nested port is created.
	VLAN         uint16             // Optional, use with Parent to request a specific VLAN for nested port.
	Location     string             // Optional, use to indicate the name of the server this port is bound to.
	RouterPort   OVNRouterPort      // Optional, the name of the associated logical router port.
	Promiscuous  bool               // Optional, controls whether to allow unknown traffic on the port.
}

OVNSwitchPortOpts options that can be applied to a swich port.

type OVNSwitchPortUUID

type OVNSwitchPortUUID string

OVNSwitchPortUUID OVN switch port UUID.

type SB

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

SB client.

func NewSB

func NewSB(dbAddr string, sslCACert string, sslClientCert string, sslClientKey string) (*SB, error)

NewSB initializes new OVN client for Southbound operations.

func (*SB) GetLogicalRouterPortActiveChassisHostname

func (o *SB) GetLogicalRouterPortActiveChassisHostname(ctx context.Context, ovnRouterPort OVNRouterPort) (string, error)

GetLogicalRouterPortActiveChassisHostname gets the hostname of the chassis managing the logical router port.

func (*SB) GetServiceHealth added in v6.6.0

func (o *SB) GetServiceHealth(ctx context.Context, address string, protocol string, port int) (string, error)

GetServiceHealth returns the current health record for a particular server and port.

Directories

Path Synopsis
schema

Jump to

Keyboard shortcuts

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