types

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: Apache-2.0 Imports: 9 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

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	// swagger:allOf
	BasicResource `yaml:",inline"`
	// Alert name
	Name string `json:",omitempty" yaml:"Name"`
	// Alert description
	Description string `json:",omitempty" yaml:"Description"`
	// Gremlin or JavaScript expression evaluated to trigger the alarm
	Expression string `json:",omitempty" valid:"nonzero" yaml:"Expression"`
	// Action to execute when the alert is triggered.
	// Can be either an empty string, or a URL (use 'file://' for local scripts)
	Action string `json:",omitempty" valid:"regexp=^(|http://|https://|file://).*$" yaml:"Action"`
	// Event that triggers the alert evaluation
	Trigger    string `json:",omitempty" valid:"regexp=^(graph|duration:.+|)$" yaml:"Trigger"`
	CreateTime time.Time
}

Alert object

Alerts provide a way to be notified when a Gremlin expression is evaluated to true.

easyjson:json swagger:model Alert

func NewAlert

func NewAlert() *Alert

NewAlert creates a New empty Alert, only CreateTime is set.

func (*Alert) GetName added in v0.24.0

func (a *Alert) GetName() string

GetName returns the resource name

func (Alert) MarshalEasyJSON added in v0.26.0

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

MarshalEasyJSON supports easyjson.Marshaler interface

func (Alert) MarshalJSON added in v0.26.0

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

MarshalJSON supports json.Marshaler interface

func (*Alert) UnmarshalEasyJSON added in v0.26.0

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

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Alert) UnmarshalJSON added in v0.26.0

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

UnmarshalJSON supports json.Unmarshaler interface

type BasicResource added in v0.19.0

type BasicResource struct {
	UUID string `yaml:"UUID"`
}

BasicResource is a resource with a unique identifier easyjson:json swagger:ignore

func (*BasicResource) GetName added in v0.24.0

func (b *BasicResource) GetName() string

GetName returns the resource name

func (*BasicResource) ID added in v0.19.0

func (b *BasicResource) ID() string

ID returns the resource ID

func (BasicResource) MarshalEasyJSON added in v0.26.0

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

MarshalEasyJSON supports easyjson.Marshaler interface

func (BasicResource) MarshalJSON added in v0.26.0

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

MarshalJSON supports json.Marshaler interface

func (*BasicResource) SetID added in v0.19.0

func (b *BasicResource) SetID(i string)

SetID sets the resource ID

func (*BasicResource) UnmarshalEasyJSON added in v0.26.0

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

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*BasicResource) UnmarshalJSON added in v0.26.0

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

UnmarshalJSON supports json.Unmarshaler interface

type Capture

type Capture struct {
	// swagger:allOf
	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 flow.ExtraLayers `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 EdgeRule added in v0.19.1

type EdgeRule struct {
	// swagger:allOf
	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 NodeRule added in v0.19.1

type NodeRule struct {
	// swagger:allOf
	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
	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

type Resource

type Resource interface {
	ID() string
	SetID(string)
	GetName() string
}

Resource used as interface resources for each API

type TopologyParams added in v0.25.0

type TopologyParams struct {
	GremlinQuery string `json:"GremlinQuery,omitempty" valid:"isGremlinExpr" yaml:"GremlinQuery"`
}

TopologyParams topology query parameters easyjson:json swagger:model

func (TopologyParams) MarshalEasyJSON added in v0.26.0

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

MarshalEasyJSON supports easyjson.Marshaler interface

func (TopologyParams) MarshalJSON added in v0.26.0

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

MarshalJSON supports json.Marshaler interface

func (*TopologyParams) UnmarshalEasyJSON added in v0.26.0

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

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*TopologyParams) UnmarshalJSON added in v0.26.0

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

UnmarshalJSON supports json.Unmarshaler interface

type Workflow added in v0.19.0

type Workflow struct {
	// swagger:allOf
	BasicResource `yaml:",inline"`
	// Workflow name
	Name string `yaml:"Name" valid:"nonzero"`
	// Workflow title
	Title string `yaml:"Title"`
	// Workflow abstract
	Abstract string `yaml:"Abstract"`
	// Workflow description
	Description string `yaml:"Description"`
	// Workflow parameters
	Parameters []WorkflowParam `yaml:"Parameters"`
	Source     string          `valid:"isValidWorkflow" yaml:"Source"`
}

Workflow object

Workflow allows to automate actions using JavaScript.

easyjson:json swagger:model

func (Workflow) MarshalEasyJSON added in v0.26.0

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

MarshalEasyJSON supports easyjson.Marshaler interface

func (Workflow) MarshalJSON added in v0.26.0

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

MarshalJSON supports json.Marshaler interface

func (*Workflow) UnmarshalEasyJSON added in v0.26.0

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

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Workflow) UnmarshalJSON added in v0.26.0

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

UnmarshalJSON supports json.Unmarshaler interface

type WorkflowCall added in v0.23.0

type WorkflowCall struct {
	Params []interface{}
}

WorkflowCall describes workflow call swagger:model

type WorkflowChoice added in v0.19.0

type WorkflowChoice struct {
	Value       string `yaml:"Value"`
	Description string `yaml:"Description"`
}

WorkflowChoice describes one value within a choice easyjson:json swagger:model

func (WorkflowChoice) MarshalEasyJSON added in v0.26.0

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

MarshalEasyJSON supports easyjson.Marshaler interface

func (WorkflowChoice) MarshalJSON added in v0.26.0

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

MarshalJSON supports json.Marshaler interface

func (*WorkflowChoice) UnmarshalEasyJSON added in v0.26.0

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

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*WorkflowChoice) UnmarshalJSON added in v0.26.0

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

UnmarshalJSON supports json.Unmarshaler interface

type WorkflowParam added in v0.19.0

type WorkflowParam struct {
	Name        string           `yaml:"Name"`
	Description string           `yaml:"Description"`
	Type        string           `yaml:"Type"`
	Default     interface{}      `yaml:"Default"`
	Values      []WorkflowChoice `yaml:"Values"`
}

WorkflowParam describes a workflow parameter easyjson:json swagger:model

func (WorkflowParam) MarshalEasyJSON added in v0.26.0

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

MarshalEasyJSON supports easyjson.Marshaler interface

func (WorkflowParam) MarshalJSON added in v0.26.0

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

MarshalJSON supports json.Marshaler interface

func (*WorkflowParam) UnmarshalEasyJSON added in v0.26.0

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

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*WorkflowParam) UnmarshalJSON added in v0.26.0

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

UnmarshalJSON supports json.Unmarshaler interface

Jump to

Keyboard shortcuts

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