rbvmomi 1.10.0 → 1.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 633f56e0603df47ca5f133a251e158a985a00bcf
4
- data.tar.gz: 5062e22c36fac015dcd57c5a7482f9c1024d0c3d
3
+ metadata.gz: 0ca855eb3fa447acc840c1079e5e85068482cfe1
4
+ data.tar.gz: 032e7e726efcd4ecf9a5fa2e2214a857da4e0983
5
5
  SHA512:
6
- metadata.gz: 72e97787a18e48380aac6e4ea9d7d24558a77c272226508dbf1035e93ef77d8fc81335ac55fb848cf7b882a44d0660f03d2e7bc38c235bc6eaa4eca961735b5d
7
- data.tar.gz: 8d50ce8c7d7f2bffb2a53cd96eed42f61b5222b6036f3ac3e20daf2f4b59cb2697e37427ac43f888de5b463b257fafe96f56961fb369771a6aa1884ef6ff619c
6
+ metadata.gz: afe2cff3f7d74de1020758f16d41603e674b0efe7cd8949b13d11ae28bd4918e810ac3b8126a0d3bdd50ca487bb2d8bc3306de1c1e926ae593f831d98d5c5f14
7
+ data.tar.gz: 18b0195220d18e5e6b26928c2de27a3528262eceeb090f30d53291da432e10a19abea4b493dc5117d66eaaa6ae83bc660b0851eb78373fcdd9c1f5d8309a56ed
data/.travis.yml CHANGED
@@ -2,9 +2,10 @@ language: ruby
2
2
  rvm:
3
3
  - 1.8.7
4
4
  - 1.9.3
5
- - 2.2.5
6
- - 2.3.1
7
- - jruby-1.7.25
8
- - jruby-9.1.2.0
5
+ - 2.2.6
6
+ - 2.3.3
7
+ - 2.4.0
8
+ - jruby-1.7.26
9
+ - jruby-9.1.8.0
9
10
  before_install:
10
11
  - gem install bundler
data/README.rdoc CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  {<img src="https://badge.fury.io/rb/rbvmomi.svg" alt="gem-version">}[https://rubygems.org/gems/rbvmomi]
4
4
  {<img src="https://travis-ci.org/vmware/rbvmomi.svg?branch=master" alt="travis-ci">}[http://travis-ci.org/vmware/rbvmomi]
5
+ {<img src="https://badges.gitter.im/vmware/rbvmomi.svg">}[https://gitter.im/vmware/rbvmomi]
5
6
 
6
7
  This is a community-supported, open source project at VMware. It is built and maintained by programmers like you!
7
8
 
@@ -97,3 +98,8 @@ can be merged back in
97
98
 
98
99
  Open an issue on the {issues page}[https://github.com/vmware/rbvmomi/issues] or
99
100
  fork the project on {GitHub}[https://github.com/vmware/rbvmomi] and send a {pull request}[https://github.com/vmware/rbvmomi/pulls].
101
+
102
+ == Support
103
+
104
+ You can chat on {Gitter}[https://gitter.im/vmware/rbvmomi] or join the {VMware \{code} Slack team}[https://vmwarecode.slack.com/]
105
+ and join the {#rbvmomi channel}[https://vmwarecode.slack.com/messages/rbvmomi].
@@ -8,7 +8,7 @@ require 'net/http'
8
8
  require 'pp'
9
9
 
10
10
  class RbVmomi::TrivialSoap
11
- attr_accessor :debug, :cookie
11
+ attr_accessor :debug, :cookie, :operation_id
12
12
  attr_reader :http
13
13
 
14
14
  def initialize opts
@@ -17,6 +17,7 @@ class RbVmomi::TrivialSoap
17
17
  return unless @opts[:host] # for testcases
18
18
  @debug = @opts[:debug]
19
19
  @cookie = @opts[:cookie]
20
+ @operation_id = @opts[:operation_id]
20
21
  @lock = Mutex.new
21
22
  @http = nil
22
23
  restart_http
@@ -64,11 +65,13 @@ class RbVmomi::TrivialSoap
64
65
  xsi = 'http://www.w3.org/2001/XMLSchema-instance'
65
66
  xml = Builder::XmlMarkup.new :indent => 0
66
67
  xml.tag!('env:Envelope', 'xmlns:xsd' => xsd, 'xmlns:env' => env, 'xmlns:xsi' => xsi) do
67
- if @vcSessionCookie
68
+ if @vcSessionCookie || @operation_id
68
69
  xml.tag!('env:Header') do
69
- xml.tag!('vcSessionCookie', @vcSessionCookie)
70
+ xml.tag!('vcSessionCookie', @vcSessionCookie) if @vcSessionCookie
71
+ xml.tag!('operationID', @operation_id) if @operation_id
70
72
  end
71
73
  end
74
+
72
75
  xml.tag!('env:Body') do
73
76
  yield xml if block_given?
74
77
  end
@@ -2,5 +2,5 @@
2
2
  # SPDX-License-Identifier: MIT
3
3
 
4
4
  module RbVmomi
5
- VERSION = '1.10.0'.freeze
5
+ VERSION = '1.11.0'.freeze
6
6
  end
data/lib/rbvmomi/vim.rb CHANGED
@@ -27,6 +27,7 @@ class VIM < Connection
27
27
  # @option opts [String] :password Password.
28
28
  # @option opts [String] :path (/sdk) SDK endpoint path.
29
29
  # @option opts [Boolean] :debug (false) If true, print SOAP traffic to stderr.
30
+ # @option opts [String] :operation_id If set, use for operationID
30
31
  def self.connect opts
31
32
  fail unless opts.is_a? Hash
32
33
  fail "host option required" unless opts[:host]
@@ -41,19 +41,23 @@ class RbVmomi::VIM::Folder
41
41
  x if x.is_a? type
42
42
  end
43
43
 
44
- # Retrieve a virtual machine or host by BIOS UUID.
45
- # @param uuid [String] The UUID to find.
46
- # @param type [Class] Return nil unless the found entity <tt>is_a? type</tt>.
47
- # @param dc [RbVmomi::VIM::Datacenter] Restricts the query to entities in the given Datacenter.
44
+ # Finds a virtual machine or host by BIOS or instance UUID
45
+ #
46
+ # @param uuid [String] UUID to find
47
+ # @param type [Class] return nil unless found entity <tt>is_a?(type)</tt>
48
+ # @param dc [RbVmomi::VIM::Datacenter] restricts query to specified datacenter
49
+ #
48
50
  # @return [VIM::ManagedEntity]
49
- def findByUuid uuid, type=RbVmomi::VIM::VirtualMachine, dc=nil
50
- propSpecs = {
51
- :entity => self, :uuid => uuid, :instanceUuid => false,
52
- :vmSearch => type == RbVmomi::VIM::VirtualMachine
51
+ def findByUuid(uuid, type = RbVmomi::VIM::VirtualMachine, dc = nil, instance_uuid = false)
52
+ prop_specs = {
53
+ :entity => self,
54
+ :instanceUuid => instance_uuid,
55
+ :uuid => uuid,
56
+ :vmSearch => type == RbVmomi::VIM::VirtualMachine
53
57
  }
54
- propSpecs[:datacenter] = dc if dc
55
- x = _connection.searchIndex.FindByUuid(propSpecs)
56
- x if x.is_a? type
58
+ prop_specs[:datacenter] = dc if dc
59
+ x = _connection.searchIndex.FindByUuid(prop_specs)
60
+ x if x.is_a?(type)
57
61
  end
58
62
 
59
63
  # Retrieve a managed entity by inventory path.
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: 1.10.0
4
+ version: 1.11.0
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: 2017-03-10 00:00:00.000000000 Z
12
+ date: 2017-04-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: builder