vmware_web_service 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/VMwareWebService/MiqVimVm.rb +35 -6
- data/lib/VMwareWebService/version.rb +1 -1
- 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: f815f44db746241670dcf6aeccceb7ba06e5239f
|
4
|
+
data.tar.gz: ce92064c9ad563462157886144c386e79c07049d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a04a387bb2cf576b16aa39ed3bddccdd161f63ec23b80e69164539970175b28b912855042d3be7e19fa66400c6a4c5867f228867b686716c7b07d61bab2d21dc
|
7
|
+
data.tar.gz: 0db6b7d78d2c31c63ed1a3b8542551cc0bfdd5b9fc63f8880d8760922e43a78becf7932a5a08430729c6bf8ba9d16f85a0127a602ad00c4f1ff6c87c2d75b915
|
@@ -21,8 +21,13 @@ class MiqVimVm
|
|
21
21
|
VIRTUAL_SCSI_CONTROLLERS = %w( VirtualBusLogicController
|
22
22
|
VirtualLsiLogicController
|
23
23
|
VirtualLsiLogicSASController
|
24
|
-
ParaVirtualSCSIController
|
25
|
-
|
24
|
+
ParaVirtualSCSIController ).freeze
|
25
|
+
VIRTUAL_NICS = %w( VirtualE1000
|
26
|
+
VirtualE1000e
|
27
|
+
VirtualPCNet32
|
28
|
+
VirtualVmxnet
|
29
|
+
VirtualVmxnet2
|
30
|
+
VirtualVmxnet3 ).freeze
|
26
31
|
MAX_SCSI_DEVICES = 15
|
27
32
|
MAX_SCSI_CONTROLLERS = 4
|
28
33
|
|
@@ -915,15 +920,39 @@ class MiqVimVm
|
|
915
920
|
# associated with the given backing file.
|
916
921
|
#
|
917
922
|
def getDeviceKeysByBacking(backingFile, hardware = nil)
|
918
|
-
|
923
|
+
dev = getDeviceByBacking(backingFile, hardware)
|
924
|
+
return [nil, nil] if dev.nil?
|
925
|
+
[dev["controllerKey"], dev["key"]]
|
926
|
+
end
|
927
|
+
|
928
|
+
#
|
929
|
+
# Returns the device details
|
930
|
+
# associated with the given backing file.
|
931
|
+
#
|
932
|
+
def getDeviceByBacking(backingFile, hardware = nil)
|
933
|
+
hardware ||= getHardware
|
919
934
|
|
920
935
|
hardware["device"].to_a.each do |dev|
|
921
936
|
next if dev.xsiType != "VirtualDisk"
|
922
937
|
next if dev["backing"]["fileName"] != backingFile
|
923
|
-
return
|
938
|
+
return dev
|
924
939
|
end
|
925
|
-
|
926
|
-
end
|
940
|
+
nil
|
941
|
+
end
|
942
|
+
|
943
|
+
def getDeviceKeysByLabel(device_label)
|
944
|
+
hardware = getHardware
|
945
|
+
hardware["device"].to_a.each do |dev|
|
946
|
+
next unless VIRTUAL_NICS.include?(dev.xsiType)
|
947
|
+
next unless dev["deviceInfo"]["label"] == device_label
|
948
|
+
controller_key = dev["controllerKey"]
|
949
|
+
key = dev["key"]
|
950
|
+
unit_number = dev["unitNumber"]
|
951
|
+
return controller_key, key, unit_number
|
952
|
+
end
|
953
|
+
# controller_key, key, unit_number
|
954
|
+
[nil, nil, nil]
|
955
|
+
end
|
927
956
|
|
928
957
|
#####################
|
929
958
|
# Miq Alarm methods.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vmware_web_service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ManageIQ Developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|