Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent type
func NewAgent ¶
func NewAgent(httpClient *service.HTTPClient) *Agent
NewAgent creates a new instance
func (*Agent) Bootstrap ¶
Bootstrap registers an agent In order to register an agent, agent do a request to tower with the following specs
POST: config(agent.tower.url)/api/v1/action/register_agent
{ "agentURL": "config(agent.url)" "agentID": "$$", "hostname": "$$" "agentApiKey": "$$" }
Headers X-Encrypted-Request: true X-API-Key: config(agent.tower.apiKey)
type BackupMessage ¶
type BackupMessage struct { Action string `json:"action"` Cron model.CronRecord `json:"cron"` Job model.JobRecord `json:"job"` Settings map[string]string `json:"settings"` CorrelationID string `json:"CorrelationID"` }
BackupMessage type
type BootstrapRequest ¶
type BootstrapRequest struct { AgentURL string `json:"agentURL"` Hostname string `json:"hostname"` AgentID string `json:"agentID"` AgentAPIKey string `json:"agentApiKey"` }
BootstrapRequest type
type HeartbeatRequest ¶
type HeartbeatRequest struct { Status string `json:"status"` Hostname string `json:"hostname"` AgentID string `json:"agentID"` }
HeartbeatRequest type
type PostbackRequest ¶
type PostbackRequest struct { JobID string `json:"jobId"` CronID string `json:"cronId"` Status string `json:"status"` Hostname string `json:"hostname"` AgentID string `json:"agentID"` }
PostbackRequest type
type Stats ¶
type Stats struct {
// contains filtered or unexported fields
}
Stats type
func (*Stats) GetTotalHosts ¶
GetTotalHosts gets total hosts count
func (*Stats) GetTotalTowers ¶
GetTotalTowers gets total towers count
type Tower ¶
type Tower struct {
// contains filtered or unexported fields
}
Tower type
type Wire ¶
type Wire struct {
// contains filtered or unexported fields
}
Wire type
func NewWire ¶
func NewWire(httpClient *service.HTTPClient, db driver.Database) *Wire
NewWire creates a new instance
func (*Wire) AgentPostback ¶
AgentPostback trigger agent postback. It updates job status inside a tower
func (*Wire) SendJobToHostAgent ¶
func (w *Wire) SendJobToHostAgent(message BackupMessage) error
SendJobToHostAgent updates a job status
func (*Wire) UpdateTowerJobStatus ¶
UpdateTowerJobStatus updates a job status