<div dir="ltr"><div>Hi wangzhh,</div><div><br></div>I think this look reasonable, but I would prefer to have a proper spec for this feature. I generally like to have extendable API in Murano.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 24, 2016 at 8:49 PM, 王正浩 <span dir="ltr"><<a href="mailto:wangzhh@awcloud.com" target="_blank">wangzhh@awcloud.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>I'm sorry that I forgot to tell you murano-paste.ini should be modified to</div><div>...</div><div><div>[app:apiv1app]</div><div>paste.app_factory = murano.api.v1.router:APIRouterV1.factory</div></div><div><u></u><div>...</div><div>And the file [4] is murano/api/v1/extensions_base.py </div><div> </div><div style="font:Verdana normal 14px;color:#000"><div style="FONT-SIZE:12px;FONT-FAMILY:Arial Narrow;padding:2px 0 2px 0">------------------ Original ------------------</div><div style="FONT-SIZE:12px;background:#efefef;padding:8px"><div><b>From: </b> "王正浩"<<a href="mailto:wangzhh@awcloud.com" target="_blank">wangzhh@awcloud.com</a>>;</div><div><b>Date: </b> Fri, Mar 25, 2016 11:10 AM</div><div><b>To: </b> "List"<<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a>>; </div><div><b>Cc: </b> "smelikyan"<<a href="mailto:smelikyan@mirantis.com" target="_blank">smelikyan@mirantis.com</a>>; </div><div><b>Subject: </b> Extending API via Plugins</div></div><div><div class="h5"><div> </div><span style="font-family:'lucida Grande',Verdana;line-height:normal">Hi Serg Melikyan,</span><div>I don't know much about <span style="font-family:'lucida Grande',Verdana;line-height:normal">CF Broker API. I'm sorry that I</span></div><div><span style="font-family:'lucida Grande',Verdana;line-height:normal">have no real use-case. But here is a test one which I plan to </span></div><div><span style="font-family:'Microsoft YaHei';font-size:13px;line-height:normal;white-space:nowrap">complete.</span></div><div><span style="font-family:'Microsoft YaHei';font-size:13px;line-height:normal;white-space:nowrap"><br></span></div><div><span style="font-family:'Microsoft YaHei';font-size:13px;line-height:normal;white-space:nowrap">I modified </span><font face="Microsoft YaHei"><span style="font-size:13px;line-height:normal;white-space:nowrap">murano/common/wsgi.py[0], murano/api/v1/router.py[1],</span></font></div><div><font face="Microsoft YaHei"><span style="font-size:13px;line-height:normal;white-space:nowrap">added </span></font></div><div><font face="Microsoft YaHei"><span style="font-size:13px;line-height:normal;white-space:nowrap">...</span></font></div><div><font face="Microsoft YaHei"><span style="font-size:13px;line-height:normal;white-space:nowrap"><div>murano.api.v1.extensions =</div><div>    test = murano.api.v1.extensions.test:testAPI</div><div>...</div><div>to the setup.cfg[2]. Imply the class testAPI[3]. </div></span></font></div><div><font face="Microsoft YaHei"><span style="font-size:13px;line-height:normal;white-space:nowrap">The class testAPI </span></font><span style="font-family:'Microsoft YaHei';font-size:13px;line-height:normal;white-space:nowrap"> </span><span style="font-family:'Microsoft YaHei';font-size:13px;line-height:normal;white-space:nowrap">inherit</span><span style="font-size:13px;line-height:normal;white-space:nowrap;font-family:'Microsoft YaHei'"> a base class APIExtensionBase[4].</span></div><div><font face="Microsoft YaHei"><span style="font-size:13px;line-height:normal;white-space:nowrap">I'll show you my code.</span></font></div><div><font face="Microsoft YaHei"><span style="font-size:13px;line-height:normal;white-space:nowrap">P.S. I copied it from nova. So there are some extra code, hope you don't mind.</span></font></div><div><font face="Microsoft YaHei"><span style="font-size:13px;line-height:normal;white-space:nowrap">[0] <a href="http://paste.openstack.org/show/491841/" target="_blank">http://paste.openstack.org/show/491841/</a></span></font></div><div><font face="Microsoft YaHei"><span style="font-size:13px;line-height:normal;white-space:nowrap">[1] <a href="http://paste.openstack.org/show/491840/" target="_blank">http://paste.openstack.org/show/491840/</a></span></font></div><div><font face="Microsoft YaHei"><span style="font-size:13px;line-height:normal;white-space:nowrap">[2] <a href="http://paste.openstack.org/show/491842/" target="_blank">http://paste.openstack.org/show/491842/</a></span></font></div><div><font face="Microsoft YaHei"><span style="font-size:13px;line-height:normal;white-space:nowrap">[3] <a href="http://paste.openstack.org/show/491845/" target="_blank">http://paste.openstack.org/show/491845/</a></span></font></div><div><font face="Microsoft YaHei"><span style="font-size:13px;line-height:normal;white-space:nowrap">[4] <a href="http://paste.openstack.org/show/491843/" target="_blank">http://paste.openstack.org/show/491843/</a></span></font></div></div></div></div><u></u></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Serg Melikyan, Development Manager at Mirantis, Inc.<br></div><div><a href="http://mirantis.com/" target="_blank">http://mirantis.com</a> | <a href="mailto:smelikyan@mirantis.com" target="_blank">smelikyan@mirantis.com</a> | <span style="font-size:12.8px">+1 (650) 440-8979</span></div></div></div></div></div></div></div>
</div>