vcenter_lib 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/lib/vcenter_lib/vcenter.rb +5 -2
- data/lib/vcenter_lib/version.rb +1 -1
- data/lib/vcenter_lib/vm_converter.rb +8 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 597f40cdd4aa4d32ff8f652aa59770487dc61e62
|
4
|
+
data.tar.gz: 785a449ace683855af51cf36479c9b073cd79530
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e96991bfcdadad96c2a1b22a89060e8417ec19f403e5470b02eeaca4f7da5aa0093ec36c7ae05595e6e3c5c742a6758ac6936f9213d586ce0aa2e83a75ba4dfe
|
7
|
+
data.tar.gz: e3bf7fe9e55bc2a65743b9e674c1b52eccbd0ff8dad2830bb0a825e43125bab3eb1508ef26fc4d192bd431665e782e719713e405616e59264c0064c284f692b7
|
data/.rubocop.yml
CHANGED
data/lib/vcenter_lib/vcenter.rb
CHANGED
@@ -19,13 +19,16 @@ module VcenterLib
|
|
19
19
|
|
20
20
|
# get all vms in all datacenters
|
21
21
|
def vms
|
22
|
-
|
23
|
-
|
22
|
+
logger.debug "get all VMs in all datacenters: begin"
|
23
|
+
result = dcs.inject([]) do |r, dc|
|
24
|
+
r + serviceContent.viewManager.CreateContainerView(
|
24
25
|
container: dc.vmFolder,
|
25
26
|
type: ['VirtualMachine'],
|
26
27
|
recursive: true
|
27
28
|
).view
|
28
29
|
end
|
30
|
+
logger.debug "get all VMs in all datacenters: end"
|
31
|
+
result
|
29
32
|
end
|
30
33
|
|
31
34
|
# find vm
|
data/lib/vcenter_lib/version.rb
CHANGED
@@ -50,11 +50,14 @@ module VcenterLib
|
|
50
50
|
@vcenter = vcenter
|
51
51
|
end
|
52
52
|
|
53
|
-
# get all vms and their facts
|
53
|
+
# get all vms and their facts as hash with vm.name as key
|
54
54
|
def facts
|
55
|
-
|
56
|
-
|
57
|
-
|
55
|
+
logger.debug "get complete data of all VMs in all datacenters: begin"
|
56
|
+
result = Hash[vm_mos_to_h(@vcenter.vms).map do |h|
|
57
|
+
[h['name'], Hash[h.map { |k, v| [k.tr('.', '_'), v] }]]
|
58
|
+
end]
|
59
|
+
logger.debug "get complete data of all VMs in all datacenters: end"
|
60
|
+
result
|
58
61
|
end
|
59
62
|
|
60
63
|
# convert a VMware RbVmomi::VIM::ManagedObject into a simple hash.
|
@@ -79,6 +82,7 @@ module VcenterLib
|
|
79
82
|
# rubocop:enable Style/RescueModifier
|
80
83
|
hosts[v] = extra
|
81
84
|
end
|
85
|
+
true
|
82
86
|
end
|
83
87
|
end
|
84
88
|
props.merge!(extra)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vcenter_lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Meyling
|
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
139
|
version: '0'
|
140
140
|
requirements: []
|
141
141
|
rubyforge_project:
|
142
|
-
rubygems_version: 2.
|
142
|
+
rubygems_version: 2.6.8
|
143
143
|
signing_key:
|
144
144
|
specification_version: 4
|
145
145
|
summary: easy access to vcenter informations
|