Documentation
¶
Overview ¶
Package agent provides the agent API for the server
Index ¶
Constants ¶
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 {
// InstanceUID is a unique identifier for the agent instance.
InstanceUID uuid.UUID `json:"instanceUid"`
// IsManaged indicates whether the agent is managed by the server.
// If true, the server manages the agent and can send commands to it.
IsManaged bool `json:"isManaged"`
// Capabilities is a bitmask representing the capabilities of the agent.
// It is used to determine what features the agent supports.
// If nil, it means the capabilities are unspecified.
Capabilities Capabilities `json:"capabilities"`
// Description is a human-readable description of the agent.
Description Description `json:"description"`
// EffectiveConfig is the effective configuration of the agent.
// It is used to determine the current 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"`
// RemoteConfig is the remote configuration of the agent.
// It is used to determine the current remote configuration of the agent.
RemoteConfig RemoteConfig `json:"remoteConfig"`
// CustomCapabilities is a map of custom capabilities for the agent.
CustomCapabilities CustomCapabilities `json:"customCapabilities"`
AvailableComponents AvailableComponents `json:"availableComponents"`
} // @name Agent
Agent represents an agent which is defined OpAMP protocol. It is a value object that contains the instance UID and raw data.
type AvailableComponents ¶ added in v0.1.18
type AvailableComponents struct {
} // @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 Command ¶ added in v0.1.0
type Command struct {
Kind string `json:"kind"`
ID string `json:"id"`
TargetInstanceUID string `json:"targetInstanceUid"`
Data map[string]any `json:"data"`
} // @name AgentCommand
Command is a common struct that represents a command to be sent to an agent.
type ComponentHealth ¶ added in v0.1.18
type ComponentHealth struct {
} // @name AgentComponentHealth
ComponentHealth represents the health status of the agent's components.
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 CustomCapabilities ¶ added in v0.1.18
type CustomCapabilities struct {
} // @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 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 {
} // @name AgentRemoteConfig
RemoteConfig represents the remote configuration of the agent.
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.