Documentation
¶
Overview ¶
Package types defines the API resource types
swagger:meta
Index ¶
Constants ¶
This section is empty.
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
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) SetID ¶ added in v0.19.0
func (b *BasicResource) SetID(i string)
SetID sets the resource ID
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 ¶
NewCapture creates a new capture
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
GetName returns the resource name
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
GetName returns the resource name
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"`
Increment bool `yaml:"Increment"`
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) Validate ¶ added in v0.17.0
func (pi *PacketInjection) Validate() error
Validate verifies the packet injection type is supported
type Resource ¶
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
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
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
WorkflowChoice describes one value within a choice easyjson:json swagger:model
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
Source Files
¶
- types.go