Initialize EAM /appinstances callback#373
Initialize EAM /appinstances callback#373travishepworth wants to merge 11 commits intocamaraproject:mainfrom
Conversation
| items: | ||
| $ref: '#/components/schemas/AppInstanceInfo' | ||
| responses: | ||
| '202': |
There was a problem hiding this comment.
Hi @travishepworth ,
Some comments from my side. According to Commonalities (https://github.com/camaraproject/Commonalities/blob/main/documentation/CAMARA-API-Event-Subscription-and-Notification-Guide.md), the expected response code for notifications is 204 instead of 202.
In addition to that, some errors are also mandatory to be included on any notifications. The Following Error codes must be present:
- for POST: 400, 401, 403, 410, 429
I recommend that we use the template available at Commonalities repo: https://github.com/camaraproject/Commonalities/blob/main/artifacts/camara-cloudevents/event-subscription-template.yaml
There was a problem hiding this comment.
Cool, I can start looking at implementing based off the template and the missing codes.
|
hi @travishepworth - note that #356 PR might have some impact on this one. I would wait for /deployments to be added before adding any callback notifications. That way, we could also use this PR to define callback notifications for a deployment. Once the deployment is added, we could check details on which callback notifications could be added there. I guess that we should also add notifications per application instance managed by such deployment. |
|
Gotcha, I'll keep this on hold until I see #356 get merged. |
|
@gunjald / @travishepworth - #356 has been already merged. Now, I think that it is time to add here on this PR the same for the deployment method. In the end, the deployment method should also include the same callback interface that informs the client about application instance changes/updates for any of the instances included in a deployment. What do you think? |
|
Sounds great @jgarciatovar , I can start drafting the next iteration and update the PR accordingly. |
|
The PR has now been updated to include deployments, and aligned with the commonalities. I added in all the required objects to setup any of the streaming subscriptions as seen at: https://github.com/camaraproject/Commonalities/blob/main/artifacts/camara-cloudevents/event-subscription-template.yaml However, this is likely undesirable, should another endpoint be implemented specifically for subscriptions? Also note that there are still default descriptions in some of the objects. I will wait until it has been decided whether this stays as a callback to the POST endpoints, or moved to another endpoint (as well as until it has been determined which subscription methods should be made available) |
|
Hi @travishepworth , sorry for the delay in the feedback.
Each of them has different implications, in my view, for this PR we can let the callback stay in the POST and make the minimum modifications to be aligned with commonalities (probably we don't need the rest of the messaging protocols right now). I think it's worth to have the discussion of the the new subscription endpoint, but perhaps it's better to move it to a different PR.
@camaraproject/edge-cloud_codeowners WDYT?? |
|
M1 commonalities issue Issue. Could this help us?? |
|
@camaraproject/edge-cloud_codeowners please, could you review the last changes?? |
JoseMConde
left a comment
There was a problem hiding this comment.
A couple of doubts @travishepworth
| type: string | ||
| description: Application deployment identifier (for deployment-based events) | ||
| status: | ||
| type: string |
There was a problem hiding this comment.
I think "status" parameter should have well-defined instance state enum values to let the API client understand the app instance running state. It could be e.g., pending, creating, running, failed, terminating etc with each value well defined and gives clear indication on instance health.
Also, how the deployment status change and instance status change events are to be differentiated as there is a single "status" field used for deployment and instance state change. Or I am missing something?
There was a problem hiding this comment.
The deployment status change should be a different object, agreed. I believe a list would be a better return object.
There was a problem hiding this comment.
Updated to an enum for the status, and for the deployments it is now set to an array instead of a single object
|
@JoseMConde @Kevsy @gunjald Please see PR #407. It is a continuation of this PR and explains why I opened it instead of picking this one up. |
gunjald
left a comment
There was a problem hiding this comment.
Changes seems fine to me.

What type of PR is this?
Add one of the following kinds:
What this PR does / why we need it:
This PR adds a callback definition for
POST/appinstancesto return that status of the application after the instantiation is accepted. This allows clients to receive an asynchronous status update for their application.Which issue(s) this PR fixes:
Fixes #370
Special notes for reviewers:
This PR only adds the callback definition. Implementation is backward-compatible.
Changelog input
Additional documentation