agent

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MPL-2.0 Imports: 20 Imported by: 0

README

Orb Agent

Agent - Fleet Synchronization Steps

Success Communication Sequence Diagram

  sequenceDiagram
    Agent->>Fleet: subscribe
    Agent->>Fleet: sendCapabilities
    Agent->>+Fleet: sendGroupMembershipReq 
    Fleet-->>-Agent: sendGroupMembership with GroupIds
    Agent-->>Fleet: Heartbeat
    Agent-->>+Fleet: sendAgentPoliciesReq
    Fleet-->>-Agent: agentPolicies with Policies
    Agent-->>Fleet: Heartbeat

Fail Communication Sequence Diagram

  sequenceDiagram
    Agent->>Fleet: subscribe
    Agent->>Fleet: sendCapabilities
    Agent->>+Fleet: sendGroupMembershipReq 
    Agent-->>Fleet: Heartbeat
    Agent-->>+Fleet: sendAgentPoliciesReq
    Fleet-->>-Agent: agentPolicies with Policies
    Agent-->>Fleet: Heartbeat

Agent is still without Groups and Policies

With Re-Request Mechanism, general idea

sequenceDiagram
    Agent-)Fleet: subscribe
    Agent-)Fleet: sendCapabilities
    Agent-)Fleet: sendGroupMembershipReq
    activate Fleet
    Agent->>Timer: starts wait timer for response
    activate Timer
    Timer-xAgent: timer runs out
    Agent-)Fleet: sendGroupMembershipReq
    Fleet--)Agent: sendGroupMembership with GroupIds
    deactivate Fleet
    Agent-->>Timer: marks as success
    deactivate Timer
    Agent-->>Fleet: Heartbeat
    Agent-->>Fleet: sendAgentPoliciesReq
    activate Fleet
    Agent->>Timer: starts wait timer for response
    activate Timer
    Fleet-->>Agent: agentPolicies with Policies
    Agent->>Timer: marks as success
    deactivate Timer
    Agent-->>Fleet: Heartbeat

Documentation

Index

Constants

View Source
const HeartbeatFreq = 50 * time.Second

HeartbeatFreq how often to heartbeat

View Source
const RestartTimeMin = 5 * time.Minute

RestartTimeMin minimum time to wait between restarts

Variables

View Source
var (
	ErrMqttConnection = errors.New("failed to connect to a broker")
)

Functions

This section is empty.

Types

type Agent

type Agent interface {
	Start(ctx context.Context, cancelFunc context.CancelFunc) error
	Stop(ctx context.Context)
	RestartAll(ctx context.Context, reason string) error
	RestartBackend(ctx context.Context, backend string, reason string) error
}

func New

func New(logger *zap.Logger, c config.Config) (Agent, error)

type GroupInfo

type GroupInfo struct {
	Name      string
	ChannelID string
}

Directories

Path Synopsis
otlpmqttexporter
Package otlpmqttexporter exports data by using the OTLP format to an MQTT endpoint.
Package otlpmqttexporter exports data by using the OTLP format to an MQTT endpoint.

Jump to

Keyboard shortcuts

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