types

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 10 Imported by: 30

Documentation

Overview

Package types defines the API resource types

swagger:meta

Index

Constants

View Source
const (
	// PIModeUniqPerNode use a unique packet identifier per source node
	PIModeUniqPerNode = "unique"
	// PIModeRandom use random packet identifier for each packet
	PIModeRandom = "random"

	// PITypeICMP4 icmpv4 packet
	PITypeICMP4 = "icmp4"
	// PITypeICMP6 icmpv6 packet
	PITypeICMP6 = "icmp6"
	// PITypeTCP4 ipv4 + tcp packet
	PITypeTCP4 = "tcp4"
	// PITypeTCP6 ipv6 + tcp packet
	PITypeTCP6 = "tcp6"
	// PITypeUDP4 ipv4 + udp packet
	PITypeUDP4 = "udp4"
	// PITypeUDP6 ipv6 + udp packet
	PITypeUDP6 = "udp6"
)

Variables

View Source
var SchemaValidator schema.Validator

SchemaValidator validates resources against JSON schemas

Functions

This section is empty.

Types

type Capture

type Capture struct {
	// swagger:allOf
	rest.BasicResource `yaml:",inline"`
	// Gremlin Query
	// required: true
	GremlinQuery string `json:"GremlinQuery,omitempty" valid:"isGremlinExpr" yaml:"GremlinQuery"`
	// BPF filter
	BPFFilter string `json:"BPFFilter,omitempty" valid:"isBPFFilter" yaml:"BPFFilter"`
	// Capture name
	Name string `json:"Name,omitempty" yaml:"Name"`
	// Capture description
	Description string `json:"Description,omitempty" yaml:"Description"`
	// Capture type. Can be afpacket, pcap, ebpf, sflow, pcapsocket, ovsmirror, dpdk, ovssflow or ovsnetflow
	Type string `json:"Type,omitempty" valid:"isValidCaptureType" yaml:"Type"`
	// Number of active captures
	// swagger:ignore
	Count int `json:"Count" yaml:"Count"`
	// SFlow port
	Port int `json:"Port,omitempty" yaml:"Port"`
	// Sampling rate for SFlow flows. 0: no flow samples
	SamplingRate uint32 `json:"SamplingRate" yaml:"SamplingRate"`
	// Polling interval for SFlow counters, 0: no counter samples
	PollingInterval uint32 `json:"PollingInterval" yaml:"PollingInterval"`
	// Maximum number of raw packets captured, 0: no packet, -1: unlimited
	RawPacketLimit int `json:"RawPacketLimit,omitempty" valid:"isValidRawPacketLimit" yaml:"RawPacketLimit"`
	// Packet header size to consider
	HeaderSize int `json:"HeaderSize,omitempty" valid:"isValidCaptureHeaderSize" yaml:"HeaderSize"`
	// Add additional TCP metrics to flows
	ExtraTCPMetric bool `json:"ExtraTCPMetric" yaml:"ExtraTCPMetric"`
	// Defragment IPv4 packets
	IPDefrag bool `json:"IPDefrag" yaml:"IPDefrag"`
	// Reassemble TCP packets
	ReassembleTCP bool `json:"ReassembleTCP" yaml:"ReassembleTCP"`
	// First layer used by flow key calculation, L2 or L3
	LayerKeyMode string `json:"LayerKeyMode,omitempty" valid:"isValidLayerKeyMode" yaml:"LayerKeyMode"`
	// List of extra layers to be added to the flow, available: DNS|DHCPv4|VRRP
	ExtraLayers int `json:"ExtraLayers,omitempty" yaml:"ExtraLayers"`
	// sFlow/NetFlow target, if empty the agent will be used
	Target string `json:"Target,omitempty" valid:"isValidAddress" yaml:"Target"`
	// target type (netflowv5, erspanv1), ignored in case of sFlow/NetFlow capture
	TargetType string `json:"TargetType,omitempty" yaml:"TargetType"`
}

Capture object

Captures provide a way to capture network traffic on the nodes matching a Gremlin expression.

easyjson:json swagger:model Capture

func NewCapture

func NewCapture(query string, bpfFilter string) *Capture

NewCapture creates a new capture

func (*Capture) GetName added in v0.24.0

func (c *Capture) GetName() string

GetName returns the resource name

func (Capture) MarshalEasyJSON added in v0.26.0

func (v Capture) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Capture) MarshalJSON added in v0.26.0

func (v Capture) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Capture) UnmarshalEasyJSON added in v0.26.0

func (v *Capture) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Capture) UnmarshalJSON added in v0.26.0

func (v *Capture) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Edge added in v0.27.0

type Edge = gtypes.Edge

Edge object swagger:model

type EdgeRule added in v0.19.1

type EdgeRule struct {
	// swagger:allOf
	rest.BasicResource `yaml:",inline"`
	// Edge rule name
	Name string `yaml:"Name"`
	// Edge rule description
	Description string `yaml:"Description"`
	// Gremlin expression of the edges source nodes
	Src string `valid:"isGremlinExpr" yaml:"Src"`
	// Gremlin expression of the edges destination nodes
	Dst string `valid:"isGremlinExpr" yaml:"Dst"`
	// Metadata of the edges to create
	Metadata graph.Metadata `yaml:"Metadata"`
}

EdgeRule object

Edge rules allow the dynamic creation of links between nodes of the graph.

easyjson:json swagger:model

func (*EdgeRule) GetName added in v0.24.0

func (e *EdgeRule) GetName() string

GetName returns the resource name

func (EdgeRule) MarshalEasyJSON added in v0.26.0

func (v EdgeRule) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EdgeRule) MarshalJSON added in v0.26.0

func (v EdgeRule) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EdgeRule) UnmarshalEasyJSON added in v0.26.0

func (v *EdgeRule) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EdgeRule) UnmarshalJSON added in v0.26.0

func (v *EdgeRule) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*EdgeRule) Validate added in v0.20.0

func (e *EdgeRule) Validate() error

Validate verifies the edge rule does not create invalid edges

type Node added in v0.27.0

type Node = gtypes.Node

Node object swagger:model

type NodeRule added in v0.19.1

type NodeRule struct {
	// swagger:allOf
	rest.BasicResource `yaml:",inline"`
	// Node rule name
	Name string `yaml:"Name"`
	// Node rule description
	Description string `yaml:"Description"`
	// Metadata of the nodes to create
	Metadata graph.Metadata `yaml:"Metadata"`
	// 'create' to create nodes, 'update' to updates nodes
	Action string `valid:"regexp=^(create|update)$" yaml:"Action"`
	// Gremlin expression of the nodes to update
	Query string `valid:"isGremlinOrEmpty" yaml:"Query"`
}

NodeRule object

Node rules allow the dynamic creation of nodes in the graph.

easyjson:json swagger:model

func (*NodeRule) GetName added in v0.24.0

func (n *NodeRule) GetName() string

GetName returns the resource name

func (NodeRule) MarshalEasyJSON added in v0.26.0

func (v NodeRule) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (NodeRule) MarshalJSON added in v0.26.0

func (v NodeRule) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*NodeRule) UnmarshalEasyJSON added in v0.26.0

func (v *NodeRule) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*NodeRule) UnmarshalJSON added in v0.26.0

func (v *NodeRule) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*NodeRule) Validate added in v0.20.0

func (n *NodeRule) Validate() error

Validate verifies the node rule does not create invalid node or change important attributes of an existing node

type PacketInjection added in v0.17.0

type PacketInjection struct {
	// swagger:allOf
	rest.BasicResource `yaml:",inline"`
	Src                string `yaml:"Src"`
	Dst                string `yaml:"Dst"`
	SrcIP              string `valid:"isIPOrCIDR" yaml:"SrcIP"`
	DstIP              string `valid:"isIPOrCIDR" yaml:"DstIP"`
	SrcMAC             string `valid:"isMAC" yaml:"SrcMAC"`
	DstMAC             string `valid:"isMAC" yaml:"DstMAC"`
	SrcPort            uint16 `yaml:"SrcPort"`
	DstPort            uint16 `yaml:"DstPort"`
	Type               string `yaml:"Type"`
	Payload            string `yaml:"Payload"`
	ICMPID             uint16 `yaml:"ICMPID"`
	Count              uint64 `yaml:"Count"`
	Interval           uint64 `yaml:"Interval"`
	Mode               string `yaml:"Mode"`
	IncrementPayload   int64  `yaml:"IncrementPayload"`
	StartTime          time.Time
	Pcap               []byte `yaml:"Pcap"`
	TTL                uint8  `yaml:"TTL"`
}

PacketInjection packet injector API parameters easyjson:json swagger:model

func (*PacketInjection) GetName added in v0.24.0

func (pi *PacketInjection) GetName() string

GetName returns the resource name

func (PacketInjection) MarshalEasyJSON added in v0.26.0

func (v PacketInjection) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (PacketInjection) MarshalJSON added in v0.26.0

func (v PacketInjection) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*PacketInjection) UnmarshalEasyJSON added in v0.26.0

func (v *PacketInjection) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*PacketInjection) UnmarshalJSON added in v0.26.0

func (v *PacketInjection) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*PacketInjection) Validate added in v0.17.0

func (pi *PacketInjection) Validate() error

Validate verifies the packet injection type is supported

Jump to

Keyboard shortcuts

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