probes

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2017 License: Apache-2.0 Imports: 42 Imported by: 22

Documentation

Index

Constants

View Source
const DockerClientAPIVersion = "1.18"

DockerClientAPIVersion Client API version used

Variables

This section is empty.

Functions

This section is empty.

Types

type BridgeOfProbe added in v0.13.0

type BridgeOfProbe struct {
	Host       string             // The global host
	Bridge     string             // The bridge monitored
	UUID       string             // The UUID of the bridge node
	Address    string             // The address of the bridge if different from name
	BridgeNode *graph.Node        // the bridge node on which the rule nodes are attached.
	OvsOfProbe *OvsOfProbe        // Back pointer to the probe
	Rules      map[string][]*Rule // The set of rules found so far grouped by rawUUID
	// contains filtered or unexported fields
}

BridgeOfProbe is the type of the probe retrieving Openflow rules on a Bridge.

An important notion is the rawUUID of a rule or the UUID obtained by ignoring the priority from the rule filter. Several rules may differ only by their priority (and associated actions). In practice the highest priority hides the other rules. It is important to handle rules with the same rawUUID as a group because ovs-ofctl monitor does not report priorities.

type DockerProbe added in v0.2.0

type DockerProbe struct {
	sync.RWMutex
	*NetNSProbe
	// contains filtered or unexported fields
}

DockerProbe describes a Docker topology graph that enhance the graph

func NewDockerProbe added in v0.2.0

func NewDockerProbe(nsProbe *NetNSProbe, dockerURL string) (probe *DockerProbe, _ error)

NewDockerProbe creates a new topology Docker probe

func NewDockerProbeFromConfig added in v0.2.0

func NewDockerProbeFromConfig(nsProbe *NetNSProbe) (*DockerProbe, error)

NewDockerProbeFromConfig creates a new topology Docker probe based on configuration

func (*DockerProbe) Start added in v0.2.0

func (probe *DockerProbe) Start()

Start the probe

func (*DockerProbe) Stop added in v0.2.0

func (probe *DockerProbe) Stop()

Stop the probe

type Event added in v0.13.0

type Event struct {
	RawRule *Rule   // The rule from the event
	Rules   []*Rule // Rules found by ovs-ofctl matching the event rule filter.
	Date    int64   // the date of the event
	Action  string  // the action taken
	Bridge  string  // The bridge whtere it ocured
}

Event is an event as monitored by ovs-ofctl monitor <br> watch:

type Execute added in v0.13.0

type Execute interface {
	ExecCommand(string, ...string) ([]byte, error)
	ExecCommandPipe(context.Context, string, ...string) (io.Reader, error)
}

Execute exposes an interface to command launch on the OS

type FabricProbe added in v0.6.0

type FabricProbe struct {
	graph.DefaultGraphListener
	Graph *graph.Graph
	// contains filtered or unexported fields
}

FabricProbe describes a topology probe

func NewFabricProbe added in v0.6.0

func NewFabricProbe(g *graph.Graph) *FabricProbe

NewFabricProbe creates a new probe to enhance the graph

func (*FabricProbe) LinkNodes added in v0.8.0

func (fb *FabricProbe) LinkNodes(parent *graph.Node, child *graph.Node, linkMetadata *graph.Metadata)

LinkNodes link the parent and child (layer 2) if there not linked already

func (*FabricProbe) OnEdgeAdded added in v0.6.0

func (fb *FabricProbe) OnEdgeAdded(e *graph.Edge)

OnEdgeAdded event

func (*FabricProbe) OnNodeDeleted added in v0.8.0

func (fb *FabricProbe) OnNodeDeleted(n *graph.Node)

OnNodeDeleted event

func (*FabricProbe) Start added in v0.6.0

func (fb *FabricProbe) Start()

Start the probe

func (*FabricProbe) Stop added in v0.6.0

func (fb *FabricProbe) Stop()

Stop the probe

type NetLinkProbe

type NetLinkProbe struct {
	sync.RWMutex
	Graph *graph.Graph
	// contains filtered or unexported fields
}

NetLinkProbe describes a list NetLink NameSpace probe to enhance the graph

func NewNetLinkProbe

func NewNetLinkProbe(g *graph.Graph) (*NetLinkProbe, error)

NewNetLinkProbe creates a new netlink probe

func (*NetLinkProbe) Register added in v0.11.0

func (u *NetLinkProbe) Register(nsPath string, root *graph.Node) (*NetNsNetLinkProbe, error)

Register a new network netlink/namespace probe in the graph

func (*NetLinkProbe) Start

func (u *NetLinkProbe) Start()

Start the probe

func (*NetLinkProbe) Stop

func (u *NetLinkProbe) Stop()

Stop the probe

func (*NetLinkProbe) Unregister added in v0.11.0

func (u *NetLinkProbe) Unregister(nsPath string) error

Unregister a probe from a network namespace

type NetNSProbe

type NetNSProbe struct {
	sync.RWMutex
	Graph        *graph.Graph
	Root         *graph.Node
	NetLinkProbe *NetLinkProbe
	// contains filtered or unexported fields
}

NetNSProbe describes a netlink probe in a network namespace

func NewNetNSProbe

func NewNetNSProbe(g *graph.Graph, n *graph.Node, nlProbe *NetLinkProbe, runPath ...string) (*NetNSProbe, error)

NewNetNSProbe creates a new network namespace probe

func NewNetNSProbeFromConfig added in v0.4.0

func NewNetNSProbeFromConfig(g *graph.Graph, n *graph.Node, nlProbe *NetLinkProbe) (*NetNSProbe, error)

NewNetNSProbeFromConfig creates a new network namespace probe based on configuration

func (*NetNSProbe) Register added in v0.2.0

func (u *NetNSProbe) Register(path string, extraMetadata graph.Metadata) *graph.Node

Register a new network namespace path

func (*NetNSProbe) Start

func (u *NetNSProbe) Start()

Start the probe

func (*NetNSProbe) Stop

func (u *NetNSProbe) Stop()

Stop the probe

func (*NetNSProbe) Unregister added in v0.2.0

func (u *NetNSProbe) Unregister(path string)

Unregister a network namespace path

type NetNs added in v0.4.0

type NetNs struct {
	// contains filtered or unexported fields
}

NetNs describes a network namespace path associated with a device / inode

func (*NetNs) String added in v0.4.0

func (ns *NetNs) String() string

type NetNsNetLinkProbe added in v0.11.0

type NetNsNetLinkProbe struct {
	sync.RWMutex
	Graph  *graph.Graph
	Root   *graph.Node
	NsPath string
	// contains filtered or unexported fields
}

NetNsNetLinkProbe describes a topology probe based on netlink in a network namespace

type NeutronPortNotFound added in v0.6.0

type NeutronPortNotFound struct {
	MAC string
}

NeutronPortNotFound error

func (NeutronPortNotFound) Error added in v0.6.0

func (e NeutronPortNotFound) Error() string

type NeutronProbe added in v0.12.0

type NeutronProbe struct {
	graph.DefaultGraphListener
	// contains filtered or unexported fields
}

NeutronProbe describes a topology porbe that map neutron attribues in the graph

func NewNeutronProbe added in v0.12.0

func NewNeutronProbe(g *graph.Graph, authURL, username, password, tenantName, regionName, domainName string, availability gophercloud.Availability) (*NeutronProbe, error)

NewNeutronProbe creates a neutron probe that will enhance the graph

func NewNeutronProbeFromConfig added in v0.12.0

func NewNeutronProbeFromConfig(g *graph.Graph) (*NeutronProbe, error)

NewNeutronProbeFromConfig creates a new neutron probe based on configuration

func (*NeutronProbe) OnNodeAdded added in v0.12.0

func (mapper *NeutronProbe) OnNodeAdded(n *graph.Node)

OnNodeAdded event

func (*NeutronProbe) OnNodeDeleted added in v0.13.0

func (mapper *NeutronProbe) OnNodeDeleted(n *graph.Node)

OnNodeDeleted event

func (*NeutronProbe) OnNodeUpdated added in v0.12.0

func (mapper *NeutronProbe) OnNodeUpdated(n *graph.Node)

OnNodeUpdated event

func (*NeutronProbe) Start added in v0.12.0

func (mapper *NeutronProbe) Start()

Start the probe

func (*NeutronProbe) Stop added in v0.12.0

func (mapper *NeutronProbe) Stop()

Stop the probe

type OpenContrailMdata added in v0.11.0

type OpenContrailMdata struct {
	UUID    string
	Mac     string
	VRF     string
	LocalIP string
}

OpenContrailMdata metadata

type OpenContrailProbe added in v0.12.0

type OpenContrailProbe struct {
	graph.DefaultGraphListener
	// contains filtered or unexported fields
}

OpenContrailProbe describes a probe that reads OpenContrail database and updates the graph

func NewOpenContrailProbeFromConfig added in v0.12.0

func NewOpenContrailProbeFromConfig(g *graph.Graph, r *graph.Node) *OpenContrailProbe

NewOpenContrailProbeFromConfig creates a new OpenContrail probe based on configuration

func (*OpenContrailProbe) OnNodeAdded added in v0.12.0

func (mapper *OpenContrailProbe) OnNodeAdded(n *graph.Node)

OnNodeAdded event

func (*OpenContrailProbe) OnNodeDeleted added in v0.12.0

func (mapper *OpenContrailProbe) OnNodeDeleted(n *graph.Node)

OnNodeDeleted event

func (*OpenContrailProbe) OnNodeUpdated added in v0.12.0

func (mapper *OpenContrailProbe) OnNodeUpdated(n *graph.Node)

OnNodeUpdated event

func (*OpenContrailProbe) Start added in v0.12.0

func (mapper *OpenContrailProbe) Start()

Start the probe

func (*OpenContrailProbe) Stop added in v0.12.0

func (mapper *OpenContrailProbe) Stop()

Stop the probe

type OvsOfProbe added in v0.13.0

type OvsOfProbe struct {
	sync.Mutex
	Host         string                    // The host
	Graph        *graph.Graph              // The graph that will receive the rules found
	Root         *graph.Node               // The root node of the host in the graph
	BridgeProbes map[string]*BridgeOfProbe // The table of probes associated to each bridge
	Translation  map[string]string         // A translation table to find the url for a given bridge knowing its name
	Certificate  string                    // Path to the certificate used for authenticated communication with bridges
	PrivateKey   string                    // Path of the private key authenticating the probe.
	CA           string                    // Path of the certicate of the Certificate authority used for authenticated communication with bridges
	// contains filtered or unexported fields
}

OvsOfProbe is the type of the probe retrieving Openflow rules on an Open Vswitch

func NewOvsOfProbe added in v0.13.0

func NewOvsOfProbe(g *graph.Graph, root *graph.Node, host string) *OvsOfProbe

NewOvsOfProbe creates a new probe associated to a given graph, root node and host.

func (*OvsOfProbe) NewBridgeProbe added in v0.13.0

func (o *OvsOfProbe) NewBridgeProbe(host string, bridge string, uuid string, bridgeNode *graph.Node) (*BridgeOfProbe, error)

NewBridgeProbe creates a probe and launch the active process

func (*OvsOfProbe) OnOvsBridgeAdd added in v0.13.0

func (o *OvsOfProbe) OnOvsBridgeAdd(bridgeNode *graph.Node)

OnOvsBridgeAdd is called when a bridge is added

func (*OvsOfProbe) OnOvsBridgeDel added in v0.13.0

func (o *OvsOfProbe) OnOvsBridgeDel(uuid string, bridgeNode *graph.Node)

OnOvsBridgeDel is called when a bridge is deleted

type OvsdbProbe

type OvsdbProbe struct {
	sync.Mutex
	Graph      *graph.Graph
	Root       *graph.Node
	OvsMon     *ovsdb.OvsMonitor
	OvsOfProbe *OvsOfProbe
	// contains filtered or unexported fields
}

OvsdbProbe describes a probe that reads OVS database and updates the graph

func NewOvsdbProbe

func NewOvsdbProbe(g *graph.Graph, n *graph.Node, p string, t string) *OvsdbProbe

NewOvsdbProbe creates a new graph OVS database probe

func NewOvsdbProbeFromConfig added in v0.2.0

func NewOvsdbProbeFromConfig(g *graph.Graph, n *graph.Node) *OvsdbProbe

NewOvsdbProbeFromConfig creates a new probe based on configuration

func (*OvsdbProbe) OnOvsBridgeAdd

func (o *OvsdbProbe) OnOvsBridgeAdd(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)

OnOvsBridgeAdd event

func (*OvsdbProbe) OnOvsBridgeDel

func (o *OvsdbProbe) OnOvsBridgeDel(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)

OnOvsBridgeDel event

func (*OvsdbProbe) OnOvsBridgeUpdate

func (o *OvsdbProbe) OnOvsBridgeUpdate(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)

OnOvsBridgeUpdate event

func (*OvsdbProbe) OnOvsInterfaceAdd

func (o *OvsdbProbe) OnOvsInterfaceAdd(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)

OnOvsInterfaceAdd event

func (*OvsdbProbe) OnOvsInterfaceDel

func (o *OvsdbProbe) OnOvsInterfaceDel(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)

OnOvsInterfaceDel event

func (*OvsdbProbe) OnOvsInterfaceUpdate

func (o *OvsdbProbe) OnOvsInterfaceUpdate(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)

OnOvsInterfaceUpdate event

func (*OvsdbProbe) OnOvsPortAdd

func (o *OvsdbProbe) OnOvsPortAdd(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)

OnOvsPortAdd event

func (*OvsdbProbe) OnOvsPortDel

func (o *OvsdbProbe) OnOvsPortDel(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)

OnOvsPortDel event

func (*OvsdbProbe) OnOvsPortUpdate

func (o *OvsdbProbe) OnOvsPortUpdate(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)

OnOvsPortUpdate event

func (*OvsdbProbe) Start

func (o *OvsdbProbe) Start()

Start the probe

func (*OvsdbProbe) Stop added in v0.2.0

func (o *OvsdbProbe) Stop()

Stop the probe

type PeeringProbe added in v0.9.0

type PeeringProbe struct {
	graph.DefaultGraphListener
	// contains filtered or unexported fields
}

PeeringProbe describes graph peering based on MAC address and graph events

func NewPeeringProbe added in v0.9.0

func NewPeeringProbe(g *graph.Graph) *PeeringProbe

NewPeeringProbe creates a new graph node peering probe

func (*PeeringProbe) OnNodeAdded added in v0.9.0

func (p *PeeringProbe) OnNodeAdded(n *graph.Node)

OnNodeAdded event

func (*PeeringProbe) OnNodeDeleted added in v0.9.0

func (p *PeeringProbe) OnNodeDeleted(n *graph.Node)

OnNodeDeleted event

func (*PeeringProbe) OnNodeUpdated added in v0.9.0

func (p *PeeringProbe) OnNodeUpdated(n *graph.Node)

OnNodeUpdated event

func (*PeeringProbe) Start added in v0.9.0

func (p *PeeringProbe) Start()

Start the MAC peering resolver probe

func (*PeeringProbe) Stop added in v0.9.0

func (p *PeeringProbe) Stop()

Stop the probe

type RealExecute added in v0.13.0

type RealExecute struct{}

RealExecute is the actual implementation given below. It can be overriden for tests.

func (RealExecute) ExecCommand added in v0.13.0

func (r RealExecute) ExecCommand(com string, args ...string) ([]byte, error)

ExecCommand executes a command on a host

func (RealExecute) ExecCommandPipe added in v0.13.0

func (r RealExecute) ExecCommandPipe(ctx context.Context, com string, args ...string) (io.Reader, error)

ExecCommandPipe executes a command on a host and gives back a pipe to control it.

type Rule added in v0.13.0

type Rule struct {
	Cookie   uint64 // cookie value of the rule
	Table    int    // table containing the rule
	Priority int    // priority of rule
	Filter   string // all the filters as a comma separated string
	Actions  string // all the actions (comma separated)
	InPort   int    // -1 is any
	UUID     string // Unique id
}

Rule is an OpenFlow rule in a switch

Jump to

Keyboard shortcuts

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