ibm_power_hmc 0.8.1 → 0.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af5d28dd76ae4e57514691d4ab40e023ca18a6a7e71c4691b15c564097920964
4
- data.tar.gz: 68a2d511853792668bca5247da9c1910725367ff6fb65ec3f21674953b7be876
3
+ metadata.gz: 5711989e385bcf182b31220eab9772c671daafe5a4c41307b91855a567122834
4
+ data.tar.gz: 4b8250abea5afc68034a2e7753803c68c35cafeeb79dba67c7e7c6d2579455b0
5
5
  SHA512:
6
- metadata.gz: a77ff9b3db36ef774dd64b37d14b5bd57226cbfe31dece9e17c799089c94418d24bea27f2504fbd0ec84d9e3120023a11db1e4619f06e46f92f12c629398d1ff
7
- data.tar.gz: 0feb113a298fb117d6ef5cbfaf1fbab3b6a7e72bb69a749c7a36bc0255147d1e0b640879acd1e233780eecb8ef96768efe35e43ea56e3c73ecd7914b63387f09
6
+ metadata.gz: 71431d500d7dd4a6151afb522f6da325d70dbc86484294a8d2098b6664dfc4d2cb88b842349d5238223574160778e89253c699ed745abaad34d8a85dea51de38
7
+ data.tar.gz: 7e3ffb83cfe3335b04c7162b5ccacb79aadb3c8cc3333d80849efa3fe438ae9d7ad71431d668100b78b090a15ffdb595264b3a2ed230f8f20b805060c0c2326f
data/.gitignore CHANGED
File without changes
data/.rubocop.yml CHANGED
File without changes
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/CHANGELOG.md CHANGED
File without changes
data/Gemfile CHANGED
File without changes
data/LICENSE CHANGED
File without changes
data/README.md CHANGED
File without changes
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.
File without changes
@@ -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
@@ -277,14 +295,16 @@ module IbmPowerHmc
277
295
  :state => "PartitionState",
278
296
  :type => "PartitionType",
279
297
  :memory => "PartitionMemoryConfiguration/CurrentMemory",
280
- :dedicated => "PartitionProcessorConfiguration/HasDedicatedProcessors",
298
+ :dedicated => "PartitionProcessorConfiguration/CurrentHasDedicatedProcessors",
299
+ :sharing_mode => "PartitionProcessorConfiguration/CurrentSharingMode",
281
300
  :rmc_state => "ResourceMonitoringControlState",
282
301
  :rmc_ipaddr => "ResourceMonitoringIPAddress",
283
302
  :os => "OperatingSystemVersion",
284
303
  :ref_code => "ReferenceCode",
285
304
  :procs => "PartitionProcessorConfiguration/CurrentDedicatedProcessorConfiguration/CurrentProcessors",
286
305
  :proc_units => "PartitionProcessorConfiguration/CurrentSharedProcessorConfiguration/CurrentProcessingUnits",
287
- :vprocs => "PartitionProcessorConfiguration/CurrentSharedProcessorConfiguration/AllocatedVirtualProcessors"
306
+ :vprocs => "PartitionProcessorConfiguration/CurrentSharedProcessorConfiguration/AllocatedVirtualProcessors",
307
+ :description => "Description"
288
308
  }.freeze
289
309
 
290
310
  def sys_uuid
@@ -292,6 +312,10 @@ module IbmPowerHmc
292
312
  uuid_from_href(href) unless href.nil?
293
313
  end
294
314
 
315
+ def group_uuids
316
+ uuids_from_links("AssociatedGroups")
317
+ end
318
+
295
319
  def net_adap_uuids
296
320
  uuids_from_links("ClientNetworkAdapters")
297
321
  end
@@ -347,6 +371,27 @@ module IbmPowerHmc
347
371
  end
348
372
  end
349
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
+
350
395
  # Empty parent class to match K2 schema definition
351
396
  class VirtualSCSIStorage < AbstractNonRest; end
352
397
 
@@ -466,6 +511,7 @@ module IbmPowerHmc
466
511
 
467
512
  # LP-HEA information
468
513
  class EthernetBackingDevice < IOAdapter; end
514
+
469
515
  class HostEthernetAdapterLogicalPort < EthernetBackingDevice
470
516
  ATTRS = ATTRS.merge({
471
517
  :macaddr => "MACAddress",
@@ -812,16 +858,22 @@ module IbmPowerHmc
812
858
 
813
859
  class PartitionTemplate < AbstractRest
814
860
  ATTRS = {
815
- :name => "partitionTemplateName",
816
- :description => "description",
817
- :os => "logicalPartitionConfig/osVersion",
818
- :memory => "logicalPartitionConfig/memoryConfiguration/currMemory"
861
+ :name => "partitionTemplateName",
862
+ :description => "description",
863
+ :os => "logicalPartitionConfig/osVersion",
864
+ :memory => "logicalPartitionConfig/memoryConfiguration/currMemory",
865
+ :dedicated => "logicalPartitionConfig/processorConfiguration/hasDedicatedProcessors",
866
+ :sharing_mode => "logicalPartitionConfig/processorConfiguration/sharingMode",
867
+ :vprocs => "logicalPartitionConfig/processorConfiguration/sharedProcessorConfiguration/desiredVirtualProcessors",
868
+ :proc_units => "logicalPartitionConfig/processorConfiguration/sharedProcessorConfiguration/desiredProcessingUnits",
869
+ :procs => "logicalPartitionConfig/processorConfiguration/dedicatedProcessorConfiguration/desiredProcessors"
819
870
  }.freeze
820
871
  end
821
872
 
822
873
  # HMC Event
823
874
  class Event < AbstractRest
824
875
  attr_accessor :usertask
876
+
825
877
  ATTRS = {
826
878
  :id => "EventID",
827
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.1"
4
+ VERSION = "0.8.6"
5
5
  end
data/lib/ibm_power_hmc.rb CHANGED
File without changes
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.1
4
+ version: 0.8.6
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-03 00:00:00.000000000 Z
11
+ date: 2022-02-21 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: []
@@ -70,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
84
  - !ruby/object:Gem::Version
71
85
  version: '0'
72
86
  requirements: []
73
- rubygems_version: 3.1.2
87
+ rubygems_version: 3.0.3
74
88
  signing_key:
75
89
  specification_version: 4
76
90
  summary: IBM Power HMC Ruby gem.