[openstack-dev] Queries about API Extension

Chris Dent cdent+os at anticdent.org
Wed Mar 28 16:58:01 UTC 2018


On Wed, 28 Mar 2018, 陈汗 wrote:

> Hi all,
>    Here are my questions:
>        For the projects whose api parts were implemented with Pecan, is there any way(hope it is graceful) to extend these api?
>       I mean, for example, somehow I have to add several extra attributes in Class Chassis in ironic project. Do you guys have any better way instead of directly editing the file of chassis.py?

As a general rule you should avoid doing this as it breaks
interoperability.

If you really need a special extension to an existing API, make a
custom API in a custom service that does what you need it to do. By
being separate it is clearly identified as not being a part of the
standard API and client code written to that standard API will
continue to work.

Of course, I'm sure plenty of people in their private clouds make
adjustments to existing services and API all the time. If you must
do, that doing it directly in the code may be one of the best ways
to go as it makes it obvious that things have changed.

Also, it might be that there are ways to such a thing in Ironic, in
which case I hope someone will followup with that. I'm speaking from
the position of APIs in OpenStack in general.

-- 
Chris Dent                       ٩◔̯◔۶           https://anticdent.org/
freenode: cdent                                         tw: @anticdent


More information about the OpenStack-dev mailing list