<div dir="ltr">Thanks for Jay point this out! If we have agreement on this and document it, that will be great for guiding developer how to add new API.<div><br></div><div>I know we didn't want extension for API. But I think we still need modularity. I don't think we should put everything in a single file, that file will become huge in the future and hard to maintenance. We can make the 'extension' not configurable. Replace 'extension' with another name, deprecate the extension info api int he future.... But that is not mean we should put everything in a file.</div><div><br></div><div>For modularity, we need define what should be in a separated module(it is extension now.) There are three cases:</div><div><br></div><div>1. Add new resource</div><div> This is totally worth to put in a separated module.</div><div>2. Add new sub-resource</div><div> like server-tags, I prefer to put in a separated module, I don't think put another 100 lines code in the servers.py is good choice.</div><div>3. extend attributes and methods for a existed resource</div><div> like add new attributes for servers, we can choice one of existed module to put it in. Just like this patch <a href="https://review.openstack.org/#/c/155853/">https://review.openstack.org/#/c/155853/</a></div><div> But for servers-tags, it's sub-resource, we can put it in its-own module.</div><div><br></div><div>If we didn't want to support extension right now, we can begin from not show servers-tags in extension info API first. That means extension info is freeze now. We deprecated the extension info api in later version.</div><div><br></div><div>Thanks</div><div>Alex</div><div class="gmail_extra"><br><div class="gmail_quote">2015-03-08 8:31 GMT+08:00 Jay Pipes <span dir="ltr"><<a href="mailto:jaypipes@gmail.com" target="_blank">jaypipes@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi Stackers,<br>
<br>
Now that microversions have been introduced to the Nova API (meaning we can now have novaclient request, say, version 2.3 of the Nova API using the special X-OpenStack-Nova-API-Version HTTP header), is there any good reason to require API extensions at all for *new* functionality.<br>
<br>
Sergey Nikitin is currently in the process of code review for the final patch that adds server instance tagging to the Nova API:<br>
<br>
<a href="https://review.openstack.org/#/c/128940" target="_blank">https://review.openstack.org/#<u></u>/c/128940</a><br>
<br>
Unfortunately, for some reason I really don't understand, Sergey is being required to create an API extension called "os-server-tags" in order to add the server tag functionality to the API. The patch implements the 2.4 Nova API microversion, though, as you can see from this part of the patch:<br>
<br>
<a href="https://review.openstack.org/#/c/128940/43/nova/api/openstack/compute/plugins/v3/server_tags.py" target="_blank">https://review.openstack.org/#<u></u>/c/128940/43/nova/api/<u></u>openstack/compute/plugins/v3/<u></u>server_tags.py</a><br>
<br>
What is the point of creating a new "plugin"/API extension for this new functionality? Why can't we just modify the nova/api/openstack/compute/<u></u>server.py Controller.show() method and decorate it with a 2.4 microversion that adds a "tags" attribute to the returned server dictionary?<br>
<br>
<a href="https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/servers.py#L369" target="_blank">https://github.com/openstack/<u></u>nova/blob/master/nova/api/<u></u>openstack/compute/servers.py#<u></u>L369</a><br>
<br>
Because we're using an API extension for this new server tags functionality, we are instead having the extension "extend" the server dictionary with an "os-server-tags:tags" key containing the list of string tags.<br>
<br>
This is ugly and pointless. We don't need to use API extensions any more for this stuff.<br>
<br>
A client knows that server tags are supported by the 2.4 API microversion. If the client requests the 2.4+ API, then we should just include the "tags" attribute in the server dictionary.<br>
<br>
Similarly, new microversion API functionality should live in a module, as a top-level (or subcollection) Controller in /nova/api/openstack/compute/, and should not be in the /nova/api/openstack/compute/<u></u>plugins/ directory. Why? Because it's not a plugin.<br>
<br>
Why are we continuing to use these awkward, messy, and cumbersome API extensions?<br>
<br>
Please, I am begging the Nova core team. Let us stop this madness. No more API extensions.<br>
<br>
Best,<br>
-jay<br>
<br>
______________________________<u></u>______________________________<u></u>______________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.<u></u>openstack.org?subject:<u></u>unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/<u></u>cgi-bin/mailman/listinfo/<u></u>openstack-dev</a><br>
</blockquote></div><br></div></div>