<div dir="ltr"><div><div><div><div>Hi all,<br><br></div>We are working on fuel certification script <a href="https://github.com/stgleb/fuel-web">https://github.com/stgleb/fuel-web</a><br></div>and have yet-one-more implementation of fuel-client, which cover very small<br></div>of Fuel API, yet we have some ideas, which you might be interesting in.<br><br>1) high-level primitives for REST operations.<br> <br> a) GET/PUT/POST/etc function, which returns closure, bonded to url and method<br><br><br> class Cluster(RestObj):<br> """Class represents Cluster in Fuel"""<br><br> add_node_call = PUT('api/nodes')<br> start_deploy = PUT('api/clusters/{id}/changes')<br> get_status = GET('api/clusters/{id}')<br> delete = DELETE('api/clusters/{id}')<br><br> GET(url_template) returns function/class method, which accepts set of parameters, <br> format part of them into url_template to obtain final url and pass other parameters<br> as data in http request. E.g. <br><br> get_some_objs = GET('some/objects/{cluster_id}/really_get')<br><br><br> get_some_objs(cluster_id=12, kind="db objects") will result in<br> HTTP request GET '..../some/objects/12/really_get' data = {'kind':'db objects'}<br><br> in case of class method it also extracts missing format parameters from self.__dict__.<br> E.g.<br><br> node = Node.get_all()[0]<br> nnode = node.get() <<< takes id from <a href="http://node.id">node.id</a><br><br><br> b) Auto generate API for strict restfull cases, e.g.<br><br> class Node(RestfulObj):<br> """Represents node in Fuel"""<br><br> __url__ = '/api/nodes/{id}'<br><br> ==<br><br> class Node(RestObj):<br> """Represents node in Fuel"""<br><br> get_all = GET('/api/nodes')<br> get = GET('/api/nodes/{id}')<br> delete = DELETE('/api/nodes/{id}')<br> create = POST('/api/nodes/{id}')<br> ....<br><br>2) API for create cluster from yaml description. Allow to deploy whole openstack cluster from single yaml file. We being asking a lot whenever this call would be available in fuel client<br></div>by different team/persons.<br><div><br><a href="https://github.com/stgleb/fuel-web/blob/sertification-script/certification_script/certification_script/cert_script.py#L165">https://github.com/stgleb/fuel-web/blob/sertification-script/certification_script/certification_script/cert_script.py#L165</a><br><br></div><div>3) I have a semi-implemented ideas for future-based API for background tasks (e.g. cluster deployment)<br><br clear="all"></div><div>Code is available in repo and we would be glad to help you to merge it to new fuel-client<br><div><div><div><div><br>-- <br><div class="gmail_signature">Kostiantyn Danilov aka <a href="http://koder.ua" target="_blank">koder.ua</a><br>Principal software engineer, Mirantis<br><br>skype:<a href="http://koder.ua" target="_blank">koder.ua</a><br><a href="http://koder-ua.blogspot.com/" target="_blank">http://koder-ua.blogspot.com/</a><br><a href="http://mirantis.com" target="_blank">http://mirantis.com</a></div>
</div></div></div></div></div></div>