ibm_power_hmc 0.8.3 → 0.8.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_local.yml +2 -0
- data/Rakefile +4 -0
- data/ibm_power_hmc.gemspec +2 -0
- data/lib/ibm_power_hmc/connection.rb +13 -1
- data/lib/ibm_power_hmc/parser.rb +48 -2
- data/lib/ibm_power_hmc/pcm.rb +1 -1
- data/lib/ibm_power_hmc/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16483135f26b1c5fd1783c55cb0d83f7e195562cda7f5859d5f1470432a1c8a9
|
4
|
+
data.tar.gz: d41ef9a0875f0b0400d619e9586083a0bdb985b8f36cc90e9869c5063e31e3fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c3aa1f9bd1e5c0994b82046fda92f5d31ef05b2f8d280f59820ad2b8ad986c5bb46e905d844e67caa5739ab3df413d822ae1f12b41777e1dcc2d265974e07f6
|
7
|
+
data.tar.gz: 7948cc93b4835d3e421292345faaa5622d5fdea6123ff1e234f2e8345845b262c98fd5a0b8d4e1a88de28ac0b507b4a2c1a0824d5456a308e1296446596f4bb0
|
data/.rubocop_local.yml
CHANGED
data/Rakefile
CHANGED
data/ibm_power_hmc.gemspec
CHANGED
@@ -196,6 +196,18 @@ module IbmPowerHmc
|
|
196
196
|
Parser.new(response.body).object(:VirtualIOServer)
|
197
197
|
end
|
198
198
|
|
199
|
+
##
|
200
|
+
# @!method groups
|
201
|
+
# Retrieve the list of groups defined on the HMC.
|
202
|
+
# A logical partition, a virtual I/O server or a managed system can be
|
203
|
+
# associated with multiple group tags.
|
204
|
+
# @return [Array<IbmPowerHmc::Group>] The list of groups.
|
205
|
+
def groups
|
206
|
+
method_url = "/rest/api/uom/Group"
|
207
|
+
response = request(:get, method_url)
|
208
|
+
FeedParser.new(response.body).objects(:Group)
|
209
|
+
end
|
210
|
+
|
199
211
|
##
|
200
212
|
# @!method virtual_switches(sys_uuid)
|
201
213
|
# Retrieve the list of virtual switches from a specified managed system.
|
@@ -612,7 +624,7 @@ module IbmPowerHmc
|
|
612
624
|
|
613
625
|
# Try to parse body as an HttpErrorResponse
|
614
626
|
unless err.response.nil?
|
615
|
-
resp = Parser.new(err.response.body).object(:HttpErrorResponse)
|
627
|
+
resp = Parser.new(err.response.body).object(:HttpErrorResponse) rescue nil
|
616
628
|
unless resp.nil?
|
617
629
|
@uri = resp.uri
|
618
630
|
@reason = resp.reason
|
data/lib/ibm_power_hmc/parser.rb
CHANGED
@@ -197,7 +197,8 @@ module IbmPowerHmc
|
|
197
197
|
:name => "ManagementConsoleName",
|
198
198
|
:build_level => "VersionInfo/BuildLevel",
|
199
199
|
:version => "BaseVersion",
|
200
|
-
:ssh_pubkey => "PublicSSHKeyValue"
|
200
|
+
:ssh_pubkey => "PublicSSHKeyValue",
|
201
|
+
:uvmid => "UVMID"
|
201
202
|
}.freeze
|
202
203
|
|
203
204
|
def managed_systems_uuids
|
@@ -218,6 +219,9 @@ module IbmPowerHmc
|
|
218
219
|
:state => "State",
|
219
220
|
:hostname => "Hostname",
|
220
221
|
:ipaddr => "PrimaryIPAddress",
|
222
|
+
:description => "Description",
|
223
|
+
:location => "SystemLocation", # Rack/Unit
|
224
|
+
:ref_code => "ReferenceCode",
|
221
225
|
:fwversion => "SystemFirmware",
|
222
226
|
:memory => "AssociatedSystemMemoryConfiguration/InstalledSystemMemory",
|
223
227
|
:avail_mem => "AssociatedSystemMemoryConfiguration/CurrentAvailableSystemMemory",
|
@@ -230,6 +234,20 @@ module IbmPowerHmc
|
|
230
234
|
:vtpm_lpars => "AssociatedSystemSecurity/AvailableVirtualTrustedPlatformModulePartitions"
|
231
235
|
}.freeze
|
232
236
|
|
237
|
+
def group_uuids
|
238
|
+
uuids_from_links("AssociatedGroups")
|
239
|
+
end
|
240
|
+
|
241
|
+
def time
|
242
|
+
Time.at(0, singleton("SystemTime").to_i, :millisecond).utc
|
243
|
+
end
|
244
|
+
|
245
|
+
def capabilities
|
246
|
+
xml.get_elements("AssociatedSystemCapabilities/*").map do |elem|
|
247
|
+
elem.name unless elem.text&.strip != "true"
|
248
|
+
end.compact
|
249
|
+
end
|
250
|
+
|
233
251
|
def cpu_compat_modes
|
234
252
|
xml.get_elements("AssociatedSystemProcessorConfiguration/SupportedPartitionProcessorCompatibilityModes").map do |elem|
|
235
253
|
elem.text&.strip
|
@@ -285,7 +303,8 @@ module IbmPowerHmc
|
|
285
303
|
:ref_code => "ReferenceCode",
|
286
304
|
:procs => "PartitionProcessorConfiguration/CurrentDedicatedProcessorConfiguration/CurrentProcessors",
|
287
305
|
:proc_units => "PartitionProcessorConfiguration/CurrentSharedProcessorConfiguration/CurrentProcessingUnits",
|
288
|
-
:vprocs => "PartitionProcessorConfiguration/CurrentSharedProcessorConfiguration/AllocatedVirtualProcessors"
|
306
|
+
:vprocs => "PartitionProcessorConfiguration/CurrentSharedProcessorConfiguration/AllocatedVirtualProcessors",
|
307
|
+
:description => "Description"
|
289
308
|
}.freeze
|
290
309
|
|
291
310
|
def sys_uuid
|
@@ -293,6 +312,10 @@ module IbmPowerHmc
|
|
293
312
|
uuid_from_href(href) unless href.nil?
|
294
313
|
end
|
295
314
|
|
315
|
+
def group_uuids
|
316
|
+
uuids_from_links("AssociatedGroups")
|
317
|
+
end
|
318
|
+
|
296
319
|
def net_adap_uuids
|
297
320
|
uuids_from_links("ClientNetworkAdapters")
|
298
321
|
end
|
@@ -348,6 +371,27 @@ module IbmPowerHmc
|
|
348
371
|
end
|
349
372
|
end
|
350
373
|
|
374
|
+
# Group information
|
375
|
+
class Group < AbstractRest
|
376
|
+
ATTRS = {
|
377
|
+
:name => "GroupName",
|
378
|
+
:description => "GroupDescription",
|
379
|
+
:color => "GroupColor"
|
380
|
+
}.freeze
|
381
|
+
|
382
|
+
def sys_uuids
|
383
|
+
uuids_from_links("AssociatedManagedSystems")
|
384
|
+
end
|
385
|
+
|
386
|
+
def lpar_uuids
|
387
|
+
uuids_from_links("AssociatedLogicalPartitions")
|
388
|
+
end
|
389
|
+
|
390
|
+
def vios_uuids
|
391
|
+
uuids_from_links("AssociatedVirtualIOServers")
|
392
|
+
end
|
393
|
+
end
|
394
|
+
|
351
395
|
# Empty parent class to match K2 schema definition
|
352
396
|
class VirtualSCSIStorage < AbstractNonRest; end
|
353
397
|
|
@@ -467,6 +511,7 @@ module IbmPowerHmc
|
|
467
511
|
|
468
512
|
# LP-HEA information
|
469
513
|
class EthernetBackingDevice < IOAdapter; end
|
514
|
+
|
470
515
|
class HostEthernetAdapterLogicalPort < EthernetBackingDevice
|
471
516
|
ATTRS = ATTRS.merge({
|
472
517
|
:macaddr => "MACAddress",
|
@@ -828,6 +873,7 @@ module IbmPowerHmc
|
|
828
873
|
# HMC Event
|
829
874
|
class Event < AbstractRest
|
830
875
|
attr_accessor :usertask
|
876
|
+
|
831
877
|
ATTRS = {
|
832
878
|
:id => "EventID",
|
833
879
|
:type => "EventType",
|
data/lib/ibm_power_hmc/pcm.rb
CHANGED
@@ -98,7 +98,7 @@ module IbmPowerHmc
|
|
98
98
|
method_url += "?" + query.map { |h| h.join("=") }.join("&") unless query.empty?
|
99
99
|
|
100
100
|
response = request(:get, method_url)
|
101
|
-
FeedParser(response.body).entries do |entry|
|
101
|
+
FeedParser.new(response.body).entries do |entry|
|
102
102
|
link = entry.elements["link"]
|
103
103
|
next if link.nil?
|
104
104
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ibm_power_hmc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- IBM Power
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: manageiq-style
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.3'
|
27
41
|
description: A Ruby gem for interacting with the IBM Hardware Management Console (HMC).
|
28
42
|
email:
|
29
43
|
executables: []
|