plugin

package
v0.0.0-...-8dd92da Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitGlobalSettings

func InitGlobalSettings(stateDriver core.StateDriver, inst *core.InstanceInfo) error

InitGlobalSettings initializes cluster-wide settings (e.g. fwd-mode)

Types

type Config

type Config struct {
	Drivers  Drivers           `json:"drivers"`
	Instance core.InstanceInfo `json:"plugin-instance"`
}

Config has the configuration for the plugin

type Drivers

type Drivers struct {
	Network  string `json:"network"`
	Endpoint string `json:"endpoint"`
	State    string `json:"state"`
}

Drivers has driver config

type NetPlugin

type NetPlugin struct {
	sync.Mutex
	ConfigFile    string
	NetworkDriver core.NetworkDriver
	StateDriver   core.StateDriver
	PluginConfig  Config
}

NetPlugin is the configuration struct for the plugin bus. Network and Endpoint drivers are all present in `drivers/` and state drivers are present in `state/`.

func (*NetPlugin) AddBgp

func (p *NetPlugin) AddBgp(id string) error

AddBgp adds bgp configs

func (*NetPlugin) AddMaster

func (p *NetPlugin) AddMaster(node core.ServiceInfo) error

AddMaster adds a master node.

func (*NetPlugin) AddPeerHost

func (p *NetPlugin) AddPeerHost(node core.ServiceInfo) error

AddPeerHost adds an peer host.

func (*NetPlugin) AddPolicyRule

func (p *NetPlugin) AddPolicyRule(id string) error

AddPolicyRule creates a policy rule

func (*NetPlugin) AddServiceLB

func (p *NetPlugin) AddServiceLB(servicename string, spec *core.ServiceSpec) error

AddServiceLB adds service

func (*NetPlugin) AddSvcSpec

func (p *NetPlugin) AddSvcSpec(svcName string, spec *core.ServiceSpec)

AddSvcSpec adds k8 service spec

func (*NetPlugin) CreateEndpoint

func (p *NetPlugin) CreateEndpoint(id string) error

CreateEndpoint creates an endpoint for a given ID.

func (*NetPlugin) CreateHostAccPort

func (p *NetPlugin) CreateHostAccPort(portName, globalIP string) (string, error)

CreateHostAccPort creates a host access port

func (*NetPlugin) CreateNetwork

func (p *NetPlugin) CreateNetwork(id string) error

CreateNetwork creates a network for a given ID.

func (*NetPlugin) CreateRemoteEndpoint

func (p *NetPlugin) CreateRemoteEndpoint(id string) error

CreateRemoteEndpoint creates an endpoint for a given ID.

func (*NetPlugin) Deinit

func (p *NetPlugin) Deinit()

Deinit is a destructor for the NetPlugin configuration.

func (*NetPlugin) DelPolicyRule

func (p *NetPlugin) DelPolicyRule(id string) error

DelPolicyRule creates a policy rule

func (*NetPlugin) DelSvcSpec

func (p *NetPlugin) DelSvcSpec(svcName string, spec *core.ServiceSpec)

DelSvcSpec deletes k8 service spec

func (*NetPlugin) DeleteBgp

func (p *NetPlugin) DeleteBgp(id string) error

DeleteBgp deletes bgp configs

func (*NetPlugin) DeleteEndpoint

func (p *NetPlugin) DeleteEndpoint(id string) error

DeleteEndpoint destroys an endpoint for an ID.

func (*NetPlugin) DeleteHostAccPort

func (p *NetPlugin) DeleteHostAccPort(portName string) error

DeleteHostAccPort creates a host access port

func (*NetPlugin) DeleteMaster

func (p *NetPlugin) DeleteMaster(node core.ServiceInfo) error

DeleteMaster removes a master node

func (*NetPlugin) DeleteNetwork

func (p *NetPlugin) DeleteNetwork(id, subnet, nwType, encap string, pktTag, extPktTag int, Gw string, tenant string) error

DeleteNetwork deletes a network provided by the ID.

func (*NetPlugin) DeletePeerHost

func (p *NetPlugin) DeletePeerHost(node core.ServiceInfo) error

DeletePeerHost removes a peer host.

func (*NetPlugin) DeleteRemoteEndpoint

func (p *NetPlugin) DeleteRemoteEndpoint(id string) error

DeleteRemoteEndpoint destroys an endpoint for an ID.

func (*NetPlugin) DeleteServiceLB

func (p *NetPlugin) DeleteServiceLB(servicename string, spec *core.ServiceSpec) error

DeleteServiceLB deletes service

func (*NetPlugin) FetchEndpoint

func (p *NetPlugin) FetchEndpoint(id string) (core.State, error)

FetchEndpoint retrieves an endpoint's state for a given ID

func (*NetPlugin) FetchNetwork

func (p *NetPlugin) FetchNetwork(id string) (core.State, error)

FetchNetwork retrieves a network's state given an ID.

func (*NetPlugin) GetEndpointStats

func (p *NetPlugin) GetEndpointStats() ([]byte, error)

GetEndpointStats returns all endpoint stats

func (*NetPlugin) GlobalConfigUpdate

func (p *NetPlugin) GlobalConfigUpdate(cfg Config) error

GlobalConfigUpdate update global config

func (*NetPlugin) Init

func (p *NetPlugin) Init(pluginConfig Config) error

Init initializes the NetPlugin instance via the configuration string passed.

func (*NetPlugin) InspectBgp

func (p *NetPlugin) InspectBgp() ([]byte, error)

InspectBgp returns current state of the plugin

func (*NetPlugin) InspectNameserver

func (p *NetPlugin) InspectNameserver() ([]byte, error)

InspectNameserver returns current state of the nameserver

func (*NetPlugin) InspectState

func (p *NetPlugin) InspectState() ([]byte, error)

InspectState returns current state of the plugin

func (*NetPlugin) Reinit

func (p *NetPlugin) Reinit(cfg Config)

Reinit reinitialize the network driver

func (*NetPlugin) SvcProviderUpdate

func (p *NetPlugin) SvcProviderUpdate(servicename string, providers []string)

SvcProviderUpdate function

func (*NetPlugin) UpdateEndpointGroup

func (p *NetPlugin) UpdateEndpointGroup(id string) error

UpdateEndpointGroup updates the endpoint with the new endpointgroup specification for the given ID.

Jump to

Keyboard shortcuts

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