Documentation
¶
Overview ¶
Copyright 2020 CLOUD&HEAT Technologies GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Copyright 2020 CLOUD&HEAT Technologies GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Copyright 2020 CLOUD&HEAT Technologies GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- Constants
- Variables
- func NewProviderClient(cfg *config.AuthOpts) (*gophercloud.ProviderClient, error)
- type CachedPort
- type CustomCreateOpts
- type OpenStackClient
- type OpenStackL3PortManager
- func (pm *OpenStackL3PortManager) CheckPortExists(portID string) (bool, error)
- func (pm *OpenStackL3PortManager) CleanUnusedPorts(usedPorts []string) error
- func (pm *OpenStackL3PortManager) EnsureAgentsState() error
- func (pm *OpenStackL3PortManager) GetAvailablePorts() ([]string, error)
- func (pm *OpenStackL3PortManager) GetExternalAddress(portID string) (string, string, error)
- func (pm *OpenStackL3PortManager) GetInternalAddress(portID string) (string, error)
- func (pm *OpenStackL3PortManager) ProvisionPort() (string, error)
- type PortClient
- type UncachedClient
- func (pc *UncachedClient) Create(c *gophercloud.ServiceClient, opts portsv2.CreateOptsBuilder) (*portsv2.Port, error)
- func (pc *UncachedClient) Delete(c *gophercloud.ServiceClient, id string) (r portsv2.DeleteResult)
- func (pc *UncachedClient) GetPortByID(ID string) (port *portsv2.Port, fip *floatingipsv2.FloatingIP, err error)
- func (pc *UncachedClient) GetPorts() (ports []portsv2.Port, err error)
- func (pc *UncachedClient) Update(c *gophercloud.ServiceClient, id string, opts portsv2.UpdateOptsBuilder) (*portsv2.Port, error)
Constants ¶
const ( TagLBManagedPort = "cah-loadbalancer.k8s.cloudandheat.com/managed" DescriptionLBManagedPort = "Managed by cah-loadbalancer" )
Variables ¶
var ( ErrFloatingIPMissing = errors.New("Expected floating IP was not found") ErrFixedIPMissing = errors.New("Port has no IP address assigned") ErrPortIsNil = errors.New("Port is nil") ErrNoFloatingIPCreated = errors.New("No floating IP was created by OpenStack") ErrVRRPSetupFailed = errors.New("Failed to update address pairs of all agents") )
Functions ¶
func NewProviderClient ¶
func NewProviderClient(cfg *config.AuthOpts) (*gophercloud.ProviderClient, error)
Types ¶
type CachedPort ¶
type CachedPort struct {
Port portsv2.Port
FloatingIP *floatingipsv2.FloatingIP
}
type CustomCreateOpts ¶
type CustomCreateOpts struct {
NetworkID string `json:"network_id" required:"true"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
AdminStateUp *bool `json:"admin_state_up,omitempty"`
MACAddress string `json:"mac_address,omitempty"`
FixedIPs interface{} `json:"fixed_ips,omitempty"`
DeviceID string `json:"device_id,omitempty"`
DeviceOwner string `json:"device_owner,omitempty"`
TenantID string `json:"tenant_id,omitempty"`
ProjectID string `json:"project_id,omitempty"`
SecurityGroups *[]string `json:"security_groups,omitempty"`
AllowedAddressPairs []portsv2.AddressPair `json:"allowed_address_pairs,omitempty"`
// specifically this one
PortSecurityEnabled *bool `json:"port_security_enabled,omitempty"`
}
We need options which are not included in the default gophercloud struct
func (CustomCreateOpts) ToPortCreateMap ¶
func (opts CustomCreateOpts) ToPortCreateMap() (map[string]interface{}, error)
type OpenStackClient ¶
type OpenStackClient struct {
// contains filtered or unexported fields
}
func (*OpenStackClient) NewNetworkV2 ¶
func (client *OpenStackClient) NewNetworkV2() (*gophercloud.ServiceClient, error)
func (*OpenStackClient) NewOpenStackL3PortManager ¶
func (client *OpenStackClient) NewOpenStackL3PortManager(networkConfig *config.NetworkingOpts, agents []config.Agent, additionalAddressPairs []string) (*OpenStackL3PortManager, error)
type OpenStackL3PortManager ¶
type OpenStackL3PortManager struct {
// contains filtered or unexported fields
}
func (*OpenStackL3PortManager) CheckPortExists ¶ added in v0.6.0
func (pm *OpenStackL3PortManager) CheckPortExists(portID string) (bool, error)
CheckPortExists tries to fetch the port with the given ID and return true if it was successful. Returns false if a 404 was returned.
func (*OpenStackL3PortManager) CleanUnusedPorts ¶
func (pm *OpenStackL3PortManager) CleanUnusedPorts(usedPorts []string) error
func (*OpenStackL3PortManager) EnsureAgentsState ¶ added in v0.8.0
func (pm *OpenStackL3PortManager) EnsureAgentsState() error
Ensures that all fixed IPs of L3 ports as well as additional configured IPs are configured as allowed address pair of all agent nodes. Should be run periodically to ensure a correct setup in case an agent was unresponsive earlier
func (*OpenStackL3PortManager) GetAvailablePorts ¶
func (pm *OpenStackL3PortManager) GetAvailablePorts() ([]string, error)
func (*OpenStackL3PortManager) GetExternalAddress ¶
func (pm *OpenStackL3PortManager) GetExternalAddress(portID string) (string, string, error)
func (*OpenStackL3PortManager) GetInternalAddress ¶
func (pm *OpenStackL3PortManager) GetInternalAddress(portID string) (string, error)
func (*OpenStackL3PortManager) ProvisionPort ¶
func (pm *OpenStackL3PortManager) ProvisionPort() (string, error)
type PortClient ¶ added in v0.4.0
type PortClient interface {
Create(c *gophercloud.ServiceClient, opts portsv2.CreateOptsBuilder) (*portsv2.Port, error)
GetPorts() ([]portsv2.Port, error)
GetPortByID(ID string) (*portsv2.Port, *floatingipsv2.FloatingIP, error)
Update(c *gophercloud.ServiceClient, id string, opts portsv2.UpdateOptsBuilder) (*portsv2.Port, error)
Delete(c *gophercloud.ServiceClient, id string) portsv2.DeleteResult
}
type UncachedClient ¶ added in v0.4.0
type UncachedClient struct {
// contains filtered or unexported fields
}
func NewPortClient ¶ added in v0.4.0
func NewPortClient(networkingclient *gophercloud.ServiceClient, tag string, useFloatingIPs bool, projectID string) *UncachedClient
func (*UncachedClient) Create ¶ added in v0.8.0
func (pc *UncachedClient) Create(c *gophercloud.ServiceClient, opts portsv2.CreateOptsBuilder) (*portsv2.Port, error)
func (*UncachedClient) Delete ¶ added in v0.8.0
func (pc *UncachedClient) Delete(c *gophercloud.ServiceClient, id string) (r portsv2.DeleteResult)
func (*UncachedClient) GetPortByID ¶ added in v0.4.0
func (pc *UncachedClient) GetPortByID(ID string) (port *portsv2.Port, fip *floatingipsv2.FloatingIP, err error)
func (*UncachedClient) GetPorts ¶ added in v0.4.0
func (pc *UncachedClient) GetPorts() (ports []portsv2.Port, err error)
func (*UncachedClient) Update ¶ added in v0.8.0
func (pc *UncachedClient) Update(c *gophercloud.ServiceClient, id string, opts portsv2.UpdateOptsBuilder) (*portsv2.Port, error)
Directories
¶
| Path | Synopsis |
|---|---|
|
Copyright 2020 CLOUD&HEAT Technologies GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
|
Copyright 2020 CLOUD&HEAT Technologies GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. |