Sha256: 19e98d3fcbbdf4a24444cc5ffb33294ffab58a7ce203c2457660ceea8840472d
Contents?: true
Size: 1.04 KB
Versions: 16
Compression:
Stored size: 1.04 KB
Contents
require 'mccloud/util/iterator' module Mccloud module Command def deregister(imageId=nil,options=nil) if imageId.nil? puts "[Error] We need at least need an imageId." exit end #f=Fog::Compute.new({ :region => "eu-west-1", :provider => "AWS"}) # i=f.create_image("i-c1ac2bb7","name","description") # f.images.all({ "Owner" => "self"}) # f.deregister_image("ami-796d5b0d") puts "Looking for imageId: #{imageId}" @environment.config.providers.each do |name,provider| begin image=provider.images.get(imageId) if image.nil? puts "[#{name}] - ImageId #{imageId} not found" else puts "[#{name}] - ImageId #{imageId} found" puts "[#{name}] - Deregistering #{imageId} now" begin provider.deregister_image(imageId) rescue Fog::Service::Error => fogerror puts "[Error] #{fogerror}" end end end end end #def end #module end #module
Version data entries
16 entries across 16 versions & 1 rubygems