-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API api to add Topology patches in worker manager #436
Conversation
36b2357
to
947bef2
Compare
@@ -18,6 +20,7 @@ class BaseObject: | |||
metadata: ObjectMetadata | |||
apiVersion: str | |||
kind: str | |||
spec: dict[str, t.Any] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added spec
here to be able to load the spec from the patches.
2a302eb
to
5022cb6
Compare
5022cb6
to
0240ded
Compare
Im using |
I think the PK should include the kind, wdyt. Since the name is not especially unique across kind |
0240ded
to
aae70c8
Compare
I did this change |
sa.JSON, server_default="{}", nullable=False | ||
) | ||
|
||
def __init__(self, topology: BaseObject) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, I would recommend to use a classmethod instead (from_topology
)
bp = Blueprint("topologies", __name__, url_prefix="/api/topologies") | ||
|
||
|
||
@bp.route("", methods=("PUT",)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
route -> patch
? /api/topologies
could be used one day to actually create components.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PUT /api/topologies/patch
from saturn_engine.utils.sqlalchemy import upsert | ||
|
||
|
||
def add(*, session: AnySession, topology: BaseObject) -> TopologyPatch: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add
-> patch
? topology
-> patch
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the renaming make sens now?
991482b
to
02bc0eb
Compare
02bc0eb
to
2281f75
Compare
The goal is to be able to dynamically edit topologies