package model import ( "encoding/json" "time" ) type Device struct { ID string `json:"id"` OwnerUserID string `json:"owner_user_id,omitempty"` DNSLabel string `json:"dns_label,omitempty"` DomainName string `json:"domain_name,omitempty"` Hostname string `json:"hostname"` OpenWrtVersion string `json:"openwrt_version"` LastSeenAt *time.Time `json:"last_seen_at"` CreatedAt time.Time `json:"created_at"` Inventory json.RawMessage `json:"inventory,omitempty"` Metrics json.RawMessage `json:"metrics,omitempty"` Online bool `json:"online"` Group string `json:"group,omitempty"` Tags []string `json:"tags,omitempty"` ActiveAlerts int `json:"active_alerts"` } type User struct { ID string `json:"id"` Username string `json:"username"` DisplayName string `json:"display_name"` Email string `json:"email"` Role string `json:"role"` Disabled bool `json:"disabled"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` } type EnrollmentGrant struct { ID string `json:"id"` UserID string `json:"user_id"` DNSLabel string `json:"dns_label,omitempty"` ExpiresAt time.Time `json:"expires_at"` UsedAt *time.Time `json:"used_at,omitempty"` CreatedAt time.Time `json:"created_at"` } type DNSRecord struct { DeviceID string `json:"device_id"` DNSLabel string `json:"dns_label"` DomainName string `json:"domain_name,omitempty"` IPv4 string `json:"ipv4,omitempty"` IPv6 string `json:"ipv6,omitempty"` TTL int `json:"ttl"` Enabled bool `json:"enabled"` LastAgentUpdateAt *time.Time `json:"last_agent_update_at,omitempty"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` } type DNSAddressHistory struct { ID string `json:"id"` DeviceID string `json:"device_id"` IPv4 string `json:"ipv4,omitempty"` IPv6 string `json:"ipv6,omitempty"` Source string `json:"source"` CreatedAt time.Time `json:"created_at"` } type Command struct { ID string `json:"id"` DeviceID string `json:"device_id"` Type string `json:"type"` Args json.RawMessage `json:"args"` Status string `json:"status"` Result json.RawMessage `json:"result,omitempty"` Output string `json:"output,omitempty"` ExitCode *int `json:"exit_code,omitempty"` AttemptCount int `json:"attempt_count"` MaxAttempts int `json:"max_attempts"` CreatedAt time.Time `json:"created_at"` ExpiresAt *time.Time `json:"expires_at,omitempty"` ClaimedAt *time.Time `json:"claimed_at,omitempty"` CompletedAt *time.Time `json:"completed_at,omitempty"` CancelledAt *time.Time `json:"cancelled_at,omitempty"` ExpiredAt *time.Time `json:"expired_at,omitempty"` } type AuditEvent struct { ID string `json:"id"` Actor string `json:"actor"` Action string `json:"action"` DeviceID string `json:"device_id,omitempty"` CommandID string `json:"command_id,omitempty"` Details json.RawMessage `json:"details,omitempty"` CreatedAt time.Time `json:"created_at"` } type MetricSample struct { ID string `json:"id"` DeviceID string `json:"device_id"` Inventory json.RawMessage `json:"inventory,omitempty"` Metrics json.RawMessage `json:"metrics,omitempty"` CreatedAt time.Time `json:"created_at"` } type Alert struct { ID string `json:"id"` DeviceID string `json:"device_id"` Type string `json:"type"` Severity string `json:"severity"` Status string `json:"status"` Message string `json:"message"` Details json.RawMessage `json:"details,omitempty"` FirstSeenAt time.Time `json:"first_seen_at"` LastSeenAt time.Time `json:"last_seen_at"` ResolvedAt *time.Time `json:"resolved_at,omitempty"` AcknowledgedAt *time.Time `json:"acknowledged_at,omitempty"` AcknowledgedBy string `json:"acknowledged_by,omitempty"` CreatedAt time.Time `json:"created_at"` } type RemoteSession struct { ID string `json:"id"` DeviceID string `json:"device_id"` Target string `json:"target"` Status string `json:"status"` ServerHost string `json:"server_host,omitempty"` ServerPort int `json:"server_port,omitempty"` RemotePort int `json:"remote_port,omitempty"` LuCIPort int `json:"luci_port,omitempty"` LuCIScheme string `json:"luci_scheme,omitempty"` LocalHost string `json:"local_host,omitempty"` LocalPort int `json:"local_port,omitempty"` CommandID string `json:"command_id,omitempty"` CreatedAt time.Time `json:"created_at"` ExpiresAt time.Time `json:"expires_at"` StartedAt *time.Time `json:"started_at,omitempty"` ClosedAt *time.Time `json:"closed_at,omitempty"` }