Remove unused generation scripts (not referenced): - scripts/generate-keypair.go (unused manual utility) - cmd/tools/keygen/ (unused utility, clutters cmd structure) Remove root-level dev files (clutter): - restart_and_fix.sh (dangerous: wipes database) - test_install_commands.sh (development only) - test-binary (compiled artifact) - sudo (third-party tool) - scanning_ux_summary.txt (dev notes) Fix ETHOS violations in build-secure-agent.sh: - Remove emojis (🔨, ✅, ℹ️) - Replace with proper format: [INFO] [build] ... Cleanup based on definitive code forensics. Impact: Cleaner repository, ETHOS-compliant, no functional loss.
40 lines
1.6 KiB
Go
40 lines
1.6 KiB
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
// StorageMetric represents a storage metric from an agent
|
|
type StorageMetric struct {
|
|
ID uuid.UUID `json:"id" db:"id"`
|
|
AgentID uuid.UUID `json:"agent_id" db:"agent_id"`
|
|
Mountpoint string `json:"mountpoint" db:"mountpoint"`
|
|
Device string `json:"device" db:"device"`
|
|
DiskType string `json:"disk_type" db:"disk_type"`
|
|
Filesystem string `json:"filesystem" db:"filesystem"`
|
|
TotalBytes int64 `json:"total_bytes" db:"total_bytes"`
|
|
UsedBytes int64 `json:"used_bytes" db:"used_bytes"`
|
|
AvailableBytes int64 `json:"available_bytes" db:"available_bytes"`
|
|
UsedPercent float64 `json:"used_percent" db:"used_percent"`
|
|
Severity string `json:"severity" db:"severity"`
|
|
Metadata JSONB `json:"metadata,omitempty" db:"metadata"`
|
|
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
|
}
|
|
|
|
// StorageMetricRequest represents the request payload for storage metrics
|
|
type StorageMetricRequest struct {
|
|
AgentID uuid.UUID `json:"agent_id"`
|
|
CommandID string `json:"command_id"`
|
|
Timestamp time.Time `json:"timestamp"`
|
|
Metrics []StorageMetric `json:"metrics"`
|
|
}
|
|
|
|
// StorageMetricsList represents a list of storage metrics with pagination
|
|
type StorageMetricsList struct {
|
|
Metrics []StorageMetric `json:"metrics"`
|
|
Total int `json:"total"`
|
|
Page int `json:"page"`
|
|
PerPage int `json:"per_page"`
|
|
} |