Closed andrei-korshikov closed 5 months ago
Actually there is another endpoint that isn't well documented for project specific notifications: https://gns3-server.readthedocs.io/en/stable/api/v2/controller/project/projectsprojectidnotificationsws.html (we have one WebSocket connection per project).
You will receive notifications like "project.updated" or "project.closed" but no "project.opened". I can add "project.opened" but it wouldn't make sense to have it on the project notification endpoint since that channel is only listened to once the project has already been opened.
Maybe a "project.created" and "project.deleted" for /v2/notifications/ws
would be good?
I totally understand that "project.opened" is not suitable for /v2/projects/{project_id}/notifications/ws
, and agree that /v2/notifications/ws
would be the right place.
Do you plan to distinguish between "project.created" and "project.opened"? The question is: is "created" project also "opened" one? I think yes (every "created" is "opened", but not every "opened" is "created"), but I'm not sure.
Do you plan to distinguish between "project.created" and "project.opened"? The question is: is "created" project also "opened" one? I think yes (every "created" is "opened", but not every "opened" is "created"), but I'm not sure.
I am thinking just having "project.created" when a new project is created.
How to determine the moment when existed (previously closed) project becomes opened?
I think, I should provide some clarification about my use case. I'm not opening/creating projects in my app. Instead, my app is waiting until a project is opened/created in GNS3 GUI (more precisely, it's looking for another project with status == 'opened'), and after that my script does some small automation.
I think, I should provide some clarification about my use case. I'm not opening/creating projects in my app. Instead, my app is waiting until a project is opened/created in GNS3 GUI (more precisely, it's looking for another project with status == 'opened'), and after that my script does some small automation.
Ok, so I think we can have both "project.created" and "project.opened" then. Also, for consistency, I am considering moving "project.updated" and "project.closed" from /v2/projects/{project_id}/notifications/ws
to /v2/notifications/ws
. It makes more sense this way.
Starting with version 2.2.45, /v2/notifications/ws
will have the following notifications: project.created
, project.opened
, project.updated
, project.closed
as well as project.deleted
Thanks a lot!
Using version 2.2.44. Looking at
/v2/notifications/ws
and/v2/compute/notifications/ws
. When new project becomes alive, there is no any special notification, just usual stream of 'ping' (from compute) and 'compute.updated' (from controller). So, to catch the moment when new project is opened (or created), I have to constantly poll/v2/projects
and watch if there is something new. Not a problem, but it would be nice to be notified. What about/v2/projects/ws
?;)