Class: Chef::Knife::VcVappCreate

Inherits:
Chef::Knife show all
Includes:
VcCommon, VcVDCCommon
Defined in:
lib/chef/knife/vapp/vc_vapp_create.rb

Instance Method Summary collapse

Methods included from VcVDCCommon

#get_vdc, included

Methods included from VcCommon

#connection, #deprecation_msg, #generate_key, #get_password, included, #locate_config_value, #locate_org_option, #notice_msg, #out_msg, #pretty_symbol, #sort_by_key, #store_config, #store_password, #wait_task

Instance Method Details

#runObject



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/chef/knife/vapp/vc_vapp_create.rb', line 27

def run
  $stdout.sync = true

  vdc_arg = @name_args.shift
  name = @name_args.shift
  description = @name_args.shift
  templateId = @name_args.shift

  connection.

  vdc = get_vdc(vdc_arg)

  result = connection.create_vapp_from_template vdc[:id], name, description, templateId

  ui.msg "vApp creation..."
  wait_task(connection, result[:task_id])
  ui.msg "vApp created with ID: #{ui.color(result[:vapp_id], :cyan)}"

  connection.logout
end