oneview-sdk 4.5.1 → 5.0.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 +56 -0
- data/Gemfile +0 -0
- data/Guardfile +0 -0
- data/LICENSE +0 -0
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/bin/oneview-sdk-ruby +0 -0
- data/lib/oneview-sdk.rb +0 -0
- data/lib/oneview-sdk/cli.rb +0 -0
- data/lib/oneview-sdk/client.rb +0 -0
- data/lib/oneview-sdk/config_loader.rb +0 -0
- data/lib/oneview-sdk/exceptions.rb +0 -0
- data/lib/oneview-sdk/image-streamer/client.rb +0 -0
- data/lib/oneview-sdk/image-streamer/resource/api300.rb +0 -0
- data/lib/oneview-sdk/image-streamer/resource/api300/artifact_bundle.rb +0 -0
- data/lib/oneview-sdk/image-streamer/resource/api300/build_plan.rb +0 -0
- data/lib/oneview-sdk/image-streamer/resource/api300/deployment_group.rb +0 -0
- data/lib/oneview-sdk/image-streamer/resource/api300/deployment_plan.rb +0 -0
- data/lib/oneview-sdk/image-streamer/resource/api300/golden_image.rb +0 -0
- data/lib/oneview-sdk/image-streamer/resource/api300/os_volume.rb +0 -0
- data/lib/oneview-sdk/image-streamer/resource/api300/plan_script.rb +0 -0
- data/lib/oneview-sdk/image-streamer/resource/api300/resource.rb +0 -0
- data/lib/oneview-sdk/image_streamer.rb +0 -0
- data/lib/oneview-sdk/resource.rb +54 -23
- data/lib/oneview-sdk/resource/api200.rb +0 -0
- data/lib/oneview-sdk/resource/api200/client_certificate.rb +134 -0
- data/lib/oneview-sdk/resource/api200/connection_template.rb +2 -1
- data/lib/oneview-sdk/resource/api200/datacenter.rb +0 -0
- data/lib/oneview-sdk/resource/api200/enclosure.rb +5 -9
- data/lib/oneview-sdk/resource/api200/enclosure_group.rb +2 -1
- data/lib/oneview-sdk/resource/api200/ethernet_network.rb +2 -2
- data/lib/oneview-sdk/resource/api200/event.rb +0 -0
- data/lib/oneview-sdk/resource/api200/fabric.rb +0 -0
- data/lib/oneview-sdk/resource/api200/fc_network.rb +0 -0
- data/lib/oneview-sdk/resource/api200/fcoe_network.rb +0 -0
- data/lib/oneview-sdk/resource/api200/firmware_bundle.rb +2 -1
- data/lib/oneview-sdk/resource/api200/firmware_driver.rb +0 -0
- data/lib/oneview-sdk/resource/api200/id_pool.rb +5 -3
- data/lib/oneview-sdk/resource/api200/interconnect.rb +0 -0
- data/lib/oneview-sdk/resource/api200/lig_uplink_set.rb +0 -0
- data/lib/oneview-sdk/resource/api200/logical_downlink.rb +0 -0
- data/lib/oneview-sdk/resource/api200/logical_enclosure.rb +1 -1
- data/lib/oneview-sdk/resource/api200/logical_interconnect.rb +4 -3
- data/lib/oneview-sdk/resource/api200/logical_interconnect_group.rb +2 -2
- data/lib/oneview-sdk/resource/api200/logical_switch.rb +0 -0
- data/lib/oneview-sdk/resource/api200/logical_switch_group.rb +0 -0
- data/lib/oneview-sdk/resource/api200/managed_san.rb +0 -0
- data/lib/oneview-sdk/resource/api200/network_set.rb +0 -0
- data/lib/oneview-sdk/resource/api200/power_device.rb +1 -1
- data/lib/oneview-sdk/resource/api200/rack.rb +0 -0
- data/lib/oneview-sdk/resource/api200/resource.rb +0 -0
- data/lib/oneview-sdk/resource/api200/san_manager.rb +0 -0
- data/lib/oneview-sdk/resource/api200/server_hardware.rb +2 -2
- data/lib/oneview-sdk/resource/api200/server_hardware_type.rb +0 -0
- data/lib/oneview-sdk/resource/api200/server_profile.rb +35 -25
- data/lib/oneview-sdk/resource/api200/server_profile_template.rb +24 -14
- data/lib/oneview-sdk/resource/api200/storage_pool.rb +0 -0
- data/lib/oneview-sdk/resource/api200/storage_system.rb +6 -10
- data/lib/oneview-sdk/resource/api200/switch.rb +4 -10
- data/lib/oneview-sdk/resource/api200/unmanaged_device.rb +0 -0
- data/lib/oneview-sdk/resource/api200/uplink_set.rb +0 -0
- data/lib/oneview-sdk/resource/api200/user.rb +18 -0
- data/lib/oneview-sdk/resource/api200/volume.rb +15 -11
- data/lib/oneview-sdk/resource/api200/volume_attachment.rb +3 -1
- data/lib/oneview-sdk/resource/api200/volume_snapshot.rb +0 -0
- data/lib/oneview-sdk/resource/api200/volume_template.rb +0 -0
- data/lib/oneview-sdk/resource/api200/web_server_certificate.rb +97 -0
- data/lib/oneview-sdk/resource/api300.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/client_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api300/c7000/connection_template.rb +0 -8
- data/lib/oneview-sdk/resource/api300/c7000/datacenter.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/enclosure.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/enclosure_group.rb +0 -1
- data/lib/oneview-sdk/resource/api300/c7000/ethernet_network.rb +1 -0
- data/lib/oneview-sdk/resource/api300/c7000/event.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/fabric.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/fc_network.rb +1 -0
- data/lib/oneview-sdk/resource/api300/c7000/fcoe_network.rb +1 -0
- data/lib/oneview-sdk/resource/api300/c7000/firmware_bundle.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/firmware_driver.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/id_pool.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/interconnect.rb +0 -0
- data/lib/oneview-sdk/resource/api300/{synergy/logical_switch.rb → c7000/internal_link_set.rb} +30 -7
- data/lib/oneview-sdk/resource/api300/c7000/lig_uplink_set.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/logical_downlink.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/logical_enclosure.rb +9 -7
- data/lib/oneview-sdk/resource/api300/c7000/logical_interconnect.rb +2 -20
- data/lib/oneview-sdk/resource/api300/c7000/logical_interconnect_group.rb +2 -0
- data/lib/oneview-sdk/resource/api300/c7000/logical_switch.rb +0 -19
- data/lib/oneview-sdk/resource/api300/c7000/logical_switch_group.rb +1 -0
- data/lib/oneview-sdk/resource/api300/c7000/managed_san.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/network_set.rb +1 -0
- data/lib/oneview-sdk/resource/api300/c7000/power_device.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/rack.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/resource.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/san_manager.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/scope.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/server_hardware.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/server_hardware_type.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/server_profile.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/server_profile_template.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/storage_pool.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/storage_system.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/switch.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/unmanaged_device.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/uplink_set.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/user.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/volume.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/volume_attachment.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/volume_snapshot.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/volume_template.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/web_server_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/client_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/connection_template.rb +0 -8
- data/lib/oneview-sdk/resource/api300/synergy/datacenter.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/drive_enclosure.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/enclosure.rb +2 -2
- data/lib/oneview-sdk/resource/api300/synergy/enclosure_group.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/ethernet_network.rb +1 -0
- data/lib/oneview-sdk/resource/api300/synergy/event.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/fabric.rb +1 -1
- data/lib/oneview-sdk/resource/api300/synergy/fc_network.rb +1 -0
- data/lib/oneview-sdk/resource/api300/synergy/fcoe_network.rb +3 -15
- data/lib/oneview-sdk/resource/api300/synergy/firmware_bundle.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/firmware_driver.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/id_pool.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/interconnect.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/internal_link_set.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/lig_uplink_set.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/logical_downlink.rb +2 -14
- data/lib/oneview-sdk/resource/api300/synergy/logical_enclosure.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/logical_interconnect.rb +0 -20
- data/lib/oneview-sdk/resource/api300/synergy/logical_interconnect_group.rb +3 -1
- data/lib/oneview-sdk/resource/api300/synergy/managed_san.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/network_set.rb +2 -17
- data/lib/oneview-sdk/resource/api300/synergy/os_deployment_plan.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/power_device.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/rack.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/resource.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/san_manager.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/sas_interconnect.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/sas_logical_interconnect.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/sas_logical_interconnect_group.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/scope.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/server_hardware.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/server_hardware_type.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/server_profile.rb +24 -27
- data/lib/oneview-sdk/resource/api300/synergy/server_profile_template.rb +0 -12
- data/lib/oneview-sdk/resource/api300/synergy/storage_pool.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/storage_system.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/switch.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/unmanaged_device.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/uplink_set.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/user.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/volume.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/volume_attachment.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/volume_snapshot.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/volume_template.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/web_server_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api500.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/client_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/connection_template.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/datacenter.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/enclosure.rb +35 -0
- data/lib/oneview-sdk/resource/api500/c7000/enclosure_group.rb +21 -0
- data/lib/oneview-sdk/resource/api500/c7000/ethernet_network.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/event.rb +2 -2
- data/lib/oneview-sdk/resource/api500/c7000/fabric.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/fc_network.rb +1 -0
- data/lib/oneview-sdk/resource/api500/c7000/fcoe_network.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/firmware_bundle.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/firmware_driver.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/id_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/interconnect.rb +8 -0
- data/lib/oneview-sdk/resource/api500/c7000/internal_link_set.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/lig_uplink_set.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/logical_downlink.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/logical_enclosure.rb +40 -0
- data/lib/oneview-sdk/resource/api500/c7000/logical_interconnect.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/logical_interconnect_group.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/logical_switch.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/logical_switch_group.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/managed_san.rb +10 -0
- data/lib/oneview-sdk/resource/api500/c7000/network_set.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/power_device.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/rack.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/resource.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/san_manager.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/scope.rb +49 -0
- data/lib/oneview-sdk/resource/api500/c7000/server_hardware.rb +20 -0
- data/lib/oneview-sdk/resource/api500/c7000/server_hardware_type.rb +1 -0
- data/lib/oneview-sdk/resource/api500/c7000/server_profile.rb +60 -1
- data/lib/oneview-sdk/resource/api500/c7000/server_profile_template.rb +86 -0
- data/lib/oneview-sdk/resource/api500/c7000/storage_pool.rb +57 -2
- data/lib/oneview-sdk/resource/api500/c7000/storage_system.rb +132 -0
- data/lib/oneview-sdk/resource/api500/c7000/switch.rb +7 -0
- data/lib/oneview-sdk/resource/api500/c7000/unmanaged_device.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/uplink_set.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/user.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/volume.rb +135 -0
- data/lib/oneview-sdk/resource/api500/c7000/volume_attachment.rb +24 -1
- data/lib/oneview-sdk/resource/api500/c7000/volume_snapshot.rb +10 -0
- data/lib/oneview-sdk/resource/api500/c7000/volume_template.rb +94 -3
- data/lib/oneview-sdk/resource/api500/c7000/web_server_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/client_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/connection_template.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/datacenter.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/drive_enclosure.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/enclosure.rb +35 -0
- data/lib/oneview-sdk/resource/api500/synergy/enclosure_group.rb +27 -0
- data/lib/oneview-sdk/resource/api500/synergy/ethernet_network.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/event.rb +2 -2
- data/lib/oneview-sdk/resource/api500/synergy/fabric.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/fc_network.rb +1 -0
- data/lib/oneview-sdk/resource/api500/synergy/fcoe_network.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/firmware_bundle.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/firmware_driver.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/{logical_switch.rb → id_pool.rb} +3 -3
- data/lib/oneview-sdk/resource/api500/synergy/interconnect.rb +17 -1
- data/lib/oneview-sdk/resource/api500/synergy/internal_link_set.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/lig_uplink_set.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/logical_downlink.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/logical_enclosure.rb +17 -0
- data/lib/oneview-sdk/resource/api500/synergy/logical_interconnect.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/logical_interconnect_group.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/managed_san.rb +2 -2
- data/lib/oneview-sdk/resource/api500/synergy/network_set.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/os_deployment_plan.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/power_device.rb +1 -1
- data/lib/oneview-sdk/resource/api500/synergy/rack.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/resource.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/san_manager.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/sas_interconnect.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/sas_logical_interconnect.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/sas_logical_interconnect_group.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/scope.rb +2 -2
- data/lib/oneview-sdk/resource/api500/synergy/server_hardware.rb +2 -2
- data/lib/oneview-sdk/resource/api500/synergy/server_hardware_type.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/server_profile.rb +4 -1
- data/lib/oneview-sdk/resource/api500/synergy/server_profile_template.rb +16 -2
- data/lib/oneview-sdk/resource/api500/synergy/storage_pool.rb +2 -2
- data/lib/oneview-sdk/resource/api500/synergy/storage_system.rb +1 -1
- data/lib/oneview-sdk/resource/api500/synergy/switch.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/unmanaged_device.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/uplink_set.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/user.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/volume.rb +2 -2
- data/lib/oneview-sdk/resource/api500/synergy/volume_attachment.rb +3 -3
- data/lib/oneview-sdk/resource/api500/synergy/volume_snapshot.rb +2 -2
- data/lib/oneview-sdk/resource/api500/synergy/volume_template.rb +2 -2
- data/lib/oneview-sdk/resource/api500/synergy/web_server_certificate.rb +22 -0
- data/lib/oneview-sdk/resource_helper.rb +30 -0
- data/lib/oneview-sdk/rest.rb +6 -2
- data/lib/oneview-sdk/scmb.rb +0 -0
- data/lib/oneview-sdk/ssl_helper.rb +0 -0
- data/lib/oneview-sdk/version.rb +1 -1
- data/oneview-sdk.gemspec +0 -0
- metadata +21 -5
File without changes
|
File without changes
|
@@ -10,12 +10,52 @@
|
|
10
10
|
# language governing permissions and limitations under the License.
|
11
11
|
|
12
12
|
require_relative '../../api300/c7000/logical_enclosure'
|
13
|
+
require_relative '../../../resource_helper'
|
13
14
|
|
14
15
|
module OneviewSDK
|
15
16
|
module API500
|
16
17
|
module C7000
|
18
|
+
# Contains helper methods to include operation with firmware of a given logical enclosure resource
|
19
|
+
module FirmwareHelper
|
20
|
+
include ResourceHelper
|
21
|
+
|
22
|
+
# Updates the firmware attributes of a given logical enclosure resource
|
23
|
+
# @param [Hash] attributes Hash with firmware attributes
|
24
|
+
# @option options [String] :firmwareUpdateOn Specifies the component types within the enclosure which has to be updated
|
25
|
+
# @option options [Boolean] :forceInstallFirmware Specifies whether the firmware operation to be carried forcefully or not
|
26
|
+
# @option options [String] :firmwareBaselineUri Firmware-drivers URI for the firmware bundle containing the baseline firmware
|
27
|
+
# @return [OneviewSDK::API500::C7000::LogicalEnclosure] self
|
28
|
+
def update_firmware(attributes = {})
|
29
|
+
patch('replace', '/firmware', attributes, 'If-Match' => @data['eTag'])
|
30
|
+
retrieve!
|
31
|
+
self
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
17
35
|
# Logical Enclosure resource implementation on API500 C7000
|
18
36
|
class LogicalEnclosure < OneviewSDK::API300::C7000::LogicalEnclosure
|
37
|
+
include OneviewSDK::API500::C7000::FirmwareHelper
|
38
|
+
|
39
|
+
# Method is not available
|
40
|
+
# @raise [OneviewSDK::MethodUnavailable] method is not available
|
41
|
+
def create(*)
|
42
|
+
unavailable_method
|
43
|
+
end
|
44
|
+
|
45
|
+
# Method is not available
|
46
|
+
# @raise [OneviewSDK::MethodUnavailable] method is not available
|
47
|
+
def delete(*)
|
48
|
+
unavailable_method
|
49
|
+
end
|
50
|
+
|
51
|
+
# Updates a logical enclosure
|
52
|
+
# @param [Hash] attributes attributes to be updated
|
53
|
+
# @return [OneviewSDK::API500::C7000::LogicalEnclosure] self
|
54
|
+
def update(attributes = {})
|
55
|
+
super(attributes)
|
56
|
+
retrieve!
|
57
|
+
self
|
58
|
+
end
|
19
59
|
end
|
20
60
|
end
|
21
61
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -16,6 +16,16 @@ module OneviewSDK
|
|
16
16
|
module C7000
|
17
17
|
# Managed SAN resource implementation for API500 C7000
|
18
18
|
class ManagedSAN < OneviewSDK::API300::C7000::ManagedSAN
|
19
|
+
|
20
|
+
# Set public attributes
|
21
|
+
# @param [Hash] attributes Public attributes
|
22
|
+
# @option attributes [String] :name
|
23
|
+
# @option attributes [String] :value
|
24
|
+
# @option attributes [String] :valueType
|
25
|
+
# @option attributes [String] :valueFormat
|
26
|
+
def set_public_attributes(attributes)
|
27
|
+
OneviewSDK::API200::ManagedSAN.instance_method(:set_public_attributes).bind(self).call(attributes)
|
28
|
+
end
|
19
29
|
end
|
20
30
|
end
|
21
31
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -16,6 +16,55 @@ module OneviewSDK
|
|
16
16
|
module C7000
|
17
17
|
# Scope resource implementation for API500 C7000
|
18
18
|
class Scope < OneviewSDK::API300::C7000::Scope
|
19
|
+
# Create a resource object, associate it with a client, and set its properties.
|
20
|
+
# @param [OneviewSDK::Client] client The client object for the OneView appliance
|
21
|
+
# @param [Hash] params The options for this resource (key-value pairs)
|
22
|
+
# @param [Integer] api_ver The api version to use when interracting with this resource.
|
23
|
+
# Defaults to the client.api_version if it exists, or the OneviewSDK::Client::DEFAULT_API_VERSION.
|
24
|
+
def initialize(client, params = {}, api_ver = nil)
|
25
|
+
@data ||= {}
|
26
|
+
@data['type'] ||= 'ScopeV2'
|
27
|
+
super
|
28
|
+
end
|
29
|
+
|
30
|
+
# Modifies scope membership by adding or removing resource assignments
|
31
|
+
# @param [Array] resources The array of resources (or any number of resources separated by comma)
|
32
|
+
# @raise [OneviewSDK::IncompleteResource] if the client or uri is not set
|
33
|
+
def change_resource_assignments(add_resources: [], remove_resources: [])
|
34
|
+
if !add_resources.empty? || !remove_resources.empty?
|
35
|
+
ensure_uri && ensure_client
|
36
|
+
add_uris = ensure_and_get_uris(add_resources)
|
37
|
+
remove_uris = ensure_and_get_uris(remove_resources)
|
38
|
+
body = []
|
39
|
+
|
40
|
+
add_uris.each do |uri|
|
41
|
+
body << { 'op' => 'add', 'path' => '/addedResourceUris/-', 'value' => uri }
|
42
|
+
end
|
43
|
+
body << { 'op' => 'replace', 'path' => '/removedResourceUris', 'value' => remove_uris }
|
44
|
+
|
45
|
+
response = @client.rest_patch(@data['uri'], { 'Content-Type' => 'application/json-patch+json', 'body' => body }, @api_version)
|
46
|
+
@client.response_handler(response)
|
47
|
+
end
|
48
|
+
self
|
49
|
+
end
|
50
|
+
|
51
|
+
# Performs a specific patch operation for the given server.
|
52
|
+
# If the server supports the particular operation, the operation is performed
|
53
|
+
# and a response is returned to the caller with the results.
|
54
|
+
# @param [String] operation The operation to be performed
|
55
|
+
# @param [String] path The path of operation
|
56
|
+
# @param [String] value The value
|
57
|
+
# @note This attribute is subject to incompatible changes in future release versions, including redefinition or removal.
|
58
|
+
def patch(operation, path, value = nil)
|
59
|
+
ensure_client && ensure_uri
|
60
|
+
body = {
|
61
|
+
'op' => operation,
|
62
|
+
'path' => path,
|
63
|
+
'value' => value
|
64
|
+
}
|
65
|
+
response = @client.rest_patch(@data['uri'], { 'Content-Type' => 'application/json-patch+json', 'body' => [body] }, @api_version)
|
66
|
+
@client.response_handler(response)
|
67
|
+
end
|
19
68
|
end
|
20
69
|
end
|
21
70
|
end
|
@@ -16,6 +16,26 @@ module OneviewSDK
|
|
16
16
|
module C7000
|
17
17
|
# Server Hardware resource implementation on API500 C7000
|
18
18
|
class ServerHardware < OneviewSDK::API300::C7000::ServerHardware
|
19
|
+
|
20
|
+
# Create a resource object, associate it with a client, and set its properties.
|
21
|
+
# @param [OneviewSDK::Client] client The client object for the OneView appliance
|
22
|
+
# @param [Hash] params The options for this resource (key-value pairs)
|
23
|
+
# @param [Integer] api_ver The api version to use when interracting with this resource.
|
24
|
+
def initialize(client, params = {}, api_ver = nil)
|
25
|
+
@data ||= {}
|
26
|
+
# Default values:
|
27
|
+
@data['type'] ||= 'server-hardware-7'
|
28
|
+
super
|
29
|
+
end
|
30
|
+
|
31
|
+
# Gets the information describing an 'SDX' partition including a list of physical server blades represented by a server hardware.
|
32
|
+
# @note Used with SDX enclosures only
|
33
|
+
# @return [Hash] Hash with the physical server hardware inventory
|
34
|
+
def get_physical_server_hardware
|
35
|
+
ensure_client && ensure_uri
|
36
|
+
response = @client.rest_get(@data['uri'] + '/physicalServerHardware')
|
37
|
+
@client.response_handler(response)
|
38
|
+
end
|
19
39
|
end
|
20
40
|
end
|
21
41
|
end
|
@@ -14,6 +14,7 @@ require_relative '../../api300/c7000/server_hardware_type'
|
|
14
14
|
module OneviewSDK
|
15
15
|
module API500
|
16
16
|
module C7000
|
17
|
+
# Server hardware type resource implementation for API500 C7000
|
17
18
|
class ServerHardwareType < OneviewSDK::API300::C7000::ServerHardwareType
|
18
19
|
end
|
19
20
|
end
|
@@ -9,13 +9,72 @@
|
|
9
9
|
# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
|
10
10
|
# language governing permissions and limitations under the License.
|
11
11
|
|
12
|
-
require_relative '
|
12
|
+
require_relative '../c7000/server_profile'
|
13
13
|
|
14
14
|
module OneviewSDK
|
15
15
|
module API500
|
16
16
|
module C7000
|
17
17
|
# Server Profile resource implementation on API500 C7000
|
18
18
|
class ServerProfile < OneviewSDK::API300::C7000::ServerProfile
|
19
|
+
|
20
|
+
# Create a resource object, associate it with a client, and set its properties.
|
21
|
+
# @param [OneviewSDK::Client] client The client object for the OneView appliance
|
22
|
+
# @param [Hash] params The options for this resource (key-value pairs)
|
23
|
+
# @param [Integer] api_ver The api version to use when interacting with this resource.
|
24
|
+
def initialize(client, params = {}, api_ver = nil)
|
25
|
+
@data ||= {}
|
26
|
+
# Default values
|
27
|
+
@data['type'] ||= 'ServerProfileV7'
|
28
|
+
super
|
29
|
+
end
|
30
|
+
|
31
|
+
# Adds volume attachment entry and creates a new Volume associated in the Server profile
|
32
|
+
# @param [OneviewSDK::Volume] volume Volume Resource to add an attachment
|
33
|
+
# @param [Hash] volume_options Options to create a new Volume.
|
34
|
+
# Please refer to OneviewSDK::Volume documentation for the data necessary to create a new Volume.
|
35
|
+
# @param [Hash] attachment_options Options of the new attachment
|
36
|
+
# @option attachment_options [Fixnum] 'id' The ID of the attached storage volume. Do not use it if you want it to be created automatically.
|
37
|
+
# @option attachment_options [String] 'lun' The logical unit number.
|
38
|
+
# @option attachment_options [String] 'lunType' The logical unit number type: Auto or Manual.
|
39
|
+
# @option attachment_options [Boolean] 'permanent' Required. If true, indicates that the volume will persist when the profile is deleted.
|
40
|
+
# If false, then the volume will be deleted when the profile is deleted.
|
41
|
+
# @option attachment_options [Array] 'storagePaths' A list of host-to-target path associations.
|
42
|
+
# @return Returns the connection hash if found, otherwise returns nil
|
43
|
+
def create_volume_with_attachment(storage_pool, volume_options, attachment_options = {})
|
44
|
+
raise IncompleteResource, 'Storage Pool not found!' unless storage_pool.retrieve!
|
45
|
+
# Convert symbols keys to string in volume_options and attachment_options
|
46
|
+
volume_options = Hash[volume_options.map { |k, v| [k.to_s, v] }]
|
47
|
+
attachment_options = Hash[attachment_options.map { |k, v| [k.to_s, v] }]
|
48
|
+
|
49
|
+
self['sanStorage'] ||= {}
|
50
|
+
self['sanStorage']['volumeAttachments'] ||= []
|
51
|
+
|
52
|
+
attachment_options['id'] ||= 0
|
53
|
+
attachment_options['volumeStoragePoolUri'] = storage_pool['uri']
|
54
|
+
attachment_options['volumeStorageSystemUri'] = storage_pool['storageSystemUri']
|
55
|
+
attachment_options['volumeName'] = volume_options['name']
|
56
|
+
attachment_options['volumeDescription'] = volume_options['description']
|
57
|
+
attachment_options['volumeProvisionType'] = volume_options['provisioningType']
|
58
|
+
attachment_options['volumeProvisionedCapacityBytes'] = volume_options['size']
|
59
|
+
|
60
|
+
# Defaults
|
61
|
+
attachment_options['permanent'] ||= true
|
62
|
+
attachment_options['lunType'] ||= 'Auto'
|
63
|
+
attachment_options['lun'] ||= nil
|
64
|
+
attachment_options['storagePaths'] ||= []
|
65
|
+
attachment_options['volumeShareable'] = false
|
66
|
+
|
67
|
+
self['sanStorage']['manageSanStorage'] ||= true
|
68
|
+
self['sanStorage']['volumeAttachments'] << attachment_options
|
69
|
+
end
|
70
|
+
|
71
|
+
# Retrieves the profile template for a given server profile.
|
72
|
+
# @return Returns a ServerProfileTemplate instance
|
73
|
+
def get_profile_template
|
74
|
+
response = @client.rest_get("#{@data['uri']}/new-profile-template")
|
75
|
+
variant = self.class.name.split('::').at(-2)
|
76
|
+
OneviewSDK.resource_named('ServerProfileTemplate', @client.api_version, variant).new(client, @client.response_handler(response))
|
77
|
+
end
|
19
78
|
end
|
20
79
|
end
|
21
80
|
end
|
@@ -16,6 +16,92 @@ module OneviewSDK
|
|
16
16
|
module C7000
|
17
17
|
# Server Profile Template resource implementation on API500 C7000
|
18
18
|
class ServerProfileTemplate < OneviewSDK::API300::C7000::ServerProfileTemplate
|
19
|
+
|
20
|
+
# Create a resource object, associate it with a client, and set its properties.
|
21
|
+
# @param [OneviewSDK::Client] client The client object for the OneView appliance
|
22
|
+
# @param [Hash] params The options for this resource (key-value pairs)
|
23
|
+
# @param [Integer] api_ver The api version to use when interracting with this resource.
|
24
|
+
def initialize(client, params = {}, api_ver = nil)
|
25
|
+
@data ||= {}
|
26
|
+
# Default values
|
27
|
+
@data['type'] ||= 'ServerProfileTemplateV3'
|
28
|
+
super
|
29
|
+
end
|
30
|
+
|
31
|
+
# Adds a connection entry to server profile template
|
32
|
+
# @param [OneviewSDK::EthernetNetwork, OneviewSDK::FCNetwork] network Network associated with the connection
|
33
|
+
# @param [Hash<String,String>] connection_options Hash containing the configuration of the connection
|
34
|
+
# @option connection_options [Boolean] 'boot' Indicates that the server will attempt to boot from this connection.
|
35
|
+
# @option connection_options [String] 'functionType' Type of function required for the connection. Values: Ethernet, FibreChannel, iSCSI.
|
36
|
+
# @option connection_options [Integer] 'id' A unique identifier for this connection. If 0, id is automatically assigned.
|
37
|
+
# @option connection_options [String] 'ipv4' The IP information for a connection. This is only used for iSCSI connections.
|
38
|
+
# @option connection_options [String] 'name' Name of the connection.
|
39
|
+
# @option connection_options [String] 'portId' Identifies the port (FlexNIC) used for this connection.
|
40
|
+
# @option connection_options [String] 'requestedMbps' The transmit throughput (mbps) that should be allocated to this connection.
|
41
|
+
# @option connection_options [String] 'requestedVFs' This value can be "Auto" or 0.
|
42
|
+
def add_connection(network, connection_options = {})
|
43
|
+
connection_options = Hash[connection_options.map { |k, v| [k.to_s, v] }]
|
44
|
+
self['connectionSettings'] = {} unless self['connectionSettings']
|
45
|
+
self['connectionSettings']['connections'] = [] unless self['connectionSettings']['connections']
|
46
|
+
self['connectionSettings']['manageConnections'] = true
|
47
|
+
connection_options['id'] ||= 0
|
48
|
+
connection_options['networkUri'] = network['uri'] if network['uri'] || network.retrieve!
|
49
|
+
self['connectionSettings']['connections'] << connection_options
|
50
|
+
end
|
51
|
+
|
52
|
+
# Removes a connection entry in server profile template
|
53
|
+
# @param [String] connection_name Name of the connection
|
54
|
+
# @return Returns the connection hash if found, otherwise returns nil
|
55
|
+
def remove_connection(connection_name)
|
56
|
+
desired_connection = nil
|
57
|
+
return desired_connection unless self['connectionSettings']['connections']
|
58
|
+
self['connectionSettings']['connections'].each do |con|
|
59
|
+
desired_connection = self['connectionSettings']['connections'].delete(con) if con['name'] == connection_name
|
60
|
+
end
|
61
|
+
desired_connection
|
62
|
+
end
|
63
|
+
|
64
|
+
# Adds a volume attachment entry with new volume in Server profile template
|
65
|
+
# @param [OneviewSDK::storage_pool] storage_pool Storage Pool Resource to add an attachment
|
66
|
+
# @param [Hash] volume_options Options to create a new Volume.
|
67
|
+
# @option volume_options [String] 'volumeName' The name of the volume.
|
68
|
+
# @option volume_options [String] 'volumeDescription' The description of the storage volume.
|
69
|
+
# @option volume_options [String] 'volumeProvisionType' The provisioning type of the new volume: Thin", "Full", or "Thin Deduplication".
|
70
|
+
# @option volume_options [Integer] 'volumeProvisionedCapacityBytes' The requested provisioned capacity of the storage volume in bytes.
|
71
|
+
# @param [Hash] attachment_options Options of the new attachment
|
72
|
+
# @option attachment_options [String] 'associatedTemplateAttachmentId' Uniquely identifying of a volume attachment in a template.
|
73
|
+
# @option attachment_options [String] 'dataProtectionLevel' Values specific to a StoreVirtual storage.
|
74
|
+
# @option attachment_options [Integer] 'id' The ID of the storage volume attachment.
|
75
|
+
# @option attachment_options [Boolean] 'isBootVolume' Identifies whether the volume will be used as a boot volume.
|
76
|
+
# @option attachment_options [String] 'lun' Logical Unit Number.
|
77
|
+
# @option attachment_options [String] 'lunType' Type of the LUN. Values: Manual or Auto.
|
78
|
+
# @option attachment_options [Array] 'storagePaths' A list of host-to-target path associations.
|
79
|
+
# @return Returns the connection hash if found, otherwise returns nil
|
80
|
+
def create_volume_with_attachment(storage_pool, volume_options, attachment_options = {})
|
81
|
+
raise IncompleteResource, 'Storage Pool not found!' unless storage_pool.retrieve!
|
82
|
+
# Convert symbols keys to string in volume_options and attachment_options
|
83
|
+
volume_options = Hash[volume_options.map { |k, v| [k.to_s, v] }]
|
84
|
+
attachment_options = Hash[attachment_options.map { |k, v| [k.to_s, v] }]
|
85
|
+
|
86
|
+
self['sanStorage'] ||= {}
|
87
|
+
self['sanStorage']['volumeAttachments'] ||= []
|
88
|
+
|
89
|
+
attachment_options['id'] ||= 0
|
90
|
+
attachment_options['volumeStoragePoolUri'] = storage_pool['uri']
|
91
|
+
attachment_options['volumeStorageSystemUri'] = storage_pool['storageSystemUri']
|
92
|
+
attachment_options['volumeName'] = volume_options['name']
|
93
|
+
attachment_options['volumeDescription'] = volume_options['description']
|
94
|
+
attachment_options['volumeProvisionType'] = volume_options['provisioningType']
|
95
|
+
attachment_options['volumeProvisionedCapacityBytes'] = volume_options['size']
|
96
|
+
|
97
|
+
# Defaults
|
98
|
+
attachment_options['volumeUri'] = nil
|
99
|
+
attachment_options['permanent'] ||= true
|
100
|
+
attachment_options['volumeShareable'] = false
|
101
|
+
self['sanStorage']['manageSanStorage'] ||= true
|
102
|
+
|
103
|
+
self['sanStorage']['volumeAttachments'] << attachment_options
|
104
|
+
end
|
19
105
|
end
|
20
106
|
end
|
21
107
|
end
|
@@ -9,13 +9,68 @@
|
|
9
9
|
# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
|
10
10
|
# language governing permissions and limitations under the License.
|
11
11
|
|
12
|
-
require_relative '
|
12
|
+
require_relative 'resource'
|
13
13
|
|
14
14
|
module OneviewSDK
|
15
15
|
module API500
|
16
16
|
module C7000
|
17
17
|
# Storage pool resource implementation for API500 C7000
|
18
|
-
class StoragePool < OneviewSDK::
|
18
|
+
class StoragePool < OneviewSDK::API500::C7000::Resource
|
19
|
+
BASE_URI = '/rest/storage-pools'.freeze
|
20
|
+
|
21
|
+
# Create a resource object, associate it with a client, and set its properties.
|
22
|
+
# @param [OneviewSDK::Client] client The client object for the OneView appliance
|
23
|
+
# @param [Hash] params The options for this resource (key-value pairs)
|
24
|
+
# @param [Integer] api_ver The api version to use when interracting with this resource.
|
25
|
+
def initialize(client, params = {}, api_ver = nil)
|
26
|
+
super
|
27
|
+
# Default values:
|
28
|
+
@data['type'] ||= 'StoragePoolV3'
|
29
|
+
end
|
30
|
+
|
31
|
+
# Method is not available
|
32
|
+
# @raise [OneviewSDK::MethodUnavailable] method is not available
|
33
|
+
def create(*)
|
34
|
+
unavailable_method
|
35
|
+
end
|
36
|
+
|
37
|
+
# Method is not available
|
38
|
+
# @raise [OneviewSDK::MethodUnavailable] method is not available
|
39
|
+
def delete(*)
|
40
|
+
unavailable_method
|
41
|
+
end
|
42
|
+
|
43
|
+
# Gets the storage pools that are connected on the specified networks based on the storage system port's expected network connectivity.
|
44
|
+
# @param [OneviewSDK::Client] client The client object for the OneView appliance
|
45
|
+
# @param [Array<Resource>] networks The list of networks with URI to be used as a filter
|
46
|
+
# @return [Array<OneviewSDK::StoragePool>] the list of storage pools
|
47
|
+
def self.reachable(client, networks = [])
|
48
|
+
uri = self::BASE_URI + '/reachable-storage-pools'
|
49
|
+
unless networks.empty?
|
50
|
+
network_uris = networks.map { |item| item['uri'] }
|
51
|
+
uri += "?networks='#{network_uris.join(',')}'"
|
52
|
+
end
|
53
|
+
find_with_pagination(client, uri)
|
54
|
+
end
|
55
|
+
|
56
|
+
# To manage/unmanage a storage pool
|
57
|
+
# @param [Boolean] be_managed Set true to manage or false to unmanage
|
58
|
+
# @note Storage Pool that belongs to Storage System with family StoreVirtual can't be changed to unmanaged
|
59
|
+
def manage(be_managed)
|
60
|
+
if !be_managed && self['family'] == 'StoreVirtual'
|
61
|
+
raise ArgumentError, 'Attempting to unmanage a StoreVirtual pool is not allowed'
|
62
|
+
end
|
63
|
+
self['isManaged'] = be_managed
|
64
|
+
update
|
65
|
+
refresh
|
66
|
+
end
|
67
|
+
|
68
|
+
# To request a refresh of a storage pool
|
69
|
+
def request_refresh
|
70
|
+
self['requestingRefresh'] = true
|
71
|
+
update
|
72
|
+
refresh
|
73
|
+
end
|
19
74
|
end
|
20
75
|
end
|
21
76
|
end
|
@@ -16,6 +16,138 @@ module OneviewSDK
|
|
16
16
|
module C7000
|
17
17
|
# Storage System resource implementation for API500 C7000
|
18
18
|
class StorageSystem < OneviewSDK::API300::C7000::StorageSystem
|
19
|
+
# deviceSpecificAttributes['serialNumber'] and deviceSpecificAttributes['wwn'] are supported too
|
20
|
+
UNIQUE_IDENTIFIERS = %w(name uri hostname).freeze
|
21
|
+
|
22
|
+
# Create a resource object, associate it with a client, and set its properties.
|
23
|
+
# @param [OneviewSDK::Client] client The client object for the OneView appliance
|
24
|
+
# @param [Hash] params The options for this resource (key-value pairs)
|
25
|
+
# @param [Integer] api_ver The api version to use when interracting with this resource.
|
26
|
+
def initialize(client, params = {}, api_ver = nil)
|
27
|
+
# Default values:
|
28
|
+
@data ||= {}
|
29
|
+
@data['type'] ||= 'StorageSystemV4'
|
30
|
+
super
|
31
|
+
end
|
32
|
+
|
33
|
+
# Method is unavailable
|
34
|
+
# @raise [OneviewSDK::MethodUnavailable] method is not available
|
35
|
+
def get_managed_ports(*)
|
36
|
+
unavailable_method
|
37
|
+
end
|
38
|
+
|
39
|
+
# Method is unavailable
|
40
|
+
# @raise [OneviewSDK::MethodUnavailable] method is not available
|
41
|
+
def set_refresh_state(*)
|
42
|
+
unavailable_method
|
43
|
+
end
|
44
|
+
|
45
|
+
# Adds the resource to OneView using the current data
|
46
|
+
# @note Calls the refresh method to set additional data
|
47
|
+
# @return [OneviewSDK::StorageSystem] self
|
48
|
+
def add
|
49
|
+
ensure_client
|
50
|
+
temp_old_data = JSON.load(@data.to_json)
|
51
|
+
credentials = temp_old_data['credentials'] || {}
|
52
|
+
request_body = {
|
53
|
+
'family' => @data['family'],
|
54
|
+
'hostname' => @data['hostname'],
|
55
|
+
'username' => @data.delete('username') || credentials['username'],
|
56
|
+
'password' => @data.delete('password') || credentials['password']
|
57
|
+
}
|
58
|
+
response = @client.rest_post(self.class::BASE_URI, { 'body' => request_body }, @api_version)
|
59
|
+
response_body = @client.response_handler(response)
|
60
|
+
set_all(response_body)
|
61
|
+
|
62
|
+
managed_domain = temp_old_data['deviceSpecificAttributes']['managedDomain'] rescue nil
|
63
|
+
if self['family'] == 'StoreServ' && managed_domain
|
64
|
+
deep_merge!(temp_old_data)
|
65
|
+
update
|
66
|
+
end
|
67
|
+
self
|
68
|
+
end
|
69
|
+
|
70
|
+
# Set data and save to OneView
|
71
|
+
# @param [Hash] attributes The attributes to add/change for this resource (key-value pairs)
|
72
|
+
# @raise [OneviewSDK::IncompleteResource] if the client or uri is not set
|
73
|
+
# @raise [StandardError] if the resource save fails
|
74
|
+
# @return [Resource] self
|
75
|
+
def update(attributes = {})
|
76
|
+
set_all(attributes)
|
77
|
+
ensure_client && ensure_uri
|
78
|
+
response = @client.rest_put(@data['uri'] + '/?force=true', { 'body' => @data }, @api_version)
|
79
|
+
@client.response_handler(response)
|
80
|
+
self
|
81
|
+
end
|
82
|
+
|
83
|
+
# Delete resource from OneView
|
84
|
+
# @return [true] if resource was deleted successfully
|
85
|
+
def remove
|
86
|
+
ensure_client && ensure_uri
|
87
|
+
response = @client.rest_delete(@data['uri'], { 'If-Match' => @data['eTag'] }, @api_version)
|
88
|
+
@client.response_handler(response)
|
89
|
+
true
|
90
|
+
end
|
91
|
+
|
92
|
+
# Checks if the resource already exists
|
93
|
+
# @return [Boolean] Whether or not resource exists
|
94
|
+
# @raise [OneviewSDK::IncompleteResource] if required attributes are not filled
|
95
|
+
def exists?
|
96
|
+
temp_item = self.class.new(@client, @data.clone)
|
97
|
+
temp_item.retrieve!
|
98
|
+
end
|
99
|
+
|
100
|
+
# Retrieves the resource details based on this resource's unique identifiers
|
101
|
+
# @note one of the UNIQUE_IDENTIFIERS, deviceSpecificAttributes['serialNumber'] or deviceSpecificAttributes['wwn']
|
102
|
+
# must be specified in the resource
|
103
|
+
# @return [Boolean] Whether or not retrieve was successful
|
104
|
+
# @raise [OneviewSDK::IncompleteResource] if required attributes are not filled
|
105
|
+
def retrieve!
|
106
|
+
data_temp = JSON.load(@data.to_json)
|
107
|
+
serial_number = data_temp['deviceSpecificAttributes']['serialNumber'] rescue nil
|
108
|
+
wwn = data_temp['deviceSpecificAttributes']['wwn'] rescue nil
|
109
|
+
|
110
|
+
proc_retrieve_temp = proc do |identifier|
|
111
|
+
results = self.class.find_by(@client, identifier)
|
112
|
+
if results.size == 1
|
113
|
+
set_all(results.first.data)
|
114
|
+
return true
|
115
|
+
end
|
116
|
+
end
|
117
|
+
proc_retrieve_temp.call('deviceSpecificAttributes' => { 'serialNumber' => serial_number }) if serial_number
|
118
|
+
proc_retrieve_temp.call('deviceSpecificAttributes' => { 'wwn' => wwn }) if wwn
|
119
|
+
|
120
|
+
super
|
121
|
+
rescue IncompleteResource => e
|
122
|
+
raise e unless serial_number || wwn
|
123
|
+
false
|
124
|
+
end
|
125
|
+
|
126
|
+
# Gets the storage ports that are connected on the specified networks based on the storage system port's expected network connectivity
|
127
|
+
# @param [Array] network Array of networks
|
128
|
+
# @return [Array] Array of reachable storage port
|
129
|
+
def get_reachable_ports(networks = [])
|
130
|
+
ensure_client && ensure_uri
|
131
|
+
uri = @data['uri'] + '/reachable-ports'
|
132
|
+
unless networks.empty?
|
133
|
+
network_uris = ensure_and_get_uris(networks)
|
134
|
+
uri += "?networks='#{network_uris.join(',')}'"
|
135
|
+
end
|
136
|
+
self.class.find_with_pagination(@client, uri)
|
137
|
+
end
|
138
|
+
|
139
|
+
# Gets a list of storage templates.
|
140
|
+
# @return [Array] Array of Storage Template
|
141
|
+
def get_templates
|
142
|
+
ensure_client && ensure_uri
|
143
|
+
self.class.find_with_pagination(@client, @data['uri'] + '/templates')
|
144
|
+
end
|
145
|
+
|
146
|
+
# Refreshes a storage system
|
147
|
+
def request_refresh
|
148
|
+
@data['requestingRefresh'] = true
|
149
|
+
update
|
150
|
+
end
|
19
151
|
end
|
20
152
|
end
|
21
153
|
end
|