rbvmomi 2.1.1 → 2.1.2
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/lib/rbvmomi/connection.rb +8 -8
- data/lib/rbvmomi/deserialization.rb +1 -2
- data/lib/rbvmomi/rake_task.rb~ +7 -0
- data/lib/rbvmomi/type_loader.rb +1 -1
- data/lib/rbvmomi/version.rb +1 -1
- data/lib/rbvmomi/vim.rb +0 -2
- data/lib/rbvmomi/vim/Folder.rb +1 -1
- data/lib/rbvmomi/vim/HostSystem.rb +2 -2
- data/lib/rbvmomi/vim/ManagedObject.rb +1 -1
- data/lib/rbvmomi/vim/VirtualMachine.rb +9 -11
- data/vmodl.db +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 641619b6235a24d24f07eb068e2c53bc0ce523411b4a9cbf5a8d764b97ae5b39
|
4
|
+
data.tar.gz: 5079013630ccb8a9e718fa5ac1d795590db9c2add18282b08282b2c86da88f2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a18286dec7bcc25220a6587ae2d3f3be73ec6bff76de3240814f98ad6a10bc5a33d190dca38eb0267ca1d83d2d32e3d148717bca426fd9fb05b7a0a21ebd4f12
|
7
|
+
data.tar.gz: c2a1a2b000f1d97e8c41087f9a964f538e16165ae967e30c2c8d1e5923ec200fa07bd8970638cb125337b39ab0187c8d171619d57f249237ab17f33dfe304a26
|
data/lib/rbvmomi/connection.rb
CHANGED
@@ -23,7 +23,7 @@ class Connection < TrivialSoap
|
|
23
23
|
attr_reader :profile_summary
|
24
24
|
attr_accessor :profiling
|
25
25
|
attr_reader :deserializer
|
26
|
-
|
26
|
+
|
27
27
|
def initialize opts
|
28
28
|
@ns = opts[:ns] or fail "no namespace specified"
|
29
29
|
@rev = opts[:rev] or fail "no revision specified"
|
@@ -32,7 +32,7 @@ class Connection < TrivialSoap
|
|
32
32
|
@profiling = false
|
33
33
|
super opts
|
34
34
|
end
|
35
|
-
|
35
|
+
|
36
36
|
def reset_profiling
|
37
37
|
@profile = {}
|
38
38
|
@profile_summary = {:network_latency => 0, :request_emit => 0, :response_parse => 0, :num_calls => 0}
|
@@ -90,7 +90,7 @@ class Connection < TrivialSoap
|
|
90
90
|
|
91
91
|
t3 = Time.now
|
92
92
|
out = parse_response resp, desc['result']
|
93
|
-
|
93
|
+
|
94
94
|
if @profiling
|
95
95
|
t4 = Time.now
|
96
96
|
@profile[method] ||= []
|
@@ -98,8 +98,8 @@ class Connection < TrivialSoap
|
|
98
98
|
:network_latency => (t3 - t2),
|
99
99
|
:request_emit => t2 - t1,
|
100
100
|
:response_parse => t4 - t3,
|
101
|
-
:params => params,
|
102
|
-
:obj => this,
|
101
|
+
:params => params,
|
102
|
+
:obj => this,
|
103
103
|
:backtrace => caller,
|
104
104
|
:request_size => body.length,
|
105
105
|
:response_size => resp_size,
|
@@ -110,7 +110,7 @@ class Connection < TrivialSoap
|
|
110
110
|
@profile_summary[:request_emit] += profile_info[:request_emit]
|
111
111
|
@profile_summary[:num_calls] += 1
|
112
112
|
end
|
113
|
-
|
113
|
+
|
114
114
|
out
|
115
115
|
end
|
116
116
|
|
@@ -139,7 +139,7 @@ class Connection < TrivialSoap
|
|
139
139
|
when BasicTypes::DataObject
|
140
140
|
if expected and not expected >= o.class and not expected == BasicTypes::AnyType
|
141
141
|
fail "expected #{expected.wsdl_name} for '#{name}', got #{o.class.wsdl_name} for field #{name.inspect}"
|
142
|
-
end
|
142
|
+
end
|
143
143
|
xml.tag! name, attrs.merge("xsi:type" => o.class.wsdl_name) do
|
144
144
|
o.class.full_props_desc.each do |desc|
|
145
145
|
if o.props.member? desc['name'].to_sym
|
@@ -223,7 +223,7 @@ class Connection < TrivialSoap
|
|
223
223
|
def type name
|
224
224
|
self.class.type name
|
225
225
|
end
|
226
|
-
|
226
|
+
|
227
227
|
def instanceUuid
|
228
228
|
nil
|
229
229
|
end
|
@@ -101,7 +101,6 @@ class NewDeserializer
|
|
101
101
|
obj = klass.new nil
|
102
102
|
props = obj.props
|
103
103
|
children = node.children.select(&:element?)
|
104
|
-
n = children.size
|
105
104
|
i = 0
|
106
105
|
|
107
106
|
klass.full_props_desc.each do |desc|
|
@@ -152,7 +151,7 @@ class NewDeserializer
|
|
152
151
|
h[child.name] = child.content
|
153
152
|
end
|
154
153
|
[h['key'], h['value']]
|
155
|
-
end
|
154
|
+
end
|
156
155
|
end
|
157
156
|
|
158
157
|
class OldDeserializer
|
data/lib/rbvmomi/type_loader.rb
CHANGED
data/lib/rbvmomi/version.rb
CHANGED
data/lib/rbvmomi/vim.rb
CHANGED
data/lib/rbvmomi/vim/Folder.rb
CHANGED
@@ -67,7 +67,7 @@ class RbVmomi::VIM::Folder
|
|
67
67
|
propSpecs = {
|
68
68
|
:entity => self, :inventoryPath => path
|
69
69
|
}
|
70
|
-
|
70
|
+
_connection.searchIndex.FindByInventoryPath(propSpecs)
|
71
71
|
end
|
72
72
|
|
73
73
|
# Alias to <tt>traverse path, type, true</tt>
|
@@ -115,12 +115,12 @@ class VIM::EsxcliNamespace
|
|
115
115
|
conn.type(@type_info.wsdlName).new(conn, @instance)
|
116
116
|
end
|
117
117
|
|
118
|
-
def method_missing
|
118
|
+
def method_missing(name, *args)
|
119
119
|
name = name.to_s
|
120
120
|
if @namespaces.member? name and args.empty?
|
121
121
|
@namespaces[name]
|
122
122
|
elsif @commands.member? name
|
123
|
-
@commands[name].call
|
123
|
+
@commands[name].call(*args)
|
124
124
|
else
|
125
125
|
raise NoMethodError
|
126
126
|
end
|
@@ -52,7 +52,7 @@ class RbVmomi::VIM::ManagedObject
|
|
52
52
|
# @return [Array] Property values in same order as +pathSet+, or the return
|
53
53
|
# value from the block if it is given.
|
54
54
|
def collect *pathSet
|
55
|
-
h = collect!
|
55
|
+
h = collect!(*pathSet)
|
56
56
|
a = pathSet.map { |k| h[k.to_s] }
|
57
57
|
if block_given?
|
58
58
|
yield a
|
@@ -13,38 +13,36 @@ class RbVmomi::VIM::VirtualMachine
|
|
13
13
|
def disks
|
14
14
|
self.config.hardware.device.grep(RbVmomi::VIM::VirtualDisk)
|
15
15
|
end
|
16
|
-
|
17
|
-
# Get the IP of the guest, but only if it is not stale
|
16
|
+
|
17
|
+
# Get the IP of the guest, but only if it is not stale
|
18
18
|
# @return [String] Current IP reported (as per VMware Tools) or nil
|
19
|
-
def guest_ip
|
19
|
+
def guest_ip
|
20
20
|
g = self.guest
|
21
21
|
if g.ipAddress && (g.toolsStatus == "toolsOk" || g.toolsStatus == "toolsOld")
|
22
22
|
g.ipAddress
|
23
23
|
else
|
24
24
|
nil
|
25
25
|
end
|
26
|
-
end
|
26
|
+
end
|
27
27
|
|
28
28
|
# Add a layer of delta disks (redo logs) in front of every disk on the VM.
|
29
29
|
# This is similar to taking a snapshot and makes the VM a valid target for
|
30
30
|
# creating a linked clone.
|
31
31
|
#
|
32
|
-
# Background: The API for linked clones is quite strange. We can't create
|
32
|
+
# Background: The API for linked clones is quite strange. We can't create
|
33
33
|
# a linked straight from any VM. The disks of the VM for which we can create a
|
34
34
|
# linked clone need to be read-only and thus VC demands that the VM we
|
35
35
|
# are cloning from uses delta-disks. Only then it will allow us to
|
36
36
|
# share the base disk.
|
37
37
|
def add_delta_disk_layer_on_all_disks
|
38
|
-
devices, = self.collect 'config.hardware.device'
|
39
|
-
disks = devices.grep(RbVmomi::VIM::VirtualDisk)
|
40
38
|
spec = update_spec_add_delta_disk_layer_on_all_disks
|
41
39
|
self.ReconfigVM_Task(:spec => spec).wait_for_completion
|
42
40
|
end
|
43
|
-
|
41
|
+
|
44
42
|
# Updates a passed in spec to perform the task of adding a delta disk layer
|
45
43
|
# on top of all disks. Does the same as add_delta_disk_layer_on_all_disks
|
46
|
-
# but instead of issuing the ReconfigVM_Task, it just constructs the
|
47
|
-
# spec, so that the caller can batch a couple of updates into one
|
44
|
+
# but instead of issuing the ReconfigVM_Task, it just constructs the
|
45
|
+
# spec, so that the caller can batch a couple of updates into one
|
48
46
|
# ReconfigVM_Task.
|
49
47
|
def update_spec_add_delta_disk_layer_on_all_disks spec = {}
|
50
48
|
devices, = self.collect 'config.hardware.device'
|
@@ -73,5 +71,5 @@ class RbVmomi::VIM::VirtualMachine
|
|
73
71
|
spec[:deviceChange] += device_change
|
74
72
|
end
|
75
73
|
spec
|
76
|
-
end
|
74
|
+
end
|
77
75
|
end
|
data/vmodl.db
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbvmomi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rich Lane
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-04-
|
12
|
+
date: 2019-04-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: builder
|
@@ -140,6 +140,7 @@ files:
|
|
140
140
|
- lib/rbvmomi/fault.rb
|
141
141
|
- lib/rbvmomi/optimist.rb
|
142
142
|
- lib/rbvmomi/pbm.rb
|
143
|
+
- lib/rbvmomi/rake_task.rb~
|
143
144
|
- lib/rbvmomi/sms.rb
|
144
145
|
- lib/rbvmomi/sms/SmsStorageManager.rb
|
145
146
|
- lib/rbvmomi/trivial_soap.rb
|