ibm_power_hmc 0.12.2 → 0.13.0

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: af80f7c29ca2a209985e3b7f62604fc9ba962f2b0c2da10041fad1eb881f7d32
4
- data.tar.gz: 006f79fee2ae35c82ba612639662e85ed743753f74142b1054d7166a71e877f9
3
+ metadata.gz: 3e96072a9ae18c79163e6f52a904e3b4f696f9b5d56729fc92d234a385929269
4
+ data.tar.gz: 69738a546bff4977e35c4732894a0b1916ec8e0dd49601c7e41d95e793f83ae8
5
5
  SHA512:
6
- metadata.gz: 0ae3f9052998b99880aa096c0cdd13fca6c8112b6c80b93b51b64f2c9f22e07070b2cf100c61a06011086bd0a459f9ec843103c6c8568c02083dd18fbfd5ebd8
7
- data.tar.gz: a9ca88412d5554c3d3d5376c72447b90da0f940553fa83d4f5396a402413af3a411b0f51a105418c77a886260d16aff954029bd73e13ff5c2ce56cfa0e30375e
6
+ metadata.gz: cbe96ad163dc152b885638579ca712a47e07716d98485cd3585de86d8b01e8ba961211cc27a0d0d8b0e4273f610b94eab46e114fc98f1049b480ab73a266f0fa
7
+ data.tar.gz: 94dafbe96f39811e3b1e70eae35fcc22442c05bbe0eae3fbca3e1e5577c35dffeb575bef5ecc87babdd08939904882391f811b5ddd980983ce30679e7f6c7f18
@@ -16,13 +16,12 @@ module IbmPowerHmc
16
16
  # @param username [String] User name.
17
17
  # @param port [Integer] TCP port number.
18
18
  # @param validate_ssl [Boolean] Verify SSL certificates.
19
- def initialize(host:, password:, username: "hscroot", port: 12_443, validate_ssl: true, timeout: 60)
19
+ def initialize(host:, password:, username: "hscroot", port: 12_443, validate_ssl: true)
20
20
  @hostname = "#{host}:#{port}"
21
21
  @username = username
22
22
  @password = password
23
23
  @verify_ssl = validate_ssl
24
24
  @api_session_token = nil
25
- @timeout = timeout
26
25
  end
27
26
 
28
27
  ##
@@ -161,6 +160,43 @@ module IbmPowerHmc
161
160
  modify_object_attributes(method_url, {:name => new_name})
162
161
  end
163
162
 
163
+ ##
164
+ # @!method lpar_migrate_validate(lpar_uuid, target_sys_name, sync = true)
165
+ # Validate if a logical partition can be migrated to another managed system.
166
+ # @raise [IbmPowerHmc::JobFailed] if validation fails
167
+ # @param lpar_uuid [String] The UUID of the logical partition to migrate.
168
+ # @param target_sys_name [String] The managed system to migrate partition to.
169
+ # @param sync [Boolean] Start the job and wait for its completion.
170
+ def lpar_migrate_validate(lpar_uuid, target_sys_name, sync = true)
171
+ # Need to include session token in payload so make sure we are logged in
172
+ logon if @api_session_token.nil?
173
+ method_url = "/rest/api/uom/LogicalPartition/#{lpar_uuid}/do/MigrateValidate"
174
+ params = {
175
+ "TargetManagedSystemName" => target_sys_name
176
+ }
177
+ HmcJob.new(self, method_url, "MigrateValidate", "LogicalPartition", params).tap do |job|
178
+ job.run if sync
179
+ end
180
+ end
181
+
182
+ ##
183
+ # @!method lpar_migrate(lpar_uuid, target_sys_name, sync = true)
184
+ # Migrate a logical partition to another managed system.
185
+ # @param lpar_uuid [String] The UUID of the logical partition to migrate.
186
+ # @param target_sys_name [String] The managed system to migrate partition to.
187
+ # @param sync [Boolean] Start the job and wait for its completion.
188
+ def lpar_migrate(lpar_uuid, target_sys_name, sync = true)
189
+ # Need to include session token in payload so make sure we are logged in
190
+ logon if @api_session_token.nil?
191
+ method_url = "/rest/api/uom/LogicalPartition/#{lpar_uuid}/do/Migrate"
192
+ params = {
193
+ "TargetManagedSystemName" => target_sys_name
194
+ }
195
+ HmcJob.new(self, method_url, "Migrate", "LogicalPartition", params).tap do |job|
196
+ job.run if sync
197
+ end
198
+ end
199
+
164
200
  ##
165
201
  # @!method vioses(sys_uuid = nil, search = {}, permissive = true)
166
202
  # Retrieve the list of virtual I/O servers managed by the HMC.
@@ -172,10 +208,10 @@ module IbmPowerHmc
172
208
  if sys_uuid.nil?
173
209
  method_url = "/rest/api/uom/VirtualIOServer"
174
210
  search.each { |key, value| method_url += "/search/(#{key}==#{value})" }
175
- method_url += "?ignoreError=true" if permissive
176
211
  else
177
212
  method_url = "/rest/api/uom/ManagedSystem/#{sys_uuid}/VirtualIOServer"
178
213
  end
214
+ method_url += "?ignoreError=true" if permissive
179
215
  response = request(:get, method_url)
180
216
  FeedParser.new(response.body).objects(:VirtualIOServer)
181
217
  end
@@ -315,6 +351,42 @@ module IbmPowerHmc
315
351
  end
316
352
  end
317
353
 
354
+ ##
355
+ # @!method vscsi_client_adapter(lpar_uuid, adap_uuid = nil)
356
+ # Retrieve one or all virtual SCSI storage client adapters attached to a logical partition.
357
+ # @param lpar_uuid [String] UUID of the logical partition.
358
+ # @param adap_uuid [String] UUID of the adapter to match (returns all adapters if omitted).
359
+ # @return [Array<IbmPowerHmc::VirtualSCSIClientAdapter>, IbmPowerHmc::VirtualSCSIClientAdapter] The list of storage adapters.
360
+ def vscsi_client_adapter(lpar_uuid, adap_uuid = nil)
361
+ if adap_uuid.nil?
362
+ method_url = "/rest/api/uom/LogicalPartition/#{lpar_uuid}/VirtualSCSIClientAdapter"
363
+ response = request(:get, method_url)
364
+ FeedParser.new(response.body).objects(:VirtualSCSIClientAdapter)
365
+ else
366
+ method_url = "/rest/api/uom/LogicalPartition/#{lpar_uuid}/VirtualSCSIClientAdapter/#{adap_uuid}"
367
+ response = request(:get, method_url)
368
+ Parser.new(response.body).object(:VirtualSCSIClientAdapter)
369
+ end
370
+ end
371
+
372
+ ##
373
+ # @!method vfc_client_adapter(lpar_uuid, adap_uuid = nil)
374
+ # Retrieve one or all virtual Fibre Channel storage client adapters attached to a logical partition.
375
+ # @param lpar_uuid [String] UUID of the logical partition.
376
+ # @param adap_uuid [String] UUID of the adapter to match (returns all adapters if omitted).
377
+ # @return [Array<IbmPowerHmc::VirtualFibreChannelClientAdapter>, IbmPowerHmc::VirtualFibreChannelClientAdapter] The list of storage adapters.
378
+ def vfc_client_adapter(lpar_uuid, adap_uuid = nil)
379
+ if adap_uuid.nil?
380
+ method_url = "/rest/api/uom/LogicalPartition/#{lpar_uuid}/VirtualFibreChannelClientAdapter"
381
+ response = request(:get, method_url)
382
+ FeedParser.new(response.body).objects(:VirtualFibreChannelClientAdapter)
383
+ else
384
+ method_url = "/rest/api/uom/LogicalPartition/#{lpar_uuid}/VirtualFibreChannelClientAdapter/#{adap_uuid}"
385
+ response = request(:get, method_url)
386
+ Parser.new(response.body).object(:VirtualFibreChannelClientAdapter)
387
+ end
388
+ end
389
+
318
390
  ##
319
391
  # @!method clusters
320
392
  # Retrieve the list of clusters managed by the HMC.
@@ -388,6 +460,24 @@ module IbmPowerHmc
388
460
  Parser.new(response.body).object(:Tier)
389
461
  end
390
462
 
463
+ ##
464
+ # @!method shared_processor_pool(sys_uuid, pool_uuid = nil)
465
+ # Retrieve information about Shared Processor Pools.
466
+ # @param sys_uuid [String] The UUID of the managed system.
467
+ # @param pool_uuid [String] The UUID of the shared storage pool (return all pools if omitted)
468
+ # @return [Array<IbmPowerHmc::SharedProcessorPool>, IbmPowerHmc::SharedProcessorPool] The list of shared processor pools.
469
+ def shared_processor_pool(sys_uuid, pool_uuid = nil)
470
+ if pool_uuid.nil?
471
+ method_url = "/rest/api/uom/ManagedSystem/#{sys_uuid}/SharedProcessorPool"
472
+ response = request(:get, method_url)
473
+ FeedParser.new(response.body).objects(:SharedProcessorPool)
474
+ else
475
+ method_url = "/rest/api/uom/ManagedSystem/#{sys_uuid}/SharedProcessorPool/#{pool_uuid}"
476
+ response = request(:get, method_url)
477
+ Parser.new(response.body).object(:SharedProcessorPool)
478
+ end
479
+ end
480
+
391
481
  ##
392
482
  # @!method templates_summary(draft = false)
393
483
  # Retrieve the list of partition template summaries.
@@ -768,8 +858,7 @@ module IbmPowerHmc
768
858
  :url => url,
769
859
  :verify_ssl => @verify_ssl,
770
860
  :payload => payload,
771
- :headers => headers,
772
- :timeout => @timeout
861
+ :headers => headers
773
862
  )
774
863
  rescue RestClient::Exception => e
775
864
  # Do not retry on failed logon attempts.
@@ -896,6 +896,22 @@ module IbmPowerHmc
896
896
  }.freeze
897
897
  end
898
898
 
899
+ # Shared Processor Pool
900
+ class SharedProcessorPool < AbstractRest
901
+ ATTRS = {
902
+ :name => "PoolName",
903
+ :available => "AvailableProcUnits",
904
+ :max => "MaximumProcessingUnits",
905
+ :reserved => "CurrentReservedProcessingUnits",
906
+ :pending_reserved => "PendingReservedProcessingUnits",
907
+ :pool_id => "PoolID"
908
+ }.freeze
909
+
910
+ def lpar_uuids
911
+ uuids_from_links("AssignedPartitions")
912
+ end
913
+ end
914
+
899
915
  class PartitionTemplateSummary < AbstractRest
900
916
  ATTRS = {
901
917
  :name => "partitionTemplateName"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IbmPowerHmc
4
- VERSION = "0.12.2"
4
+ VERSION = "0.13.0"
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.12.2
4
+ version: 0.13.0
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-09-20 00:00:00.000000000 Z
11
+ date: 2022-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client