Git Product home page Git Product logo

kahuna's Introduction

Abiquo API Command Line Tool

This project is a simple command line tool for the Abiquo Cloud Platform API, using Jython as a wrapper to the Official Java client. To understand the code and adapt it to your needs, you may want to take a look at the official Java client project page:

Requirements

To run Kahuna you will need to install Maven >= 2.2.1, JRE >= 1.6 and Jython >= 2.5.2.

Configuration

Since this project is currently in development process and we don't have any egg package ready, the $JYHTONPATH environment variable needs to be set manually:

export JYTHONPATH=$(YOUR_PROJECT_HOME_DIRECTORY)

You must also copy the config/kahuna.conf file to $HOME/.kahuna/kahuna.conf and edit it to configure the connection to your Abiquo Platform. It is also a good choice to add the script to your PATH. You could simply create a symlink to the kahuna script in /usr/local/bin:

cd <kahuna source directory>
cp config/kahuna.conf ~/.kahuna/kahuna.conf  # Then edit the file accordingly
chmod u+x kahuna.sh
ln -s $(pwd)/kahuna.sh /usr/local/bin/kahuna

Running

You can run now the command line as follows. If you run it without parameters, it will print the help with all the available options:

$ kahuna

Usage: kahuna <plugin> <command> [<options>]
The following plugins are available:

Interactive shell plugin. 
    shell open     Opens an interactive shell.

Template plugin. 
    template find	 Find a template given its name. 
    template list	 List all available templates. 

Virtual machine plugin. 
    vm create       Creates a virtual machine based on a given template. 
    vm delete       Delete a virtual machine given its name. 
    vm deploy       Deploy an existing virtual machine given its name. 
    vm find         Find a virtual machine given its name. 
    vm list         List all virtual machines. 
    vm undeploy     Undeploy an existing virtual machine given its name. 

Use it interactively

You can also perform actions against the Api in an interactive way. You just need to use the 'shell' plugin as follows:

$ kahuna shell open
Jython 2.5.2 (Release_2_5_2:7206, Mar 2 2011, 23:12:06) 
[Java HotSpot(TM) Server VM (Sun Microsystems Inc.)] on java1.6.0_18
Type "help", "copyright", "credits" or "license" for more information.
>>> from kahuna.session import ContextLoader
>>> ctx = ContextLoader().load_context()
Using endpoint: http://10.60.1.222/api
>>> cloud = ctx.getCloudService()         
>>> cloud.listVirtualDatacenters()
[VirtualDatacenter [id=11, type=XENSERVER, name=Kaahumanu]]
>>> vdc = cloud.listVirtualDatacenters()[0]
>>> vdc.setName("Updated VDC")
>>> vdc.update()
>>> cloud.listVirtualDatacenters()         
[VirtualDatacenter [id=11, type=XENSERVER, name=Updated VDC]]
>>> ctx.close()
>>> exit()

Adding more plugins

Plugins are easy to create. Take a look at the Project Wiki to see how to create and add your own plugins.

Note on patches/pull requests

  • Fork the project.
  • Create a topic branch for your feature or bug fix.
  • Develop in the just created feature/bug branch.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Commit.
  • Send me a pull request.

Issue Tracking

If you find any issue, please submit it to the Bug tracking system and we will do our best to fix it.

License

This software is licensed under the MIT license.

Copyright (c) 2011 Ignasi Barrera

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

kahuna's People

Contributors

fmontserrat avatar nacx avatar rubiojr avatar sergicastro avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.