Create incident_models.py
Browse files
app/models/incident_models.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Literal
|
| 2 |
+
from pydantic import BaseModel, Field
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
class IncidentReport(BaseModel):
|
| 6 |
+
service: str = Field(..., description="Service name")
|
| 7 |
+
signal_type: Literal["latency", "error_rate", "cpu", "memory"] = Field(..., description="Type of signal")
|
| 8 |
+
value: float = Field(..., description="Measured value")
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class IncidentResponse(BaseModel):
|
| 12 |
+
service: str
|
| 13 |
+
reliability: float
|