-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Include request ID in REST API responses #11254
Comments
This could be feasible currently, however we need to consider future plans to generate changelog records outside of the request/response cycle (see #11202), which would inhibit us from returning the ObjectChange ID directly. (In this scenario, the ObjectChange would not be created until just after the response has been sent.) Additionally, bulk changes would result in the creation of multiple ObjectChanges, so we'd need a way to convey those. Alternatively, we could attach to the API response the UUID of the request, which could then be used to query for all ObjectChange records relevant to the specific request. |
I'm going to move this to "needs milestone" with the assumption that this is the preferred approach. Many changes can result in the creation of multiple new change records, and conveying them reliably and succinctly would be difficult. Returning the unique request ID is a lot more portable. |
Note: This would be similar to a correlation ID in logging (which might also be useful) There are two Django packages that do this that could be used for inspiration https://github.com/snok/django-guid and https://github.com/Polyconseil/django-cid |
Just to add - I think it makes sense for the request UUID to be returned as part of the response headers, rather than the payload itself. In other APIs where similar type of data is returned, headers seem to be the common pattern. |
… unique ID of each request for change logging
… unique ID of each request for change logging
… unique ID of each request for change logging
NetBox version
3.2.5
Feature type
Change to existing functionality
Proposed functionality
When changing an item, using the REST API, could it be possible to get the changelog id returned immediately?
f.x as an X-ChangeId header or similar?
Use case
When multiple systems update various properties of the same entities in Netbox, we can not always rely on simply getting the latest change via the extras/object-changes endpoint.
Also getting the change id immediately would save an otherwise unnecessary API request.
Database changes
No response
External dependencies
No response
The text was updated successfully, but these errors were encountered: