ibm_power_hmc 0.13.0 → 0.14.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: 3e96072a9ae18c79163e6f52a904e3b4f696f9b5d56729fc92d234a385929269
4
- data.tar.gz: 69738a546bff4977e35c4732894a0b1916ec8e0dd49601c7e41d95e793f83ae8
3
+ metadata.gz: 3162f83d1c3168407716f683401e5f3f1b3c49489728561e52ab49410209beaa
4
+ data.tar.gz: c50f1ac36cda911c01262b06762fd928c06790d4df116f020958edd10ca0713e
5
5
  SHA512:
6
- metadata.gz: cbe96ad163dc152b885638579ca712a47e07716d98485cd3585de86d8b01e8ba961211cc27a0d0d8b0e4273f610b94eab46e114fc98f1049b480ab73a266f0fa
7
- data.tar.gz: 94dafbe96f39811e3b1e70eae35fcc22442c05bbe0eae3fbca3e1e5577c35dffeb575bef5ecc87babdd08939904882391f811b5ddd980983ce30679e7f6c7f18
6
+ metadata.gz: 014ff944d75d5dccf07d894628a0b41c08fe99d3478558f57b22aff2a1e86cc9589368c3a55696dc0f196edabd59f0d9e47b0f2aa09f726b7d6b18c5d250e775
7
+ data.tar.gz: 68a388e0a6a75c9cc61e9befeca8644fa64f92e95ca8411948fe166ba81c44997bd67c0247d943567fb0f345671bb9164dbc77294bdeb153f534b394c4637334
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'erb'
4
+
3
5
  # Module for IBM HMC Rest API Client
4
6
  module IbmPowerHmc
5
7
  class Error < StandardError; end
@@ -16,12 +18,13 @@ module IbmPowerHmc
16
18
  # @param username [String] User name.
17
19
  # @param port [Integer] TCP port number.
18
20
  # @param validate_ssl [Boolean] Verify SSL certificates.
19
- def initialize(host:, password:, username: "hscroot", port: 12_443, validate_ssl: true)
21
+ def initialize(host:, password:, username: "hscroot", port: 12_443, validate_ssl: true, timeout: 60)
20
22
  @hostname = "#{host}:#{port}"
21
23
  @username = username
22
24
  @password = password
23
25
  @verify_ssl = validate_ssl
24
26
  @api_session_token = nil
27
+ @timeout = timeout
25
28
  end
26
29
 
27
30
  ##
@@ -76,13 +79,13 @@ module IbmPowerHmc
76
79
  end
77
80
 
78
81
  ##
79
- # @!method managed_systems(search = {})
82
+ # @!method managed_systems(search = nil)
80
83
  # Retrieve the list of systems managed by the HMC.
81
- # @param search [Hash] The optional property name and value to match.
84
+ # @param search [String] The optional search criteria.
82
85
  # @return [Array<IbmPowerHmc::ManagedSystem>] The list of managed systems.
83
- def managed_systems(search = {})
86
+ def managed_systems(search = nil)
84
87
  method_url = "/rest/api/uom/ManagedSystem"
85
- search.each { |key, value| method_url += "/search/(#{key}==#{value})" }
88
+ method_url += "/search/(#{ERB::Util.url_encode(search)})" unless search.nil?
86
89
  response = request(:get, method_url)
87
90
  FeedParser.new(response.body).objects(:ManagedSystem)
88
91
  end
@@ -102,15 +105,15 @@ module IbmPowerHmc
102
105
  end
103
106
 
104
107
  ##
105
- # @!method lpars(sys_uuid = nil, search = {})
108
+ # @!method lpars(sys_uuid = nil, search = nil)
106
109
  # Retrieve the list of logical partitions managed by the HMC.
107
110
  # @param sys_uuid [String] The UUID of the managed system.
108
- # @param search [Hash] The optional property name and value to match.
111
+ # @param search [String] The optional search criteria.
109
112
  # @return [Array<IbmPowerHmc::LogicalPartition>] The list of logical partitions.
110
- def lpars(sys_uuid = nil, search = {})
113
+ def lpars(sys_uuid = nil, search = nil)
111
114
  if sys_uuid.nil?
112
115
  method_url = "/rest/api/uom/LogicalPartition"
113
- search.each { |key, value| method_url += "/search/(#{key}==#{value})" }
116
+ method_url += "/search/(#{ERB::Util.url_encode(search)})" unless search.nil?
114
117
  else
115
118
  method_url = "/rest/api/uom/ManagedSystem/#{sys_uuid}/LogicalPartition"
116
119
  end
@@ -198,16 +201,16 @@ module IbmPowerHmc
198
201
  end
199
202
 
200
203
  ##
201
- # @!method vioses(sys_uuid = nil, search = {}, permissive = true)
204
+ # @!method vioses(sys_uuid = nil, search = nil, permissive = true)
202
205
  # Retrieve the list of virtual I/O servers managed by the HMC.
203
206
  # @param sys_uuid [String] The UUID of the managed system.
204
- # @param search [Hash] The optional property name and value to match.
207
+ # @param search [String] The optional search criteria.
205
208
  # @param permissive [Boolean] Skip virtual I/O servers that have error conditions.
206
209
  # @return [Array<IbmPowerHmc::VirtualIOServer>] The list of virtual I/O servers.
207
- def vioses(sys_uuid = nil, search = {}, permissive = true)
210
+ def vioses(sys_uuid = nil, search = nil, permissive = true)
208
211
  if sys_uuid.nil?
209
212
  method_url = "/rest/api/uom/VirtualIOServer"
210
- search.each { |key, value| method_url += "/search/(#{key}==#{value})" }
213
+ method_url += "/search/(#{ERB::Util.url_encode(search)})" unless search.nil?
211
214
  else
212
215
  method_url = "/rest/api/uom/ManagedSystem/#{sys_uuid}/VirtualIOServer"
213
216
  end
@@ -858,7 +861,8 @@ module IbmPowerHmc
858
861
  :url => url,
859
862
  :verify_ssl => @verify_ssl,
860
863
  :payload => payload,
861
- :headers => headers
864
+ :headers => headers,
865
+ :timeout => @timeout
862
866
  )
863
867
  rescue RestClient::Exception => e
864
868
  # Do not retry on failed logon attempts.
@@ -262,7 +262,9 @@ module IbmPowerHmc
262
262
  :model => "MachineTypeModelAndSerialNumber/Model",
263
263
  :serial => "MachineTypeModelAndSerialNumber/SerialNumber",
264
264
  :vtpm_version => "AssociatedSystemSecurity/VirtualTrustedPlatformModuleVersion",
265
- :vtpm_lpars => "AssociatedSystemSecurity/AvailableVirtualTrustedPlatformModulePartitions"
265
+ :vtpm_lpars => "AssociatedSystemSecurity/AvailableVirtualTrustedPlatformModulePartitions",
266
+ :is_classic_hmc_mgmt => "IsClassicHMCManagement",
267
+ :is_hmc_mgmt_master => "IsHMCPowerVMManagementMaster"
266
268
  }.freeze
267
269
 
268
270
  def group_uuids
@@ -517,7 +519,9 @@ module IbmPowerHmc
517
519
  :type => "AdapterType", # "Server", "Client", "Unknown"
518
520
  :location => "LocationCode",
519
521
  :slot => "VirtualSlotNumber",
520
- :required => "RequiredAdapter"
522
+ :required => "RequiredAdapter",
523
+ :lpar_id => "LocalPartitionID",
524
+ :dr_name => "DynamicReconfigurationConnectorName"
521
525
  }.freeze
522
526
  end
523
527
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IbmPowerHmc
4
- VERSION = "0.13.0"
4
+ VERSION = "0.14.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.13.0
4
+ version: 0.14.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-06 00:00:00.000000000 Z
11
+ date: 2022-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client