Class: Chef::Knife::VcOvfUpload

Inherits:
Chef::Knife show all
Includes:
VcCatalogCommon, VcCommon, VcVDCCommon
Defined in:
lib/chef/knife/ovf/vc_ovf_upload.rb

Instance Method Summary collapse

Methods included from VcCatalogCommon

#get_catalog, #get_catalog_item, included

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



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/chef/knife/ovf/vc_ovf_upload.rb', line 41

def run
  $stdout.sync = true

  vdc_arg = @name_args.shift
  catalog_arg = @name_args.shift
  vapp_name = @name_args.shift
  vapp_description = @name_args.shift
  ovf_filename = @name_args.shift

  show_progress_bar = locate_config_value(:ovf_show_progress_bar)
  send_manifest = locate_config_value(:ovf_send_manifest)

  connection.

  vdc = get_vdc(vdc_arg)
  catalog = get_catalog(catalog_arg)

  ui.msg "Uploading OVF..."

  result = connection.upload_ovf(vdc[:id], vapp_name,
                    vapp_description, ovf_filename, catalog[:id],
                    { :send_manifest => send_manifest,
                      :progressbar_enable => show_progress_bar})

  ui.msg "OVF uploaded. vAppTemplate created with ID: #{ui.color(result[:id], :cyan)}"

  connection.logout
end