[rudder-users] Command line interface for the API

Benoit Peccatte benoit.peccatte at normation.com
Tue Jan 6 12:04:40 CET 2015


Hello everyone,


I made a first version of a command line interface for Rudder API.
I am calling for comments on it before it becomes a stable command
included with Rudder.

You can find it here: https://github.com/peckpeck/rudder-api-client

Here is how it works: I first made a python library that is a simple
mapping of the API (auto generated from the documentation).
This means that you can use it in your python code.
I then created a command line in python that uses it with almost the
same named ans parameters.

For now, you will have to clone the repo to use it for now. The full
steps are in the README.md. There are little dependencies (python 2 or
3, docopt and requests)



The command line is build on git model, with commands and subcommands.
Here is an example usage :
  rudder-cli node list_pending
  rudder-cli node accept fb1d6f5a-0929-4f18-a574-7b37febc2896

The command accept singular and plural form for the subcommand name.

If you want to use json instead of arguments to pass parameters, you can
add a -j option '-j -' will read from stdin.
JSON overrides command line parameters (wich in turn override
configuration file parameters). This allow you to use your preferred
form of call.


Finally for missing commands or for debugging the API, you can use this
subcommand:
  rudder-cli api GET /api/nodes



I hope you will like it, but whether you like it or not, please tell me
what you you think so that we can get the best of this cli.


Benoît
-- 
------------------------------------------------------------------------
*Benoît PECCATTE*
/Responsable cloud development/
Normation <http://www.normation.com>
------------------------------------------------------------------------
*87, Rue de Turbigo, 75003 Paris, France*
Phone: 	+33 (0)1 85 08 48 96
------------------------------------------------------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.rudder-project.org/pipermail/rudder-users/attachments/20150106/ec2be0f5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo-square.png
Type: image/png
Size: 3503 bytes
Desc: not available
URL: <http://www.rudder-project.org/pipermail/rudder-users/attachments/20150106/ec2be0f5/attachment.png>


More information about the rudder-users mailing list