rbvmomi2 3.8.0 → 3.9.0
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/README.md +7 -3
- data/lib/rbvmomi/pbm.rb +2 -3
- data/lib/rbvmomi/sms.rb +2 -4
- data/lib/rbvmomi/version.rb +1 -1
- data/lib/rbvmomi/vim.rb +3 -4
- data/lib/rbvmomi/vsan.rb +7 -0
- data/lib/rbvmomi/vslm.rb +7 -0
- data/lib/tasks/vmodl.rake +13 -0
- data/lib/tasks/vmodl_helper.rb +23 -19
- data/vmodl.db +0 -0
- metadata +19 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bb35545cfd0c050c6b3044a6d772151359626a5e412de92033f1182f569fa171
|
|
4
|
+
data.tar.gz: c397dac73dafb9010241d707f927a5c8627bb62a556346ceb1c895e0ea7660c0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 73ef59177beefb0723c3f46fdddcc41e80a3dd2bf0d4adb811a7402f728a900c4d356ff0df1df38601108a6357d75ca13bdb1f45caea3dc8dd5be792d9722746
|
|
7
|
+
data.tar.gz: 93f4919baabaed3df723fc20e5af395c9828197ae552557b82e33fccdf2ac1fe8ef32057f514d33fe083d60e7d7cb58d0129b422f13c3438592257acdf3cdc0d
|
data/README.md
CHANGED
|
@@ -12,9 +12,9 @@ maintained by programmers like you!
|
|
|
12
12
|
|
|
13
13
|
RbVmomi is a Ruby interface to the vSphere API. Like the Perl and Java SDKs,
|
|
14
14
|
you can use it to manage ESX and vCenter servers. The current release
|
|
15
|
-
supports the vSphere
|
|
15
|
+
supports the vSphere 9.0 API. RbVmomi specific documentation is
|
|
16
16
|
[online](http://rdoc.info/github/ManageIQ/rbvmomi2/master/frames) and is meant to
|
|
17
|
-
be used alongside the official [documentation](
|
|
17
|
+
be used alongside the official [documentation](https://developer.broadcom.com/xapis/vsphere-web-services-api/latest/).
|
|
18
18
|
|
|
19
19
|
## Installation
|
|
20
20
|
|
|
@@ -70,7 +70,7 @@ in the first example uses the SearchIndex for fast lookups.
|
|
|
70
70
|
|
|
71
71
|
A few important points:
|
|
72
72
|
|
|
73
|
-
* All class, method, parameter, and property names match the official [documentation](
|
|
73
|
+
* All class, method, parameter, and property names match the official [documentation](https://developer.broadcom.com/xapis/vsphere-web-services-api/latest/).
|
|
74
74
|
* Properties are exposed as accessor methods.
|
|
75
75
|
* Data object types can usually be inferred from context, so you may use a hash instead.
|
|
76
76
|
* Enumeration values are simply strings.
|
|
@@ -103,3 +103,7 @@ To see the full list, use `git shortlog -nes`.
|
|
|
103
103
|
## Support
|
|
104
104
|
|
|
105
105
|
You can chat on [Gitter](https://gitter.im/vmware/rbvmomi)
|
|
106
|
+
|
|
107
|
+
## License
|
|
108
|
+
|
|
109
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/lib/rbvmomi/pbm.rb
CHANGED
|
@@ -63,8 +63,7 @@ module RbVmomi
|
|
|
63
63
|
pp.text "PBM(#{@opts[:host]})"
|
|
64
64
|
end
|
|
65
65
|
|
|
66
|
-
add_extension_dir File.join(
|
|
67
|
-
load_vmodl(ENV['VMODL'] || File.join(
|
|
66
|
+
add_extension_dir File.join(__dir__, 'pbm')
|
|
67
|
+
load_vmodl(ENV['VMODL'] || File.join(__dir__, '../../vmodl.db'))
|
|
68
68
|
end
|
|
69
|
-
|
|
70
69
|
end
|
data/lib/rbvmomi/sms.rb
CHANGED
|
@@ -57,9 +57,7 @@ module RbVmomi
|
|
|
57
57
|
pp.text "SMS(#{@opts[:host]})"
|
|
58
58
|
end
|
|
59
59
|
|
|
60
|
-
add_extension_dir File.join(
|
|
61
|
-
load_vmodl(ENV['VMODL'] || File.join(
|
|
60
|
+
add_extension_dir File.join(__dir__, 'sms')
|
|
61
|
+
load_vmodl(ENV['VMODL'] || File.join(__dir__, '../../vmodl.db'))
|
|
62
62
|
end
|
|
63
|
-
|
|
64
63
|
end
|
|
65
|
-
|
data/lib/rbvmomi/version.rb
CHANGED
data/lib/rbvmomi/vim.rb
CHANGED
|
@@ -34,7 +34,7 @@ module RbVmomi
|
|
|
34
34
|
opts[:port] ||= (opts[:ssl] ? 443 : 80)
|
|
35
35
|
opts[:path] ||= '/sdk'
|
|
36
36
|
opts[:ns] ||= 'urn:vim25'
|
|
37
|
-
opts[:rev] = '
|
|
37
|
+
opts[:rev] = '9.0' if opts[:rev].nil?
|
|
38
38
|
opts[:debug] = (!ENV['RBVMOMI_DEBUG'].empty? rescue false) unless opts.member? :debug
|
|
39
39
|
|
|
40
40
|
conn = new(opts).tap do |vim|
|
|
@@ -131,10 +131,9 @@ module RbVmomi
|
|
|
131
131
|
keys
|
|
132
132
|
end
|
|
133
133
|
|
|
134
|
-
add_extension_dir File.join(
|
|
134
|
+
add_extension_dir File.join(__dir__, 'vim')
|
|
135
135
|
(ENV['RBVMOMI_VIM_EXTENSION_PATH']||'').split(':').each { |dir| add_extension_dir dir }
|
|
136
136
|
|
|
137
|
-
load_vmodl(ENV['VMODL'] || File.join(
|
|
137
|
+
load_vmodl(ENV['VMODL'] || File.join(__dir__, '../../vmodl.db'))
|
|
138
138
|
end
|
|
139
|
-
|
|
140
139
|
end
|
data/lib/rbvmomi/vsan.rb
ADDED
data/lib/rbvmomi/vslm.rb
ADDED
data/lib/tasks/vmodl.rake
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require_relative './vmodl_helper'
|
|
4
|
+
require 'yaml'
|
|
5
|
+
require 'pathname'
|
|
4
6
|
|
|
5
7
|
namespace :vmodl do
|
|
6
8
|
desc 'Verify vmodl.db'
|
|
@@ -12,4 +14,15 @@ namespace :vmodl do
|
|
|
12
14
|
task :generate do
|
|
13
15
|
VmodlHelper.generate!
|
|
14
16
|
end
|
|
17
|
+
|
|
18
|
+
desc 'Convert vmodl.db to vmodl.yml'
|
|
19
|
+
task :to_yaml do
|
|
20
|
+
gem_root = Pathname.new(__dir__).join('../..')
|
|
21
|
+
db_path = gem_root.join('vmodl.db')
|
|
22
|
+
yml_path = gem_root.join('vmodl.yml')
|
|
23
|
+
|
|
24
|
+
vmodl_data = Marshal.load(File.binread(db_path))
|
|
25
|
+
|
|
26
|
+
File.write(yml_path, YAML.dump(vmodl_data))
|
|
27
|
+
end
|
|
15
28
|
end
|
data/lib/tasks/vmodl_helper.rb
CHANGED
|
@@ -7,6 +7,8 @@ require 'wsdl/parser'
|
|
|
7
7
|
require 'rbvmomi'
|
|
8
8
|
require 'rbvmomi/pbm'
|
|
9
9
|
require 'rbvmomi/sms'
|
|
10
|
+
require 'rbvmomi/vsan'
|
|
11
|
+
require 'rbvmomi/vslm'
|
|
10
12
|
|
|
11
13
|
class VmodlHelper
|
|
12
14
|
class << self
|
|
@@ -104,7 +106,7 @@ class VmodlHelper
|
|
|
104
106
|
vmodl_data = @vmodl[type_name] || build_wsdl_class!(type)
|
|
105
107
|
props_by_name = vmodl_data['props'].index_by { |prop| prop['name'] }
|
|
106
108
|
|
|
107
|
-
vmodl_data['props'] = wsdl_properties(type).
|
|
109
|
+
vmodl_data['props'] = wsdl_properties(type).flat_map do |element|
|
|
108
110
|
# NOTE we should prioritize the existing property hash over building a
|
|
109
111
|
# new one because the generic ManagedObjectReferences are manually
|
|
110
112
|
# replaced with their specific counterparts (e.g. Datastore) which
|
|
@@ -139,6 +141,8 @@ class VmodlHelper
|
|
|
139
141
|
vmodl_klass = wsdl_constantize(vmodl_prop['wsdl_type'])
|
|
140
142
|
wsdl_klass = wsdl_constantize(wsdl_prop.type.source)
|
|
141
143
|
|
|
144
|
+
next if vmodl_klass.nil? || wsdl_klass.nil?
|
|
145
|
+
|
|
142
146
|
vmodl_prop['wsdl_type'] = wsdl_klass.wsdl_name unless vmodl_klass <= wsdl_klass
|
|
143
147
|
end
|
|
144
148
|
end
|
|
@@ -197,13 +201,19 @@ class VmodlHelper
|
|
|
197
201
|
end
|
|
198
202
|
|
|
199
203
|
def build_vmodl_property(element)
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
204
|
+
# If the element is a Group then we have to recurse through the nested
|
|
205
|
+
# elements and build a vmodl property for each.
|
|
206
|
+
if element.kind_of?(WSDL::XMLSchema::Group)
|
|
207
|
+
element.content.elements.flat_map { |e| build_vmodl_property(e) }
|
|
208
|
+
else
|
|
209
|
+
{
|
|
210
|
+
'name' => element.name.name,
|
|
211
|
+
'is-optional' => element.minoccurs == 0,
|
|
212
|
+
'is-array' => element.maxoccurs != 1,
|
|
213
|
+
'version-id-ref' => nil,
|
|
214
|
+
'wsdl_type' => wsdl_to_vmodl_type(element.type)
|
|
215
|
+
}
|
|
216
|
+
end
|
|
207
217
|
end
|
|
208
218
|
|
|
209
219
|
def wsdl_properties(type)
|
|
@@ -239,7 +249,7 @@ class VmodlHelper
|
|
|
239
249
|
|
|
240
250
|
def wsdl_to_vmodl_type(type)
|
|
241
251
|
case type.source
|
|
242
|
-
when /vim25:/, /pbm:/, /sms:/
|
|
252
|
+
when /vim25:/, /pbm:/, /sms:/, /vsan:/, /vslm:/
|
|
243
253
|
vmodl_type = type.name == 'ManagedObjectReference' ? 'ManagedObject' : type.name
|
|
244
254
|
when /xsd:/
|
|
245
255
|
vmodl_type = type.source
|
|
@@ -251,16 +261,10 @@ class VmodlHelper
|
|
|
251
261
|
end
|
|
252
262
|
|
|
253
263
|
def wsdl_to_rbvmomi_namespace(type)
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
RbVmomi::PBM
|
|
259
|
-
when 'urn:sms'
|
|
260
|
-
RbVmomi::SMS
|
|
261
|
-
else
|
|
262
|
-
raise ArgumentError, "Unrecognized namespace [#{type}]"
|
|
263
|
-
end
|
|
264
|
+
ns = type.targetnamespace.split(':').last
|
|
265
|
+
ns = 'vim' if ns == 'vim25'
|
|
266
|
+
|
|
267
|
+
RbVmomi.const_get(ns.upcase, false)
|
|
264
268
|
end
|
|
265
269
|
|
|
266
270
|
# Normalize the type, some of these don't have RbVmomi equivalents such as xsd:long
|
data/vmodl.db
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rbvmomi2
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Adam Grare
|
|
8
8
|
- Jason Frey
|
|
9
|
-
autorequire:
|
|
10
9
|
bindir: exe
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
14
|
name: builder
|
|
@@ -93,14 +92,14 @@ dependencies:
|
|
|
93
92
|
requirements:
|
|
94
93
|
- - "~>"
|
|
95
94
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: 0.
|
|
95
|
+
version: 0.16.0
|
|
97
96
|
type: :development
|
|
98
97
|
prerelease: false
|
|
99
98
|
version_requirements: !ruby/object:Gem::Requirement
|
|
100
99
|
requirements:
|
|
101
100
|
- - "~>"
|
|
102
101
|
- !ruby/object:Gem::Version
|
|
103
|
-
version: 0.
|
|
102
|
+
version: 0.16.0
|
|
104
103
|
- !ruby/object:Gem::Dependency
|
|
105
104
|
name: rake
|
|
106
105
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -122,6 +121,9 @@ dependencies:
|
|
|
122
121
|
- - "~>"
|
|
123
122
|
- !ruby/object:Gem::Version
|
|
124
123
|
version: '1.0'
|
|
124
|
+
- - ">="
|
|
125
|
+
- !ruby/object:Gem::Version
|
|
126
|
+
version: 1.29.0
|
|
125
127
|
type: :development
|
|
126
128
|
prerelease: false
|
|
127
129
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -129,6 +131,9 @@ dependencies:
|
|
|
129
131
|
- - "~>"
|
|
130
132
|
- !ruby/object:Gem::Version
|
|
131
133
|
version: '1.0'
|
|
134
|
+
- - ">="
|
|
135
|
+
- !ruby/object:Gem::Version
|
|
136
|
+
version: 1.29.0
|
|
132
137
|
- !ruby/object:Gem::Dependency
|
|
133
138
|
name: simplecov
|
|
134
139
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -150,6 +155,9 @@ dependencies:
|
|
|
150
155
|
- - "~>"
|
|
151
156
|
- !ruby/object:Gem::Version
|
|
152
157
|
version: '2.0'
|
|
158
|
+
- - ">="
|
|
159
|
+
- !ruby/object:Gem::Version
|
|
160
|
+
version: 2.0.6
|
|
153
161
|
type: :development
|
|
154
162
|
prerelease: false
|
|
155
163
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -157,6 +165,9 @@ dependencies:
|
|
|
157
165
|
- - "~>"
|
|
158
166
|
- !ruby/object:Gem::Version
|
|
159
167
|
version: '2.0'
|
|
168
|
+
- - ">="
|
|
169
|
+
- !ruby/object:Gem::Version
|
|
170
|
+
version: 2.0.6
|
|
160
171
|
- !ruby/object:Gem::Dependency
|
|
161
172
|
name: test-unit
|
|
162
173
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -185,7 +196,6 @@ dependencies:
|
|
|
185
196
|
- - "~>"
|
|
186
197
|
- !ruby/object:Gem::Version
|
|
187
198
|
version: 0.9.36
|
|
188
|
-
description:
|
|
189
199
|
email:
|
|
190
200
|
- adam@grare.com
|
|
191
201
|
- fryguy9@gmail.com
|
|
@@ -237,6 +247,8 @@ files:
|
|
|
237
247
|
- lib/rbvmomi/vim/ServiceInstance.rb
|
|
238
248
|
- lib/rbvmomi/vim/Task.rb
|
|
239
249
|
- lib/rbvmomi/vim/VirtualMachine.rb
|
|
250
|
+
- lib/rbvmomi/vsan.rb
|
|
251
|
+
- lib/rbvmomi/vslm.rb
|
|
240
252
|
- lib/rbvmomi2.rb
|
|
241
253
|
- lib/tasks/vmodl.rake
|
|
242
254
|
- lib/tasks/vmodl_helper.rb
|
|
@@ -245,7 +257,6 @@ homepage: https://github.com/ManageIQ/rbvmomi2
|
|
|
245
257
|
licenses:
|
|
246
258
|
- MIT
|
|
247
259
|
metadata: {}
|
|
248
|
-
post_install_message:
|
|
249
260
|
rdoc_options: []
|
|
250
261
|
require_paths:
|
|
251
262
|
- lib
|
|
@@ -260,8 +271,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
260
271
|
- !ruby/object:Gem::Version
|
|
261
272
|
version: '0'
|
|
262
273
|
requirements: []
|
|
263
|
-
rubygems_version: 3.
|
|
264
|
-
signing_key:
|
|
274
|
+
rubygems_version: 3.6.7
|
|
265
275
|
specification_version: 4
|
|
266
276
|
summary: Ruby interface to the VMware vSphere API
|
|
267
277
|
test_files: []
|