(20250212) Started a new class (util) that handles MikroTik config. in async mode, and started implementing that in the PPPoE-1000 controller. I can now configure and roll back the first three steps. Long way to go :')
This commit is contained in:
@@ -77,6 +77,12 @@ REGEX_SESSION_TOKEN = r"^[a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[89ab][a-f0-9]
|
||||
|
||||
class MikroTikConfigAttemptResponse(BaseModel):
|
||||
|
||||
actionChain: str | int = Field(
|
||||
description = "To be able to link all the actions of one process",
|
||||
frozen = False,
|
||||
default = None
|
||||
)
|
||||
|
||||
success: bool = Field(
|
||||
description = "To indicate whether or not, the action was a success",
|
||||
frozen = False,
|
||||
@@ -107,7 +113,14 @@ class MikroTikConfigAttemptResponse(BaseModel):
|
||||
# ┃ ┓┏┏╋┏┓┏┳┓ ┣ ┓┏┏┓┏┏
|
||||
# ┗┛┗┻┛┗┗┛┛┗┗ ┻ ┗┻┛┗┗┛
|
||||
|
||||
pass
|
||||
def __add__(self, other):
|
||||
|
||||
return MikroTikConfigAttemptResponse(
|
||||
actionChain = other.actionChain or self.actionChain,
|
||||
success = self.success and other.success,
|
||||
message = self.message + " -> " + other.message,
|
||||
exception = other.exception or self.exception
|
||||
)
|
||||
|
||||
# ┓┏ ┓• ┓ •
|
||||
# ┃┃┏┓┃┓┏┫┏┓╋┓┏┓┏┓
|
||||
@@ -121,6 +134,12 @@ class MikroTikConfigAttemptResponse(BaseModel):
|
||||
|
||||
class MikroTikRollBackAttemptResponse(BaseModel):
|
||||
|
||||
actionChain: str | int = Field(
|
||||
description = "To be able to link all the actions of one process",
|
||||
frozen = False,
|
||||
default = None
|
||||
)
|
||||
|
||||
success: bool = Field(
|
||||
description = "To indicate whether or not, the action was a success",
|
||||
frozen = False,
|
||||
|
||||
Reference in New Issue
Block a user