You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But for most list views, this class is not inherited. As one of many examples, see IPaddressList
which inherits from HostPermissionsListCreateAPIView which inherits from HostLogMixin and MregPermissionsListCreateAPIView... But none of these classes implement Location headers for post. So, using post on the ipaddress endpoint does not return a location header for the newly created entry...
Now, there may be a reason for this. We have models that look like this:
When creating a Host via post to the hosts endpoint, we get a Location header telling us were the new host is, which is done manually and repeatedly:
mreg/mreg/api/v1/views.py
Lines 349 to 408 in d45d257
Now, we have a MregListCreateAPIView implements Location for create...
But for most list views, this class is not inherited. As one of many examples, see IPaddressList
which inherits from HostPermissionsListCreateAPIView which inherits from HostLogMixin and MregPermissionsListCreateAPIView... But none of these classes implement Location headers for post. So, using post on the ipaddress endpoint does not return a location header for the newly created entry...
Now, there may be a reason for this. We have models that look like this:
So how would a location header look like? Sadly, the best we can do is
/api/v1/ipaddresses/?host=<host>&ipaddress=<ipaddress>
.This is 1) inconsistent, 2) very annoying when trying to write automation, 3) missing a unique ID field that would resolve all this.
Addendum: There is an autogenerated id / pk field. We just don't return it in post. :(
The text was updated successfully, but these errors were encountered: