ibm_power_hmc 0.12.0 → 0.13.0

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: e162db8e4002c4b1fbee71faceaa8c4a859f5e7e92e33e4cbbdb59862da9cde6
4
- data.tar.gz: 97bc18d7e606bddd79f6ed83b9f2f5b562f5121c433d613085e7da5e695f71df
3
+ metadata.gz: 3e96072a9ae18c79163e6f52a904e3b4f696f9b5d56729fc92d234a385929269
4
+ data.tar.gz: 69738a546bff4977e35c4732894a0b1916ec8e0dd49601c7e41d95e793f83ae8
5
5
  SHA512:
6
- metadata.gz: 3a36c85b010b6e67bd91e67fa380c4edb6cc27a34aee732237b5c95eaee2f6a983ee1c461bc6ab5830d4952743360f848a1228f85121f9ac8cf150b194440dac
7
- data.tar.gz: 741c9dedab5f6bd5fd7af0038e8bdab555c6b71274f3cecded7aaf4cabb21371b744e3fd355140e61bc9c7a36128a473a81fffd6983662d2def0c0e22ac1fcc5
6
+ metadata.gz: cbe96ad163dc152b885638579ca712a47e07716d98485cd3585de86d8b01e8ba961211cc27a0d0d8b0e4273f610b94eab46e114fc98f1049b480ab73a266f0fa
7
+ data.tar.gz: 94dafbe96f39811e3b1e70eae35fcc22442c05bbe0eae3fbca3e1e5577c35dffeb575bef5ecc87babdd08939904882391f811b5ddd980983ce30679e7f6c7f18
@@ -160,6 +160,43 @@ module IbmPowerHmc
160
160
  modify_object_attributes(method_url, {:name => new_name})
161
161
  end
162
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
+
163
200
  ##
164
201
  # @!method vioses(sys_uuid = nil, search = {}, permissive = true)
165
202
  # Retrieve the list of virtual I/O servers managed by the HMC.
@@ -171,10 +208,10 @@ module IbmPowerHmc
171
208
  if sys_uuid.nil?
172
209
  method_url = "/rest/api/uom/VirtualIOServer"
173
210
  search.each { |key, value| method_url += "/search/(#{key}==#{value})" }
174
- method_url += "?ignoreError=true" if permissive
175
211
  else
176
212
  method_url = "/rest/api/uom/ManagedSystem/#{sys_uuid}/VirtualIOServer"
177
213
  end
214
+ method_url += "?ignoreError=true" if permissive
178
215
  response = request(:get, method_url)
179
216
  FeedParser.new(response.body).objects(:VirtualIOServer)
180
217
  end
@@ -314,6 +351,42 @@ module IbmPowerHmc
314
351
  end
315
352
  end
316
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
+
317
390
  ##
318
391
  # @!method clusters
319
392
  # Retrieve the list of clusters managed by the HMC.
@@ -387,6 +460,24 @@ module IbmPowerHmc
387
460
  Parser.new(response.body).object(:Tier)
388
461
  end
389
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
+
390
481
  ##
391
482
  # @!method templates_summary(draft = false)
392
483
  # Retrieve the list of partition template summaries.
@@ -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.0"
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.0
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-07-18 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