I'm in the midst of writing the microversion handling code for the
placement API and I've stumbled across a situation that I'm not sure
how I should resolve. This is not necessarily something that someone
should do with microversion, but since it is possible, I'd like to
make the code behave in the most reasonable way.

The code I'm writing borrows from the nova api_version decorator.
That takes a min_version string and an optional max_version. This
identifies the microversion window in which the decorated function
should be available. When there are multiple decorated functions this
works fine to select one of them assuming the requested function is
inside the lowest minimum and highest maximum version that is set
for those functions.

What I can't decide is what response code should be sent if the
requested microversion is outside that window. If the requested
microversion is outside the available microversions for the entire
service, it is clear: that's a '406 Not Acceptable'.

If the microversion is acceptable but there's no available function,
things become less clear: If the requested version is less than the
absolute minimum for the function, a 404 mostly makes sense because in
the time which the request microversion sort of represents there was no
mapping between any URI and any function.

If the requested microversion is greater than the maximum, a 404 still
makes some sense (no mapping _now_), but a 406 could as well because it
provides a signal that if you used a different microversion the
situation could be different and the time represented by the
requested microversion has conceptual awareness of its past.

What do people think?

I think I recall there was some discussion of this sort of thing
with regard to some of the proxy APIs at the nova midcycle but I
can't remember the details of the outcome.

(Of course one way to avoid this conundrum is to not allow it either
by crook or convention, but that seems to limit the power of
microversions to turn things off. A power that is important to


Chris Dent               ┬─┬ノ( º _ ºノ)        https://anticdent.org/
freenode: cdent                                         tw: @anticdent
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe

Reply via email to