Class: Vcloud::CLI::Utils::DeleteNetwork

Inherits:
Object
  • Object
show all
Includes:
Methadone::CLILogging, Methadone::Main
Defined in:
lib/vcloud/cli/utils/delete_network.rb

Class Method Summary collapse

Class Method Details

.runObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/vcloud/cli/utils/delete_network.rb', line 13

def self.run

  main do |identifier|
    vcloud = ::Fog::Compute::VcloudDirector.new
    if identifier =~ /^[-0-9a-f]+/
      net = Vcloud::Core::OrgVdcNetwork.new(identifier)
    end
    Fog.mock! if ENV['FOG_MOCK']
    task = vcloud.delete_network(net.id).body
    vcloud.process_task(task)
  end

  arg :identifier

  on("-f", "--force", "Force deletion of running vapp")

  description "
  "

  go!

end