The public tree and its history contain only the listed paths. Earlier projection history remains preserved internally. Source-Sha: 913fde029b935671833254797f0f20f1eb9fabba Policy-Sha: 913fde029b935671833254797f0f20f1eb9fabba Tree-Digest: 180ae530c1058a2a5c89837bdce2d323ae83e669e38590ca72e75b8d92b7262f
50 lines
1.9 KiB
Go
50 lines
1.9 KiB
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/gofrs/uuid/v5"
|
|
)
|
|
|
|
// AgentSubsystem represents a subsystem configuration for an agent
|
|
type AgentSubsystem struct {
|
|
ID uuid.UUID `json:"id" db:"id"`
|
|
AgentID uuid.UUID `json:"agent_id" db:"agent_id"`
|
|
Subsystem string `json:"subsystem" db:"subsystem"`
|
|
Enabled bool `json:"enabled" db:"enabled"`
|
|
IntervalMinutes int `json:"interval_minutes" db:"interval_minutes"`
|
|
AutoRun bool `json:"auto_run" db:"auto_run"`
|
|
LastRunAt *time.Time `json:"last_run_at,omitempty" db:"last_run_at"`
|
|
NextRunAt *time.Time `json:"next_run_at,omitempty" db:"next_run_at"`
|
|
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
|
|
}
|
|
|
|
// SubsystemType represents the type of subsystem
|
|
type SubsystemType string
|
|
|
|
const (
|
|
SubsystemStorage SubsystemType = "storage"
|
|
SubsystemSystem SubsystemType = "system"
|
|
SubsystemDocker SubsystemType = "docker"
|
|
)
|
|
|
|
// SubsystemConfig represents the configuration for updating a subsystem
|
|
type SubsystemConfig struct {
|
|
Enabled *bool `json:"enabled,omitempty"`
|
|
IntervalMinutes *int `json:"interval_minutes,omitempty"`
|
|
AutoRun *bool `json:"auto_run,omitempty"`
|
|
}
|
|
|
|
// SubsystemStats provides statistics about a subsystem's execution
|
|
type SubsystemStats struct {
|
|
Subsystem string `json:"subsystem"`
|
|
Enabled bool `json:"enabled"`
|
|
LastRunAt *time.Time `json:"last_run_at,omitempty"`
|
|
NextRunAt *time.Time `json:"next_run_at,omitempty"`
|
|
IntervalMinutes int `json:"interval_minutes"`
|
|
AutoRun bool `json:"auto_run"`
|
|
RunCount int `json:"run_count"` // Total runs
|
|
LastStatus string `json:"last_status"` // Last command status
|
|
LastDuration int `json:"last_duration"` // Last run duration in seconds
|
|
}
|