knife-vcloud 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/README.md +9 -3
- data/lib/chef/knife/catalog/vc_catalog_item_show.rb +35 -15
- data/lib/chef/knife/vapp/vc_vapp_discard_suspended.rb +44 -0
- data/lib/chef/knife/vapp/vc_vapp_snapshot.rb +2 -2
- data/lib/chef/knife/vc_commands.rb +2 -0
- data/lib/chef/knife/vm/vc_vm_discard_suspended.rb +44 -0
- data/lib/chef/knife/vm/vc_vm_show.rb +2 -1
- data/lib/knife-vcloud/version.rb +1 -1
- metadata +18 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10c1b893ad8aa6677bb69cecb3e94466e044b492
|
4
|
+
data.tar.gz: c1ddbbadd0b3ae1978010314d6f0a99cfa6a93c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f7b6ea402d9bb1e79340dd031ff3ed8c4d69eea102aa064972f9c9306cb977449755ddca892a6ef6926a08b690e611fcc1fd22c54c3830331f17e4db287ef85
|
7
|
+
data.tar.gz: 8930ea3e4d97cfd3ef521df8c05901cd123a16d4f226fbf8feca9837bb13aad96a91153dea82d1c3f386e0386b636bbf70bc75ca4f277d39b66090bb9ed82b52
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,20 @@
|
|
1
1
|
Changes
|
2
2
|
==
|
3
|
+
2014-06-03 (1.3.0)
|
4
|
+
|
5
|
+
This version requires vcloud-rest v. 1.3.0.
|
6
|
+
|
7
|
+
FEATURES:
|
8
|
+
|
9
|
+
* Add "media" item type management to `catalog item show`
|
10
|
+
* Add commands `[vm|vapp] discard suspended` to discard suspended state of a vApp or VM
|
11
|
+
|
12
|
+
FIXES:
|
13
|
+
|
14
|
+
* Adapt 'vc vm show' to display different IPs from same network
|
15
|
+
|
16
|
+
Note that now `get_vm` appends NetworkConnectionIndex to network name to generate a unique hash key.
|
17
|
+
|
3
18
|
2014-02-06 (1.2.0)
|
4
19
|
--
|
5
20
|
|
data/README.md
CHANGED
@@ -23,7 +23,7 @@ FEATURES
|
|
23
23
|
- show VDCs
|
24
24
|
- show Catalogs
|
25
25
|
- show Catalog Items
|
26
|
-
- create/start/stop/delete/show/reset/suspend/reboot vApps and VMs
|
26
|
+
- create/start/stop/delete/show/reset/suspend/reboot/discard suspended vApps and VMs
|
27
27
|
- add/edit/delete vApp networks (both internal and external)
|
28
28
|
- basic VM network configuration
|
29
29
|
- basic VM Guest Customization configuration
|
@@ -31,9 +31,12 @@ FEATURES
|
|
31
31
|
|
32
32
|
PREREQUISITES
|
33
33
|
--
|
34
|
-
- chef
|
34
|
+
- chef
|
35
35
|
- knife-windows
|
36
|
-
- vcloud-rest
|
36
|
+
- vcloud-rest
|
37
|
+
|
38
|
+
(see *knife-vcloud.gemspec* for details)
|
39
|
+
|
37
40
|
|
38
41
|
USAGE
|
39
42
|
--
|
@@ -52,6 +55,7 @@ USAGE
|
|
52
55
|
knife vc vapp clone [VDC] [SOURCE_VAPP] [DEST_NAME] (options)
|
53
56
|
knife vc vapp create [VDC] [NAME] [DESCRIPTION] [TEMPLATE_ID] (options)
|
54
57
|
knife vc vapp delete [VAPP] (options)
|
58
|
+
knife vc vapp discard suspended [VAPP] (options)
|
55
59
|
knife vc vapp network external [add|delete|edit| [VAPP] [NETWORK] (options)
|
56
60
|
knife vc vapp network internal [add|delete|edit| [VAPP] [NETWORK] (options)
|
57
61
|
knife vc vapp reboot [VAPP] (options)
|
@@ -230,6 +234,8 @@ _Example:_
|
|
230
234
|
###Manage vApp/VM status
|
231
235
|
vApp/VM's status can be managed with _start/stop/reboot/reset/suspend/delete_
|
232
236
|
|
237
|
+
A suspended state can be discarded, it means that a vApp/VM is switched from paused to stopped.
|
238
|
+
|
233
239
|
Note: use _knife vc vm..._ to operate on VMs.
|
234
240
|
|
235
241
|
_Example:_
|
@@ -33,22 +33,42 @@ class Chef
|
|
33
33
|
catalog_item = get_catalog_item(item_arg)
|
34
34
|
connection.logout
|
35
35
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
36
|
+
if catalog_item[:type] == "vAppTemplate"
|
37
|
+
header = [
|
38
|
+
ui.color('Name', :bold),
|
39
|
+
ui.color('Template ID', :bold)
|
40
|
+
]
|
41
|
+
|
42
|
+
ui.msg "#{ui.color('Description:', :cyan)} #{catalog_item[:description]}"
|
43
|
+
list = header
|
44
|
+
|
45
|
+
catalog_item[:items].each do |item|
|
46
|
+
list << (item[:name] || '')
|
47
|
+
list << (item[:id] || '')
|
48
|
+
# TODO: show VMs using this item? item[:vms_hash]
|
49
|
+
end
|
50
|
+
|
51
|
+
ui.msg ui.list(list, :columns_across, 2)
|
52
|
+
|
53
|
+
elsif catalog_item[:type] == "media"
|
54
|
+
header = [
|
55
|
+
ui.color('Name', :bold),
|
56
|
+
ui.color('Media ID', :bold)
|
57
|
+
]
|
50
58
|
|
51
|
-
|
59
|
+
ui.msg "#{ui.color('Description:', :cyan)} #{catalog_item[:description]}"
|
60
|
+
list = header
|
61
|
+
|
62
|
+
list << (catalog_item[:name] || '')
|
63
|
+
list << (catalog_item[:id] || '')
|
64
|
+
|
65
|
+
ui.msg ui.list(list, :columns_across, 2)
|
66
|
+
|
67
|
+
elsif catalog_item[:type] == "unknown"
|
68
|
+
|
69
|
+
ui.msg "#{ui.color('Description:', :cyan)} #{catalog_item[:description]}"
|
70
|
+
ui.msg "#{ui.color('Unknown catalog item type', :bold)}"
|
71
|
+
end
|
52
72
|
end
|
53
73
|
end
|
54
74
|
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Marco Betti (<m.betti@gmail.com>)
|
3
|
+
# Copyright:: Copyright (c) 2014
|
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
|
+
class Chef
|
20
|
+
class Knife
|
21
|
+
class VcVappDiscardSuspended < Chef::Knife
|
22
|
+
include Knife::VcCommon
|
23
|
+
include Knife::VcVappCommon
|
24
|
+
|
25
|
+
banner "knife vc vapp discard suspended [VAPP] (options)"
|
26
|
+
|
27
|
+
def run
|
28
|
+
$stdout.sync = true
|
29
|
+
|
30
|
+
vapp_arg = @name_args.shift
|
31
|
+
|
32
|
+
connection.login
|
33
|
+
vapp = get_vapp(vapp_arg)
|
34
|
+
|
35
|
+
task_id = connection.discard_suspend_state_vapp vapp[:id]
|
36
|
+
|
37
|
+
ui.msg "Discarding vApp suspended state..."
|
38
|
+
wait_task(connection, task_id)
|
39
|
+
|
40
|
+
connection.logout
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -42,11 +42,11 @@ class Chef
|
|
42
42
|
|
43
43
|
case command
|
44
44
|
when :create
|
45
|
-
task_id = connection.
|
45
|
+
task_id = connection.create_vapp_snapshot vapp[:id]
|
46
46
|
ui.msg "vApp snapshot creation..."
|
47
47
|
wait_task(connection, task_id)
|
48
48
|
when :revert
|
49
|
-
task_id = connection.
|
49
|
+
task_id = connection.revert_vapp_snapshot vapp[:id]
|
50
50
|
ui.msg "vApp snapshot revert..."
|
51
51
|
wait_task(connection, task_id)
|
52
52
|
end
|
@@ -51,6 +51,7 @@ require 'chef/knife/vapp/vc_vapp_suspend'
|
|
51
51
|
require 'chef/knife/vapp/vc_vapp_clone'
|
52
52
|
require 'chef/knife/vapp/vc_vapp_bootstrap'
|
53
53
|
require 'chef/knife/vapp/vc_vapp_snapshot'
|
54
|
+
require 'chef/knife/vapp/vc_vapp_discard_suspended'
|
54
55
|
|
55
56
|
# VM
|
56
57
|
require 'chef/knife/common/vc_vm_common'
|
@@ -65,6 +66,7 @@ require 'chef/knife/vm/vc_vm_start'
|
|
65
66
|
require 'chef/knife/vm/vc_vm_stop'
|
66
67
|
require 'chef/knife/vm/vc_vm_suspend'
|
67
68
|
require 'chef/knife/vm/vc_vm_bootstrap'
|
69
|
+
require 'chef/knife/vm/vc_vm_discard_suspended'
|
68
70
|
|
69
71
|
# OVF
|
70
72
|
require 'chef/knife/ovf/vc_ovf_upload'
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Marco Betti (<m.betti@gmail.com>)
|
3
|
+
# Copyright:: Copyright (c) 2014
|
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
|
+
class Chef
|
20
|
+
class Knife
|
21
|
+
class VcVmDiscardSuspended < Chef::Knife
|
22
|
+
include Knife::VcCommon
|
23
|
+
include Knife::VcVmCommon
|
24
|
+
|
25
|
+
banner "knife vc vm discard suspended [VM] (options)"
|
26
|
+
|
27
|
+
def run
|
28
|
+
$stdout.sync = true
|
29
|
+
|
30
|
+
vm_arg = @name_args.shift
|
31
|
+
|
32
|
+
connection.login
|
33
|
+
vm = get_vm(vm_arg)
|
34
|
+
|
35
|
+
task_id = connection.discard_suspend_state_vm vm[:id]
|
36
|
+
|
37
|
+
ui.msg "Discarding VM suspended state..."
|
38
|
+
wait_task(connection, task_id)
|
39
|
+
|
40
|
+
connection.logout
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -61,7 +61,8 @@ class Chef
|
|
61
61
|
|
62
62
|
list << ['', '', ui.color('Networks', :bold), '']
|
63
63
|
vm[:networks].each do |network, values|
|
64
|
-
|
64
|
+
# remove NetworkConnectionIndex from network hash key
|
65
|
+
list << [network.gsub(/^(.*)_[0-9]+$/, '\1') || '', '']
|
65
66
|
values.each do |k, v|
|
66
67
|
list << " #{(pretty_symbol(k) || '')}"
|
67
68
|
list << (v || '')
|
data/lib/knife-vcloud/version.rb
CHANGED
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-vcloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefano Tortarolo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.10.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.10.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: knife-windows
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: vcloud-rest
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: 1.3.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: 1.3.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: winrm
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 1.1.3
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.1.3
|
69
69
|
description: A Knife plugin to create, list and manage vCloud servers
|
@@ -74,8 +74,8 @@ extensions: []
|
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
76
|
- CHANGELOG.md
|
77
|
-
- README.md
|
78
77
|
- LICENSE
|
78
|
+
- README.md
|
79
79
|
- lib/chef/knife/catalog/vc_catalog_item_show.rb
|
80
80
|
- lib/chef/knife/catalog/vc_catalog_show.rb
|
81
81
|
- lib/chef/knife/common/vc_bootstrap_common.rb
|
@@ -93,6 +93,7 @@ files:
|
|
93
93
|
- lib/chef/knife/vapp/vc_vapp_clone.rb
|
94
94
|
- lib/chef/knife/vapp/vc_vapp_create.rb
|
95
95
|
- lib/chef/knife/vapp/vc_vapp_delete.rb
|
96
|
+
- lib/chef/knife/vapp/vc_vapp_discard_suspended.rb
|
96
97
|
- lib/chef/knife/vapp/vc_vapp_network_external.rb
|
97
98
|
- lib/chef/knife/vapp/vc_vapp_network_internal.rb
|
98
99
|
- lib/chef/knife/vapp/vc_vapp_reboot.rb
|
@@ -108,6 +109,7 @@ files:
|
|
108
109
|
- lib/chef/knife/vdc/vc_vdc_show.rb
|
109
110
|
- lib/chef/knife/vm/vc_vm_bootstrap.rb
|
110
111
|
- lib/chef/knife/vm/vc_vm_config_guest.rb
|
112
|
+
- lib/chef/knife/vm/vc_vm_discard_suspended.rb
|
111
113
|
- lib/chef/knife/vm/vc_vm_network.rb
|
112
114
|
- lib/chef/knife/vm/vc_vm_reboot.rb
|
113
115
|
- lib/chef/knife/vm/vc_vm_reset.rb
|
@@ -128,19 +130,18 @@ require_paths:
|
|
128
130
|
- lib
|
129
131
|
required_ruby_version: !ruby/object:Gem::Requirement
|
130
132
|
requirements:
|
131
|
-
- -
|
133
|
+
- - ">="
|
132
134
|
- !ruby/object:Gem::Version
|
133
135
|
version: '0'
|
134
136
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
137
|
requirements:
|
136
|
-
- -
|
138
|
+
- - ">="
|
137
139
|
- !ruby/object:Gem::Version
|
138
140
|
version: '0'
|
139
141
|
requirements: []
|
140
142
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
143
|
+
rubygems_version: 2.2.2
|
142
144
|
signing_key:
|
143
145
|
specification_version: 4
|
144
146
|
summary: A knife plugin for the VMWare vCloud API
|
145
147
|
test_files: []
|
146
|
-
has_rdoc:
|