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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 90008b33210851e9ac14f556bd7e3b42231f38adcf68b6d5d59eed7e35671678
4
- data.tar.gz: 6c85e9814f527680bea78f9c90fcc06a8796c949ac458c41074e01d6f44f7b61
3
+ metadata.gz: 16483135f26b1c5fd1783c55cb0d83f7e195562cda7f5859d5f1470432a1c8a9
4
+ data.tar.gz: d41ef9a0875f0b0400d619e9586083a0bdb985b8f36cc90e9869c5063e31e3fa
5
5
  SHA512:
6
- metadata.gz: ece63d99cccdf86022d907f75be7fe48871c6cac5fd64b5469fb0470fc4a0fe25e586fff16e2cc8ee65799eae8b315ba81b34879f395a7bb7375ae04edb74d61
7
- data.tar.gz: 767ee9bd259139e97bba680a1edd395da73f5f40ab5ec149574c1538fd4964dd081dc1d272feee5395a8bf2aabeb8b8e5d57b410c5250699f6eef6b19f07f8f9
6
+ metadata.gz: 2c3aa1f9bd1e5c0994b82046fda92f5d31ef05b2f8d280f59820ad2b8ad986c5bb46e905d844e67caa5739ab3df413d822ae1f12b41777e1dcc2d265974e07f6
7
+ data.tar.gz: 7948cc93b4835d3e421292345faaa5622d5fdea6123ff1e234f2e8345845b262c98fd5a0b8d4e1a88de28ac0b507b4a2c1a0824d5456a308e1296446596f4bb0
data/.rubocop_local.yml CHANGED
@@ -7,3 +7,5 @@ Style/ConditionalAssignment:
7
7
  Enabled: false
8
8
  Style/OptionalBooleanParameter:
9
9
  Enabled: false
10
+ Style/StringConcatenation:
11
+ Enabled: false
data/Rakefile CHANGED
@@ -1,2 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
+ require 'rubocop/rake_task'
3
+
2
4
  task :default => :spec
5
+
6
+ RuboCop::RakeTask.new
@@ -27,4 +27,6 @@ Gem::Specification.new do |spec|
27
27
  spec.require_paths = ["lib"]
28
28
 
29
29
  spec.add_runtime_dependency "rest-client", "~> 2.1"
30
+
31
+ spec.add_development_dependency "manageiq-style", "~> 1.3"
30
32
  end
@@ -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
@@ -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",
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IbmPowerHmc
4
- VERSION = "0.8.3"
4
+ VERSION = "0.8.7"
5
5
  end
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.3
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-02-11 00:00:00.000000000 Z
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: []