forked from retoor/devplacepy
refactor: split schemas.py into package (ref.md 3.6)
This commit is contained in:
@@ -0,0 +1,100 @@
|
||||
# retoor <retoor@molodetz.nl>
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
from devplacepy.schemas.base import _Out
|
||||
|
||||
|
||||
class InstanceOut(_Out):
|
||||
uid: str = ""
|
||||
project_uid: str = ""
|
||||
name: str = ""
|
||||
slug: str = ""
|
||||
container_id: Optional[str] = None
|
||||
status: Optional[str] = None
|
||||
desired_state: Optional[str] = None
|
||||
restart_policy: Optional[str] = None
|
||||
restart_count: int = 0
|
||||
ingress_slug: Optional[str] = None
|
||||
ingress_port: int = 0
|
||||
boot_command: Optional[str] = None
|
||||
boot_language: Optional[str] = None
|
||||
boot_script: Optional[str] = None
|
||||
run_as_uid: Optional[str] = None
|
||||
start_on_boot: int = 0
|
||||
cpu_limit: Optional[str] = None
|
||||
mem_limit: Optional[str] = None
|
||||
created_at: Optional[str] = None
|
||||
started_at: Optional[str] = None
|
||||
stopped_at: Optional[str] = None
|
||||
|
||||
|
||||
class ScheduleOut(_Out):
|
||||
uid: str = ""
|
||||
instance_uid: str = ""
|
||||
action: Optional[str] = None
|
||||
enabled: int = 0
|
||||
next_run_at: Optional[str] = None
|
||||
last_run_at: Optional[str] = None
|
||||
run_count: int = 0
|
||||
|
||||
|
||||
class ContainersOut(_Out):
|
||||
project: Optional[dict] = None
|
||||
instances: list[InstanceOut] = []
|
||||
|
||||
|
||||
class AdminContainersOut(_Out):
|
||||
instances: list = []
|
||||
projects: list = []
|
||||
boot_languages: list = []
|
||||
restart_policies: list = []
|
||||
admin_section: Optional[str] = None
|
||||
user: Optional[Any] = None
|
||||
|
||||
|
||||
class AdminContainerEditOut(_Out):
|
||||
instance: Optional[Any] = None
|
||||
project: Optional[dict] = None
|
||||
run_as_user: Optional[dict] = None
|
||||
boot_languages: list = []
|
||||
restart_policies: list = []
|
||||
admin_section: Optional[str] = None
|
||||
user: Optional[Any] = None
|
||||
|
||||
|
||||
class AdminContainerInstanceOut(_Out):
|
||||
instance: Optional[Any] = None
|
||||
project: Optional[dict] = None
|
||||
project_slug: Optional[str] = None
|
||||
events: list = []
|
||||
schedules: list = []
|
||||
stats: Optional[Any] = None
|
||||
runtime: Optional[Any] = None
|
||||
admin_section: Optional[str] = None
|
||||
user: Optional[Any] = None
|
||||
|
||||
|
||||
class BotFrameOut(_Out):
|
||||
slot: int = 0
|
||||
username: str = ""
|
||||
persona: str = ""
|
||||
action: str = ""
|
||||
status: str = ""
|
||||
url: str = ""
|
||||
label: str = ""
|
||||
captured_at: int = 0
|
||||
age_seconds: int = 0
|
||||
has_image: bool = False
|
||||
active: bool = False
|
||||
frame_url: str = ""
|
||||
|
||||
|
||||
class AdminBotsOut(_Out):
|
||||
frames: list[BotFrameOut] = []
|
||||
enabled: bool = False
|
||||
service_status: str = ""
|
||||
admin_section: Optional[str] = None
|
||||
user: Optional[Any] = None
|
||||
Reference in New Issue
Block a user