agent

package
v0.1.26 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package agent provides the agent API for the server

Index

Constants

View Source
const (
	// AgentKind is the kind of the agent resource.
	AgentKind = "Agent"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	// Metadata contains identifying information about the agent.
	Metadata Metadata `json:"metadata"`

	// Spec contains the desired configuration for the agent.
	Spec Spec `json:"spec"`

	// Status contains the observed state of the agent.
	Status Status `json:"status"`

} // @name Agent

Agent represents an agent which is defined OpAMP protocol. It follows the Kubernetes-style resource structure with Metadata, Spec, and Status.

type AvailableComponents added in v0.1.18

type AvailableComponents struct {
	Components map[string]ComponentDetails `json:"components,omitempty"`

} // @name AgentAvailableComponents

AvailableComponents represents the available components of the agent.

type Capabilities added in v0.1.18

type Capabilities uint64

Capabilities is a bitmask representing the capabilities of the agent.

type ComponentDetails added in v0.1.22

type ComponentDetails struct {
	Type    string `json:"type,omitempty"`
	Version string `json:"version,omitempty"`

} // @name ComponentDetails

ComponentDetails represents details of an available component.

type ComponentHealth added in v0.1.18

type ComponentHealth struct {
	Healthy       bool              `json:"healthy"`
	StartTimeUnix int64             `json:"startTimeUnix,omitempty"`
	LastError     string            `json:"lastError,omitempty"`
	Status        string            `json:"status,omitempty"`
	StatusTimeMS  int64             `json:"statusTimeMs,omitempty"`
	ComponentsMap map[string]string `json:"componentsMap,omitempty"`

} // @name AgentComponentHealth

ComponentHealth represents the health status of the agent's components.

type Condition added in v0.1.24

type Condition struct {
	Type               ConditionType   `json:"type"`
	LastTransitionTime string          `json:"lastTransitionTime"`
	Status             ConditionStatus `json:"status"`
	Reason             string          `json:"reason"`
	Message            string          `json:"message,omitempty"`

} // @name AgentCondition

Condition represents a condition of an agent.

type ConditionStatus added in v0.1.24

type ConditionStatus string // @name AgentConditionStatus

ConditionStatus represents the status of an agent condition.

const (
	// ConditionStatusTrue represents a true condition status.
	ConditionStatusTrue ConditionStatus = "True"
	// ConditionStatusFalse represents a false condition status.
	ConditionStatusFalse ConditionStatus = "False"
	// ConditionStatusUnknown represents an unknown condition status.
	ConditionStatusUnknown ConditionStatus = "Unknown"
)

type ConditionType added in v0.1.24

type ConditionType string // @name AgentConditionType

ConditionType represents the type of an agent condition.

const (
	// ConditionTypeConnected represents the condition when the agent is connected.
	ConditionTypeConnected ConditionType = "Connected"
	// ConditionTypeHealthy represents the condition when the agent is healthy.
	ConditionTypeHealthy ConditionType = "Healthy"
	// ConditionTypeConfigured represents the condition when the agent has been configured.
	ConditionTypeConfigured ConditionType = "Configured"
	// ConditionTypeRegistered represents the condition when the agent has been registered.
	ConditionTypeRegistered ConditionType = "Registered"
)

type ConfigFile added in v0.1.18

type ConfigFile struct {
	Body        string `json:"body"`
	ContentType string `json:"contentType"`

} // @name AgentConfigFile

ConfigFile represents a configuration file for the agent.

type ConfigMap added in v0.1.18

type ConfigMap struct {
	ConfigMap map[string]ConfigFile `json:"configMap"`

} // @name AgentConfigMap

ConfigMap represents a map of configuration files for the agent.

type ConnectionSettings added in v0.1.26

type ConnectionSettings struct {
	// OpAMP contains OpAMP server connection settings.
	OpAMP OpAMPConnectionSettings `json:"opamp,omitempty"`
	// OwnMetrics contains own metrics connection settings.
	OwnMetrics TelemetryConnectionSettings `json:"ownMetrics,omitempty"`
	// OwnLogs contains own logs connection settings.
	OwnLogs TelemetryConnectionSettings `json:"ownLogs,omitempty"`
	// OwnTraces contains own traces connection settings.
	OwnTraces TelemetryConnectionSettings `json:"ownTraces,omitempty"`
	// OtherConnections contains other connection settings mapped by name.
	OtherConnections map[string]OtherConnectionSettings `json:"otherConnections,omitempty"`

} // @name ConnectionSettings

ConnectionSettings represents connection settings for the agent.

type CustomCapabilities added in v0.1.18

type CustomCapabilities struct {
	Capabilities []string `json:"capabilities,omitempty"`

} // @name AgentCustomCapabilities

CustomCapabilities represents the custom capabilities of the agent.

type Description added in v0.1.18

type Description struct {
	// IdentifyingAttributes are attributes that uniquely identify the agent.
	IdentifyingAttributes map[string]string `json:"identifyingAttributes,omitempty"`
	// NonIdentifyingAttributes are attributes that do not uniquely identify the agent.
	NonIdentifyingAttributes map[string]string `json:"nonIdentifyingAttributes,omitempty"`

} // @name AgentDescription

Description represents the description of the agent.

type EffectiveConfig added in v0.1.18

type EffectiveConfig struct {
	ConfigMap ConfigMap `json:"configMap"`

} // @name AgentEffectiveConfig

EffectiveConfig represents the effective configuration of the agent.

type ListResponse added in v0.1.9

type ListResponse = v1.ListResponse[Agent]

ListResponse represents a list of agents with metadata.

func NewListResponse added in v0.1.9

func NewListResponse(agents []Agent, metadata v1.ListMeta) *ListResponse

NewListResponse creates a new ListResponse with the given agents and metadata.

type Metadata added in v0.1.22

type Metadata struct {
	// InstanceUID is a unique identifier for the agent instance.
	InstanceUID uuid.UUID `json:"instanceUid"`

	// Description is a human-readable description of the agent.
	Description Description `json:"description"`

	// Capabilities is a bitmask representing the capabilities of the agent.
	Capabilities Capabilities `json:"capabilities"`

	// CustomCapabilities is a map of custom capabilities for the agent.
	CustomCapabilities CustomCapabilities `json:"customCapabilities"`

} // @name AgentMetadata

Metadata contains identifying information about the agent.

type OpAMPConnectionSettings added in v0.1.26

type OpAMPConnectionSettings struct {
	// DestinationEndpoint is the URL to connect to the OpAMP server.
	DestinationEndpoint string `json:"destinationEndpoint"`
	// Headers are HTTP headers to include in requests.
	Headers map[string][]string `json:"headers,omitempty"`
	// Certificate contains TLS certificate information.
	Certificate TLSCertificate `json:"certificate,omitempty"`

} // @name OpAMPConnectionSettings

OpAMPConnectionSettings represents OpAMP connection settings.

type OtherConnectionSettings added in v0.1.26

type OtherConnectionSettings struct {
	// DestinationEndpoint is the URL to connect to.
	DestinationEndpoint string `json:"destinationEndpoint"`
	// Headers are HTTP headers to include in requests.
	Headers map[string][]string `json:"headers,omitempty"`
	// Certificate contains TLS certificate information.
	Certificate TLSCertificate `json:"certificate,omitempty"`

} // @name OtherConnectionSettings

OtherConnectionSettings represents other connection settings.

type PackageStatus added in v0.1.18

type PackageStatus struct {
	// Name is the name of the package.
	Name string `json:"name"`

} // @name AgentPackageStatus

PackageStatus represents the status of a package in the agent.

type PackageStatuses added in v0.1.18

type PackageStatuses struct {
	Packages                      map[string]PackageStatus `json:"packages"`
	ServerProvidedAllPackagesHash string                   `json:"serverProvidedAllPackagesHash,omitempty"`
	ErrorMessage                  string                   `json:"errorMessage,omitempty"`

} // @name AgentPackageStatuses

PackageStatuses represents the package statuses of the agent.

type RemoteConfig added in v0.1.18

type RemoteConfig struct {
	ConfigMap  map[string]ConfigFile `json:"configMap,omitempty"`
	ConfigHash string                `json:"configHash,omitempty"`

} // @name AgentRemoteConfig

RemoteConfig represents the remote configuration of the agent.

type SetNewInstanceUIDRequest added in v0.1.24

type SetNewInstanceUIDRequest struct {
	NewInstanceUID uuid.UUID `binding:"required" json:"newInstanceUid"`

} // @name SetNewInstanceUIDRequest

SetNewInstanceUIDRequest is a struct that represents the request to set a new instance UID for the agent.

type Spec added in v0.1.22

type Spec struct {
	// NewInstanceUID is a new instance UID to inform the agent of its new identity.
	NewInstanceUID string `json:"newInstanceUid,omitempty"`

	// ConnectionSettings contains connection settings for the agent.
	ConnectionSettings ConnectionSettings `json:"connectionSettings,omitempty"`

	// RemoteConfig is the remote configuration of the agent.
	RemoteConfig RemoteConfig `json:"remoteConfig"`

} // @name AgentSpec

Spec contains the desired configuration for the agent.

type Status added in v0.1.22

type Status struct {
	// EffectiveConfig is the effective configuration of the agent.
	EffectiveConfig EffectiveConfig `json:"effectiveConfig"`

	// PackageStatuses is a map of package statuses for the agent.
	PackageStatuses PackageStatuses `json:"packageStatuses"`

	// ComponentHealth is the health status of the agent's components.
	ComponentHealth ComponentHealth `json:"componentHealth"`

	// AvailableComponents lists components available on the agent.
	AvailableComponents AvailableComponents `json:"availableComponents"`

	// Conditions is a list of conditions that apply to the agent.
	Conditions []Condition `json:"conditions"`

	// Connected indicates if the agent is currently connected.
	Connected bool `json:"connected"`

	// ConnectionType indicates the type of connection the agent is using.
	ConnectionType string `json:"connectionType,omitempty"`

	// SequenceNum is the sequence number from the last AgentToServer message.
	SequenceNum uint64 `json:"sequenceNum,omitempty"`

	// LastReportedAt is the timestamp when the agent last reported its status.
	LastReportedAt string `json:"lastReportedAt,omitempty"`

} // @name AgentStatus

Status contains the observed state of the agent.

type TLSCertificate added in v0.1.26

type TLSCertificate struct {
	// Cert is the PEM-encoded certificate.
	Cert string `json:"cert,omitempty"`
	// PrivateKey is the PEM-encoded private key.
	PrivateKey string `json:"privateKey,omitempty"`
	// CaCert is the PEM-encoded CA certificate.
	CaCert string `json:"caCert,omitempty"`

} // @name TLSCertificate

TLSCertificate represents TLS certificate information.

type TelemetryConnectionSettings added in v0.1.26

type TelemetryConnectionSettings struct {
	// DestinationEndpoint is the URL to send telemetry data to.
	DestinationEndpoint string `json:"destinationEndpoint"`
	// Headers are HTTP headers to include in requests.
	Headers map[string][]string `json:"headers,omitempty"`
	// Certificate contains TLS certificate information.
	Certificate TLSCertificate `json:"certificate,omitempty"`

} // @name TelemetryConnectionSettings

TelemetryConnectionSettings represents telemetry connection settings.

type UpdateAgentConfigRequest added in v0.1.0

type UpdateAgentConfigRequest struct {
	RemoteConfig any `binding:"required" json:"remoteConfig"`

} // @name UpdateAgentConfigRequest

UpdateAgentConfigRequest is a struct that represents the request to update the agent configuration. It contains the target instance UID and the remote configuration data.

Jump to

Keyboard shortcuts

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