Igor, Yep, I knew that you start to rewrite fuel-client, but it seemd for me that this ideas is not for https://etherpad.openstack.org/p/fuelclient-redesign document because it's implementation details. Should I create a new notepad for it?
On Wed, Jan 14, 2015 at 11:58 AM, Igor Kalnitsky <[email protected]> wrote: > Hi, Konstantin, > > Thank you for sharing ideas. Your "yet-one-more implementation of > fuel-client" one more time confirms that currently we have completely > unusable implementation. > > Just for your information: we have plans for python-fuelclient > refactoring [1]. The main point of this blueprint is to provide > fuelclient which will be useful as both: library and cli. Please, do > not hesitate share your ideas in blueprint or in the working ehterpad > [2]. > > - Igor > > [1]: https://review.openstack.org/#/c/135915/ > [2]: https://etherpad.openstack.org/p/fuelclient-redesign > > On Wed, Jan 14, 2015 at 12:38 PM, Konstantin Danilov > <[email protected]> wrote: > > Hi all, > > > > We are working on fuel certification script > > https://github.com/stgleb/fuel-web > > and have yet-one-more implementation of fuel-client, which cover very > small > > of Fuel API, yet we have some ideas, which you might be interesting in. > > > > 1) high-level primitives for REST operations. > > > > a) GET/PUT/POST/etc function, which returns closure, bonded to url > and > > method > > > > > > class Cluster(RestObj): > > """Class represents Cluster in Fuel""" > > > > add_node_call = PUT('api/nodes') > > start_deploy = PUT('api/clusters/{id}/changes') > > get_status = GET('api/clusters/{id}') > > delete = DELETE('api/clusters/{id}') > > > > GET(url_template) returns function/class method, which accepts > set > > of parameters, > > format part of them into url_template to obtain final url and > pass > > other parameters > > as data in http request. E.g. > > > > get_some_objs = GET('some/objects/{cluster_id}/really_get') > > > > > > get_some_objs(cluster_id=12, kind="db objects") will result in > > HTTP request GET '..../some/objects/12/really_get' data = > > {'kind':'db objects'} > > > > in case of class method it also extracts missing format > parameters > > from self.__dict__. > > E.g. > > > > node = Node.get_all()[0] > > nnode = node.get() <<< takes id from node.id > > > > > > b) Auto generate API for strict restfull cases, e.g. > > > > class Node(RestfulObj): > > """Represents node in Fuel""" > > > > __url__ = '/api/nodes/{id}' > > > > == > > > > class Node(RestObj): > > """Represents node in Fuel""" > > > > get_all = GET('/api/nodes') > > get = GET('/api/nodes/{id}') > > delete = DELETE('/api/nodes/{id}') > > create = POST('/api/nodes/{id}') > > .... > > > > 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 > > by different team/persons. > > > > > https://github.com/stgleb/fuel-web/blob/sertification-script/certification_script/certification_script/cert_script.py#L165 > > > > 3) I have a semi-implemented ideas for future-based API for background > tasks > > (e.g. cluster deployment) > > > > Code is available in repo and we would be glad to help you to merge it to > > new fuel-client > > > > -- > > Kostiantyn Danilov aka koder.ua > > Principal software engineer, Mirantis > > > > skype:koder.ua > > http://koder-ua.blogspot.com/ > > http://mirantis.com > > > > > __________________________________________________________________________ > > OpenStack Development Mailing List (not for usage questions) > > Unsubscribe: > [email protected]?subject:unsubscribe > > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev > > > > __________________________________________________________________________ > OpenStack Development Mailing List (not for usage questions) > Unsubscribe: [email protected]?subject:unsubscribe > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev > -- Kostiantyn Danilov aka koder.ua Principal software engineer, Mirantis skype:koder.ua http://koder-ua.blogspot.com/ http://mirantis.com
__________________________________________________________________________ OpenStack Development Mailing List (not for usage questions) Unsubscribe: [email protected]?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
