Documentation
¶
Overview ¶
AMI operations handlers for Universal AMI System (Phase 5.1 Week 2)
AWS Compliance API handlers for Prism daemon ¶
Package daemon provides the daemon server implementation ¶
Package daemon provides invitation management API handlers for Prism v0.5.11+
This file implements REST API endpoints for the user invitation system, enabling project owners to invite collaborators via email.
Marketplace operations handlers for Template Marketplace Integration (Phase 5.1 Week 3)
Package daemon provides rate limiting API handlers ¶
Package daemon provides rate limiting for instance launch operations ¶
Security API handlers for Prism daemon ¶
Package daemon provides shared token management API handlers for Prism v0.5.13+
This file implements REST API endpoints for the shared token system, enabling project owners to create tokens that multiple users can redeem.
Package daemon provides singleton enforcement for the Prism daemon.
This ensures only one daemon process runs at a time and handles graceful shutdown of old processes when a new daemon starts.
Package daemon provides sleep/wake monitoring REST API handlers
Package daemon provides sleep/wake monitoring integration
Index ¶
- Constants
- Variables
- func GetConfigPath() string
- func SaveConfig(config *Config) error
- type APIVersion
- type APIVersionManager
- func (m *APIVersionManager) AddVersion(version APIVersion)
- func (m *APIVersionManager) BuildVersionedPath(path, version string) string
- func (m *APIVersionManager) ExtractVersionFromPath(path string) string
- func (m *APIVersionManager) GetDefaultVersion() string
- func (m *APIVersionManager) GetLatestVersion() string
- func (m *APIVersionManager) GetStableVersion() string
- func (m *APIVersionManager) GetSupportedVersions() []APIVersion
- func (m *APIVersionManager) GetVersion(version string) (APIVersion, bool)
- func (m *APIVersionManager) NormalizePath(path, version string) string
- func (m *APIVersionManager) TranslateRequestPath(path, version string) string
- func (m *APIVersionManager) VersionHeaderMiddleware(next http.Handler) http.Handler
- func (m *APIVersionManager) VersionRoutingMiddleware(next http.Handler) http.Handler
- type CircuitBreaker
- type CircuitBreakerState
- type CleanupRequest
- type CleanupResponse
- type CloudInitStatus
- type Config
- type CreateTunnelsRequest
- type CreateTunnelsResponse
- type DaemonHealthSummary
- type DaemonProfileAdapter
- type DaemonRegistry
- type DefaultProcessManager
- func (pm *DefaultProcessManager) CleanupProcesses() error
- func (pm *DefaultProcessManager) FindDaemonProcesses() ([]ProcessInfo, error)
- func (pm *DefaultProcessManager) ForceKill(pid int) error
- func (pm *DefaultProcessManager) GetPIDFilePath() string
- func (pm *DefaultProcessManager) GetRegistryPath() string
- func (pm *DefaultProcessManager) GracefulShutdown(pid int) error
- func (pm *DefaultProcessManager) IsProcessRunning(pid int) bool
- func (pm *DefaultProcessManager) RegisterDaemon(pid int, configPath, logPath string) error
- func (pm *DefaultProcessManager) UnregisterDaemon(pid int) error
- func (pm *DefaultProcessManager) WaitForShutdown(pid int, timeout time.Duration) error
- type ErrorRecord
- type ErrorSeverity
- type GetGroupUsersHandler
- type GroupUsersHandler
- type GroupUsersMethodDispatcher
- type HTTPServer
- type HealthCheck
- type HealthCheckResult
- type HealthMonitor
- func (hm *HealthMonitor) AddHealthCheck(name string, check HealthCheck)
- func (hm *HealthMonitor) GetHealthHistory() []HealthSnapshot
- func (hm *HealthMonitor) GetHealthSummary() DaemonHealthSummary
- func (hm *HealthMonitor) HandleDetailedHealthEndpoint(w http.ResponseWriter, r *http.Request)
- func (hm *HealthMonitor) HandleHealthEndpoint(w http.ResponseWriter, r *http.Request)
- func (hm *HealthMonitor) IsHealthy() bool
- func (hm *HealthMonitor) RemoveHealthCheck(name string)
- func (hm *HealthMonitor) Start(ctx context.Context)
- type HealthSnapshot
- type HealthStatus
- type LaunchProgressMonitor
- type MetricStats
- type Operation
- type Permission
- type PermissionLevel
- type PolicyAssignRequest
- type PolicyAssignResponse
- type PolicyCheckRequest
- type PolicyCheckResponse
- type PolicyEnforcementRequest
- type PolicyEnforcementResponse
- type PolicySetInfo
- type PolicySetsResponse
- type PolicyStatusResponse
- type ProcessInfo
- type ProcessListResponse
- type ProcessManager
- type ProgressStage
- type PutGroupUsersHandler
- type QuotaCheckRequest
- type RateLimitError
- type RateLimiter
- type RateLimiterStatus
- type RecoveryManager
- func (rm *RecoveryManager) AddRecoveryStrategy(errorType string, strategy RecoveryStrategy)
- func (rm *RecoveryManager) GetRecoveryStrategies() map[string]RecoveryStrategy
- func (rm *RecoveryManager) GracefulShutdown(ctx context.Context) error
- func (rm *RecoveryManager) HandleGoroutineLeak() error
- func (rm *RecoveryManager) HandleMemoryPressure() error
- func (rm *RecoveryManager) HealthCheck() error
- func (rm *RecoveryManager) RecoverFromError(component string, err error) error
- func (rm *RecoveryManager) RecoverFromPanic(component string)
- func (rm *RecoveryManager) RecoverGoroutine(component string, fn func())
- func (rm *RecoveryManager) RecoverHTTPHandler(component string, handler http.HandlerFunc) http.HandlerFunc
- type RecoveryStrategy
- type ResearchUserRequest
- type ResearchUserSSHKeyRequest
- type Resource
- type SSHTunnel
- type Server
- func (s *Server) Cleanup() error
- func (s *Server) ExecuteHibernateAll(projectID string) error
- func (s *Server) ExecutePreventLaunch(projectID string) error
- func (s *Server) ExecuteStopAll(projectID string) error
- func (s *Server) RegisterAMIRoutes(mux *http.ServeMux, applyMiddleware func(http.HandlerFunc) http.HandlerFunc)
- func (s *Server) RegisterConnectionProxyRoutes(mux *http.ServeMux, applyMiddleware func(http.HandlerFunc) http.HandlerFunc)
- func (s *Server) RegisterCostHandlers(mux *http.ServeMux, applyMiddleware func(http.HandlerFunc) http.HandlerFunc)
- func (s *Server) RegisterIdleRoutes(mux *http.ServeMux, applyMiddleware func(http.HandlerFunc) http.HandlerFunc)
- func (s *Server) RegisterMarketplaceRoutes(mux *http.ServeMux, applyMiddleware func(http.HandlerFunc) http.HandlerFunc)
- func (s *Server) RegisterPolicyRoutes(mux *http.ServeMux, applyMiddleware func(http.HandlerFunc) http.HandlerFunc)
- func (s *Server) RegisterSleepWakeRoutes(mux *http.ServeMux, applyMiddleware func(http.HandlerFunc) http.HandlerFunc)
- func (s *Server) Start() error
- func (s *Server) Stop() error
- type SetProjectBudgetRequest
- type SingletonManager
- type StabilityManager
- func (sm *StabilityManager) CheckMemoryPressure() bool
- func (sm *StabilityManager) EnableForceGC(enabled bool)
- func (sm *StabilityManager) ExecuteWithCircuitBreaker(name string, operation func() error) error
- func (sm *StabilityManager) ForceGarbageCollection()
- func (sm *StabilityManager) GetCircuitBreaker(name string) *CircuitBreaker
- func (sm *StabilityManager) GetCircuitBreakerStatus() map[string]*CircuitBreaker
- func (sm *StabilityManager) GetErrorHistory() []ErrorRecord
- func (sm *StabilityManager) GetStabilityMetrics() StabilityMetrics
- func (sm *StabilityManager) IsHealthy() bool
- func (sm *StabilityManager) RecordError(component, errorType, message string, severity ErrorSeverity)
- func (sm *StabilityManager) RecordRecovery(component, errorType string)
- func (sm *StabilityManager) SetMemoryThreshold(bytes int64)
- func (sm *StabilityManager) Start(ctx context.Context)
- type StabilityMetrics
- type StateManager
- type StateMonitor
- type StatusTracker
- func (s *StatusTracker) EndOperation()
- func (s *StatusTracker) EndOperationWithType(opType string)
- func (s *StatusTracker) GetActiveOperationCount() int
- func (s *StatusTracker) GetRecentlyActiveInstances(within time.Duration) []string
- func (s *StatusTracker) GetRequestRate() float64
- func (s *StatusTracker) GetStatus(version string, region string, awsProfile string) types.DaemonStatus
- func (s *StatusTracker) RecordInstanceActivity(instanceName string)
- func (s *StatusTracker) RecordRequest()
- func (s *StatusTracker) StartOperation() int64
- func (s *StatusTracker) StartOperationWithType(opType string) int64
- type SystemMetrics
- type TransferRequest
- type TransferResponse
- type TunnelInfo
- type TunnelManager
- func (tm *TunnelManager) CloseAll()
- func (tm *TunnelManager) CloseInstanceTunnels(instanceName string)
- func (tm *TunnelManager) CloseTunnel(instanceName, serviceName string) error
- func (tm *TunnelManager) CreateTunnel(instance *types.Instance, service types.Service) (*SSHTunnel, error)
- func (tm *TunnelManager) GetInstanceTunnels(instanceName string) []*SSHTunnel
- func (tm *TunnelManager) GetTunnel(instanceName, serviceName string) (*SSHTunnel, bool)
- type UpdateProjectBudgetRequest
- type UserManager
- func (m *UserManager) Authenticate(ctx context.Context, username, password string) (*usermgmt.AuthenticationResult, error)
- func (m *UserManager) Close() error
- func (m *UserManager) CreateUser(ctx context.Context, user *usermgmt.User) (*usermgmt.User, error)
- func (m *UserManager) DeleteUser(ctx context.Context, id string) error
- func (m *UserManager) DisableUser(ctx context.Context, id string) error
- func (m *UserManager) EnableUser(ctx context.Context, id string) error
- func (m *UserManager) GetDefaultProvisionOptions() (*usermgmt.UserProvisionOptions, error)
- func (m *UserManager) GetUser(ctx context.Context, id string) (*usermgmt.User, error)
- func (m *UserManager) GetUserByUsername(ctx context.Context, username string) (*usermgmt.User, error)
- func (m *UserManager) GetUsers(ctx context.Context, filter *usermgmt.UserFilter, ...) (*usermgmt.PaginatedUsers, error)
- func (m *UserManager) Initialize() error
- func (m *UserManager) IsUserInRole(ctx context.Context, userID string, role usermgmt.UserRole) (bool, error)
- func (m *UserManager) RegisterProvider(provider usermgmt.UserManagementProvider) error
- func (m *UserManager) SetDefaultProvisionOptions(options *usermgmt.UserProvisionOptions) error
- func (m *UserManager) SynchronizeUsers(ctx context.Context, options *usermgmt.SyncOptions) (*usermgmt.SyncResult, error)
- func (m *UserManager) UnregisterProvider(providerType usermgmt.Provider) error
- func (m *UserManager) UpdateUser(ctx context.Context, user *usermgmt.User) (*usermgmt.User, error)
Constants ¶
const ( // PIDFileName is the name of the PID file PIDFileName = "cwsd.pid" // ShutdownTimeout is how long to wait for graceful shutdown ShutdownTimeout = 10 * time.Second // ForceKillTimeout is how long to wait before force kill ForceKillTimeout = 15 * time.Second )
Variables ¶
var ErrUserManagerNotInitialized = errors.New("user manager not initialized")
Functions ¶
func GetConfigPath ¶
func GetConfigPath() string
getConfigPath returns the standard daemon configuration file path GetConfigPath returns the path to the daemon configuration file
func SaveConfig ¶
SaveConfig saves daemon configuration to the standard location
Types ¶
type APIVersion ¶
type APIVersion struct {
// Version identifier (e.g., "v1", "v2")
Version string
// Status of this version (stable, beta, alpha, deprecated)
Status string
// IsDefault indicates if this is the default version to use when no version is specified
IsDefault bool
// ReleaseDate is when this version was released
ReleaseDate time.Time
// DeprecationDate is when this version was deprecated (if applicable)
DeprecationDate *time.Time
// SunsetDate is when this version will be removed (if applicable)
SunsetDate *time.Time
// DocsURL is the documentation URL for this version
DocsURL string
}
APIVersion represents a specific API version
type APIVersionManager ¶
type APIVersionManager struct {
// contains filtered or unexported fields
}
APIVersionManager manages API versions and routing
func NewAPIVersionManager ¶
func NewAPIVersionManager(basePath string) *APIVersionManager
NewAPIVersionManager creates a new API version manager
func (*APIVersionManager) AddVersion ¶
func (m *APIVersionManager) AddVersion(version APIVersion)
AddVersion adds a new API version to the manager
func (*APIVersionManager) BuildVersionedPath ¶
func (m *APIVersionManager) BuildVersionedPath(path, version string) string
BuildVersionedPath builds a properly versioned path Example: BuildVersionedPath("instances", "v2") -> "/api/v2/instances"
func (*APIVersionManager) ExtractVersionFromPath ¶
func (m *APIVersionManager) ExtractVersionFromPath(path string) string
ExtractVersionFromPath extracts the version string from a URL path Example: "/api/v1/instances" -> "v1"
func (*APIVersionManager) GetDefaultVersion ¶
func (m *APIVersionManager) GetDefaultVersion() string
GetDefaultVersion returns the default API version
func (*APIVersionManager) GetLatestVersion ¶
func (m *APIVersionManager) GetLatestVersion() string
GetLatestVersion returns the latest API version (may be alpha/beta)
func (*APIVersionManager) GetStableVersion ¶
func (m *APIVersionManager) GetStableVersion() string
GetStableVersion returns the current stable API version
func (*APIVersionManager) GetSupportedVersions ¶
func (m *APIVersionManager) GetSupportedVersions() []APIVersion
GetSupportedVersions returns all supported API versions
func (*APIVersionManager) GetVersion ¶
func (m *APIVersionManager) GetVersion(version string) (APIVersion, bool)
GetVersion returns details about an API version
func (*APIVersionManager) NormalizePath ¶
func (m *APIVersionManager) NormalizePath(path, version string) string
NormalizePath standardizes the path format for a given version Example: "/instances" -> "/api/v1/instances" (for default version v1)
func (*APIVersionManager) TranslateRequestPath ¶
func (m *APIVersionManager) TranslateRequestPath(path, version string) string
TranslateRequestPath translates a request path based on API version This allows API evolution by mapping newer API calls to older implementations when needed Example: "/api/v2/instances" might map to a different handler than "/api/v1/instances"
func (*APIVersionManager) VersionHeaderMiddleware ¶
func (m *APIVersionManager) VersionHeaderMiddleware(next http.Handler) http.Handler
VersionHeaderMiddleware adds versioning information to response headers
func (*APIVersionManager) VersionRoutingMiddleware ¶
func (m *APIVersionManager) VersionRoutingMiddleware(next http.Handler) http.Handler
VersionRoutingMiddleware handles routing based on API version
type CircuitBreaker ¶
type CircuitBreaker struct {
Name string
FailureCount int
LastFailure time.Time
State CircuitBreakerState
FailureThreshold int
ResetTimeout time.Duration
}
CircuitBreaker prevents cascade failures
type CircuitBreakerState ¶
type CircuitBreakerState string
CircuitBreakerState represents circuit breaker states
const ( CircuitBreakerClosed CircuitBreakerState = "closed" CircuitBreakerOpen CircuitBreakerState = "open" CircuitBreakerHalfOpen CircuitBreakerState = "half_open" )
type CleanupRequest ¶
type CleanupRequest struct {
ForceKill bool `json:"force_kill,omitempty"`
RemoveAll bool `json:"remove_all,omitempty"`
}
CleanupRequest represents a request for daemon cleanup
type CleanupResponse ¶
type CleanupResponse struct {
ProcessesFound int `json:"processes_found"`
ProcessesCleaned int `json:"processes_cleaned"`
ProcessesFailed int `json:"processes_failed"`
FailedProcesses []int `json:"failed_processes,omitempty"`
FilesRemoved []string `json:"files_removed,omitempty"`
Status string `json:"status"`
Message string `json:"message"`
}
CleanupResponse represents the response for cleanup operations
type CloudInitStatus ¶
type CloudInitStatus struct {
Status string // "running", "done", "error", "disabled"
Description string
Errors []string
}
CloudInitStatus represents cloud-init status
type Config ¶
type Config struct {
// Instance retention settings
InstanceRetentionMinutes int `json:"instance_retention_minutes"` // 0 = indefinite, >0 = minutes to retain terminated instances
// Server settings
Port string `json:"port,omitempty"` // Server port (default: 8947)
// Monitoring settings (future expansion)
MonitoringIntervalSeconds int `json:"monitoring_interval_seconds,omitempty"` // Future: monitoring frequency
}
Config represents daemon configuration options
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the default daemon configuration
func LoadConfig ¶
LoadConfig loads daemon configuration from the standard location
func (*Config) GetRetentionDuration ¶
GetRetentionDuration returns the retention duration from config
type CreateTunnelsRequest ¶
type CreateTunnelsRequest struct {
InstanceName string `json:"instance_name"`
Services []string `json:"services,omitempty"` // If empty, create all
}
CreateTunnelsRequest is the request to create tunnels
type CreateTunnelsResponse ¶
type CreateTunnelsResponse struct {
Tunnels []TunnelInfo `json:"tunnels"`
Message string `json:"message"`
}
CreateTunnelsResponse is the response from creating tunnels
type DaemonHealthSummary ¶
type DaemonHealthSummary struct {
Status HealthStatus `json:"status"`
Score float64 `json:"score"`
LastChecked time.Time `json:"last_checked"`
SystemMetrics SystemMetrics `json:"system_metrics"`
ActiveChecks int `json:"active_checks"`
FailedChecks int `json:"failed_checks"`
CriticalIssues []string `json:"critical_issues"`
Recommendations []string `json:"recommendations"`
}
DaemonHealthSummary provides overall daemon health summary
type DaemonProfileAdapter ¶
type DaemonProfileAdapter struct{}
DaemonProfileAdapter adapts the profile manager for daemon use
func (*DaemonProfileAdapter) GetCurrentProfile ¶
func (d *DaemonProfileAdapter) GetCurrentProfile() (string, error)
func (*DaemonProfileAdapter) GetProfileConfig ¶
func (d *DaemonProfileAdapter) GetProfileConfig(profileID string) (interface{}, error)
func (*DaemonProfileAdapter) UpdateProfileConfig ¶
func (d *DaemonProfileAdapter) UpdateProfileConfig(profileID string, config interface{}) error
type DaemonRegistry ¶
type DaemonRegistry struct {
Processes []ProcessInfo `json:"processes"`
LastUpdated time.Time `json:"last_updated"`
Version string `json:"version"`
}
DaemonRegistry represents the daemon registry for tracking instances
type DefaultProcessManager ¶
type DefaultProcessManager struct {
// contains filtered or unexported fields
}
DefaultProcessManager implements ProcessManager interface
func (*DefaultProcessManager) CleanupProcesses ¶
func (pm *DefaultProcessManager) CleanupProcesses() error
CleanupProcesses performs comprehensive cleanup of all daemon processes
func (*DefaultProcessManager) FindDaemonProcesses ¶
func (pm *DefaultProcessManager) FindDaemonProcesses() ([]ProcessInfo, error)
FindDaemonProcesses discovers all running Prism daemon processes
func (*DefaultProcessManager) ForceKill ¶
func (pm *DefaultProcessManager) ForceKill(pid int) error
ForceKill forcefully terminates a daemon process
func (*DefaultProcessManager) GetPIDFilePath ¶
func (pm *DefaultProcessManager) GetPIDFilePath() string
GetPIDFilePath returns the path to the PID file
func (*DefaultProcessManager) GetRegistryPath ¶
func (pm *DefaultProcessManager) GetRegistryPath() string
GetRegistryPath returns the path to the registry file
func (*DefaultProcessManager) GracefulShutdown ¶
func (pm *DefaultProcessManager) GracefulShutdown(pid int) error
GracefulShutdown attempts graceful shutdown of a daemon process
func (*DefaultProcessManager) IsProcessRunning ¶
func (pm *DefaultProcessManager) IsProcessRunning(pid int) bool
IsProcessRunning checks if a process is currently running
func (*DefaultProcessManager) RegisterDaemon ¶
func (pm *DefaultProcessManager) RegisterDaemon(pid int, configPath, logPath string) error
RegisterDaemon registers a daemon process in the registry
func (*DefaultProcessManager) UnregisterDaemon ¶
func (pm *DefaultProcessManager) UnregisterDaemon(pid int) error
UnregisterDaemon removes a daemon process from the registry
func (*DefaultProcessManager) WaitForShutdown ¶
func (pm *DefaultProcessManager) WaitForShutdown(pid int, timeout time.Duration) error
WaitForShutdown waits for a process to shut down within timeout
type ErrorRecord ¶
type ErrorRecord struct {
Timestamp time.Time `json:"timestamp"`
ErrorType string `json:"error_type"`
Message string `json:"message"`
Component string `json:"component"`
Severity ErrorSeverity `json:"severity"`
Count int `json:"count"`
Recovered bool `json:"recovered"`
}
ErrorRecord tracks error occurrences for analysis
type ErrorSeverity ¶
type ErrorSeverity string
ErrorSeverity represents error severity levels
const ( ErrorSeverityLow ErrorSeverity = "low" ErrorSeverityMedium ErrorSeverity = "medium" ErrorSeverityHigh ErrorSeverity = "high" ErrorSeverityCritical ErrorSeverity = "critical" )
type GetGroupUsersHandler ¶
type GetGroupUsersHandler struct{}
GetGroupUsersHandler handles GET requests for group users
func (*GetGroupUsersHandler) CanHandle ¶
func (h *GetGroupUsersHandler) CanHandle(method string) bool
func (*GetGroupUsersHandler) Handle ¶
func (h *GetGroupUsersHandler) Handle(w http.ResponseWriter, r *http.Request, id string, server *Server) error
type GroupUsersHandler ¶
type GroupUsersHandler interface {
CanHandle(method string) bool
Handle(w http.ResponseWriter, r *http.Request, id string, server *Server) error
}
GroupUsersHandler interface for different HTTP methods (Strategy Pattern - SOLID)
type GroupUsersMethodDispatcher ¶
type GroupUsersMethodDispatcher struct {
// contains filtered or unexported fields
}
GroupUsersMethodDispatcher manages HTTP method handlers (Strategy Pattern - SOLID)
func NewGroupUsersMethodDispatcher ¶
func NewGroupUsersMethodDispatcher() *GroupUsersMethodDispatcher
NewGroupUsersMethodDispatcher creates group users method dispatcher
func (*GroupUsersMethodDispatcher) Dispatch ¶
func (d *GroupUsersMethodDispatcher) Dispatch(w http.ResponseWriter, r *http.Request, id string, server *Server)
Dispatch handles request using appropriate handler
type HTTPServer ¶
HTTPServer interface to avoid circular dependency
type HealthCheck ¶
type HealthCheck struct {
Name string `json:"name"`
Description string `json:"description"`
CheckFunc func() HealthCheckResult `json:"-"`
Interval time.Duration `json:"interval"`
Timeout time.Duration `json:"timeout"`
Critical bool `json:"critical"`
LastRun time.Time `json:"last_run"`
LastResult HealthCheckResult `json:"last_result"`
}
HealthCheck represents a health check function
type HealthCheckResult ¶
type HealthCheckResult struct {
Status HealthStatus `json:"status"`
Message string `json:"message"`
Duration time.Duration `json:"duration"`
Error string `json:"error,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
CheckedAt time.Time `json:"checked_at"`
}
HealthCheckResult represents the result of a health check
type HealthMonitor ¶
type HealthMonitor struct {
// contains filtered or unexported fields
}
HealthMonitor provides comprehensive daemon health monitoring
func NewHealthMonitor ¶
func NewHealthMonitor(stateManager StateManager, stabilityMgr *StabilityManager, recoveryMgr *RecoveryManager, monitor *monitoring.PerformanceMonitor) *HealthMonitor
NewHealthMonitor creates a new health monitor
func (*HealthMonitor) AddHealthCheck ¶
func (hm *HealthMonitor) AddHealthCheck(name string, check HealthCheck)
AddHealthCheck adds a custom health check
func (*HealthMonitor) GetHealthHistory ¶
func (hm *HealthMonitor) GetHealthHistory() []HealthSnapshot
GetHealthHistory returns recent health history
func (*HealthMonitor) GetHealthSummary ¶
func (hm *HealthMonitor) GetHealthSummary() DaemonHealthSummary
GetHealthSummary returns current health summary
func (*HealthMonitor) HandleDetailedHealthEndpoint ¶
func (hm *HealthMonitor) HandleDetailedHealthEndpoint(w http.ResponseWriter, r *http.Request)
HandleDetailedHealthEndpoint handles detailed health endpoint
func (*HealthMonitor) HandleHealthEndpoint ¶
func (hm *HealthMonitor) HandleHealthEndpoint(w http.ResponseWriter, r *http.Request)
HandleHealthEndpoint handles HTTP health endpoint
func (*HealthMonitor) IsHealthy ¶
func (hm *HealthMonitor) IsHealthy() bool
IsHealthy returns current health status
func (*HealthMonitor) RemoveHealthCheck ¶
func (hm *HealthMonitor) RemoveHealthCheck(name string)
RemoveHealthCheck removes a health check
func (*HealthMonitor) Start ¶
func (hm *HealthMonitor) Start(ctx context.Context)
Start begins health monitoring
type HealthSnapshot ¶
type HealthSnapshot struct {
Timestamp time.Time `json:"timestamp"`
OverallStatus HealthStatus `json:"overall_status"`
CheckResults map[string]HealthCheckResult `json:"check_results"`
SystemMetrics SystemMetrics `json:"system_metrics"`
StabilityScore float64 `json:"stability_score"`
}
HealthSnapshot represents a point-in-time health snapshot
type HealthStatus ¶
type HealthStatus string
HealthStatus represents health check status
const ( HealthStatusHealthy HealthStatus = "healthy" HealthStatusDegraded HealthStatus = "degraded" HealthStatusUnhealthy HealthStatus = "unhealthy" HealthStatusUnknown HealthStatus = "unknown" )
type LaunchProgressMonitor ¶
type LaunchProgressMonitor struct {
// contains filtered or unexported fields
}
LaunchProgressMonitor monitors instance setup progress via SSH
func NewLaunchProgressMonitor ¶
func NewLaunchProgressMonitor(instance *types.Instance, sshKeyPath, username string) *LaunchProgressMonitor
NewLaunchProgressMonitor creates a new progress monitor
func (*LaunchProgressMonitor) GetProgress ¶
func (m *LaunchProgressMonitor) GetProgress() float64
GetProgress returns the overall progress percentage
func (*LaunchProgressMonitor) GetStages ¶
func (m *LaunchProgressMonitor) GetStages() []ProgressStage
GetStages returns the current progress stages
type MetricStats ¶
type MetricStats struct {
Average float64
Maximum float64
Minimum float64
P95 float64
P99 float64
Count int
}
MetricStats holds statistical analysis of metric datapoints
type Operation ¶
type Operation string
Operation represents an operation type
const ( // OperationCreate represents a create operation OperationCreate Operation = "create" // OperationRead represents a read operation OperationRead Operation = "read" // OperationUpdate represents an update operation OperationUpdate Operation = "update" // OperationDelete represents a delete operation OperationDelete Operation = "delete" // OperationList represents a list operation OperationList Operation = "list" // OperationManage represents a management operation OperationManage Operation = "manage" )
type Permission ¶
type Permission struct {
// Resource is the resource type
Resource Resource
// Operation is the operation type
Operation Operation
// MinimumLevel is the minimum permission level required
MinimumLevel PermissionLevel
}
Permission represents a permission check
type PermissionLevel ¶
type PermissionLevel int
PermissionLevel represents an access level for an operation
const ( // PermissionNone represents no access PermissionNone PermissionLevel = iota // PermissionRead represents read access PermissionRead // PermissionWrite represents write access (includes read) PermissionWrite // PermissionAdmin represents administrative access (includes read and write) PermissionAdmin )
type PolicyAssignRequest ¶
type PolicyAssignRequest struct {
PolicySet string `json:"policy_set"`
UserID string `json:"user_id,omitempty"`
}
PolicyAssignRequest represents a policy assignment request
type PolicyAssignResponse ¶
type PolicyAssignResponse struct {
Success bool `json:"success"`
Message string `json:"message"`
AssignedPolicySet string `json:"assigned_policy_set"`
EnforcementStatus string `json:"enforcement_status"`
}
PolicyAssignResponse represents the response to a policy assignment
type PolicyCheckRequest ¶
type PolicyCheckRequest struct {
TemplateName string `json:"template_name"`
UserID string `json:"user_id,omitempty"`
}
PolicyCheckRequest represents a template access check request
type PolicyCheckResponse ¶
type PolicyCheckResponse struct {
Allowed bool `json:"allowed"`
TemplateName string `json:"template_name"`
Reason string `json:"reason"`
MatchedPolicies []string `json:"matched_policies,omitempty"`
Suggestions []string `json:"suggestions,omitempty"`
}
PolicyCheckResponse represents the result of a policy check
type PolicyEnforcementRequest ¶
type PolicyEnforcementRequest struct {
Enabled bool `json:"enabled"`
}
PolicyEnforcementRequest represents an enforcement state change request
type PolicyEnforcementResponse ¶
type PolicyEnforcementResponse struct {
Success bool `json:"success"`
Message string `json:"message"`
Enabled bool `json:"enabled"`
Status string `json:"status"`
}
PolicyEnforcementResponse represents the response to enforcement changes
type PolicySetInfo ¶
type PolicySetInfo struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Policies int `json:"policies"`
Status string `json:"status"`
Tags map[string]string `json:"tags,omitempty"`
}
PolicySetInfo provides information about a policy set
type PolicySetsResponse ¶
type PolicySetsResponse struct {
PolicySets map[string]PolicySetInfo `json:"policy_sets"`
}
PolicySetsResponse represents available policy sets
type PolicyStatusResponse ¶
type PolicyStatusResponse struct {
Enabled bool `json:"enabled"`
Status string `json:"status"`
StatusIcon string `json:"status_icon"`
AssignedPolicies []string `json:"assigned_policies"`
Message string `json:"message,omitempty"`
}
PolicyStatusResponse represents the policy enforcement status
type ProcessInfo ¶
type ProcessInfo struct {
PID int `json:"pid"`
Command string `json:"command"`
StartTime time.Time `json:"start_time"`
ConfigPath string `json:"config_path,omitempty"`
LogPath string `json:"log_path,omitempty"`
WorkingDir string `json:"working_dir,omitempty"`
User string `json:"user,omitempty"`
Status string `json:"status"`
}
ProcessInfo represents information about a daemon process
type ProcessListResponse ¶
type ProcessListResponse struct {
Processes []ProcessInfo `json:"processes"`
Total int `json:"total"`
Status string `json:"status"`
}
ProcessListResponse represents the response for listing daemon processes
type ProcessManager ¶
type ProcessManager interface {
FindDaemonProcesses() ([]ProcessInfo, error)
GracefulShutdown(pid int) error
ForceKill(pid int) error
CleanupProcesses() error
RegisterDaemon(pid int, configPath, logPath string) error
UnregisterDaemon(pid int) error
GetPIDFilePath() string
GetRegistryPath() string
IsProcessRunning(pid int) bool
WaitForShutdown(pid int, timeout time.Duration) error
}
ProcessManager interface defines daemon process management operations
func NewProcessManager ¶
func NewProcessManager() ProcessManager
NewProcessManager creates a new process manager instance
type ProgressStage ¶
type ProgressStage struct {
Name string // Internal name: "system-packages"
DisplayName string // User-facing: "Installing system packages"
Status string // "pending", "running", "complete", "error"
StartTime time.Time
EndTime time.Time
Output string // Last output line from this stage
}
ProgressStage represents a stage in the setup process
type PutGroupUsersHandler ¶
type PutGroupUsersHandler struct{}
PutGroupUsersHandler handles PUT requests for updating group users
func (*PutGroupUsersHandler) CanHandle ¶
func (h *PutGroupUsersHandler) CanHandle(method string) bool
func (*PutGroupUsersHandler) Handle ¶
func (h *PutGroupUsersHandler) Handle(w http.ResponseWriter, r *http.Request, id string, server *Server) error
type QuotaCheckRequest ¶ added in v0.5.11
type QuotaCheckRequest struct {
InstanceType string `json:"instance_type"`
Count int `json:"count"` // Number of students/invitations
TemplateName string `json:"template_name,omitempty"`
}
QuotaCheckRequest represents a request to check AWS quotas for bulk invitations
type RateLimitError ¶ added in v0.5.11
RateLimitError is returned when a launch is rate limited
func (*RateLimitError) Error ¶ added in v0.5.11
func (e *RateLimitError) Error() string
type RateLimiter ¶ added in v0.5.11
type RateLimiter struct {
// contains filtered or unexported fields
}
RateLimiter provides token bucket-based rate limiting for instance launches
func NewRateLimiter ¶ added in v0.5.11
func NewRateLimiter(maxLaunches int, window time.Duration) *RateLimiter
NewRateLimiter creates a new rate limiter
func (*RateLimiter) CheckAndRecordLaunch ¶ added in v0.5.11
func (rl *RateLimiter) CheckAndRecordLaunch() error
CheckAndRecordLaunch checks if a launch is allowed and records it if so Returns nil if allowed, error with retry time if rate limited
func (*RateLimiter) GetStatus ¶ added in v0.5.11
func (rl *RateLimiter) GetStatus() RateLimiterStatus
GetStatus returns current rate limiter status
func (*RateLimiter) SetEnabled ¶ added in v0.5.11
func (rl *RateLimiter) SetEnabled(enabled bool)
SetEnabled enables or disables rate limiting
func (*RateLimiter) UpdateConfig ¶ added in v0.5.11
func (rl *RateLimiter) UpdateConfig(maxLaunches int, window time.Duration)
UpdateConfig updates rate limiter configuration
type RateLimiterStatus ¶ added in v0.5.11
type RateLimiterStatus struct {
Enabled bool `json:"enabled"`
MaxLaunches int `json:"max_launches"`
Window time.Duration `json:"window"`
Current int `json:"current"`
Remaining int `json:"remaining"`
ResetTime time.Time `json:"reset_time,omitempty"`
}
RateLimiterStatus represents the current status of the rate limiter
type RecoveryManager ¶
type RecoveryManager struct {
HTTPServer HTTPServer
// contains filtered or unexported fields
}
RecoveryManager handles panic recovery and graceful degradation
func NewRecoveryManager ¶
func NewRecoveryManager(stabilityMgr *StabilityManager, httpServer HTTPServer) *RecoveryManager
NewRecoveryManager creates a new recovery manager
func (*RecoveryManager) AddRecoveryStrategy ¶
func (rm *RecoveryManager) AddRecoveryStrategy(errorType string, strategy RecoveryStrategy)
AddRecoveryStrategy adds a custom recovery strategy
func (*RecoveryManager) GetRecoveryStrategies ¶
func (rm *RecoveryManager) GetRecoveryStrategies() map[string]RecoveryStrategy
GetRecoveryStrategies returns all recovery strategies
func (*RecoveryManager) GracefulShutdown ¶
func (rm *RecoveryManager) GracefulShutdown(ctx context.Context) error
GracefulShutdown performs graceful shutdown
func (*RecoveryManager) HandleGoroutineLeak ¶
func (rm *RecoveryManager) HandleGoroutineLeak() error
HandleGoroutineLeak handles excessive goroutine count
func (*RecoveryManager) HandleMemoryPressure ¶
func (rm *RecoveryManager) HandleMemoryPressure() error
HandleMemoryPressure handles high memory usage situations
func (*RecoveryManager) HealthCheck ¶
func (rm *RecoveryManager) HealthCheck() error
HealthCheck performs comprehensive health check
func (*RecoveryManager) RecoverFromError ¶
func (rm *RecoveryManager) RecoverFromError(component string, err error) error
RecoverFromError attempts to recover from a specific error
func (*RecoveryManager) RecoverFromPanic ¶
func (rm *RecoveryManager) RecoverFromPanic(component string)
RecoverFromPanic provides panic recovery middleware
func (*RecoveryManager) RecoverGoroutine ¶
func (rm *RecoveryManager) RecoverGoroutine(component string, fn func())
RecoverGoroutine wraps goroutine execution with panic recovery
func (*RecoveryManager) RecoverHTTPHandler ¶
func (rm *RecoveryManager) RecoverHTTPHandler(component string, handler http.HandlerFunc) http.HandlerFunc
RecoverHTTPHandler creates HTTP handler with panic recovery
type RecoveryStrategy ¶
type RecoveryStrategy struct {
Name string
Description string
Handler func(error) error
Retries int
Timeout time.Duration
}
RecoveryStrategy defines how to recover from specific error types
type ResearchUserRequest ¶
type ResearchUserRequest struct {
Username string `json:"username"`
}
ResearchUserRequest represents a request to create a research user
type ResearchUserSSHKeyRequest ¶
type ResearchUserSSHKeyRequest struct {
Username string `json:"username"`
KeyType string `json:"key_type,omitempty"` // "ed25519" or "rsa"
}
ResearchUserSSHKeyRequest represents a request to manage SSH keys
type Resource ¶
type Resource string
Resource represents a resource type
const ( // ResourceInstance represents an instance resource ResourceInstance Resource = "instance" // ResourceTemplate represents a template resource ResourceTemplate Resource = "template" // ResourceVolume represents a volume resource ResourceVolume Resource = "volume" // ResourceStorage represents a storage resource ResourceStorage Resource = "storage" // ResourceUser represents a user resource ResourceUser Resource = "user" // ResourceGroup represents a group resource ResourceGroup Resource = "group" // ResourceSystem represents system-level resources ResourceSystem Resource = "system" )
type SSHTunnel ¶
type SSHTunnel struct {
InstanceName string
ServiceName string
RemotePort int
LocalPort int
PublicIP string
Username string
KeyPath string
AuthToken string // Authentication token (e.g., Jupyter token)
// contains filtered or unexported fields
}
SSHTunnel represents an active SSH tunnel
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the Prism daemon server
func NewServerForTesting ¶ added in v0.5.7
NewServerForTesting creates a new daemon server with test mode enabled Test mode skips AWS operations to allow unit testing without AWS credentials
func (*Server) ExecuteHibernateAll ¶
ExecuteHibernateAll hibernates all instances for a project
func (*Server) ExecutePreventLaunch ¶
ExecutePreventLaunch sets a flag to prevent new launches for a project
func (*Server) ExecuteStopAll ¶
ExecuteStopAll stops all instances for a project
func (*Server) RegisterAMIRoutes ¶
func (s *Server) RegisterAMIRoutes(mux *http.ServeMux, applyMiddleware func(http.HandlerFunc) http.HandlerFunc)
RegisterAMIRoutes registers all AMI-related API routes
func (*Server) RegisterConnectionProxyRoutes ¶
func (s *Server) RegisterConnectionProxyRoutes(mux *http.ServeMux, applyMiddleware func(http.HandlerFunc) http.HandlerFunc)
RegisterConnectionProxyRoutes registers all connection proxy endpoints
func (*Server) RegisterCostHandlers ¶
func (s *Server) RegisterCostHandlers(mux *http.ServeMux, applyMiddleware func(http.HandlerFunc) http.HandlerFunc)
RegisterCostHandlers registers all cost-related HTTP handlers
func (*Server) RegisterIdleRoutes ¶
func (s *Server) RegisterIdleRoutes(mux *http.ServeMux, applyMiddleware func(http.HandlerFunc) http.HandlerFunc)
RegisterIdleRoutes registers all idle policy API routes
func (*Server) RegisterMarketplaceRoutes ¶
func (s *Server) RegisterMarketplaceRoutes(mux *http.ServeMux, applyMiddleware func(http.HandlerFunc) http.HandlerFunc)
RegisterMarketplaceRoutes registers all marketplace-related API routes
func (*Server) RegisterPolicyRoutes ¶
func (s *Server) RegisterPolicyRoutes(mux *http.ServeMux, applyMiddleware func(http.HandlerFunc) http.HandlerFunc)
RegisterPolicyRoutes registers all policy-related API endpoints
func (*Server) RegisterSleepWakeRoutes ¶ added in v0.5.13
func (s *Server) RegisterSleepWakeRoutes(mux *http.ServeMux, applyMiddleware func(http.HandlerFunc) http.HandlerFunc)
RegisterSleepWakeRoutes registers all sleep/wake API routes
type SetProjectBudgetRequest ¶
type SetProjectBudgetRequest struct {
TotalBudget float64 `json:"total_budget"`
MonthlyLimit *float64 `json:"monthly_limit,omitempty"`
DailyLimit *float64 `json:"daily_limit,omitempty"`
AlertThresholds []types.BudgetAlert `json:"alert_thresholds,omitempty"`
AutoActions []types.BudgetAutoAction `json:"auto_actions,omitempty"`
BudgetPeriod types.BudgetPeriod `json:"budget_period"`
EndDate *time.Time `json:"end_date,omitempty"`
}
SetProjectBudgetRequest represents a request to set or enable a project budget
func (*SetProjectBudgetRequest) Validate ¶
func (r *SetProjectBudgetRequest) Validate() error
Validate validates the set budget request
type SingletonManager ¶
type SingletonManager struct {
// contains filtered or unexported fields
}
SingletonManager manages daemon singleton enforcement
func NewSingletonManager ¶
func NewSingletonManager() (*SingletonManager, error)
NewSingletonManager creates a new singleton manager
func (*SingletonManager) Acquire ¶
func (s *SingletonManager) Acquire() error
Acquire attempts to acquire the singleton lock If another daemon is running, it will attempt to gracefully shut it down
func (*SingletonManager) GetPID ¶
func (s *SingletonManager) GetPID() (int, error)
GetPID returns the PID from the PID file, or 0 if not running
func (*SingletonManager) Release ¶
func (s *SingletonManager) Release() error
Release releases the singleton lock
type StabilityManager ¶
type StabilityManager struct {
// contains filtered or unexported fields
}
StabilityManager manages daemon stability, memory, and error recovery
func NewStabilityManager ¶
func NewStabilityManager(monitor *monitoring.PerformanceMonitor) *StabilityManager
NewStabilityManager creates a new stability manager
func (*StabilityManager) CheckMemoryPressure ¶
func (sm *StabilityManager) CheckMemoryPressure() bool
CheckMemoryPressure checks if memory usage is too high
func (*StabilityManager) EnableForceGC ¶
func (sm *StabilityManager) EnableForceGC(enabled bool)
EnableForceGC enables/disables forced garbage collection
func (*StabilityManager) ExecuteWithCircuitBreaker ¶
func (sm *StabilityManager) ExecuteWithCircuitBreaker(name string, operation func() error) error
ExecuteWithCircuitBreaker executes a function with circuit breaker protection
func (*StabilityManager) ForceGarbageCollection ¶
func (sm *StabilityManager) ForceGarbageCollection()
ForceGarbageCollection triggers garbage collection
func (*StabilityManager) GetCircuitBreaker ¶
func (sm *StabilityManager) GetCircuitBreaker(name string) *CircuitBreaker
GetCircuitBreaker gets or creates a circuit breaker
func (*StabilityManager) GetCircuitBreakerStatus ¶
func (sm *StabilityManager) GetCircuitBreakerStatus() map[string]*CircuitBreaker
GetCircuitBreakerStatus returns all circuit breaker statuses
func (*StabilityManager) GetErrorHistory ¶
func (sm *StabilityManager) GetErrorHistory() []ErrorRecord
GetErrorHistory returns recent error history
func (*StabilityManager) GetStabilityMetrics ¶
func (sm *StabilityManager) GetStabilityMetrics() StabilityMetrics
GetStabilityMetrics returns current stability metrics
func (*StabilityManager) IsHealthy ¶
func (sm *StabilityManager) IsHealthy() bool
IsHealthy returns current health status
func (*StabilityManager) RecordError ¶
func (sm *StabilityManager) RecordError(component, errorType, message string, severity ErrorSeverity)
RecordError records an error for stability tracking
func (*StabilityManager) RecordRecovery ¶
func (sm *StabilityManager) RecordRecovery(component, errorType string)
RecordRecovery records successful error recovery
func (*StabilityManager) SetMemoryThreshold ¶
func (sm *StabilityManager) SetMemoryThreshold(bytes int64)
SetMemoryThreshold sets memory threshold for triggering GC
func (*StabilityManager) Start ¶
func (sm *StabilityManager) Start(ctx context.Context)
Start begins stability monitoring
type StabilityMetrics ¶
type StabilityMetrics struct {
Uptime time.Duration `json:"uptime"`
MemoryUsageMB float64 `json:"memory_usage_mb"`
GoroutineCount int `json:"goroutine_count"`
GCCount uint32 `json:"gc_count"`
LastGCPause time.Duration `json:"last_gc_pause"`
TotalErrors int `json:"total_errors"`
CriticalErrors int `json:"critical_errors"`
RecoveredErrors int `json:"recovered_errors"`
CircuitBreakersOpen int `json:"circuit_breakers_open"`
HealthScore float64 `json:"health_score"`
}
StabilityMetrics tracks daemon stability metrics
type StateManager ¶
type StateManager interface {
}
StateManager interface to avoid circular dependency
type StateMonitor ¶ added in v0.5.8
type StateMonitor struct {
// contains filtered or unexported fields
}
StateMonitor monitors instance state changes in the background It polls AWS for instances in transitional states and updates local state
func NewStateMonitor ¶ added in v0.5.8
func NewStateMonitor(awsManager *aws.Manager, stateManager *state.Manager) *StateMonitor
NewStateMonitor creates a new state monitor
func (*StateMonitor) Start ¶ added in v0.5.8
func (sm *StateMonitor) Start() error
Start begins background state monitoring
func (*StateMonitor) Stop ¶ added in v0.5.8
func (sm *StateMonitor) Stop()
Stop gracefully stops the state monitor
type StatusTracker ¶
type StatusTracker struct {
// contains filtered or unexported fields
}
StatusTracker tracks daemon operational metrics
func NewStatusTracker ¶
func NewStatusTracker() *StatusTracker
NewStatusTracker creates a new status tracker
func (*StatusTracker) EndOperation ¶
func (s *StatusTracker) EndOperation()
EndOperation decrements the active operations counter
func (*StatusTracker) EndOperationWithType ¶
func (s *StatusTracker) EndOperationWithType(opType string)
EndOperationWithType decrements the active operations counter for a specific type
func (*StatusTracker) GetActiveOperationCount ¶
func (s *StatusTracker) GetActiveOperationCount() int
GetActiveOperationCount returns the current number of active operations
func (*StatusTracker) GetRecentlyActiveInstances ¶
func (s *StatusTracker) GetRecentlyActiveInstances(within time.Duration) []string
GetRecentlyActiveInstances returns instances that had activity within the specified duration
func (*StatusTracker) GetRequestRate ¶
func (s *StatusTracker) GetRequestRate() float64
GetRequestRate calculates the current request rate per minute
func (*StatusTracker) GetStatus ¶
func (s *StatusTracker) GetStatus(version string, region string, awsProfile string) types.DaemonStatus
GetStatus returns the current daemon status
func (*StatusTracker) RecordInstanceActivity ¶
func (s *StatusTracker) RecordInstanceActivity(instanceName string)
RecordInstanceActivity records that an instance had recent activity
func (*StatusTracker) RecordRequest ¶
func (s *StatusTracker) RecordRequest()
RecordRequest records a request and updates metrics
func (*StatusTracker) StartOperation ¶
func (s *StatusTracker) StartOperation() int64
StartOperation increments the active operations counter Returns an operation ID that can be used for tracking
func (*StatusTracker) StartOperationWithType ¶
func (s *StatusTracker) StartOperationWithType(opType string) int64
StartOperationWithType increments the active operations counter for a specific type Returns an operation ID that can be used for tracking
type SystemMetrics ¶
type SystemMetrics struct {
MemoryUsageMB float64 `json:"memory_usage_mb"`
GoroutineCount int `json:"goroutine_count"`
GCCount uint32 `json:"gc_count"`
LastGCPause time.Duration `json:"last_gc_pause"`
Uptime time.Duration `json:"uptime"`
CPUUsagePercent float64 `json:"cpu_usage_percent"`
LoadAverage float64 `json:"load_average"`
}
SystemMetrics represents system-level metrics
type TransferRequest ¶ added in v0.5.7
type TransferRequest struct {
// Type is the transfer operation type ("upload" or "download")
Type string `json:"type"`
// LocalPath is the local file path
LocalPath string `json:"local_path"`
// S3Bucket is the S3 bucket name
S3Bucket string `json:"s3_bucket"`
// S3Key is the S3 object key
S3Key string `json:"s3_key"`
// Options for transfer configuration (optional)
Options *storage.TransferOptions `json:"options,omitempty"`
}
TransferRequest represents a request to start a file transfer
type TransferResponse ¶ added in v0.5.7
type TransferResponse struct {
// TransferID is the unique identifier for the transfer
TransferID string `json:"transfer_id"`
// Status is the current transfer status
Status storage.TransferStatus `json:"status"`
// Progress contains detailed transfer progress
Progress *storage.TransferProgress `json:"progress,omitempty"`
// Error contains error message if transfer failed to start
Error string `json:"error,omitempty"`
}
TransferResponse represents the response from a transfer request
type TunnelInfo ¶
type TunnelInfo struct {
InstanceName string `json:"instance_name"`
ServiceName string `json:"service_name"`
ServiceDesc string `json:"service_description"`
RemotePort int `json:"remote_port"`
LocalPort int `json:"local_port"`
LocalURL string `json:"local_url"`
AuthToken string `json:"auth_token,omitempty"` // Authentication token (e.g., Jupyter)
Status string `json:"status"`
StartTime string `json:"start_time,omitempty"`
}
TunnelInfo represents tunnel information for API responses
type TunnelManager ¶
type TunnelManager struct {
// contains filtered or unexported fields
}
TunnelManager manages SSH tunnels for instance services
func NewTunnelManager ¶
func NewTunnelManager(state StateManager) *TunnelManager
NewTunnelManager creates a new tunnel manager
func (*TunnelManager) CloseInstanceTunnels ¶
func (tm *TunnelManager) CloseInstanceTunnels(instanceName string)
CloseInstanceTunnels closes all tunnels for an instance
func (*TunnelManager) CloseTunnel ¶
func (tm *TunnelManager) CloseTunnel(instanceName, serviceName string) error
CloseTunnel closes a specific tunnel
func (*TunnelManager) CreateTunnel ¶
func (tm *TunnelManager) CreateTunnel(instance *types.Instance, service types.Service) (*SSHTunnel, error)
CreateTunnel creates an SSH tunnel for a service
func (*TunnelManager) GetInstanceTunnels ¶
func (tm *TunnelManager) GetInstanceTunnels(instanceName string) []*SSHTunnel
GetInstanceTunnels returns all tunnels for an instance
type UpdateProjectBudgetRequest ¶
type UpdateProjectBudgetRequest struct {
TotalBudget *float64 `json:"total_budget,omitempty"`
MonthlyLimit *float64 `json:"monthly_limit,omitempty"`
DailyLimit *float64 `json:"daily_limit,omitempty"`
AlertThresholds []types.BudgetAlert `json:"alert_thresholds,omitempty"`
AutoActions []types.BudgetAutoAction `json:"auto_actions,omitempty"`
EndDate *time.Time `json:"end_date,omitempty"`
}
UpdateProjectBudgetRequest represents a request to update a project budget
type UserManager ¶
type UserManager struct {
// contains filtered or unexported fields
}
UserManager manages user-related operations in the daemon
func (*UserManager) Authenticate ¶
func (m *UserManager) Authenticate(ctx context.Context, username, password string) (*usermgmt.AuthenticationResult, error)
Authenticate authenticates a user with the given credentials
func (*UserManager) Close ¶
func (m *UserManager) Close() error
Close closes the user manager and releases resources
func (*UserManager) CreateUser ¶
CreateUser creates a new user
func (*UserManager) DeleteUser ¶
func (m *UserManager) DeleteUser(ctx context.Context, id string) error
DeleteUser deletes a user
func (*UserManager) DisableUser ¶
func (m *UserManager) DisableUser(ctx context.Context, id string) error
DisableUser disables a user
func (*UserManager) EnableUser ¶
func (m *UserManager) EnableUser(ctx context.Context, id string) error
EnableUser enables a user
func (*UserManager) GetDefaultProvisionOptions ¶
func (m *UserManager) GetDefaultProvisionOptions() (*usermgmt.UserProvisionOptions, error)
GetDefaultProvisionOptions gets the default options for provisioning users
func (*UserManager) GetUserByUsername ¶
func (m *UserManager) GetUserByUsername(ctx context.Context, username string) (*usermgmt.User, error)
GetUserByUsername gets a user by username
func (*UserManager) GetUsers ¶
func (m *UserManager) GetUsers(ctx context.Context, filter *usermgmt.UserFilter, pagination *usermgmt.PaginationOptions) (*usermgmt.PaginatedUsers, error)
GetUsers gets users matching the specified filter
func (*UserManager) Initialize ¶
func (m *UserManager) Initialize() error
Initialize initializes the user manager
func (*UserManager) IsUserInRole ¶
func (m *UserManager) IsUserInRole(ctx context.Context, userID string, role usermgmt.UserRole) (bool, error)
IsUserInRole checks if a user has the specified role
func (*UserManager) RegisterProvider ¶
func (m *UserManager) RegisterProvider(provider usermgmt.UserManagementProvider) error
RegisterProvider registers a user management provider
func (*UserManager) SetDefaultProvisionOptions ¶
func (m *UserManager) SetDefaultProvisionOptions(options *usermgmt.UserProvisionOptions) error
SetDefaultProvisionOptions sets the default options for provisioning users
func (*UserManager) SynchronizeUsers ¶
func (m *UserManager) SynchronizeUsers(ctx context.Context, options *usermgmt.SyncOptions) (*usermgmt.SyncResult, error)
SynchronizeUsers synchronizes users from all providers
func (*UserManager) UnregisterProvider ¶
func (m *UserManager) UnregisterProvider(providerType usermgmt.Provider) error
UnregisterProvider unregisters a user management provider
func (*UserManager) UpdateUser ¶
UpdateUser updates an existing user
Source Files
¶
- ami_handlers.go
- api_versioning.go
- auth.go
- aws_compliance_handlers.go
- aws_helpers.go
- budget_handlers.go
- config.go
- connection_proxy_handlers.go
- context.go
- core_handlers.go
- cost_handlers.go
- error_handler.go
- health_monitor.go
- idle_handlers.go
- instance_handlers.go
- invitation_handlers.go
- launch_progress.go
- log_handlers.go
- marketplace_handlers.go
- middleware.go
- permission.go
- policy_handlers.go
- process_handlers.go
- process_manager.go
- project_handlers.go
- rate_limit_handlers.go
- rate_limiter.go
- recovery.go
- research_user_handlers.go
- rightsizing_handlers.go
- security_handlers.go
- server.go
- shared_token_handlers.go
- singleton.go
- sleepwake_handlers.go
- sleepwake_integration.go
- snapshot_handlers.go
- stability.go
- stability_handlers.go
- state_monitor.go
- status.go
- storage_handlers.go
- storage_transfer_handlers.go
- system_metrics.go
- template_application_handlers.go
- template_handlers.go
- throttling_handlers.go
- tunnel_handlers.go
- tunnel_manager.go
- user_handlers.go
- user_manager.go
- volume_handlers.go