Documentation
¶
Index ¶
- func CleanAllNMStatePolicies(apiClient *clients.Settings, options ...goclient.ListOptions) error
- type AdditionalOptions
- type Bridge
- type Builder
- type DesiredState
- type Ethernet
- type InterfaceIPAddress
- type InterfaceIpv4
- type InterfaceIpv6
- type LinkAggregation
- type NetworkInterface
- type OptionsLinkAggregation
- type PolicyBuilder
- func (builder *PolicyBuilder) Create() (*PolicyBuilder, error)
- func (builder *PolicyBuilder) Delete() (*PolicyBuilder, error)
- func (builder *PolicyBuilder) Exists() bool
- func (builder *PolicyBuilder) Get() (*nmstateV1.NodeNetworkConfigurationPolicy, error)
- func (builder *PolicyBuilder) Update(force bool) (*PolicyBuilder, error)
- func (builder *PolicyBuilder) WaitUntilCondition(condition nmstateShared.ConditionType, timeout time.Duration) error
- func (builder *PolicyBuilder) WithAbsentInterface(interfaceName string) *PolicyBuilder
- func (builder *PolicyBuilder) WithBondInterface(slavePorts []string, bondName, mode string) *PolicyBuilder
- func (builder *PolicyBuilder) WithInterfaceAndVFs(sriovInterface string, numberOfVF uint8) *PolicyBuilder
- func (builder *PolicyBuilder) WithOptions(options ...AdditionalOptions) *PolicyBuilder
- func (builder *PolicyBuilder) WithVlanInterface(baseInterface string, vlanID uint16) *PolicyBuilder
- func (builder *PolicyBuilder) WithVlanInterfaceIP(baseInterface, ipv4Addresses, ipv6Addresses string, vlanID uint16) *PolicyBuilder
- type Sriov
- type StateBuilder
- func (builder *StateBuilder) Exists() bool
- func (builder *StateBuilder) Get() (*nmstateV1alpha1.NodeNetworkState, error)
- func (builder *StateBuilder) GetInterfaceType(interfaceName, interfaceType string) (NetworkInterface, error)
- func (builder *StateBuilder) GetSriovVfs(sriovInterfaceName string) ([]Vf, error)
- func (builder *StateBuilder) GetTotalVFs(sriovInterfaceName string) (int, error)
- type Vf
- type Vlan
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanAllNMStatePolicies ¶
func CleanAllNMStatePolicies(apiClient *clients.Settings, options ...goclient.ListOptions) error
CleanAllNMStatePolicies removes all NodeNetworkConfigurationPolicies.
Types ¶
type AdditionalOptions ¶
type AdditionalOptions func(builder *PolicyBuilder) (*PolicyBuilder, error)
AdditionalOptions additional options for pod object.
type Bridge ¶
Bridge provides struct for the NMState Interface Ethernet Bridge state object containing interface Bridge information.
type Builder ¶
type Builder struct { // NMState definition. Used to create NMState object with minimum set of required elements. Definition *nmstateV1.NMState // Created NMState object on the cluster. Object *nmstateV1.NMState // contains filtered or unexported fields }
Builder provides struct for the NMState object containing connection to the cluster and the NMState definitions.
func NewBuilder ¶
NewBuilder creates a new instance of nmstate Builder.
func PullNMstate ¶
PullNMstate retrieves an existing NMState object from the cluster.
func (*Builder) Create ¶
Create makes a NMState in the cluster and stores the created object in struct.
type DesiredState ¶
type DesiredState struct {
Interfaces []NetworkInterface `yaml:"interfaces,omitempty"`
}
DesiredState provides struct for the NMState desired state object containing all NMState configuration.
type Ethernet ¶
type Ethernet struct {
Sriov Sriov `yaml:"sr-iov,omitempty"`
}
Ethernet provides struct for the NMState Interface Ethernet state object containing interface Ethernet information.
type InterfaceIPAddress ¶
type InterfaceIPAddress struct { IP net.IP `yaml:"ip,omitempty"` PrefixLen uint8 `yaml:"prefix-length,omitempty"` }
InterfaceIPAddress is a struct for constructing an IP with prefix.
type InterfaceIpv4 ¶
type InterfaceIpv4 struct { Enabled bool `yaml:"enabled,omitempty"` Dhcp bool `yaml:"dhcp,omitempty"` Address []InterfaceIPAddress `yaml:"address,omitempty"` }
InterfaceIpv4 enables an IPv4 address on an interface.
type InterfaceIpv6 ¶
type InterfaceIpv6 struct { Enabled bool `yaml:"enabled,omitempty"` Dhcp bool `json:"dhcp,omitempty"` Address []InterfaceIPAddress `yaml:"address,omitempty"` }
InterfaceIpv6 enables an IPv6 address on an interface.
type LinkAggregation ¶
type LinkAggregation struct { Mode string `yaml:"mode"` Options OptionsLinkAggregation `yaml:"options,omitempty"` Port []string `yaml:"port,omitempty"` }
LinkAggregation provides struct for the NMState Interface Ethernet LinkAggregation state object containing interface LinkAggregation information.
type NetworkInterface ¶
type NetworkInterface struct { Name string `yaml:"name"` Type string `yaml:"type"` State string `yaml:"state"` Ethernet Ethernet `yaml:"ethernet,omitempty"` Bridge Bridge `yaml:"bridge,omitempty"` LinkAggregation LinkAggregation `yaml:"link-aggregation,omitempty"` Vlan Vlan `yaml:"vlan,omitempty"` Ipv4 InterfaceIpv4 `yaml:"ipv4,omitempty"` Ipv6 InterfaceIpv6 `yaml:"ipv6,omitempty"` }
NetworkInterface provides struct for the NMState interface state object containing interface information.
type OptionsLinkAggregation ¶
type OptionsLinkAggregation struct { Primary string `yaml:"primary,omitempty"` Miimon int `yaml:"miimon,omitempty"` FailOverMac string `yaml:"fail_over_mac,omitempty"` }
OptionsLinkAggregation provides struct for the NMState Interface Ethernet LinkAggregation Options state object containing interface LinkAggregation Options information.
type PolicyBuilder ¶
type PolicyBuilder struct { // srIovPolicy definition. Used to create srIovPolicy object. Definition *nmstateV1.NodeNetworkConfigurationPolicy // Created srIovPolicy object Object *nmstateV1.NodeNetworkConfigurationPolicy // contains filtered or unexported fields }
PolicyBuilder provides struct for the NodeNetworkConfigurationPolicy object containing connection to the cluster and the NodeNetworkConfigurationPolicy definition.
func ListPolicy ¶
func ListPolicy(apiClient *clients.Settings, options ...goclient.ListOptions) ([]*PolicyBuilder, error)
ListPolicy returns a list of NodeNetworkConfigurationPolicy.
func NewPolicyBuilder ¶
func NewPolicyBuilder(apiClient *clients.Settings, name string, nodeSelector map[string]string) *PolicyBuilder
NewPolicyBuilder creates a new instance of PolicyBuilder.
func (*PolicyBuilder) Create ¶
func (builder *PolicyBuilder) Create() (*PolicyBuilder, error)
Create makes a NodeNetworkConfigurationPolicy in the cluster and stores the created object in struct.
func (*PolicyBuilder) Delete ¶
func (builder *PolicyBuilder) Delete() (*PolicyBuilder, error)
Delete removes NodeNetworkConfigurationPolicy object from a cluster.
func (*PolicyBuilder) Exists ¶
func (builder *PolicyBuilder) Exists() bool
Exists checks whether the given NodeNetworkConfigurationPolicy exists.
func (*PolicyBuilder) Get ¶
func (builder *PolicyBuilder) Get() (*nmstateV1.NodeNetworkConfigurationPolicy, error)
Get returns NodeNetworkConfigurationPolicy object if found.
func (*PolicyBuilder) Update ¶
func (builder *PolicyBuilder) Update(force bool) (*PolicyBuilder, error)
Update renovates the existing NodeNetworkConfigurationPolicy object with the NodeNetworkConfigurationPolicy definition in builder.
func (*PolicyBuilder) WaitUntilCondition ¶
func (builder *PolicyBuilder) WaitUntilCondition(condition nmstateShared.ConditionType, timeout time.Duration) error
WaitUntilCondition waits for the duration of the defined timeout or until the NodeNetworkConfigurationPolicy gets to a specific condition.
func (*PolicyBuilder) WithAbsentInterface ¶
func (builder *PolicyBuilder) WithAbsentInterface(interfaceName string) *PolicyBuilder
WithAbsentInterface appends the configuration for an absent interface to the NodeNetworkConfigurationPolicy.
func (*PolicyBuilder) WithBondInterface ¶
func (builder *PolicyBuilder) WithBondInterface(slavePorts []string, bondName, mode string) *PolicyBuilder
WithBondInterface adds Bond interface configuration to the NodeNetworkConfigurationPolicy.
func (*PolicyBuilder) WithInterfaceAndVFs ¶
func (builder *PolicyBuilder) WithInterfaceAndVFs(sriovInterface string, numberOfVF uint8) *PolicyBuilder
WithInterfaceAndVFs adds SR-IOV VF configuration to the NodeNetworkConfigurationPolicy.
func (*PolicyBuilder) WithOptions ¶
func (builder *PolicyBuilder) WithOptions(options ...AdditionalOptions) *PolicyBuilder
WithOptions creates pod with generic mutation options.
func (*PolicyBuilder) WithVlanInterface ¶
func (builder *PolicyBuilder) WithVlanInterface(baseInterface string, vlanID uint16) *PolicyBuilder
WithVlanInterface adds VLAN interface configuration to the NodeNetworkConfigurationPolicy.
func (*PolicyBuilder) WithVlanInterfaceIP ¶
func (builder *PolicyBuilder) WithVlanInterfaceIP(baseInterface, ipv4Addresses, ipv6Addresses string, vlanID uint16) *PolicyBuilder
WithVlanInterfaceIP adds VLAN interface with IP configuration to the NodeNetworkConfigurationPolicy.
type Sriov ¶
Sriov provides struct for the NMState Interface Ethernet Sriov state object containing interface Ethernet Sriov information.
type StateBuilder ¶
type StateBuilder struct { // Created NodeNetworkState object on the cluster. Object *nmstateV1alpha1.NodeNetworkState // contains filtered or unexported fields }
StateBuilder provides struct for the NodeNetworkState object containing connection to the cluster.
func PullNodeNetworkState ¶
func PullNodeNetworkState(apiClient *clients.Settings, name string) (*StateBuilder, error)
PullNodeNetworkState retrieves an existing NodeNetworkState object from the cluster.
func (*StateBuilder) Exists ¶
func (builder *StateBuilder) Exists() bool
Exists checks whether the given NodeNetworkState exists.
func (*StateBuilder) Get ¶
func (builder *StateBuilder) Get() (*nmstateV1alpha1.NodeNetworkState, error)
Get returns NodeNetworkState object if found.
func (*StateBuilder) GetInterfaceType ¶
func (builder *StateBuilder) GetInterfaceType(interfaceName, interfaceType string) (NetworkInterface, error)
GetInterfaceType returns Interface with the given interface name and given type.
func (*StateBuilder) GetSriovVfs ¶
func (builder *StateBuilder) GetSriovVfs(sriovInterfaceName string) ([]Vf, error)
GetSriovVfs returns all configured VFs under the given SR-IOV interface.
func (*StateBuilder) GetTotalVFs ¶
func (builder *StateBuilder) GetTotalVFs(sriovInterfaceName string) (int, error)
GetTotalVFs returns total-vfs under the given interface.
type Vf ¶
type Vf struct { ID int `yaml:"id"` MacAddress string `yaml:"mac-address,omitempty"` MaxTxRate *int `yaml:"max-tx-rate,omitempty"` MinTxRate *int `yaml:"min-tx-rate,omitempty"` Qos *int `yaml:"qos,omitempty"` SpoofCheck *bool `yaml:"spoof-check,omitempty"` Trust *bool `yaml:"trust,omitempty"` VlanID *int `yaml:"vlan-id,omitempty"` }
Vf provides struct for the NMState SR-IOV VF state object containing SR-IOV VF information.