Sha256: c11c71f043f5b5ba658b321d5ffc9fb0627d727e1f4b95dce2f07357d3582383

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

namespace :ec2 do
  desc "Rehash instances"
  task :rehash do |t|
    EC2.rehash
  end

  desc "Rehash single attribute of all instances"
  task :rehash_attr_all, [:property] do |t, args|
    if args[:property].nil?
      puts "Missing property"
      return 1
    end
    EC2.rehash_property(args[:property])
  end

  desc "Rehash ec2 attributes for a single instance"
  task :rehash_attrs_for, [:instance] do |t, args|
    if args[:instance].nil?
      puts "Missing instance"
      return 1
    end
    res = EC2.rehash_properties_for_instance(args[:instance])
    return 1 unless res
  end

  desc "Rehash a single property for an instance"
  task :rehash_attr_for, [:instance, :property] do |t, args|
    if args[:instance].nil?
      puts "Missing instance"
      return 1
    end
    if args[:property].nil?
      puts "Missing property"
      return 1
    end
    res = EC2.rehash_property_for_instance(args[:property], args[:instance])
    if res
      puts "#{property} for instance #{instance} set to '#{res}'"
    else
      return 1
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gaptool-server-0.6.6 tasks/ec2.rb