rbvmomi2 3.0.0 → 3.0.1
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 +11 -25
- data/exe/rbvmomish +50 -48
- data/lib/rbvmomi/basic_types.rb +318 -294
- data/lib/rbvmomi/connection.rb +221 -216
- data/lib/rbvmomi/deserialization.rb +201 -205
- data/lib/rbvmomi/fault.rb +10 -9
- data/lib/rbvmomi/optimist.rb +51 -50
- data/lib/rbvmomi/pbm.rb +52 -50
- data/lib/rbvmomi/sms/SmsStorageManager.rb +2 -1
- data/lib/rbvmomi/sms.rb +48 -46
- data/lib/rbvmomi/sso.rb +13 -18
- data/lib/rbvmomi/trivial_soap.rb +9 -8
- data/lib/rbvmomi/type_loader.rb +100 -101
- data/lib/rbvmomi/utils/admission_control.rb +90 -106
- data/lib/rbvmomi/utils/deploy.rb +77 -85
- data/lib/rbvmomi/utils/leases.rb +31 -33
- data/lib/rbvmomi/utils/perfdump.rb +177 -207
- data/lib/rbvmomi/version.rb +2 -1
- data/lib/rbvmomi/vim/ComputeResource.rb +17 -15
- data/lib/rbvmomi/vim/Datacenter.rb +1 -0
- data/lib/rbvmomi/vim/Datastore.rb +18 -15
- data/lib/rbvmomi/vim/DynamicTypeMgrAllTypeInfo.rb +7 -6
- data/lib/rbvmomi/vim/DynamicTypeMgrDataTypeInfo.rb +3 -2
- data/lib/rbvmomi/vim/DynamicTypeMgrManagedTypeInfo.rb +7 -6
- data/lib/rbvmomi/vim/Folder.rb +37 -33
- data/lib/rbvmomi/vim/HostSystem.rb +139 -136
- data/lib/rbvmomi/vim/ManagedEntity.rb +15 -14
- data/lib/rbvmomi/vim/ManagedObject.rb +11 -10
- data/lib/rbvmomi/vim/ObjectContent.rb +3 -1
- data/lib/rbvmomi/vim/ObjectUpdate.rb +3 -1
- data/lib/rbvmomi/vim/OvfManager.rb +50 -57
- data/lib/rbvmomi/vim/PerfCounterInfo.rb +4 -3
- data/lib/rbvmomi/vim/PerformanceManager.rb +28 -31
- data/lib/rbvmomi/vim/PropertyCollector.rb +8 -7
- data/lib/rbvmomi/vim/ReflectManagedMethodExecuter.rb +22 -21
- data/lib/rbvmomi/vim/ResourcePool.rb +19 -18
- data/lib/rbvmomi/vim/ServiceInstance.rb +8 -7
- data/lib/rbvmomi/vim/Task.rb +6 -5
- data/lib/rbvmomi/vim/VirtualMachine.rb +8 -7
- data/lib/rbvmomi/vim.rb +112 -129
- data/lib/rbvmomi.rb +1 -0
- metadata +54 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d34ef12391cd295ad859e953162f145e58266a7ff08273af472c5c9a1d165fc9
|
4
|
+
data.tar.gz: 661da76f808d7aa9ea90903c1c6f10157b19570a2ef74e9b9bc0ddfb30b1108f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8073e399abfc3dcabc569a9e80daad2ec2024dda355167c61fbded973b44f94b2b4474f8bf8ebe854b87e2e2e1514391202f0584d4f64664b8b123c4b2c462d3
|
7
|
+
data.tar.gz: 5794ea5f1524626c144760feb120007eb95b9263efa95ebb8fd2f2dfa76638e4df9803c586e316fbb52a28ae107712775e9a76142a3e37e12e22306132ccae83
|
data/README.md
CHANGED
@@ -1,38 +1,24 @@
|
|
1
1
|
# RbVmomi
|
2
2
|
|
3
3
|
[<img src="https://badge.fury.io/rb/rbvmomi.svg" alt="gem-version">](https://rubygems.org/gems/rbvmomi)
|
4
|
-
[
|
4
|
+

|
5
|
+

|
5
6
|
[<img src="https://badges.gitter.im/vmware/rbvmomi.svg">](https://gitter.im/vmware/rbvmomi)
|
6
7
|
|
7
|
-
This is a community-supported, open source project at
|
8
|
+
This is a community-supported, open source project at ManageIQ. It is built and
|
8
9
|
maintained by programmers like you!
|
9
10
|
|
10
11
|
## Introduction
|
11
12
|
|
12
13
|
RbVmomi is a Ruby interface to the vSphere API. Like the Perl and Java SDKs,
|
13
14
|
you can use it to manage ESX and vCenter servers. The current release
|
14
|
-
supports the vSphere
|
15
|
-
[online](http://rdoc.info/github/
|
15
|
+
supports the vSphere 7.0 API. RbVmomi specific documentation is
|
16
|
+
[online](http://rdoc.info/github/ManageIQ/rbvmomi2/master/frames) and is meant to
|
16
17
|
be used alongside the official [documentation](http://pubs.vmware.com/vsphere-65/index.jsp#com.vmware.wssdk.apiref.doc/right-pane.html).
|
17
18
|
|
18
19
|
## Installation
|
19
20
|
|
20
|
-
gem install
|
21
|
-
|
22
|
-
### Support for older Ruby versions
|
23
|
-
|
24
|
-
RbVmomi supports Ruby 1.8.7 and higher, but certain dependencies may need
|
25
|
-
pinning to older versions to get a compatible set of gems.
|
26
|
-
|
27
|
-
On Ruby 1.8.7:
|
28
|
-
|
29
|
-
* use `nokogiri` 1.5.x (Gemfile: `gem 'nokogiri', '< 1.6'`)
|
30
|
-
|
31
|
-
|
32
|
-
On both Ruby 1.9 and 1.8.7:
|
33
|
-
|
34
|
-
* use `json` 1.x (Gemfile: `gem 'json', '< 2'`)
|
35
|
-
|
21
|
+
gem install rbvmomi2
|
36
22
|
|
37
23
|
## Usage
|
38
24
|
|
@@ -101,14 +87,14 @@ A few important points:
|
|
101
87
|
|
102
88
|
Built-in extensions are under `lib/rbvmomi/vim/`. You are encouraged to reopen
|
103
89
|
VIM classes in your applications and add extensions of your own. If you write
|
104
|
-
something generally useful please open a [pull request](https://github.com/
|
90
|
+
something generally useful please open a [pull request](https://github.com/ManageIQ/rbvmomi2/pulls) so it can be merged back in
|
105
91
|
|
106
92
|
## Development
|
107
93
|
|
108
|
-
Open an issue on the [issues page](https://github.com/
|
109
|
-
or fork the project on [GitHub](https://github.com/
|
110
|
-
[pull request](https://github.com/
|
94
|
+
Open an issue on the [issues page](https://github.com/ManageIQ/rbvmomi2/issues)
|
95
|
+
or fork the project on [GitHub](https://github.com/ManageIQ/rbvmomi2) and send a
|
96
|
+
[pull request](https://github.com/ManageIQ/rbvmomi2/pulls).
|
111
97
|
|
112
98
|
## Support
|
113
99
|
|
114
|
-
You can chat on [Gitter](https://gitter.im/vmware/rbvmomi)
|
100
|
+
You can chat on [Gitter](https://gitter.im/vmware/rbvmomi)
|
data/exe/rbvmomish
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
# TODO keepalive
|
3
4
|
# TODO rc file
|
4
5
|
# TODO proxy support?
|
@@ -10,29 +11,29 @@ require 'rbvmomi/optimist'
|
|
10
11
|
VIM = RbVmomi::VIM
|
11
12
|
|
12
13
|
opts = Optimist.options do
|
13
|
-
banner
|
14
|
-
vSphere API console.
|
15
|
-
|
16
|
-
Usage:
|
17
|
-
|
18
|
-
|
19
|
-
Predefined methods:
|
20
|
-
conn: Returns the VIM connection
|
21
|
-
si: Returns the ServiceInstance
|
22
|
-
help: Displays this text.
|
23
|
-
|
24
|
-
Special syntax:
|
25
|
-
Adding a '#' suffix to an expression displays information about the type of the
|
26
|
-
result, including its properties and methods, instead of the value.
|
27
|
-
|
28
|
-
VIM connection options:
|
14
|
+
banner <<~EOS
|
15
|
+
vSphere API console.
|
16
|
+
#{}
|
17
|
+
Usage:
|
18
|
+
rbvmomish [options]
|
19
|
+
#{}
|
20
|
+
Predefined methods:
|
21
|
+
conn: Returns the VIM connection
|
22
|
+
si: Returns the ServiceInstance
|
23
|
+
help: Displays this text.
|
24
|
+
#{}
|
25
|
+
Special syntax:
|
26
|
+
Adding a '#' suffix to an expression displays information about the type of the
|
27
|
+
result, including its properties and methods, instead of the value.
|
28
|
+
#{}
|
29
|
+
VIM connection options:
|
29
30
|
EOS
|
30
31
|
|
31
32
|
rbvmomi_connection_opts
|
32
33
|
|
33
|
-
text
|
34
|
-
|
35
|
-
Other options:
|
34
|
+
text <<~EOS
|
35
|
+
#{}
|
36
|
+
Other options:
|
36
37
|
EOS
|
37
38
|
|
38
39
|
$optimist = self
|
@@ -45,9 +46,10 @@ rescue Errno::EHOSTUNREACH
|
|
45
46
|
end
|
46
47
|
|
47
48
|
typenames = VIM.loader.typenames
|
48
|
-
Readline.completion_append_character =
|
49
|
+
Readline.completion_append_character = ' '
|
49
50
|
Readline.completion_proc = lambda do |word|
|
50
51
|
return unless word
|
52
|
+
|
51
53
|
prefix_regex = /^#{Regexp.escape(word)}/
|
52
54
|
candidates = typenames.sort
|
53
55
|
candidates.find_all { |e| e.match(prefix_regex) }
|
@@ -68,13 +70,13 @@ def type name
|
|
68
70
|
elsif klass < VIM::ManagedObject
|
69
71
|
puts "Managed Object #{klass}"
|
70
72
|
puts
|
71
|
-
puts
|
73
|
+
puts 'Properties:'
|
72
74
|
klass.full_props_desc.each do |desc|
|
73
75
|
puts " #{desc['name']}: #{q[desc['wsdl_type']]}#{desc['is-array'] ? '[]' : ''}"
|
74
76
|
end
|
75
77
|
puts
|
76
|
-
puts
|
77
|
-
klass.full_methods_desc.sort_by(&:first).each do |name,desc|
|
78
|
+
puts 'Methods:'
|
79
|
+
klass.full_methods_desc.sort_by(&:first).each do |name, desc|
|
78
80
|
params = desc['params']
|
79
81
|
puts " #{name}(#{params.map { |x| "#{x['name']} : #{q[x['wsdl_type'] || 'void']}#{x['is-array'] ? '[]' : ''}" } * ', '}) : #{q[desc['result']['wsdl_type'] || 'void']}"
|
80
82
|
end
|
@@ -109,30 +111,30 @@ end
|
|
109
111
|
$binding = $vim.instance_eval { binding }
|
110
112
|
|
111
113
|
loop do
|
112
|
-
begin
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
114
|
+
begin
|
115
|
+
input = Readline.readline("#{opts[:host]}> ", false) or break
|
116
|
+
input = input.strip
|
117
|
+
next if input.empty?
|
118
|
+
|
119
|
+
(history.puts input; Readline::HISTORY << input) unless input == Readline::HISTORY.to_a[-1]
|
120
|
+
|
121
|
+
result = eval(input, $binding)
|
122
|
+
if input =~ /\#$/
|
123
|
+
type result.class.wsdl_name
|
124
|
+
else
|
125
|
+
pp result unless result == :no_result
|
126
|
+
end
|
127
|
+
rescue SystemExit, IOError
|
128
|
+
raise
|
129
|
+
rescue RuntimeError, RbVmomi::Fault
|
130
|
+
puts "#{$!.class}: #{$!.message}"
|
131
|
+
puts $!.backtrace * "\n"
|
132
|
+
rescue UserError
|
133
|
+
puts $!.message
|
134
|
+
rescue Interrupt
|
135
|
+
puts
|
136
|
+
rescue Exception
|
137
|
+
puts "#{$!.class}: #{$!.message}"
|
138
|
+
puts $!.backtrace * "\n"
|
124
139
|
end
|
125
|
-
rescue SystemExit, IOError
|
126
|
-
raise
|
127
|
-
rescue RuntimeError, RbVmomi::Fault
|
128
|
-
puts "#{$!.class}: #{$!.message}"
|
129
|
-
puts $!.backtrace * "\n"
|
130
|
-
rescue UserError
|
131
|
-
puts $!.message
|
132
|
-
rescue Interrupt
|
133
|
-
puts
|
134
|
-
rescue Exception
|
135
|
-
puts "#{$!.class}: #{$!.message}"
|
136
|
-
puts $!.backtrace * "\n"
|
137
|
-
end
|
138
140
|
end
|