ibm_power_hmc 0.16.1 → 0.17.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: 28ceda6d2c9095912e1bcf9b7a24bcb0153bc34a5c437a41966be9036fffb858
4
- data.tar.gz: 94d8d1706954d560303e96f8c793fde5e9b0a181a7e2657a75d5f37fb5977fa3
3
+ metadata.gz: b656be196e11b14214f13c50871c1f9a892d6346db7729e2ce0f1cc4f976c5be
4
+ data.tar.gz: 24f50dbe1015ac99524604cece6275cd5fd9c79f0236acb2e8a01de0bcd6bd71
5
5
  SHA512:
6
- metadata.gz: c001400d781dbadea9f68df8dc4eb5266ac6c3e74a9d8035ed7c112b404ec7553c8b97eab297dd72ce22919b024d8eaa3cfb30bf133514df1eae266ce198252b
7
- data.tar.gz: 62dd1000797804b87a22528c711e777c07071d80df40621f6007d88e5b68ed90da6413888eee5e185379a15a9da522cfb0cbaa9c693640ccedecad23b2af9bd9
6
+ metadata.gz: deb0194fb5f3df5bbcc69182f30f29956f11a66cf2a91740dec214d63fce5b16383626ef600f3478084616b23ee1a557620ce45cc05ff7adbdb0364719d2a371
7
+ data.tar.gz: 6c19000f0cf64c5413552d60a304e51005b688403e4171367ed3d7d5384a9315a819225e9a5255b51735ddf69f0e38c040888cacbd1ec1688b67f1c594a361e6
@@ -80,17 +80,32 @@ module IbmPowerHmc
80
80
  end
81
81
 
82
82
  ##
83
- # @!method managed_systems(search = nil)
83
+ # @!method managed_systems(search = nil, group_name = nil)
84
84
  # Retrieve the list of systems managed by the HMC.
85
85
  # @param search [String] The optional search criteria.
86
+ # @param group_name [String] The extended group attributes.
86
87
  # @return [Array<IbmPowerHmc::ManagedSystem>] The list of managed systems.
87
- def managed_systems(search = nil)
88
+ def managed_systems(search = nil, group_name = nil)
88
89
  method_url = "/rest/api/uom/ManagedSystem"
89
90
  method_url += "/search/(#{ERB::Util.url_encode(search)})" unless search.nil?
91
+ method_url += "?group=#{group_name}" unless group_name.nil?
90
92
  response = request(:get, method_url)
91
93
  FeedParser.new(response.body).objects(:ManagedSystem)
92
94
  end
93
95
 
96
+ ##
97
+ # @!method managed_system(sys_uuid = nil, group_name = nil)
98
+ # Retrieve information about a managed system.
99
+ # @param sys_uuid [String] The UUID of the managed system.
100
+ # @param group_name [String] The extended group attributes.
101
+ # @return [IbmPowerHmc::ManagedSystem] The managed system.
102
+ def managed_system(sys_uuid, group_name = nil)
103
+ method_url = "/rest/api/uom/ManagedSystem/#{sys_uuid}"
104
+ method_url += "?group=#{group_name}" unless group_name.nil?
105
+ response = request(:get, method_url)
106
+ Parser.new(response.body).object(:ManagedSystem)
107
+ end
108
+
94
109
  ##
95
110
  # @!method managed_systems_quick
96
111
  # Retrieve the list of systems managed by the HMC (using Quick API).
@@ -115,32 +130,20 @@ module IbmPowerHmc
115
130
  end
116
131
 
117
132
  ##
118
- # @!method managed_system(lpar_uuid, sys_uuid = nil, group_name = nil)
119
- # Retrieve information about a managed system.
120
- # @param sys_uuid [String] The UUID of the managed system.
121
- # @param group_name [String] The extended group attributes.
122
- # @return [IbmPowerHmc::ManagedSystem] The managed system.
123
- def managed_system(sys_uuid, group_name = nil)
124
- method_url = "/rest/api/uom/ManagedSystem/#{sys_uuid}"
125
- method_url += "?group=#{group_name}" unless group_name.nil?
126
-
127
- response = request(:get, method_url)
128
- Parser.new(response.body).object(:ManagedSystem)
129
- end
130
-
131
- ##
132
- # @!method lpars(sys_uuid = nil, search = nil)
133
+ # @!method lpars(sys_uuid = nil, search = nil, group_name = nil)
133
134
  # Retrieve the list of logical partitions managed by the HMC.
134
135
  # @param sys_uuid [String] The UUID of the managed system.
135
136
  # @param search [String] The optional search criteria.
137
+ # @param group_name [String] The extended group attributes.
136
138
  # @return [Array<IbmPowerHmc::LogicalPartition>] The list of logical partitions.
137
- def lpars(sys_uuid = nil, search = nil)
139
+ def lpars(sys_uuid = nil, search = nil, group_name = nil)
138
140
  if sys_uuid.nil?
139
141
  method_url = "/rest/api/uom/LogicalPartition"
140
142
  method_url += "/search/(#{ERB::Util.url_encode(search)})" unless search.nil?
141
143
  else
142
144
  method_url = "/rest/api/uom/ManagedSystem/#{sys_uuid}/LogicalPartition"
143
145
  end
146
+ method_url += "?group=#{group_name}" unless group_name.nil?
144
147
  response = request(:get, method_url)
145
148
  FeedParser.new(response.body).objects(:LogicalPartition)
146
149
  end
@@ -159,11 +162,25 @@ module IbmPowerHmc
159
162
  method_url = "/rest/api/uom/ManagedSystem/#{sys_uuid}/LogicalPartition/#{lpar_uuid}"
160
163
  end
161
164
  method_url += "?group=#{group_name}" unless group_name.nil?
162
-
163
165
  response = request(:get, method_url)
164
166
  Parser.new(response.body).object(:LogicalPartition)
165
167
  end
166
168
 
169
+ ##
170
+ # @!method lpars_quick(sys_uuid = nil)
171
+ # Retrieve the list of logical partitions managed by the HMC (using Quick API).
172
+ # @param sys_uuid [String] The UUID of the managed system.
173
+ # @return [Array<Hash>] The list of logical partitions.
174
+ def lpars_quick(sys_uuid = nil)
175
+ if sys_uuid.nil?
176
+ method_url = "/rest/api/uom/LogicalPartition/quick/All"
177
+ else
178
+ method_url = "/rest/api/uom/ManagedSystem/#{sys_uuid}/LogicalPartition/quick/All"
179
+ end
180
+ response = request(:get, method_url)
181
+ JSON.parse(response.body)
182
+ end
183
+
167
184
  ##
168
185
  # @!method lpar_quick_property(lpar_uuid, property_name)
169
186
  # Retrieve a quick property of a logical partition.
@@ -226,20 +243,25 @@ module IbmPowerHmc
226
243
  end
227
244
 
228
245
  ##
229
- # @!method vioses(sys_uuid = nil, search = nil, permissive = true)
246
+ # @!method vioses(sys_uuid = nil, search = nil, group_name = nil, permissive = true)
230
247
  # Retrieve the list of virtual I/O servers managed by the HMC.
231
248
  # @param sys_uuid [String] The UUID of the managed system.
232
249
  # @param search [String] The optional search criteria.
250
+ # @param group_name [String] The extended group attributes.
233
251
  # @param permissive [Boolean] Skip virtual I/O servers that have error conditions.
234
252
  # @return [Array<IbmPowerHmc::VirtualIOServer>] The list of virtual I/O servers.
235
- def vioses(sys_uuid = nil, search = nil, permissive = true)
253
+ def vioses(sys_uuid = nil, search = nil, group_name = nil, permissive = true)
236
254
  if sys_uuid.nil?
237
255
  method_url = "/rest/api/uom/VirtualIOServer"
238
256
  method_url += "/search/(#{ERB::Util.url_encode(search)})" unless search.nil?
239
257
  else
240
258
  method_url = "/rest/api/uom/ManagedSystem/#{sys_uuid}/VirtualIOServer"
241
259
  end
242
- method_url += "?ignoreError=true" if permissive
260
+ query = {}
261
+ query["ignoreError"] = "true" if permissive
262
+ query["group"] = group_name unless group_name.nil?
263
+ method_url += "?" + query.map { |h| h.join("=") }.join("&") unless query.empty?
264
+
243
265
  response = request(:get, method_url)
244
266
  FeedParser.new(response.body).objects(:VirtualIOServer)
245
267
  end
@@ -258,11 +280,25 @@ module IbmPowerHmc
258
280
  method_url = "/rest/api/uom/ManagedSystem/#{sys_uuid}/VirtualIOServer/#{vios_uuid}"
259
281
  end
260
282
  method_url += "?group=#{group_name}" unless group_name.nil?
261
-
262
283
  response = request(:get, method_url)
263
284
  Parser.new(response.body).object(:VirtualIOServer)
264
285
  end
265
286
 
287
+ ##
288
+ # @!method vioses_quick(sys_uuid = nil)
289
+ # Retrieve the list of virtual I/O servers managed by the HMC (using Quick API).
290
+ # @param sys_uuid [String] The UUID of the managed system.
291
+ # @return [Array<Hash>] The list of virtual I/O servers.
292
+ def vioses_quick(sys_uuid = nil)
293
+ if sys_uuid.nil?
294
+ method_url = "/rest/api/uom/VirtualIOServer/quick/All"
295
+ else
296
+ method_url = "/rest/api/uom/ManagedSystem/#{sys_uuid}/VirtualIOServer/quick/All"
297
+ end
298
+ response = request(:get, method_url)
299
+ JSON.parse(response.body)
300
+ end
301
+
266
302
  ##
267
303
  # @!method groups
268
304
  # Retrieve the list of groups defined on the HMC.
@@ -379,6 +379,11 @@ module IbmPowerHmc
379
379
  def io_adapters
380
380
  collection_of("PartitionIOConfiguration/ProfileIOSlots/ProfileIOSlot/AssociatedIOSlot/RelatedIOAdapter", "*[1]")
381
381
  end
382
+
383
+ def shared_processor_pool_uuid
384
+ href = singleton("ProcessorPool", "href")
385
+ uuid_from_href(href) unless href.nil?
386
+ end
382
387
  end
383
388
 
384
389
  # Logical Partition information
@@ -933,6 +938,10 @@ module IbmPowerHmc
933
938
  def lpar_uuids
934
939
  uuids_from_links("AssignedPartitions")
935
940
  end
941
+
942
+ def sys_uuid
943
+ uuid_from_href(href, -3)
944
+ end
936
945
  end
937
946
 
938
947
  class PartitionTemplateSummary < AbstractRest
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IbmPowerHmc
4
- VERSION = "0.16.1"
4
+ VERSION = "0.17.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.16.1
4
+ version: 0.17.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-10-10 00:00:00.000000000 Z
11
+ date: 2022-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client