Documentation ¶
Index ¶
- Variables
- func ExternalNetworksOnly(opts networks.ListOptsBuilder) networks.ListOptsBuilder
- type GetNetworkOpts
- type PortListOpts
- type Service
- func (s *Service) AdoptPorts(scope *scope.WithLogger, desiredPorts []infrav1.ResolvedPortSpec, ...) error
- func (s *Service) AssociateFloatingIP(eventObject runtime.Object, fp *floatingips.FloatingIP, portID string) error
- func (s *Service) ConstructPorts(spec *infrav1.OpenStackMachineSpec, clusterResourceName, baseName string, ...) ([]infrav1.ResolvedPortSpec, error)
- func (s *Service) CreateFloatingIPForPool(pool *v1alpha1.OpenStackFloatingIPPool) (*floatingips.FloatingIP, error)
- func (s *Service) CreatePort(eventObject runtime.Object, portSpec *infrav1.ResolvedPortSpec) (*ports.Port, error)
- func (s *Service) CreatePorts(eventObject runtime.Object, desiredPorts []infrav1.ResolvedPortSpec, ...) error
- func (s *Service) DeleteClusterPorts(openStackCluster *infrav1.OpenStackCluster) error
- func (s *Service) DeleteFloatingIP(eventObject runtime.Object, ip string) error
- func (s *Service) DeleteInstanceTrunkAndPort(eventObject runtime.Object, port infrav1.PortStatus, trunkSupported bool) error
- func (s *Service) DeleteNetwork(openStackCluster *infrav1.OpenStackCluster, clusterResourceName string) error
- func (s *Service) DeletePort(eventObject runtime.Object, portID string) error
- func (s *Service) DeleteRouter(openStackCluster *infrav1.OpenStackCluster, clusterResourceName string) error
- func (s *Service) DeleteSecurityGroups(openStackCluster *infrav1.OpenStackCluster, clusterResourceName string) error
- func (s *Service) DeleteTrunk(eventObject runtime.Object, portID string) error
- func (s *Service) DisassociateFloatingIP(eventObject runtime.Object, ip string) error
- func (s *Service) GetFloatingIP(ip string) (*floatingips.FloatingIP, error)
- func (s *Service) GetFloatingIPByPortID(portID string) (*floatingips.FloatingIP, error)
- func (s *Service) GetFloatingIPsByTag(tag string) ([]floatingips.FloatingIP, error)
- func (s *Service) GetNetworkByID(networkID string) (*networks.Network, error)
- func (s *Service) GetNetworkByParam(param *infrav1.NetworkParam, opts ...GetNetworkOpts) (*networks.Network, error)
- func (s *Service) GetNetworkIDByParam(param *infrav1.NetworkParam, opts ...GetNetworkOpts) (string, error)
- func (s *Service) GetNetworkSubnetByParam(networkID string, param *infrav1.SubnetParam) (*subnets.Subnet, error)
- func (s *Service) GetOrCreateFloatingIP(eventObject runtime.Object, openStackCluster *infrav1.OpenStackCluster, ...) (*floatingips.FloatingIP, error)
- func (s *Service) GetPortForExternalNetwork(instanceID string, externalNetworkID string) (*ports.Port, error)
- func (s *Service) GetPortFromInstanceIP(instanceID string, ip string) ([]ports.Port, error)
- func (s *Service) GetSecurityGroups(securityGroupParams []infrav1.SecurityGroupParam) ([]string, error)
- func (s *Service) GetSubnetByParam(param *infrav1.SubnetParam) (*subnets.Subnet, error)
- func (s *Service) GetSubnetIDByParam(param *infrav1.SubnetParam) (string, error)
- func (s *Service) GetSubnetsByFilter(opts subnets.ListOptsBuilder) ([]subnets.Subnet, error)
- func (s *Service) GetTrunkSupport() (bool, error)
- func (s *Service) IsTrunkExtSupported() (trunknSupported bool, err error)
- func (s *Service) ReconcileExternalNetwork(openStackCluster *infrav1.OpenStackCluster) error
- func (s *Service) ReconcileNetwork(openStackCluster *infrav1.OpenStackCluster, clusterResourceName string) error
- func (s *Service) ReconcileRouter(openStackCluster *infrav1.OpenStackCluster, clusterResourceName string) error
- func (s *Service) ReconcileSecurityGroups(openStackCluster *infrav1.OpenStackCluster, clusterResourceName string) error
- func (s *Service) ReconcileSubnet(openStackCluster *infrav1.OpenStackCluster, clusterResourceName string) error
- func (s *Service) RemoveTrunkSubports(trunkID string) error
- func (s *Service) TagFloatingIP(ip string, tag string) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrFilterMatch = fmt.Errorf("filter match error") ErrMultipleMatches = multipleMatchesError{} ErrNoMatches = noMatchesError{} )
Functions ¶
func ExternalNetworksOnly ¶
func ExternalNetworksOnly(opts networks.ListOptsBuilder) networks.ListOptsBuilder
Types ¶
type GetNetworkOpts ¶
type GetNetworkOpts func(networks.ListOptsBuilder) networks.ListOptsBuilder
type PortListOpts ¶
type PortListOpts struct { DeviceOwner []string `q:"device_owner"` NetworkID string `q:"network_id"` }
func (*PortListOpts) ToPortListQuery ¶
func (p *PortListOpts) ToPortListQuery() (string, error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service interfaces with the OpenStack Networking API. It will create a network related infrastructure for the cluster, like network, subnet, router, security groups.
func NewService ¶
func NewService(scope *scope.WithLogger) (*Service, error)
NewService returns an instance of the networking service.
func (*Service) AdoptPorts ¶
func (s *Service) AdoptPorts(scope *scope.WithLogger, desiredPorts []infrav1.ResolvedPortSpec, resources *infrav1.MachineResources) error
AdoptPorts looks for ports in desiredPorts which were previously created, and adds them to resources.Ports. A port matches if it has the same name and network ID as the desired port.
func (*Service) AssociateFloatingIP ¶
func (s *Service) AssociateFloatingIP(eventObject runtime.Object, fp *floatingips.FloatingIP, portID string) error
func (*Service) ConstructPorts ¶
func (s *Service) ConstructPorts(spec *infrav1.OpenStackMachineSpec, clusterResourceName, baseName string, defaultNetwork *infrav1.NetworkStatusWithSubnets, managedSecurityGroup *string, baseTags []string) ([]infrav1.ResolvedPortSpec, error)
ConstructPorts builds an array of ports from the machine spec. If no ports are in the spec, returns a single port for a network connection to the default cluster network.
func (*Service) CreateFloatingIPForPool ¶
func (s *Service) CreateFloatingIPForPool(pool *v1alpha1.OpenStackFloatingIPPool) (*floatingips.FloatingIP, error)
func (*Service) CreatePort ¶
func (*Service) CreatePorts ¶
func (s *Service) CreatePorts(eventObject runtime.Object, desiredPorts []infrav1.ResolvedPortSpec, resources *infrav1.MachineResources) error
func (*Service) DeleteClusterPorts ¶
func (s *Service) DeleteClusterPorts(openStackCluster *infrav1.OpenStackCluster) error
DeleteClusterPorts deletes all ports created for the cluster.
func (*Service) DeleteFloatingIP ¶
func (*Service) DeleteInstanceTrunkAndPort ¶
func (s *Service) DeleteInstanceTrunkAndPort(eventObject runtime.Object, port infrav1.PortStatus, trunkSupported bool) error
DeleteTrunk deletes the Neutron trunk and port with the given ID.
func (*Service) DeleteNetwork ¶
func (s *Service) DeleteNetwork(openStackCluster *infrav1.OpenStackCluster, clusterResourceName string) error
func (*Service) DeletePort ¶
DeletePort deletes the Neutron port with the given ID.
func (*Service) DeleteRouter ¶
func (s *Service) DeleteRouter(openStackCluster *infrav1.OpenStackCluster, clusterResourceName string) error
func (*Service) DeleteSecurityGroups ¶
func (s *Service) DeleteSecurityGroups(openStackCluster *infrav1.OpenStackCluster, clusterResourceName string) error
func (*Service) DeleteTrunk ¶
func (*Service) DisassociateFloatingIP ¶
func (*Service) GetFloatingIP ¶
func (s *Service) GetFloatingIP(ip string) (*floatingips.FloatingIP, error)
func (*Service) GetFloatingIPByPortID ¶
func (s *Service) GetFloatingIPByPortID(portID string) (*floatingips.FloatingIP, error)
func (*Service) GetFloatingIPsByTag ¶
func (s *Service) GetFloatingIPsByTag(tag string) ([]floatingips.FloatingIP, error)
func (*Service) GetNetworkByID ¶
GetNetworkByID retrieves network by the ID.
func (*Service) GetNetworkByParam ¶
func (s *Service) GetNetworkByParam(param *infrav1.NetworkParam, opts ...GetNetworkOpts) (*networks.Network, error)
GetNetworkByParam gets the network specified by the given NetworkParam.
func (*Service) GetNetworkIDByParam ¶
func (s *Service) GetNetworkIDByParam(param *infrav1.NetworkParam, opts ...GetNetworkOpts) (string, error)
GetNetworkIDByParam returns the ID of the network specified by the given NetworkParam. It does not make an OpenStack call if the network is specified by ID.
func (*Service) GetNetworkSubnetByParam ¶
func (s *Service) GetNetworkSubnetByParam(networkID string, param *infrav1.SubnetParam) (*subnets.Subnet, error)
GetNetworkSubnetByParam gets a single subnet of the given network, specified by the given SubnetParam. It returns an ErrFilterMatch if no or multiple subnets are found.
func (*Service) GetOrCreateFloatingIP ¶
func (s *Service) GetOrCreateFloatingIP(eventObject runtime.Object, openStackCluster *infrav1.OpenStackCluster, clusterResourceName string, ip *string) (*floatingips.FloatingIP, error)
func (*Service) GetPortForExternalNetwork ¶
func (*Service) GetPortFromInstanceIP ¶
GetPortFromInstanceIP returns at most one port attached to the instance with given ID and with the IP address provided.
func (*Service) GetSecurityGroups ¶
func (s *Service) GetSecurityGroups(securityGroupParams []infrav1.SecurityGroupParam) ([]string, error)
func (*Service) GetSubnetByParam ¶
GetSubnetByParam gets a single subnet specified by the given SubnetParam It returns an ErrFilterMatch if no or multiple subnets are found.
func (*Service) GetSubnetIDByParam ¶
func (s *Service) GetSubnetIDByParam(param *infrav1.SubnetParam) (string, error)
GetSubnetIDByParam gets the id of a subnet from the given SubnetParam. It does not make any OpenStack API calls if the subnet is specified by ID.
func (*Service) GetSubnetsByFilter ¶
GetSubnetsByFilter gets the id of a subnet by querying openstack with filters.
func (*Service) GetTrunkSupport ¶
func (*Service) IsTrunkExtSupported ¶
IsTrunkExtSupported verifies trunk setup on the OpenStack deployment.
func (*Service) ReconcileExternalNetwork ¶
func (s *Service) ReconcileExternalNetwork(openStackCluster *infrav1.OpenStackCluster) error
ReconcileExternalNetwork will try to find an external network and set it in the cluster status. The external network can be specified in the cluster spec or will be searched for if not specified. OpenStackCluster.Status.ExternalNetwork will be set to nil if one of these conditions are met: - no external network was given in the cluster spec and no external network was found - the user has set OpenStackCluster.Spec.DisableExternalNetwork to true.
func (*Service) ReconcileNetwork ¶
func (s *Service) ReconcileNetwork(openStackCluster *infrav1.OpenStackCluster, clusterResourceName string) error
func (*Service) ReconcileRouter ¶
func (s *Service) ReconcileRouter(openStackCluster *infrav1.OpenStackCluster, clusterResourceName string) error
func (*Service) ReconcileSecurityGroups ¶
func (s *Service) ReconcileSecurityGroups(openStackCluster *infrav1.OpenStackCluster, clusterResourceName string) error
ReconcileSecurityGroups reconcile the security groups.
func (*Service) ReconcileSubnet ¶
func (s *Service) ReconcileSubnet(openStackCluster *infrav1.OpenStackCluster, clusterResourceName string) error