View on GitHub

rOCCI-cli

A ready-to-use shell client for OCCI enabled services

download .ZIPdownload .TGZ

rOCCI-cli - A Ruby OCCI Framework

Build Status Dependency Status Gem Version Code Climate

Requirements

Ruby

Examples

For distros based on Debian:

apt-get install ruby rubygems ruby-dev
ruby -v

Unless you have Ruby >= 1.9.3, please, go to rOCCI-cli#RVM and install RVM with a newer Ruby version.

For distros based on RHEL:

yum install ruby-devel openssl-devel gcc gcc-c++ ruby rubygems
ruby -v

Unless you have Ruby >= 1.9.3, please, go to rOCCI-cli#RVM and install RVM with a newer Ruby version.

To use rOCCI-cli with Java, you need JRE 6 or 7. To build rOCCI-cli for Java, you need JDK 6 or 7.

Installation

From RubyGems.org

Mac OS X has some special requirements for the installation. Detailed information can be found in doc/macosx.md.

To install the most recent stable version

gem install occi-cli

To install the most recent beta version

gem install occi-cli --pre

From source (dev)

Installation from source should never be your first choice! Especially, if you are not familiar with RVM, Bundler, Rake and other dev tools for Ruby!

However, if you wish to contribute to our project, this is the right way to start.

To build and install the bleeding edge version from master

git clone git://github.com/EGI-FCTF/rOCCI-cli.git
cd rOCCI-cli
gem install bundler
bundle install
bundle exec rake test
rake install

From source, for Java

Notice: In order to build rOCCI-cli for Java, you need working jRuby installation. We recommend using rOCCI-cli#RVM.

To build a Java jar file from master use

git clone git://github.com/EGI-FCTF/rOCCI-cli.git
cd rOCCI-cli
gem install bundler
bundle install
warble

For Linux / Mac OS X you can create a OCCI Java executable from the jar file using

sudo echo '#!/usr/bin/java -jar' | cat - occi-cli.jar > occi ; sudo chmod +x occi

RVM

Notice: Follow the RVM installation guide linked below, we recommend using the default 'Single-User installation'.

Warning: NEVER install RVM as root! If you choose the 'Multi-User installation', use a different user account with sudo access instead!

rvm requirements
rvm install 1.9.3
rvm use 1.9.3 --default
ruby -v

Usage

Client

The OCCI gem includes a client you can use directly from shell with the following auth methods: x509 (with --password, --user-cred and --ca-path), basic (with --username and --password), digest (with --username and --password), none. If you won't set a password using --password, the client will ask for it later on.

To find out more about available options and defaults use

occi --help

To list available resources use

occi --endpoint https://<ENDPOINT>:<PORT>/ --action list --resource compute --auth x509
occi --endpoint https://<ENDPOINT>:<PORT>/ --action list --resource storage --auth x509
occi --endpoint https://<ENDPOINT>:<PORT>/ --action list --resource network --auth x509

To describe available resources use

occi --endpoint https://<ENDPOINT>:<PORT>/ --action describe --resource compute --auth x509
occi --endpoint https://<ENDPOINT>:<PORT>/ --action describe --resource storage --auth x509
occi --endpoint https://<ENDPOINT>:<PORT>/ --action describe --resource network --auth x509

To describe specific resources use

occi --endpoint https://<ENDPOINT>:<PORT>/ --action describe --resource /compute/<OCCI_ID> --auth x509
occi --endpoint https://<ENDPOINT>:<PORT>/ --action describe --resource /storage/<OCCI_ID> --auth x509
occi --endpoint https://<ENDPOINT>:<PORT>/ --action describe --resource /network/<OCCI_ID> --auth x509

To list available OS templates or Resource templates use

occi --endpoint https://<ENDPOINT>:<PORT>/ --action list --resource os_tpl --auth x509
occi --endpoint https://<ENDPOINT>:<PORT>/ --action list --resource resource_tpl --auth x509

To describe a specific OS template or Resource template use

occi --endpoint https://<ENDPOINT>:<PORT>/ --action describe --resource os_tpl#debian6 --auth x509
occi --endpoint https://<ENDPOINT>:<PORT>/ --action describe --resource resource_tpl#small --auth x509

To create a compute resource with mixins use

occi --endpoint https://<ENDPOINT>:<PORT>/ --action create --resource compute --mixin os_tpl#debian6 --mixin resource_tpl#small --attribute occi.core.title="My rOCCI VM" --auth x509

To delete a compute resource use

occi --endpoint https://<ENDPOINT>:<PORT>/ --action delete --resource /compute/<OCCI_ID> --auth x509

Changelog

Version 4.3

Version 4.2

Version 4.1

Version 4.0

Version 3.1

Version 3.0

Version 2.5

Version 2.4

Version 2.3

Version 2.2

Version 2.1

Version 2.0

Version 1.X

Development

Checkout latest version from GIT:

git clone git://github.com/EGI-FCTF/rOCCI-cli.git

Change to rOCCI-cli folder

cd rOCCI-cli

Install dependencies for deployment

bundle install

Code Documentation

Code Documentation for rOCCI-cli by YARD

Continuous integration

Continuous integration for rOCCI-cli by Travis-CI

Contribute

  1. Fork it.
  2. Create a branch (git checkout -b my_markup)
  3. Commit your changes (git commit -am "My changes")
  4. Push to the branch (git push origin my_markup)
  5. Create an Issue with a link to your branch