Documentation ¶
Index ¶
- Variables
- type OVN
- func (o *OVN) ChassisGroupAdd(haChassisGroupName OVNChassisGroup, mayExist bool) error
- func (o *OVN) ChassisGroupChassisAdd(haChassisGroupName OVNChassisGroup, chassisID string, priority uint) error
- func (o *OVN) ChassisGroupChassisDelete(haChassisGroupName OVNChassisGroup, chassisID string) error
- func (o *OVN) ChassisGroupDelete(haChassisGroupName OVNChassisGroup) error
- func (o *OVN) LogicalRouterAdd(routerName OVNRouter, mayExist bool) error
- func (o *OVN) LogicalRouterDNATSNATAdd(routerName OVNRouter, extIP net.IP, intIP net.IP, stateless bool, ...) error
- func (o *OVN) LogicalRouterDNATSNATDelete(routerName OVNRouter, extIP net.IP) error
- func (o *OVN) LogicalRouterDNATSNATDeleteAll(routerName OVNRouter) error
- func (o OVN) LogicalRouterDelete(routerName OVNRouter) error
- func (o *OVN) LogicalRouterPortAdd(routerName OVNRouter, portName OVNRouterPort, mac net.HardwareAddr, ...) error
- func (o *OVN) LogicalRouterPortDelete(portName OVNRouterPort) error
- func (o *OVN) LogicalRouterPortDeleteIPv6Advertisements(portName OVNRouterPort) error
- func (o *OVN) LogicalRouterPortLinkChassisGroup(portName OVNRouterPort, haChassisGroupName OVNChassisGroup) error
- func (o *OVN) LogicalRouterPortSetIPv6Advertisements(portName OVNRouterPort, opts *OVNIPv6RAOpts) error
- func (o *OVN) LogicalRouterRouteAdd(routerName OVNRouter, destination *net.IPNet, nextHop net.IP, mayExist bool) error
- func (o *OVN) LogicalRouterRouteDelete(routerName OVNRouter, destination *net.IPNet, nextHop net.IP) error
- func (o *OVN) LogicalRouterSNATAdd(routerName OVNRouter, intNet *net.IPNet, extIP net.IP, mayExist bool) error
- func (o *OVN) LogicalRouterSNATDeleteAll(routerName OVNRouter) error
- func (o *OVN) LogicalSwitchAdd(switchName OVNSwitch, mayExist bool) error
- func (o *OVN) LogicalSwitchDHCPOptionsDelete(switchName OVNSwitch, onlyUUID ...OVNDHCPOptionsUUID) error
- func (o *OVN) LogicalSwitchDHCPOptionsGet(switchName OVNSwitch) ([]OVNDHCPOptsSet, error)
- func (o *OVN) LogicalSwitchDHCPOptionsGetID(switchName OVNSwitch, subnet *net.IPNet) (OVNDHCPOptionsUUID, error)
- func (o *OVN) LogicalSwitchDHCPv4OptionsSet(switchName OVNSwitch, uuid OVNDHCPOptionsUUID, subnet *net.IPNet, ...) error
- func (o *OVN) LogicalSwitchDHCPv6OptionsSet(switchName OVNSwitch, uuid OVNDHCPOptionsUUID, subnet *net.IPNet, ...) error
- func (o *OVN) LogicalSwitchDelete(switchName OVNSwitch) error
- func (o *OVN) LogicalSwitchPortAdd(switchName OVNSwitch, portName OVNSwitchPort, mayExist bool) error
- func (o *OVN) LogicalSwitchPortDelete(portName OVNSwitchPort) error
- func (o *OVN) LogicalSwitchPortDeleteDNS(switchName OVNSwitch, dnsUUID OVNDNSUUID) error
- func (o *OVN) LogicalSwitchPortDynamicIPs(portName OVNSwitchPort) ([]net.IP, error)
- func (o *OVN) LogicalSwitchPortGetDNS(portName OVNSwitchPort) (OVNDNSUUID, string, []net.IP, error)
- func (o *OVN) LogicalSwitchPortLinkProviderNetwork(switchPortName OVNSwitchPort, extNetworkName string) error
- func (o *OVN) LogicalSwitchPortLinkRouter(switchPortName OVNSwitchPort, routerPortName OVNRouterPort) error
- func (o *OVN) LogicalSwitchPortSet(portName OVNSwitchPort, opts *OVNSwitchPortOpts) error
- func (o *OVN) LogicalSwitchPortSetDNS(switchName OVNSwitch, portName OVNSwitchPort, dnsName string) (OVNDNSUUID, net.IP, net.IP, error)
- func (o *OVN) LogicalSwitchPortUUID(portName OVNSwitchPort) (OVNSwitchPortUUID, error)
- func (o *OVN) LogicalSwitchSetACLRules(switchName OVNSwitch, aclRules ...OVNACLRule) error
- func (o *OVN) LogicalSwitchSetIPAllocation(switchName OVNSwitch, opts *OVNIPAllocationOpts) error
- func (o *OVN) PortGroupAdd(portGroupName OVNPortGroup, initialPortMembers ...OVNSwitchPort) error
- func (o *OVN) PortGroupDelete(portGroupName OVNPortGroup) error
- func (o *OVN) PortGroupInfo(portGroupName OVNPortGroup) (OVNPortGroupUUID, bool, error)
- func (o *OVN) PortGroupMemberAdd(portGroupName OVNPortGroup, portMemberUUID OVNSwitchPortUUID) error
- func (o *OVN) PortGroupMemberDelete(portGroupName OVNPortGroup, portMemberUUID OVNSwitchPortUUID) error
- func (o *OVN) PortGroupSetACLRules(portGroupName OVNPortGroup, aclRules ...OVNACLRule) error
- func (o *OVN) SetDatabaseAddress(addr string)
- type OVNACLRule
- type OVNChassisGroup
- type OVNDHCPOptionsUUID
- type OVNDHCPOptsSet
- type OVNDHCPv4Opts
- type OVNDHCPv6Opts
- type OVNDNSUUID
- type OVNIPAllocationOpts
- type OVNIPv6AddressMode
- type OVNIPv6RAOpts
- type OVNPortGroup
- type OVNPortGroupUUID
- type OVNRouter
- type OVNRouterPort
- type OVNSwitch
- type OVNSwitchPort
- type OVNSwitchPortOpts
- type OVNSwitchPortUUID
- type OVS
- func (o *OVS) BridgeAdd(bridgeName string, mayExist bool) error
- func (o *OVS) BridgeDelete(bridgeName string) error
- func (o *OVS) BridgeExists(bridgeName string) (bool, error)
- func (o *OVS) BridgePortAdd(bridgeName string, portName string, mayExist bool) error
- func (o *OVS) BridgePortDelete(bridgeName string, portName string) error
- func (o *OVS) BridgePortList(bridgeName string) ([]string, error)
- func (o *OVS) BridgePortSet(portName string, options ...string) error
- func (o *OVS) ChassisID() (string, error)
- func (o *OVS) Installed() bool
- func (o *OVS) InterfaceAssociateOVNSwitchPort(interfaceName string, ovnSwitchPortName OVNSwitchPort) error
- func (o *OVS) InterfaceAssociatedOVNSwitchPort(interfaceName string) (OVNSwitchPort, error)
- func (o *OVS) OVNBridgeMappingAdd(bridgeName string, providerName string) error
- func (o *OVS) OVNBridgeMappingDelete(bridgeName string, providerName string) error
- func (o *OVS) OVNBridgeMappings(bridgeName string) ([]string, error)
- func (o *OVS) OVNEncapIP() (net.IP, error)
Constants ¶
This section is empty.
Variables ¶
var ErrOVNNoPortIPs = fmt.Errorf("No port IPs")
ErrOVNNoPortIPs used when no IPs are found for a logical port.
Functions ¶
This section is empty.
Types ¶
type OVN ¶
type OVN struct {
// contains filtered or unexported fields
}
OVN command wrapper.
func NewOVN ¶
NewOVN initialises new OVN client wrapper with the connection set in network.ovn.northbound_connection config.
func (*OVN) ChassisGroupAdd ¶
func (o *OVN) ChassisGroupAdd(haChassisGroupName OVNChassisGroup, mayExist bool) error
ChassisGroupAdd 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 (*OVN) ChassisGroupChassisAdd ¶
func (o *OVN) ChassisGroupChassisAdd(haChassisGroupName OVNChassisGroup, chassisID string, priority uint) error
ChassisGroupChassisAdd adds a chassis ID to an HA chassis group with the specified priority.
func (*OVN) ChassisGroupChassisDelete ¶
func (o *OVN) ChassisGroupChassisDelete(haChassisGroupName OVNChassisGroup, chassisID string) error
ChassisGroupChassisDelete deletes a chassis ID from an HA chassis group.
func (*OVN) ChassisGroupDelete ¶
func (o *OVN) ChassisGroupDelete(haChassisGroupName OVNChassisGroup) error
ChassisGroupDelete deletes an HA chassis group.
func (*OVN) LogicalRouterAdd ¶
LogicalRouterAdd adds a named logical router.
func (*OVN) LogicalRouterDNATSNATAdd ¶
func (o *OVN) LogicalRouterDNATSNATAdd(routerName OVNRouter, extIP net.IP, intIP net.IP, stateless bool, mayExist bool) error
LogicalRouterDNATSNATAdd adds a DNAT_AND_SNAT rule to a logical router to translate packets from extIP to intIP.
func (*OVN) LogicalRouterDNATSNATDelete ¶
LogicalRouterDNATSNATDelete deletes a DNAT_AND_SNAT rule from a logical router.
func (*OVN) LogicalRouterDNATSNATDeleteAll ¶
LogicalRouterDNATSNATDeleteAll deletes all DNAT_AND_SNAT rules from a logical router.
func (OVN) LogicalRouterDelete ¶
LogicalRouterDelete deletes a named logical router.
func (*OVN) LogicalRouterPortAdd ¶
func (o *OVN) LogicalRouterPortAdd(routerName OVNRouter, portName OVNRouterPort, mac net.HardwareAddr, ipAddr []*net.IPNet, mayExist bool) error
LogicalRouterPortAdd adds a named logical router port to a logical router.
func (*OVN) LogicalRouterPortDelete ¶
func (o *OVN) LogicalRouterPortDelete(portName OVNRouterPort) error
LogicalRouterPortDelete deletes a named logical router port from a logical router.
func (*OVN) LogicalRouterPortDeleteIPv6Advertisements ¶
func (o *OVN) LogicalRouterPortDeleteIPv6Advertisements(portName OVNRouterPort) error
LogicalRouterPortDeleteIPv6Advertisements removes the IPv6 RA announcement settings from a router port.
func (*OVN) LogicalRouterPortLinkChassisGroup ¶
func (o *OVN) LogicalRouterPortLinkChassisGroup(portName OVNRouterPort, haChassisGroupName OVNChassisGroup) error
LogicalRouterPortLinkChassisGroup links a logical router port to a HA chassis group.
func (*OVN) LogicalRouterPortSetIPv6Advertisements ¶
func (o *OVN) LogicalRouterPortSetIPv6Advertisements(portName OVNRouterPort, opts *OVNIPv6RAOpts) error
LogicalRouterPortSetIPv6Advertisements sets the IPv6 router advertisement options on a router port.
func (*OVN) LogicalRouterRouteAdd ¶
func (o *OVN) LogicalRouterRouteAdd(routerName OVNRouter, destination *net.IPNet, nextHop net.IP, mayExist bool) error
LogicalRouterRouteAdd adds a static route to the logical router.
func (*OVN) LogicalRouterRouteDelete ¶
func (o *OVN) LogicalRouterRouteDelete(routerName OVNRouter, destination *net.IPNet, nextHop net.IP) error
LogicalRouterRouteDelete deletes a static route from the logical router. If nextHop is specified as nil, then any route matching the destination is removed.
func (*OVN) LogicalRouterSNATAdd ¶
func (o *OVN) LogicalRouterSNATAdd(routerName OVNRouter, intNet *net.IPNet, extIP net.IP, mayExist bool) error
LogicalRouterSNATAdd adds an SNAT rule to a logical router to translate packets from intNet to extIP.
func (*OVN) LogicalRouterSNATDeleteAll ¶
LogicalRouterSNATDeleteAll deletes all SNAT rules from a logical router.
func (*OVN) LogicalSwitchAdd ¶
LogicalSwitchAdd adds a named logical switch. If mayExist is true, then an existing resource of the same name is not treated as an error.
func (*OVN) LogicalSwitchDHCPOptionsDelete ¶
func (o *OVN) LogicalSwitchDHCPOptionsDelete(switchName OVNSwitch, onlyUUID ...OVNDHCPOptionsUUID) error
LogicalSwitchDHCPOptionsDelete deletes any DHCP options defined for a switch. Optionally accepts one or more specific UUID records to delete (if they are associated to the specified switch).
func (*OVN) LogicalSwitchDHCPOptionsGet ¶
func (o *OVN) LogicalSwitchDHCPOptionsGet(switchName OVNSwitch) ([]OVNDHCPOptsSet, error)
LogicalSwitchDHCPOptionsGet retrieves the existing DHCP options defined for a logical switch.
func (*OVN) LogicalSwitchDHCPOptionsGetID ¶
func (o *OVN) LogicalSwitchDHCPOptionsGetID(switchName OVNSwitch, subnet *net.IPNet) (OVNDHCPOptionsUUID, error)
LogicalSwitchDHCPOptionsGetID returns the UUID for DHCP options set associated to the logical switch and subnet.
func (*OVN) LogicalSwitchDHCPv4OptionsSet ¶
func (o *OVN) LogicalSwitchDHCPv4OptionsSet(switchName OVNSwitch, uuid OVNDHCPOptionsUUID, subnet *net.IPNet, opts *OVNDHCPv4Opts) error
LogicalSwitchDHCPv4OptionsSet 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 (*OVN) LogicalSwitchDHCPv6OptionsSet ¶
func (o *OVN) LogicalSwitchDHCPv6OptionsSet(switchName OVNSwitch, uuid OVNDHCPOptionsUUID, subnet *net.IPNet, opts *OVNDHCPv6Opts) error
LogicalSwitchDHCPv6OptionsSet 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 (*OVN) LogicalSwitchDelete ¶
LogicalSwitchDelete deletes a named logical switch.
func (*OVN) LogicalSwitchPortAdd ¶
func (o *OVN) LogicalSwitchPortAdd(switchName OVNSwitch, portName OVNSwitchPort, mayExist bool) error
LogicalSwitchPortAdd adds a named logical switch port to a logical switch. If mayExist is true, then an existing resource of the same name is not treated as an error.
func (*OVN) LogicalSwitchPortDelete ¶
func (o *OVN) LogicalSwitchPortDelete(portName OVNSwitchPort) error
LogicalSwitchPortDelete deletes a named logical switch port.
func (*OVN) LogicalSwitchPortDeleteDNS ¶
func (o *OVN) LogicalSwitchPortDeleteDNS(switchName OVNSwitch, dnsUUID OVNDNSUUID) error
LogicalSwitchPortDeleteDNS removes DNS records for a switch port.
func (*OVN) LogicalSwitchPortDynamicIPs ¶
func (o *OVN) LogicalSwitchPortDynamicIPs(portName OVNSwitchPort) ([]net.IP, error)
LogicalSwitchPortDynamicIPs returns a list of dynamc IPs for a switch port.
func (*OVN) LogicalSwitchPortGetDNS ¶
func (o *OVN) LogicalSwitchPortGetDNS(portName OVNSwitchPort) (OVNDNSUUID, string, []net.IP, error)
LogicalSwitchPortGetDNS returns the logical switch port DNS info (UUID, name and IPs).
func (*OVN) LogicalSwitchPortLinkProviderNetwork ¶
func (o *OVN) LogicalSwitchPortLinkProviderNetwork(switchPortName OVNSwitchPort, extNetworkName string) error
LogicalSwitchPortLinkProviderNetwork links a logical switch port to a provider network.
func (*OVN) LogicalSwitchPortLinkRouter ¶
func (o *OVN) LogicalSwitchPortLinkRouter(switchPortName OVNSwitchPort, routerPortName OVNRouterPort) error
LogicalSwitchPortLinkRouter links a logical switch port to a logical router port.
func (*OVN) LogicalSwitchPortSet ¶
func (o *OVN) LogicalSwitchPortSet(portName OVNSwitchPort, opts *OVNSwitchPortOpts) error
LogicalSwitchPortSet sets options on logical switch port.
func (*OVN) LogicalSwitchPortSetDNS ¶
func (o *OVN) LogicalSwitchPortSetDNS(switchName OVNSwitch, portName OVNSwitchPort, dnsName string) (OVNDNSUUID, net.IP, net.IP, error)
LogicalSwitchPortSetDNS sets up the switch DNS records for the DNS name resolving to the IPs of the switch port. Attempts to find at most one IP for each IP protocol, preferring static addresses over dynamic. Returns the DNS record UUID, IPv4 and IPv6 addresses used for DNS records.
func (*OVN) LogicalSwitchPortUUID ¶
func (o *OVN) LogicalSwitchPortUUID(portName OVNSwitchPort) (OVNSwitchPortUUID, error)
LogicalSwitchPortUUID returns the logical switch port UUID or empty string if port doesn't exist.
func (*OVN) LogicalSwitchSetACLRules ¶
func (o *OVN) LogicalSwitchSetACLRules(switchName OVNSwitch, aclRules ...OVNACLRule) error
LogicalSwitchSetACLRules applies a set of rules to the specified logical switch. Any existing rules are removed.
func (*OVN) LogicalSwitchSetIPAllocation ¶
func (o *OVN) LogicalSwitchSetIPAllocation(switchName OVNSwitch, opts *OVNIPAllocationOpts) error
LogicalSwitchSetIPAllocation sets the IP allocation config on the logical switch.
func (*OVN) PortGroupAdd ¶
func (o *OVN) PortGroupAdd(portGroupName OVNPortGroup, initialPortMembers ...OVNSwitchPort) error
PortGroupAdd creates a new port group and optionally adds logical switch ports to the group.
func (*OVN) PortGroupDelete ¶
func (o *OVN) PortGroupDelete(portGroupName OVNPortGroup) error
PortGroupDelete deletes a port group and all ACLs associated to it.
func (*OVN) PortGroupInfo ¶
func (o *OVN) PortGroupInfo(portGroupName OVNPortGroup) (OVNPortGroupUUID, bool, error)
PortGroupInfo 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 (*OVN) PortGroupMemberAdd ¶
func (o *OVN) PortGroupMemberAdd(portGroupName OVNPortGroup, portMemberUUID OVNSwitchPortUUID) error
PortGroupMemberAdd adds a logical switch port (by UUID) to an existing port group.
func (*OVN) PortGroupMemberDelete ¶
func (o *OVN) PortGroupMemberDelete(portGroupName OVNPortGroup, portMemberUUID OVNSwitchPortUUID) error
PortGroupMemberDelete deleted a logical switch port (by UUID) from an existing port group.
func (*OVN) PortGroupSetACLRules ¶
func (o *OVN) PortGroupSetACLRules(portGroupName OVNPortGroup, aclRules ...OVNACLRule) error
PortGroupSetACLRules applies a set of rules to the specified port group. Any existing rules are removed.
func (*OVN) SetDatabaseAddress ¶
SetDatabaseAddress sets the address that runs the OVN northbound and southbound databases.
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 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 }
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 OVNIPAllocationOpts ¶
type OVNIPAllocationOpts struct { PrefixIPv4 *net.IPNet PrefixIPv6 *net.IPNet ExcludeIPv4 []shared.IPRange }
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 OVNSwitchPortOpts ¶
type OVNSwitchPortOpts struct { MAC net.HardwareAddr // Optional, if nil will be set to dynamic. IPs []net.IP // Optional, if empty IPs will be set to dynamic. DHCPv4OptsID OVNDHCPOptionsUUID // Optional, if empty, no DHCPv4 enabled on port. DHCPv6OptsID OVNDHCPOptionsUUID // Optional, if empty, no DHCPv6 enabled on port. }
OVNSwitchPortOpts options that can be applied to a swich port.
type OVS ¶
type OVS struct{}
OVS command wrapper.
func (*OVS) BridgeDelete ¶
BridgeDelete deletes an OVS bridge.
func (*OVS) BridgeExists ¶
BridgeExists returns true if OVS bridge exists.
func (*OVS) BridgePortAdd ¶
BridgePortAdd adds a port to the bridge (if already attached does nothing).
func (*OVS) BridgePortDelete ¶
BridgePortDelete deletes a port from the bridge (if already detached does nothing).
func (*OVS) BridgePortList ¶
BridgePortList returns a list of ports that are connected to the bridge.
func (*OVS) BridgePortSet ¶
BridgePortSet sets port options.
func (*OVS) InterfaceAssociateOVNSwitchPort ¶
func (o *OVS) InterfaceAssociateOVNSwitchPort(interfaceName string, ovnSwitchPortName OVNSwitchPort) error
InterfaceAssociateOVNSwitchPort removes any existing OVS ports associated to the specified ovnSwitchPortName and then associates the specified interfaceName to the OVN switch port.
func (*OVS) InterfaceAssociatedOVNSwitchPort ¶
func (o *OVS) InterfaceAssociatedOVNSwitchPort(interfaceName string) (OVNSwitchPort, error)
InterfaceAssociatedOVNSwitchPort returns the OVN switch port associated to the OVS interface.
func (*OVS) OVNBridgeMappingAdd ¶
OVNBridgeMappingAdd appends an OVN bridge mapping between an OVS bridge and the logical provider name.
func (*OVS) OVNBridgeMappingDelete ¶
OVNBridgeMappingDelete deletes an OVN bridge mapping between an OVS bridge and the logical provider name.
func (*OVS) OVNBridgeMappings ¶
OVNBridgeMappings gets the current OVN bridge mappings.