knife-vcloud 0.2.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +44 -1
  3. data/README.md +356 -91
  4. data/lib/chef/knife/{vc_catalog_item_show.rb → catalog/vc_catalog_item_show.rb} +13 -13
  5. data/lib/chef/knife/{vc_catalog_show.rb → catalog/vc_catalog_show.rb} +9 -12
  6. data/lib/chef/knife/common/vc_bootstrap_common.rb +208 -0
  7. data/lib/chef/knife/common/vc_catalog_common.rb +58 -0
  8. data/lib/chef/knife/common/vc_common.rb +165 -0
  9. data/lib/chef/knife/common/vc_network_common.rb +34 -0
  10. data/lib/chef/knife/common/vc_vapp_common.rb +49 -0
  11. data/lib/chef/knife/common/vc_vdc_common.rb +43 -0
  12. data/lib/chef/knife/common/vc_vm_common.rb +80 -0
  13. data/lib/chef/knife/network/vc_network_show.rb +45 -0
  14. data/lib/chef/knife/{vc_org_list.rb → org/vc_org_list.rb} +3 -5
  15. data/lib/chef/knife/{vc_org_show.rb → org/vc_org_show.rb} +10 -11
  16. data/lib/chef/knife/ovf/vc_ovf_upload.rb +71 -0
  17. data/lib/chef/knife/vapp/vc_vapp_bootstrap.rb +51 -0
  18. data/lib/chef/knife/vapp/vc_vapp_clone.rb +80 -0
  19. data/lib/chef/knife/{vc_vapp_create.rb → vapp/vc_vapp_create.rb} +10 -9
  20. data/lib/chef/knife/{vc_vapp_delete.rb → vapp/vc_vapp_delete.rb} +12 -10
  21. data/lib/chef/knife/vapp/vc_vapp_network_external.rb +101 -0
  22. data/lib/chef/knife/vapp/vc_vapp_network_internal.rb +151 -0
  23. data/lib/chef/knife/vapp/vc_vapp_reboot.rb +45 -0
  24. data/lib/chef/knife/vapp/vc_vapp_reset.rb +44 -0
  25. data/lib/chef/knife/vapp/vc_vapp_show.rb +90 -0
  26. data/lib/chef/knife/vapp/vc_vapp_snapshot.rb +58 -0
  27. data/lib/chef/knife/{vc_vapp_start.rb → vapp/vc_vapp_start.rb} +7 -7
  28. data/lib/chef/knife/{vc_vapp_stop.rb → vapp/vc_vapp_stop.rb} +7 -7
  29. data/lib/chef/knife/vapp/vc_vapp_suspend.rb +44 -0
  30. data/lib/chef/knife/vc_commands.rb +70 -0
  31. data/lib/chef/knife/vc_login.rb +2 -2
  32. data/lib/chef/knife/{vc_vdc_show.rb → vdc/vc_vdc_show.rb} +13 -14
  33. data/lib/chef/knife/vm/vc_vm_bootstrap.rb +48 -0
  34. data/lib/chef/knife/vm/vc_vm_config_guest.rb +110 -0
  35. data/lib/chef/knife/{vc_vm_config_network.rb → vm/vc_vm_config_network.rb} +17 -11
  36. data/lib/chef/knife/vm/vc_vm_reboot.rb +44 -0
  37. data/lib/chef/knife/vm/vc_vm_reset.rb +44 -0
  38. data/lib/chef/knife/vm/vc_vm_set_disks.rb +78 -0
  39. data/lib/chef/knife/vm/vc_vm_set_info.rb +79 -0
  40. data/lib/chef/knife/{vc_vm_show.rb → vm/vc_vm_show.rb} +35 -18
  41. data/lib/chef/knife/vm/vc_vm_start.rb +44 -0
  42. data/lib/chef/knife/vm/vc_vm_stop.rb +44 -0
  43. data/lib/chef/knife/vm/vc_vm_suspend.rb +44 -0
  44. data/lib/knife-vcloud/version.rb +3 -0
  45. metadata +69 -38
  46. data/lib/chef/knife/vc_common.rb +0 -103
  47. data/lib/chef/knife/vc_vapp_config_network.rb +0 -63
  48. data/lib/chef/knife/vc_vapp_show.rb +0 -59
  49. data/lib/chef/knife/vc_vm_config_guest.rb +0 -67
@@ -1,63 +0,0 @@
1
- #
2
- # Author:: Stefano Tortarolo (<stefano.tortarolo@gmail.com>)
3
- # Copyright:: Copyright (c) 2012
4
- # License:: Apache License, Version 2.0
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
-
19
- require 'chef/knife/vc_common'
20
-
21
- class Chef
22
- class Knife
23
- class VcVappConfigNetwork < Chef::Knife
24
- include Knife::VcCommon
25
-
26
- banner "knife vc vapp config network [VAPP_ID] [NETWORK_NAME] (options)"
27
-
28
- option :fence_mode,
29
- :short => "-F FENCE_MODE",
30
- :long => "--fence-mode FENCE_MODE",
31
- :description => "Set Fence Mode (e.g., Isolated, Bridged)",
32
- :proc => Proc.new { |key| Chef::Config[:knife][:fence_mode] = key }
33
-
34
- option :retain_network,
35
- :long => "--[no-]retain-network",
36
- :description => "Toggle Retain Network across deployments (default true)",
37
- :proc => Proc.new { |key| Chef::Config[:knife][:retain_network] = key },
38
- :boolean => true,
39
- :default => true
40
-
41
- def run
42
- $stdout.sync = true
43
-
44
- vapp_id = @name_args.shift
45
- network_name = @name_args.shift
46
-
47
- connection.login
48
-
49
- config = {
50
- :fence_mode => locate_config_value(:fence_mode),
51
- :retain_net => locate_config_value(:retain_net)
52
- }
53
-
54
- task_id, response = connection.set_vapp_network_config vapp_id, network_name, config
55
-
56
- print "vApp network configuration..."
57
- wait_task(connection, task_id)
58
-
59
- connection.logout
60
- end
61
- end
62
- end
63
- end
@@ -1,59 +0,0 @@
1
- #
2
- # Author:: Stefano Tortarolo (<stefano.tortarolo@gmail.com>)
3
- # Copyright:: Copyright (c) 2012
4
- # License:: Apache License, Version 2.0
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
-
19
- require 'chef/knife/vc_common'
20
-
21
- class Chef
22
- class Knife
23
- class VcVappShow < Chef::Knife
24
- include Knife::VcCommon
25
-
26
- banner "knife vc vapp show [VAPP_ID] (options)"
27
-
28
- def run
29
- $stdout.sync = true
30
-
31
- vapp_id = @name_args.first
32
-
33
- list = [
34
- ui.color('Name', :bold),
35
- ui.color('Status', :bold),
36
- ui.color('IPs', :bold),
37
- ui.color('ID', :bold)
38
- ]
39
-
40
- connection.login
41
- name, description, status, ip, vms_hash = connection.show_vapp vapp_id
42
- connection.logout
43
-
44
- out_msg("Name", name)
45
- out_msg("Description", description)
46
- out_msg("Status", status)
47
- out_msg("IP", ip)
48
-
49
- vms_hash.each do |k, v|
50
- list << (k || '')
51
- list << (v[:status] || '')
52
- list << (v[:addresses].join(', ') || '<no ip>')
53
- list << (v[:id] || '')
54
- end
55
- puts ui.list(list, :columns_across, 4)
56
- end
57
- end
58
- end
59
- end
@@ -1,67 +0,0 @@
1
- #
2
- # Author:: Stefano Tortarolo (<stefano.tortarolo@gmail.com>)
3
- # Copyright:: Copyright (c) 2012
4
- # License:: Apache License, Version 2.0
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
-
19
- require 'chef/knife/vc_common'
20
-
21
- class Chef
22
- class Knife
23
- class VcVmConfigGuest < Chef::Knife
24
- include Knife::VcCommon
25
-
26
- banner "knife vc vm config guest [VM_ID] [COMPUTER_NAME] (options)"
27
-
28
- option :guest_enabled,
29
- :long => "--[no-]guest",
30
- :description => "Toggle Guest Customization (default true)",
31
- :boolean => true,
32
- :default => true
33
-
34
- option :admin_passwd_enabled,
35
- :long => "--use-[no-]admin-passwd",
36
- :description => "Toggle Admin Password (default true)",
37
- :boolean => true,
38
- :default => true
39
-
40
- option :admin_passwd,
41
- :long => "--admin-passwd ADMIN_PASSWD",
42
- :description => "Set Admin Password"
43
-
44
- def run
45
- $stdout.sync = true
46
-
47
- vm_id = @name_args.shift
48
- computer_name = @name_args.shift
49
-
50
- connection.login
51
-
52
- config = {
53
- :enabled => locate_config_value(:guest_enabled),
54
- :admin_passwd_enabled => locate_config_value(:admin_passwd_enabled),
55
- :admin_passwd => locate_config_value(:admin_passwd)
56
- }
57
-
58
- task_id, response = connection.set_vm_guest_customization vm_id, computer_name, config
59
-
60
- print "VM guest configuration..."
61
- wait_task(connection, task_id)
62
-
63
- connection.logout
64
- end
65
- end
66
- end
67
- end