File size: 2,024 Bytes
c30c59f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | """
Pythonic data models for ARF Demo
"""
from dataclasses import dataclass, asdict
from enum import Enum
from typing import Dict, List, Optional, Any
import datetime
class IncidentSeverity(Enum):
"""Enum for incident severity levels"""
LOW = "LOW"
MEDIUM = "MEDIUM"
HIGH = "HIGH"
CRITICAL = "CRITICAL"
class DemoMode(Enum):
"""Enum for demo modes"""
QUICK = "quick"
COMPREHENSIVE = "comprehensive"
INVESTOR = "investor"
@dataclass
class OSSAnalysis:
"""Structured OSS analysis results"""
status: str
recommendations: List[str]
estimated_time: str
engineers_needed: str
manual_effort: str
confidence_score: float = 0.95
def to_dict(self) -> Dict:
return asdict(self)
@dataclass
class EnterpriseResults:
"""Structured enterprise execution results"""
actions_completed: List[str]
metrics_improvement: Dict[str, str]
business_impact: Dict[str, Any]
approval_required: bool = True
execution_time: str = ""
def to_dict(self) -> Dict:
return asdict(self)
@dataclass
class IncidentScenario:
"""Pythonic incident scenario model"""
name: str
severity: IncidentSeverity
metrics: Dict[str, str]
impact: Dict[str, str]
oss_analysis: Optional[OSSAnalysis] = None
enterprise_results: Optional[EnterpriseResults] = None
def to_dict(self) -> Dict:
"""Convert to dictionary for JSON serialization"""
data = {
"name": self.name,
"severity": self.severity.value,
"metrics": self.metrics,
"impact": self.impact
}
if self.oss_analysis:
data["oss_analysis"] = self.oss_analysis.to_dict()
if self.enterprise_results:
data["enterprise_results"] = self.enterprise_results.to_dict()
return data
@dataclass
class DemoStep:
"""Demo step for presenter guidance"""
title: str
scenario: Optional[str]
action: str
message: str
icon: str = "🎯" |