Class: Chef::Knife::BlueboxImageDelete

Inherits:
Chef::Knife show all
Defined in:
lib/chef/knife/bluebox_image_delete.rb

Instance Method Summary collapse

Instance Method Details

#highlineObject



33
34
35
# File 'lib/chef/knife/bluebox_image_delete.rb', line 33

def highline
  @highline ||= HighLine.new
end

#runObject



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/chef/knife/bluebox_image_delete.rb', line 37

def run
  bluebox,image,delete = ARGV.shift, ARGV.shift, ARGV.shift
  bluebox = Fog::Compute::Bluebox.new(
    :bluebox_customer_id => Chef::Config[:knife][:bluebox_customer_id],
    :bluebox_api_key => Chef::Config[:knife][:bluebox_api_key]
  )
  image_uuid = ARGV.shift

  image = bluebox.images.get( image_uuid )

  if image
    puts image.destroy
  else
    ui.error("Image: #{image_uuid} could not be found")
  end
end