Documentation ¶
Index ¶
Constants ¶
View Source
const ( START = "start" STOP = "stop" RESTART = "restart" STATUS = "status" RELOAD = "reload" INVENTORY = "inventory" VERSION = "version" )
View Source
const ( // action types. CONFIG = "config" COMMAND = "command" STATUS_ACTIVE = "active" //nolint:revive,nosnakecase,stylecheck STATUS_ERROR = "error" //nolint:revive,nosnakecase,stylecheck )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIAction ¶
type APIAction struct { ConfigAssignmentID string `json:"config_assignment_id"` Config APIConfig `json:"configuration"` Agent APIConfigAgent `json:"agent"` }
type APIActions ¶
type APIActions []APIAction
type APIConfigAgent ¶
type APIConfigAgent struct {
ID string `json:"agent_type_id"`
}
type ActionPoller ¶ added in v0.2.10
type ActionPoller struct {
// contains filtered or unexported fields
}
func NewActionPoller ¶ added in v0.2.10
func NewActionPoller() (*ActionPoller, error)
func (*ActionPoller) Start ¶ added in v0.2.10
func (p *ActionPoller) Start(ctx context.Context)
type Command ¶
type Command struct { ID string `json:"id" yaml:"id"` Agent string `json:"agent" yaml:"agent"` Command string `json:"command" yaml:"command"` }
not OS commands, commands the agent knows (e.g. restart_agent, agent_status, etc.). how to restart an agent is in the agent inventory. agent status would be the result of running `systemctl status <agent>`.
type CommandData ¶
type CommandResult ¶
type CommandResult struct { ID string `json:"id" yaml:"id"` Status string `json:"status" yaml:"status"` // active or error CommandData CommandData `json:"data" yaml:"data"` }
Output will be base64 encoded.
type Config ¶
type Config struct { ID string `json:"id" yaml:"id"` Path string `json:"path" yaml:"path"` Contents string `json:"contents" yaml:"contents"` }
Contest should be base64 encoded.
type ConfigData ¶
type ConfigResult ¶
type ConfigResult struct { ID string `json:"config_assignment_id" yaml:"config_assignment_id"` Status string `json:"status" yaml:"status"` // STATUS_ACTIVE or STATUS_ERROR Info string `json:"info,omitempty" yaml:"info,omitempty"` ConfigData ConfigData `json:"data,omitempty" yaml:"data,omitempty"` }
write result will be "OK" or the err received when trying to write the file. reload result will be empty or base64 encoded as it may be multi-line output.
type Result ¶
type Result struct { ActionID string `json:"action_id" yaml:"action_id"` // not used at this time, api only supports configs ConfigResult ConfigResult `json:"config_result" yaml:"config_result"` CommandResult CommandResult `json:"command_result" yaml:"command_result"` }
type StatusData ¶ added in v0.2.10
type StatusPoller ¶ added in v0.2.10
type StatusPoller struct {
// contains filtered or unexported fields
}
func NewStatusPoller ¶ added in v0.2.10
func NewStatusPoller() (*StatusPoller, error)
func (*StatusPoller) Start ¶ added in v0.2.10
func (p *StatusPoller) Start(ctx context.Context)
type StatusResult ¶ added in v0.2.10
type StatusResult struct { Status string `json:"status"` StatusData StatusData `json:"status_data"` }
Click to show internal directories.
Click to hide internal directories.