2024-09-30 18:40:26 +00:00
|
|
|
from enum import Enum
|
2024-10-04 13:03:44 +00:00
|
|
|
|
2024-09-30 18:40:26 +00:00
|
|
|
import marshmallow as ma
|
|
|
|
|
2024-10-04 13:03:44 +00:00
|
|
|
|
2024-09-30 18:40:26 +00:00
|
|
|
class HealthStatus(Enum):
|
|
|
|
OK = 0
|
|
|
|
WARNING = 1
|
|
|
|
ERROR = 2
|
|
|
|
CRITICAL = 3
|
|
|
|
|
|
|
|
class HealthGet(ma.Schema):
|
|
|
|
alive_since = ma.fields.String()
|
|
|
|
alive_for = ma.fields.String()
|
|
|
|
status = ma.fields.Enum(HealthStatus, type=ma.fields.String)
|
|
|
|
|
|
|
|
class ApiVersionGet(ma.Schema):
|
|
|
|
version = ma.fields.String(example="0.1")
|
|
|
|
|
|
|
|
class OpenAPIGet(ma.Schema):
|
|
|
|
pass
|