CloudApplianceDescriptor

Helper gem to ease creation of cloud appliance descriptor.

Build Status Dependency Status Gem Version Code Climate

Installation

Add this line to your application's Gemfile:

gem 'cloud-appliance-descriptor'

And then execute:

$ bundle

Or install it yourself as:

$ gem install cloud-appliance-descriptor

Usage

Cloud appliance is basically a virtual machine with set of disks running an operating system.

os = Cloud::Appliance::Descriptor::Os.new :distribution => 'Ubuntu', :version => '14.04'
disk = Cloud::Appliance::Descriptor::Disk.new :type => :os, :format => :raw

# Every attribute can be set either during object initialization
appliance = Cloud::Appliance::Descriptor::Appliance.new :action => :create, :title => 'Title', :version => '548242', :os => os, :groups => ['GROUP1', 'GROUP2'], :attributes => { 'KEY' => 'VALUE' }
# or later via setter.
appliance.memory = 2048

# Disks, attributes and groups can be added and removed via their add and remove methods.
appliance.add_disk disk
appliance.remove_attribute 'KEY'
appliance.remove_group 'GROUP1'

# Once populated, appliance can be rendered as JSON
json_output = appliance.to_json

# Appliance can be also constructed from its JSON representation
appliance_from_json = Cloud::Appliance::Descriptor::Appliance.from_json(json_input)

Contributing

  1. Fork it ( https://github.com/Misenko/cloud-appliance-descriptor/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request