rbvmomi2 3.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -25
  3. data/exe/rbvmomish +50 -48
  4. data/lib/rbvmomi/basic_types.rb +318 -294
  5. data/lib/rbvmomi/connection.rb +221 -216
  6. data/lib/rbvmomi/deserialization.rb +201 -205
  7. data/lib/rbvmomi/fault.rb +10 -9
  8. data/lib/rbvmomi/optimist.rb +51 -50
  9. data/lib/rbvmomi/pbm.rb +52 -50
  10. data/lib/rbvmomi/sms/SmsStorageManager.rb +2 -1
  11. data/lib/rbvmomi/sms.rb +48 -46
  12. data/lib/rbvmomi/sso.rb +13 -18
  13. data/lib/rbvmomi/trivial_soap.rb +9 -8
  14. data/lib/rbvmomi/type_loader.rb +100 -101
  15. data/lib/rbvmomi/utils/admission_control.rb +90 -106
  16. data/lib/rbvmomi/utils/deploy.rb +77 -85
  17. data/lib/rbvmomi/utils/leases.rb +31 -33
  18. data/lib/rbvmomi/utils/perfdump.rb +177 -207
  19. data/lib/rbvmomi/version.rb +2 -1
  20. data/lib/rbvmomi/vim/ComputeResource.rb +17 -15
  21. data/lib/rbvmomi/vim/Datacenter.rb +1 -0
  22. data/lib/rbvmomi/vim/Datastore.rb +18 -15
  23. data/lib/rbvmomi/vim/DynamicTypeMgrAllTypeInfo.rb +7 -6
  24. data/lib/rbvmomi/vim/DynamicTypeMgrDataTypeInfo.rb +3 -2
  25. data/lib/rbvmomi/vim/DynamicTypeMgrManagedTypeInfo.rb +7 -6
  26. data/lib/rbvmomi/vim/Folder.rb +37 -33
  27. data/lib/rbvmomi/vim/HostSystem.rb +139 -136
  28. data/lib/rbvmomi/vim/ManagedEntity.rb +15 -14
  29. data/lib/rbvmomi/vim/ManagedObject.rb +11 -10
  30. data/lib/rbvmomi/vim/ObjectContent.rb +3 -1
  31. data/lib/rbvmomi/vim/ObjectUpdate.rb +3 -1
  32. data/lib/rbvmomi/vim/OvfManager.rb +50 -57
  33. data/lib/rbvmomi/vim/PerfCounterInfo.rb +4 -3
  34. data/lib/rbvmomi/vim/PerformanceManager.rb +28 -31
  35. data/lib/rbvmomi/vim/PropertyCollector.rb +8 -7
  36. data/lib/rbvmomi/vim/ReflectManagedMethodExecuter.rb +22 -21
  37. data/lib/rbvmomi/vim/ResourcePool.rb +19 -18
  38. data/lib/rbvmomi/vim/ServiceInstance.rb +8 -7
  39. data/lib/rbvmomi/vim/Task.rb +6 -5
  40. data/lib/rbvmomi/vim/VirtualMachine.rb +8 -7
  41. data/lib/rbvmomi/vim.rb +112 -129
  42. data/lib/rbvmomi.rb +1 -0
  43. metadata +54 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a9290a6ccd179ef5e0dddb1d0956a1ba976a368ceb1534b44b13024fbe7a2fb5
4
- data.tar.gz: 2cb20596b8f3cef9db32468e2f110f3abdcef70235a466efe81726259a650ea7
3
+ metadata.gz: d34ef12391cd295ad859e953162f145e58266a7ff08273af472c5c9a1d165fc9
4
+ data.tar.gz: 661da76f808d7aa9ea90903c1c6f10157b19570a2ef74e9b9bc0ddfb30b1108f
5
5
  SHA512:
6
- metadata.gz: 8238c2c399f04f57930ac7bb2437de3eb2abc16723700366a6c57c97076f9043e342393bca69cc511ebe1fe91d9df354149144cff04f859c8178471fe5644381
7
- data.tar.gz: ed586f8b93ded01b4ade32d1c4e95b1e349c94584084db14e83a6433b011e0c70f85a6df7674ac4228e1bc4d7d94814ba91bb0d2cb55f84bcfd828dc6fc802bf
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
- [<img src="https://travis-ci.org/vmware/rbvmomi.svg?branch=master" alt="travis-ci">](http://travis-ci.org/vmware/rbvmomi)
4
+ ![Test](https://github.com/ManageIQ/rbvmomi2/workflows/Test/badge.svg)
5
+ ![Lint](https://github.com/ManageIQ/rbvmomi2/workflows/Lint/badge.svg)
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 VMware. It is built and
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 6.5 API. RbVmomi specific documentation is
15
- [online](http://rdoc.info/github/vmware/rbvmomi/master/frames) and is meant to
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 rbvmomi
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/vmware/rbvmomi/pulls) so it can be merged back in
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/vmware/rbvmomi/issues)
109
- or fork the project on [GitHub](https://github.com/vmware/rbvmomi) and send a
110
- [pull request](https://github.com/vmware/rbvmomi/pulls).
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) or join the [VMware {code} Slack team](https://vmwarecode.slack.com/) and join the [#rbvmomi channel](https://vmwarecode.slack.com/messages/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 <<-EOS
14
- vSphere API console.
15
-
16
- Usage:
17
- rbvmomish [options]
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 <<-EOS
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 "Properties:"
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 "Methods:"
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
- input = Readline.readline("#{opts[:host]}> ", false) or break
114
- input = input.strip
115
- next if input.empty?
116
-
117
- (history.puts input; Readline::HISTORY << input) unless input == Readline::HISTORY.to_a[-1]
118
-
119
- result = eval(input, $binding)
120
- if input =~ /\#$/
121
- type result.class.wsdl_name
122
- else
123
- pp result unless result == :no_result
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