ibm_power_hmc 0.24.0 → 0.25.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/ibm_power_hmc/apis/templates.rb +0 -14
- data/lib/ibm_power_hmc/apis/uom.rb +6 -2
- data/lib/ibm_power_hmc/schema/uom.rb +2 -0
- data/lib/ibm_power_hmc/utils.rb +40 -0
- data/lib/ibm_power_hmc/version.rb +1 -1
- data/lib/ibm_power_hmc.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b15e5d3ed25c9329a63b1655da54869b5f0a979f7775149209648d86a0fa67ad
|
4
|
+
data.tar.gz: c1c78e4c661ef6c90ea743245b3e5c29777e7ab51e276a088ca9206d814b99ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 379f4c199e6c5a818617608060d98fe75413856b588760a6c0a2a946002858d7df52ce2b86ba54a4af9a2de3b61391828d3fbca4457dae93319c37cc2813bec9
|
7
|
+
data.tar.gz: 5299f74322afac43f91af2a131b5fb1521fc0f3ca3ed87106405006ef181eaa9d776b80e1501f13dabdbdee9630ba3868a47b0839ba88458f88b2782ed43623b
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## v0.25.0
|
2
|
+
* Add `vios_uuid` as alias to `lpar_uuid` for VFC schema definition
|
3
|
+
* Add `lpar_delete_vios_mappings` util method
|
4
|
+
* Add option to `lpar_delete` to delete associated VIOS VSCSI/VFC mappings
|
1
5
|
## v0.24.0
|
2
6
|
* Add schema methods to modify VSCSI and VFC mappings
|
3
7
|
* Add schema definition for IOSlot
|
@@ -119,20 +119,6 @@ module IbmPowerHmc
|
|
119
119
|
job
|
120
120
|
end
|
121
121
|
|
122
|
-
##
|
123
|
-
# @!method template_provision(template_uuid, target_sys_uuid, changes)
|
124
|
-
# Deploy Logical Partition from a Template (performs Check, Transform and Deploy steps in a single method).
|
125
|
-
# @param template_uuid [String] The UUID of the Template to deploy an LPAR from.
|
126
|
-
# @param target_sys_uuid [String] The UUID of the Managed System to deploy the LPAR on.
|
127
|
-
# @param changes [Hash] Modifications to apply to the Template before deploying Logical Partition.
|
128
|
-
# @return [String] The UUID of the deployed Logical Partition.
|
129
|
-
def template_provision(template_uuid, target_sys_uuid, changes)
|
130
|
-
draft_uuid = template_check(template_uuid, target_sys_uuid).results["TEMPLATE_UUID"]
|
131
|
-
template_transform(draft_uuid, target_sys_uuid)
|
132
|
-
template_modify(draft_uuid, changes)
|
133
|
-
template_deploy(draft_uuid, target_sys_uuid).results["PartitionUuid"]
|
134
|
-
end
|
135
|
-
|
136
122
|
##
|
137
123
|
# @!method template_modify(template_uuid, changes)
|
138
124
|
# Modify a template.
|
@@ -168,11 +168,15 @@ module IbmPowerHmc
|
|
168
168
|
end
|
169
169
|
|
170
170
|
##
|
171
|
-
# @!method lpar_delete(lpar_uuid)
|
171
|
+
# @!method lpar_delete(lpar_uuid, delete_vios_mappings: false)
|
172
172
|
# Delete a logical partition.
|
173
173
|
# @param lpar_uuid [String] The UUID of the logical partition to delete.
|
174
|
-
|
174
|
+
# @param delete_vios_mappings [Boolean] Delete associated VIOS VFC and VSCSI server adapters.
|
175
|
+
def lpar_delete(lpar_uuid, delete_vios_mappings: false)
|
175
176
|
method_url = "/rest/api/uom/LogicalPartition/#{lpar_uuid}"
|
177
|
+
|
178
|
+
lpar_delete_vios_mappings(lpar_uuid) if delete_vios_mappings
|
179
|
+
|
176
180
|
request(:delete, method_url)
|
177
181
|
# Returns HTTP 204 if ok
|
178
182
|
end
|
@@ -843,6 +843,8 @@ module IbmPowerHmc
|
|
843
843
|
|
844
844
|
# VFC client information
|
845
845
|
class VirtualFibreChannelClientAdapter < VirtualFibreChannelAdapter
|
846
|
+
alias vios_uuid lpar_uuid
|
847
|
+
|
846
848
|
def nport_loggedin
|
847
849
|
collection_of("NportLoggedInStatus", "VirtualFibreChannelNPortLoginStatus")
|
848
850
|
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module IbmPowerHmc
|
4
|
+
class Connection
|
5
|
+
##
|
6
|
+
# @!method lpar_delete_vios_mappings(lpar_uuid)
|
7
|
+
# Delete VIOS VSCSI and VFC mappings associated to a given logical partition.
|
8
|
+
# @param lpar_uuid [String] The logical partition UUID.
|
9
|
+
def lpar_delete_vios_mappings(lpar_uuid)
|
10
|
+
vscsi_client_adapter(lpar_uuid).concat(vfc_client_adapter(lpar_uuid)).group_by(&:vios_uuid).each do |vios_uuid, adapters|
|
11
|
+
modify_object do
|
12
|
+
vios(vios_uuid, nil, "ViosSCSIMapping,ViosFCMapping").tap do |vios|
|
13
|
+
adapters.collect(&:server).each do |server|
|
14
|
+
case server
|
15
|
+
when VirtualSCSIServerAdapter
|
16
|
+
vios.vscsi_mapping_delete!(server.location)
|
17
|
+
when VirtualFibreChannelServerAdapter
|
18
|
+
vios.vfc_mapping_delete!(server.location)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
##
|
27
|
+
# @!method template_provision(template_uuid, target_sys_uuid, changes)
|
28
|
+
# Deploy Logical Partition from a Template (performs Check, Transform and Deploy steps in a single method).
|
29
|
+
# @param template_uuid [String] The UUID of the Template to deploy an LPAR from.
|
30
|
+
# @param target_sys_uuid [String] The UUID of the Managed System to deploy the LPAR on.
|
31
|
+
# @param changes [Hash] Modifications to apply to the Template before deploying Logical Partition.
|
32
|
+
# @return [String] The UUID of the deployed Logical Partition.
|
33
|
+
def template_provision(template_uuid, target_sys_uuid, changes)
|
34
|
+
draft_uuid = template_check(template_uuid, target_sys_uuid).results["TEMPLATE_UUID"]
|
35
|
+
template_transform(draft_uuid, target_sys_uuid)
|
36
|
+
template_modify(draft_uuid, changes)
|
37
|
+
template_deploy(draft_uuid, target_sys_uuid).results["PartitionUuid"]
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/ibm_power_hmc.rb
CHANGED
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.
|
4
|
+
version: 0.25.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-11-
|
11
|
+
date: 2022-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -68,6 +68,7 @@ files:
|
|
68
68
|
- lib/ibm_power_hmc/schema/sem.rb
|
69
69
|
- lib/ibm_power_hmc/schema/templates.rb
|
70
70
|
- lib/ibm_power_hmc/schema/uom.rb
|
71
|
+
- lib/ibm_power_hmc/utils.rb
|
71
72
|
- lib/ibm_power_hmc/version.rb
|
72
73
|
homepage: http://github.com/IBM/ibm_power_hmc_sdk_ruby
|
73
74
|
licenses:
|