Sha256: b7c681d3307ab79ff2234926a601cd330c0185f0bc8827b85b5a3f4b805d9f39

Contents?: true

Size: 960 Bytes

Versions: 1

Compression:

Stored size: 960 Bytes

Contents

#!/usr/bin/env ruby

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'cli_helper'

options = {}
OptionParser.new do |opts|
  opts.on('-n', '--name NAME', 'friendly name for this machine.') {|v| options[:name] = v }
  opts.on('-e', '--dataset URN', 'dataset URN.') {|v| options[:dataset] = v }
  opts.on('-p', '--package NAME', 'Name of the package to use on provisioning.') {|v| options[:package] = v }
  opts.on('-h','--help') do
    puts opts
    print "\n" + 'Datasets(urn):'
    fixture('datasets').each do |dataset|
      print ' ' + dataset['urn']
    end
    print "\n\n" + 'Packages(name):'
    fixture('packages').each do |packages|
      print ' ' + packages['name']
    end
    puts
    exit
  end

  begin
    opts.parse!(ARGV)
  rescue => e
    puts e.to_s << "\n" << opts.to_s
    exit
  end
end

begin
  puts client.machines.create options
rescue Smartdc::Error::Conflict => e
  puts e
rescue => e
  puts e.inspect
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
smartdc-0.4.0 bin/sdc-createmachine