Sha256: 20c510f511030b28f0eb69101d56fcd97aea38385741f360b5b3a458a0fbad67

Contents?: true

Size: 901 Bytes

Versions: 2

Compression:

Stored size: 901 Bytes

Contents

module Brightbox
  desc 'Register an image'
  command [:register] do |c|

    c.desc "Name to give the image"
    c.flag [:n, "name"]

    c.desc "Archtecture of the image (i686 or x86_64)"
    c.flag [:a, "arch"]

    c.desc "Source filename of the image you uploaded to the image library"
    c.flag [:s, "source"]

    c.desc "This image does not support virtio so needs 'compatibility mode'"
    c.switch [:c, "compatibility"]

    c.desc "Image description"
    c.flag [:d, "description"]

    c.action do |global_options,options,args|

      raise "You must specify the architecture" unless options[:a]
      raise "You must specify the source filename" unless options[:s]

      image = Image.register :name => options[:n], :arch => options[:a],
      :source => options[:s], :compatibility_mode => options[:c],
      :description => options[:d]

      render_table([image])

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
brightbox-cli-0.13.1 lib/brightbox-cli/commands/images-register.rb
brightbox-cli-0.13.0 lib/brightbox-cli/commands/images-register.rb