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 +4 -4
- data/.travis.yml +5 -4
- data/README.rdoc +6 -0
- data/lib/rbvmomi/trivial_soap.rb +6 -3
- data/lib/rbvmomi/version.rb +1 -1
- data/lib/rbvmomi/vim.rb +1 -0
- data/lib/rbvmomi/vim/Folder.rb +15 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ca855eb3fa447acc840c1079e5e85068482cfe1
|
4
|
+
data.tar.gz: 032e7e726efcd4ecf9a5fa2e2214a857da4e0983
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afe2cff3f7d74de1020758f16d41603e674b0efe7cd8949b13d11ae28bd4918e810ac3b8126a0d3bdd50ca487bb2d8bc3306de1c1e926ae593f831d98d5c5f14
|
7
|
+
data.tar.gz: 18b0195220d18e5e6b26928c2de27a3528262eceeb090f30d53291da432e10a19abea4b493dc5117d66eaaa6ae83bc660b0851eb78373fcdd9c1f5d8309a56ed
|
data/.travis.yml
CHANGED
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].
|
data/lib/rbvmomi/trivial_soap.rb
CHANGED
@@ -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
|
data/lib/rbvmomi/version.rb
CHANGED
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]
|
data/lib/rbvmomi/vim/Folder.rb
CHANGED
@@ -41,19 +41,23 @@ class RbVmomi::VIM::Folder
|
|
41
41
|
x if x.is_a? type
|
42
42
|
end
|
43
43
|
|
44
|
-
#
|
45
|
-
#
|
46
|
-
# @param
|
47
|
-
# @param
|
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
|
50
|
-
|
51
|
-
:entity
|
52
|
-
:
|
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
|
-
|
55
|
-
x = _connection.searchIndex.FindByUuid(
|
56
|
-
x if x.is_a?
|
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.
|
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-
|
12
|
+
date: 2017-04-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: builder
|