(20241225) Work started on upgrades and server-registration module.
This commit is contained in:
+45
-4
@@ -74,6 +74,50 @@ import datetime
|
||||
# *****************************************************************************************************************
|
||||
|
||||
|
||||
class LogChainRequestData(BaseModel):
|
||||
|
||||
limit: int = Field(
|
||||
description = "the max. logs to pick",
|
||||
default = 25,
|
||||
frozen = True
|
||||
)
|
||||
|
||||
skip: int = Field(
|
||||
description = "how many initial matches to skip before picking logs; needed for pagination",
|
||||
default = 0,
|
||||
frozen = True
|
||||
)
|
||||
|
||||
sort: dict = Field(
|
||||
description = "the sorting conditions for the picked logs",
|
||||
default = {"ts": 1, "_id": -1},
|
||||
frozen = True
|
||||
)
|
||||
|
||||
projection: dict = Field(
|
||||
description = "to decide what fields are retrieved",
|
||||
default = {"_id": False},
|
||||
frozen = True
|
||||
)
|
||||
|
||||
# ┏┓ ┏•
|
||||
# ┃ ┏┓┏┓╋┓┏┓
|
||||
# ┗┛┗┛┛┗┛┗┗┫
|
||||
# ┛
|
||||
|
||||
class Config:
|
||||
extra = "forbid"
|
||||
|
||||
# ┓┏ ┓• ┓ •
|
||||
# ┃┃┏┓┃┓┏┫┏┓╋┓┏┓┏┓
|
||||
# ┗┛┗┻┗┗┗┻┗┻┗┗┗┛┛┗
|
||||
|
||||
pass
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
class LogsByFilterRequestData(BaseModel):
|
||||
|
||||
filter: dict = Field(
|
||||
@@ -117,10 +161,7 @@ class LogsByFilterRequestData(BaseModel):
|
||||
# ┃┃┏┓┃┓┏┫┏┓╋┓┏┓┏┓
|
||||
# ┗┛┗┻┗┗┗┻┗┻┗┗┗┛┛┗
|
||||
|
||||
@field_validator("unsetJson", "setJson", mode = "before")
|
||||
def ensure_non_null(cls, value):
|
||||
if value is None: value = {}
|
||||
return value
|
||||
pass
|
||||
|
||||
|
||||
# *****************************************************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user