refactored the big main.py file
This commit is contained in:
24
session-manager/models.py
Normal file
24
session-manager/models.py
Normal file
@@ -0,0 +1,24 @@
|
||||
"""
|
||||
Data models for Session Management Service
|
||||
|
||||
Pydantic models for session data and API request/response schemas.
|
||||
"""
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class SessionData(BaseModel):
|
||||
"""Represents a user session with its associated container"""
|
||||
|
||||
session_id: str
|
||||
container_name: str
|
||||
container_id: Optional[str] = None
|
||||
host_dir: str
|
||||
port: Optional[int] = None
|
||||
auth_token: Optional[str] = None # Authentication token for the session
|
||||
created_at: datetime
|
||||
last_accessed: datetime
|
||||
status: str = "creating" # creating, running, stopped, error
|
||||
Reference in New Issue
Block a user