oneview-sdk 5.2.0 → 5.3.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 +11 -0
- data/Gemfile +0 -0
- data/Guardfile +0 -0
- data/LICENSE +0 -0
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/TESTING.md +0 -0
- data/bin/oneview-sdk-ruby +0 -0
- data/endpoints-support.md +221 -186
- data/lib/oneview-sdk.rb +4 -3
- data/lib/oneview-sdk/cli.rb +9 -9
- data/lib/oneview-sdk/client.rb +6 -6
- 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 +4 -4
- data/lib/oneview-sdk/image-streamer/resource/api300.rb +0 -0
- data/lib/oneview-sdk/image-streamer/resource/api300/artifact_bundle.rb +1 -1
- 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 +1 -1
- 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 +5 -6
- data/lib/oneview-sdk/resource/api200.rb +0 -0
- data/lib/oneview-sdk/resource/api200/client_certificate.rb +0 -0
- data/lib/oneview-sdk/resource/api200/connection_template.rb +0 -0
- data/lib/oneview-sdk/resource/api200/datacenter.rb +0 -0
- data/lib/oneview-sdk/resource/api200/enclosure.rb +5 -6
- data/lib/oneview-sdk/resource/api200/enclosure_group.rb +0 -0
- data/lib/oneview-sdk/resource/api200/ethernet_network.rb +0 -0
- 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 +0 -0
- data/lib/oneview-sdk/resource/api200/firmware_driver.rb +0 -0
- data/lib/oneview-sdk/resource/api200/id_pool.rb +0 -0
- data/lib/oneview-sdk/resource/api200/interconnect.rb +1 -1
- 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 +0 -0
- data/lib/oneview-sdk/resource/api200/logical_interconnect.rb +0 -0
- data/lib/oneview-sdk/resource/api200/logical_interconnect_group.rb +6 -6
- data/lib/oneview-sdk/resource/api200/logical_switch.rb +5 -3
- data/lib/oneview-sdk/resource/api200/logical_switch_group.rb +0 -0
- data/lib/oneview-sdk/resource/api200/login_detail.rb +27 -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 +0 -0
- data/lib/oneview-sdk/resource/api200/rack.rb +8 -1
- 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 +10 -4
- data/lib/oneview-sdk/resource/api200/server_hardware_type.rb +1 -1
- data/lib/oneview-sdk/resource/api200/server_profile.rb +2 -2
- data/lib/oneview-sdk/resource/api200/server_profile_template.rb +0 -0
- data/lib/oneview-sdk/resource/api200/storage_pool.rb +6 -0
- data/lib/oneview-sdk/resource/api200/storage_system.rb +7 -1
- data/lib/oneview-sdk/resource/api200/switch.rb +1 -1
- 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 +5 -4
- data/lib/oneview-sdk/resource/api200/version.rb +27 -0
- data/lib/oneview-sdk/resource/api200/volume.rb +21 -17
- data/lib/oneview-sdk/resource/api200/volume_attachment.rb +0 -0
- data/lib/oneview-sdk/resource/api200/volume_snapshot.rb +0 -0
- data/lib/oneview-sdk/resource/api200/volume_template.rb +7 -10
- data/lib/oneview-sdk/resource/api200/web_server_certificate.rb +0 -0
- data/lib/oneview-sdk/resource/api300.rb +1 -1
- data/lib/oneview-sdk/resource/api300/c7000.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/client_certificate.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/connection_template.rb +0 -0
- 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 -0
- data/lib/oneview-sdk/resource/api300/c7000/ethernet_network.rb +0 -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 +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/fcoe_network.rb +0 -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/c7000/internal_link_set.rb +0 -0
- 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 +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/logical_interconnect.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/logical_interconnect_group.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/logical_switch.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/logical_switch_group.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/login_detail.rb +23 -0
- data/lib/oneview-sdk/resource/api300/c7000/managed_san.rb +0 -0
- data/lib/oneview-sdk/resource/api300/c7000/network_set.rb +0 -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 +3 -5
- 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/version.rb +23 -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 +0 -0
- data/lib/oneview-sdk/resource/api300/synergy.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/client_certificate.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/connection_template.rb +0 -0
- 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 +1 -1
- data/lib/oneview-sdk/resource/api300/synergy/enclosure_group.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/ethernet_network.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/event.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/fabric.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/fc_network.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/fcoe_network.rb +0 -0
- 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 +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/lig_uplink_set.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/logical_downlink.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/logical_enclosure.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/logical_interconnect.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/logical_interconnect_group.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/login_detail.rb +23 -0
- data/lib/oneview-sdk/resource/api300/synergy/managed_san.rb +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/network_set.rb +0 -0
- 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 +0 -0
- data/lib/oneview-sdk/resource/api300/synergy/server_profile_template.rb +0 -0
- 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/version.rb +23 -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 +0 -0
- data/lib/oneview-sdk/resource/api500.rb +1 -1
- data/lib/oneview-sdk/resource/api500/c7000.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/client_certificate.rb +0 -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 +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/enclosure_group.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/ethernet_network.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/event.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/fabric.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/fc_network.rb +0 -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 +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/interconnect.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/internal_link_set.rb +0 -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 +0 -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/login_detail.rb +23 -0
- data/lib/oneview-sdk/resource/api500/c7000/managed_san.rb +0 -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 +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/server_hardware.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/server_hardware_type.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/server_profile.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/server_profile_template.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/storage_pool.rb +7 -1
- data/lib/oneview-sdk/resource/api500/c7000/storage_system.rb +3 -3
- data/lib/oneview-sdk/resource/api500/c7000/switch.rb +0 -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/version.rb +23 -0
- data/lib/oneview-sdk/resource/api500/c7000/volume.rb +21 -14
- data/lib/oneview-sdk/resource/api500/c7000/volume_attachment.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/volume_snapshot.rb +0 -0
- data/lib/oneview-sdk/resource/api500/c7000/volume_template.rb +3 -5
- data/lib/oneview-sdk/resource/api500/c7000/web_server_certificate.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/client_certificate.rb +0 -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 +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/enclosure_group.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/ethernet_network.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/event.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/fabric.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/fc_network.rb +0 -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/id_pool.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/interconnect.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/internal_link_set.rb +0 -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 +0 -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/login_detail.rb +23 -0
- data/lib/oneview-sdk/resource/api500/synergy/managed_san.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/network_set.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/os_deployment_plan.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/power_device.rb +0 -0
- 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 +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/server_hardware.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/server_hardware_type.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/server_profile.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/server_profile_template.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/storage_pool.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/storage_system.rb +0 -0
- 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/version.rb +23 -0
- data/lib/oneview-sdk/resource/api500/synergy/volume.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/volume_attachment.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/volume_snapshot.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/volume_template.rb +0 -0
- data/lib/oneview-sdk/resource/api500/synergy/web_server_certificate.rb +0 -0
- data/lib/oneview-sdk/resource_helper.rb +0 -0
- data/lib/oneview-sdk/rest.rb +7 -6
- data/lib/oneview-sdk/scmb.rb +0 -0
- data/lib/oneview-sdk/ssl_helper.rb +3 -2
- data/lib/oneview-sdk/version.rb +1 -1
- data/oneview-sdk.gemspec +3 -2
- metadata +31 -7
data/lib/oneview-sdk.rb
CHANGED
@@ -13,6 +13,7 @@ require_relative 'oneview-sdk/version'
|
|
13
13
|
require_relative 'oneview-sdk/exceptions'
|
14
14
|
require_relative 'oneview-sdk/client'
|
15
15
|
require_relative 'oneview-sdk/resource'
|
16
|
+
require_relative 'oneview-sdk/resource_helper'
|
16
17
|
Dir[File.dirname(__FILE__) + '/oneview-sdk/resource/*.rb'].each { |file| require file }
|
17
18
|
require_relative 'oneview-sdk/scmb'
|
18
19
|
require_relative 'oneview-sdk/image_streamer'
|
@@ -20,9 +21,9 @@ require_relative 'oneview-sdk/cli'
|
|
20
21
|
|
21
22
|
# Module for interacting with the HPE OneView API
|
22
23
|
module OneviewSDK
|
23
|
-
env_sdk = %w
|
24
|
-
env_sdk.concat %w
|
25
|
-
env_i3s = %w
|
24
|
+
env_sdk = %w[ONEVIEWSDK_URL ONEVIEWSDK_USER ONEVIEWSDK_PASSWORD ONEVIEWSDK_TOKEN ONEVIEWSDK_DOMAIN]
|
25
|
+
env_sdk.concat %w[ONEVIEWSDK_SSL_ENABLED ONEVIEWSDK_API_VERSION ONEVIEWSDK_VARIANT]
|
26
|
+
env_i3s = %w[I3S_URL I3S_SSL_ENABLED]
|
26
27
|
ENV_VARS = env_sdk.concat(env_i3s).freeze
|
27
28
|
|
28
29
|
SUPPORTED_API_VERSIONS = [200, 300, 500].freeze
|
data/lib/oneview-sdk/cli.rb
CHANGED
@@ -73,7 +73,7 @@ module OneviewSDK
|
|
73
73
|
class_option :log_level,
|
74
74
|
desc: 'Log level to use',
|
75
75
|
aliases: '-l',
|
76
|
-
enum: %w
|
76
|
+
enum: %w[debug info warn error],
|
77
77
|
default: :warn
|
78
78
|
|
79
79
|
map ['-v', '--version'] => :version
|
@@ -108,7 +108,7 @@ module OneviewSDK
|
|
108
108
|
method_option :format,
|
109
109
|
desc: 'Output format',
|
110
110
|
aliases: '-f',
|
111
|
-
enum: %w
|
111
|
+
enum: %w[json yaml human],
|
112
112
|
default: 'human'
|
113
113
|
desc 'env', 'Show environment variables for oneview-sdk-ruby'
|
114
114
|
# Show environment variables for oneview-sdk-ruby
|
@@ -117,7 +117,7 @@ module OneviewSDK
|
|
117
117
|
OneviewSDK::ENV_VARS.each { |k| data[k] = ENV[k] }
|
118
118
|
if @options['format'] == 'human'
|
119
119
|
data.each do |key, value|
|
120
|
-
value = "'#{value}'" if value && !%w
|
120
|
+
value = "'#{value}'" if value && !%w[true false].include?(value)
|
121
121
|
printf "%-#{data.keys.max_by(&:length).length}s = %s\n", key, value || 'nil'
|
122
122
|
end
|
123
123
|
else
|
@@ -135,7 +135,7 @@ module OneviewSDK
|
|
135
135
|
method_option :format,
|
136
136
|
desc: 'Output format',
|
137
137
|
aliases: '-f',
|
138
|
-
enum: %w
|
138
|
+
enum: %w[json yaml human],
|
139
139
|
default: 'human'
|
140
140
|
desc 'list TYPE', 'List names of resources'
|
141
141
|
# List names of resources
|
@@ -150,7 +150,7 @@ module OneviewSDK
|
|
150
150
|
method_option :format,
|
151
151
|
desc: 'Output format',
|
152
152
|
aliases: '-f',
|
153
|
-
enum: %w
|
153
|
+
enum: %w[json yaml human],
|
154
154
|
default: 'human'
|
155
155
|
method_option :attribute,
|
156
156
|
type: :string,
|
@@ -177,7 +177,7 @@ module OneviewSDK
|
|
177
177
|
method_option :format,
|
178
178
|
desc: 'Output format',
|
179
179
|
aliases: '-f',
|
180
|
-
enum: %w
|
180
|
+
enum: %w[json yaml human],
|
181
181
|
default: 'human'
|
182
182
|
method_option :attribute,
|
183
183
|
type: :string,
|
@@ -218,7 +218,7 @@ module OneviewSDK
|
|
218
218
|
method_option :format,
|
219
219
|
desc: 'Output format',
|
220
220
|
aliases: '-f',
|
221
|
-
enum: %w
|
221
|
+
enum: %w[json yaml raw],
|
222
222
|
default: 'json'
|
223
223
|
method_option :data,
|
224
224
|
desc: 'Data to pass in the request body (in JSON format)',
|
@@ -384,7 +384,7 @@ module OneviewSDK
|
|
384
384
|
method_option :format,
|
385
385
|
desc: 'Output format',
|
386
386
|
aliases: '-f',
|
387
|
-
enum: %w
|
387
|
+
enum: %w[json yaml],
|
388
388
|
default: 'json'
|
389
389
|
desc 'to_file TYPE NAME', 'Save resource details to file'
|
390
390
|
# Save resource details to file
|
@@ -436,7 +436,7 @@ module OneviewSDK
|
|
436
436
|
method_option :format,
|
437
437
|
desc: 'Output format',
|
438
438
|
aliases: '-f',
|
439
|
-
enum: %w
|
439
|
+
enum: %w[json yaml raw],
|
440
440
|
default: 'json'
|
441
441
|
scmb_examples = "\n oneview-sdk-ruby scmb -r 'scmb.ethernet-networks.#'"
|
442
442
|
scmb_examples << "\n oneview-sdk-ruby scmb -r 'scmb.ethernet-networks.Created'"
|
data/lib/oneview-sdk/client.rb
CHANGED
@@ -17,9 +17,9 @@ require_relative 'ssl_helper'
|
|
17
17
|
module OneviewSDK
|
18
18
|
# The client defines the connection to the OneView server and handles communication with it.
|
19
19
|
class Client
|
20
|
-
attr_reader :max_api_version
|
20
|
+
attr_reader :max_api_version, :log_level
|
21
21
|
attr_accessor :url, :user, :token, :password, :domain, :ssl_enabled, :api_version, \
|
22
|
-
:logger, :
|
22
|
+
:logger, :cert_store, :print_wait_dots, :timeout
|
23
23
|
|
24
24
|
include Rest
|
25
25
|
|
@@ -42,7 +42,7 @@ module OneviewSDK
|
|
42
42
|
options = Hash[options.map { |k, v| [k.to_sym, v] }] # Convert string hash keys to symbols
|
43
43
|
STDOUT.sync = true
|
44
44
|
@logger = options[:logger] || Logger.new(STDOUT)
|
45
|
-
[
|
45
|
+
%i[debug info warn error level=].each { |m| raise InvalidClient, "Logger must respond to #{m} method " unless @logger.respond_to?(m) }
|
46
46
|
self.log_level = options[:log_level] || :info
|
47
47
|
@print_wait_dots = options.fetch(:print_wait_dots, false)
|
48
48
|
@url = options[:url] || ENV['ONEVIEWSDK_URL']
|
@@ -56,8 +56,8 @@ module OneviewSDK
|
|
56
56
|
OneviewSDK.api_version = @api_version unless OneviewSDK.api_version_updated? || !OneviewSDK::SUPPORTED_API_VERSIONS.include?(@api_version)
|
57
57
|
@ssl_enabled = true
|
58
58
|
if ENV.key?('ONEVIEWSDK_SSL_ENABLED')
|
59
|
-
if %w
|
60
|
-
@ssl_enabled = !%w
|
59
|
+
if %w[true false 1 0].include?(ENV['ONEVIEWSDK_SSL_ENABLED'])
|
60
|
+
@ssl_enabled = !%w[false 0].include?(ENV['ONEVIEWSDK_SSL_ENABLED'])
|
61
61
|
else
|
62
62
|
@logger.warn "Unrecognized ssl_enabled value '#{ENV['ONEVIEWSDK_SSL_ENABLED']}'. Valid options are 'true' & 'false'"
|
63
63
|
end
|
@@ -191,7 +191,7 @@ module OneviewSDK
|
|
191
191
|
response = rest_api(:get, '/rest/version', options)
|
192
192
|
version = response_handler(response)['currentVersion']
|
193
193
|
raise ConnectionError, "Couldn't get API version" unless version
|
194
|
-
version = version.to_i if version.class !=
|
194
|
+
version = version.to_i if version.class != Integer
|
195
195
|
version
|
196
196
|
rescue ConnectionError
|
197
197
|
@logger.warn "Failed to get OneView max api version. Using default (#{OneviewSDK::DEFAULT_API_VERSION})"
|
File without changes
|
File without changes
|
@@ -39,7 +39,7 @@ module OneviewSDK
|
|
39
39
|
options = Hash[options.map { |k, v| [k.to_sym, v] }] # Convert string hash keys to symbols
|
40
40
|
STDOUT.sync = true
|
41
41
|
@logger = options[:logger] || Logger.new(STDOUT)
|
42
|
-
[
|
42
|
+
%i[debug info warn error level=].each { |m| raise InvalidClient, "Logger must respond to #{m} method " unless @logger.respond_to?(m) }
|
43
43
|
self.log_level = options[:log_level] || :info
|
44
44
|
@print_wait_dots = options.fetch(:print_wait_dots, false)
|
45
45
|
@url = options[:url] || ENV['I3S_URL']
|
@@ -54,8 +54,8 @@ module OneviewSDK
|
|
54
54
|
OneviewSDK::ImageStreamer.api_version_updated? || !OneviewSDK::ImageStreamer::SUPPORTED_API_VERSIONS.include?(@api_version)
|
55
55
|
@ssl_enabled = true
|
56
56
|
if ENV.key?('I3S_SSL_ENABLED')
|
57
|
-
if %w
|
58
|
-
@ssl_enabled = !%w
|
57
|
+
if %w[true false 1 0].include?(ENV['I3S_SSL_ENABLED'])
|
58
|
+
@ssl_enabled = !%w[false 0].include?(ENV['I3S_SSL_ENABLED'])
|
59
59
|
else
|
60
60
|
@logger.warn "Unrecognized ssl_enabled value '#{ENV['I3S_SSL_ENABLED']}'. Valid options are 'true' & 'false'"
|
61
61
|
end
|
@@ -88,7 +88,7 @@ module OneviewSDK
|
|
88
88
|
response = rest_api(:get, '/rest/version', options)
|
89
89
|
version = response_handler(response)['currentVersion']
|
90
90
|
raise ConnectionError, "Couldn't get API version" unless version
|
91
|
-
version = version.to_i if version.class !=
|
91
|
+
version = version.to_i if version.class != Integer
|
92
92
|
version
|
93
93
|
rescue ConnectionError
|
94
94
|
@logger.warn "Failed to get Image Streamer max api version. Using default (#{OneviewSDK::ImageStreamer::DEFAULT_API_VERSION})"
|
File without changes
|
@@ -16,7 +16,7 @@ module OneviewSDK
|
|
16
16
|
module API300
|
17
17
|
# Artifacts Bundle resource implementation for Image Streamer
|
18
18
|
class ArtifactBundle < Resource
|
19
|
-
ACCEPTED_FORMATS = %w
|
19
|
+
ACCEPTED_FORMATS = %w[.zip .ZIP].freeze # Supported upload extensions
|
20
20
|
|
21
21
|
BASE_URI = '/rest/artifact-bundles'.freeze
|
22
22
|
BACKUPS_URI = "#{BASE_URI}/backups".freeze
|
File without changes
|
File without changes
|
File without changes
|
@@ -17,7 +17,7 @@ module OneviewSDK
|
|
17
17
|
# Golden Image resource implementation for Image Streamer
|
18
18
|
class GoldenImage < Resource
|
19
19
|
BASE_URI = '/rest/golden-images'.freeze
|
20
|
-
ACCEPTED_FORMATS = %w
|
20
|
+
ACCEPTED_FORMATS = %w[.zip .ZIP].freeze # Supported upload extensions
|
21
21
|
|
22
22
|
# Create a resource object, associate it with a client, and set its properties.
|
23
23
|
# @param [OneviewSDK::ImageStreamer::Client] client The client object for the Image Streamer appliance
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/oneview-sdk/resource.rb
CHANGED
@@ -17,7 +17,7 @@ module OneviewSDK
|
|
17
17
|
# Resource base class that defines all common resource functionality.
|
18
18
|
class Resource
|
19
19
|
BASE_URI = '/rest'.freeze
|
20
|
-
UNIQUE_IDENTIFIERS = %w
|
20
|
+
UNIQUE_IDENTIFIERS = %w[name uri].freeze # Ordered list of unique attributes to search by
|
21
21
|
DEFAULT_REQUEST_HEADER = {}.freeze
|
22
22
|
|
23
23
|
attr_accessor \
|
@@ -50,7 +50,7 @@ module OneviewSDK
|
|
50
50
|
# @param [Hash] header The header options for the request (key-value pairs)
|
51
51
|
# @return [Boolean] Whether or not retrieve was successful
|
52
52
|
def retrieve!(header = self.class::DEFAULT_REQUEST_HEADER)
|
53
|
-
retrieval_keys = self.class::UNIQUE_IDENTIFIERS.
|
53
|
+
retrieval_keys = self.class::UNIQUE_IDENTIFIERS.reject { |k| @data[k].nil? }
|
54
54
|
raise IncompleteResource, "Must set resource #{self.class::UNIQUE_IDENTIFIERS.join(' or ')} before trying to retrieve!" if retrieval_keys.empty?
|
55
55
|
retrieval_keys.each do |k|
|
56
56
|
results = self.class.find_by(@client, { k => @data[k] }, self.class::BASE_URI, header)
|
@@ -66,7 +66,7 @@ module OneviewSDK
|
|
66
66
|
# @param [Hash] header The header options for the request (key-value pairs)
|
67
67
|
# @return [Boolean] Whether or not resource exists
|
68
68
|
def exists?(header = self.class::DEFAULT_REQUEST_HEADER)
|
69
|
-
retrieval_keys = self.class::UNIQUE_IDENTIFIERS.
|
69
|
+
retrieval_keys = self.class::UNIQUE_IDENTIFIERS.reject { |k| @data[k].nil? }
|
70
70
|
raise IncompleteResource, "Must set resource #{self.class::UNIQUE_IDENTIFIERS.join(' or ')} before trying to retrieve!" if retrieval_keys.empty?
|
71
71
|
retrieval_keys.each do |k|
|
72
72
|
results = self.class.find_by(@client, { k => @data[k] }, self.class::BASE_URI, header)
|
@@ -133,7 +133,6 @@ module OneviewSDK
|
|
133
133
|
# @return The value set for the given key
|
134
134
|
def []=(key, value)
|
135
135
|
set(key, value)
|
136
|
-
value
|
137
136
|
end
|
138
137
|
|
139
138
|
# Check equality of 2 resources. Same as eql?(other)
|
@@ -234,7 +233,7 @@ module OneviewSDK
|
|
234
233
|
# @note If a .yml or .yaml file extension is given in the file_path, the format will be set automatically
|
235
234
|
# @return [True] The Resource was saved successfully
|
236
235
|
def to_file(file_path, format = :json)
|
237
|
-
format = :yml if %w
|
236
|
+
format = :yml if %w[.yml .yaml].include? File.extname(file_path)
|
238
237
|
temp_data = { type: self.class.name, api_version: @api_version, data: @data }
|
239
238
|
case format.to_sym
|
240
239
|
when :json
|
@@ -379,7 +378,7 @@ module OneviewSDK
|
|
379
378
|
|
380
379
|
# Fail for methods that are not available for one resource
|
381
380
|
def unavailable_method
|
382
|
-
raise MethodUnavailable, "The method ##{caller[
|
381
|
+
raise MethodUnavailable, "The method ##{caller(1..1).first[/`.*'/][1..-2]} is unavailable for this resource"
|
383
382
|
end
|
384
383
|
|
385
384
|
private
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -21,7 +21,7 @@ module OneviewSDK
|
|
21
21
|
include OneviewSDK::ResourceHelper::ConfigurationOperation
|
22
22
|
|
23
23
|
BASE_URI = '/rest/enclosures'.freeze
|
24
|
-
UNIQUE_IDENTIFIERS = %w
|
24
|
+
UNIQUE_IDENTIFIERS = %w[name uri serialNumber activeOaPreferredIP standbyOaPreferredIP].freeze
|
25
25
|
|
26
26
|
# Remove resource from OneView
|
27
27
|
# @return [true] if resource was removed successfully
|
@@ -37,7 +37,6 @@ module OneviewSDK
|
|
37
37
|
@data['type'] ||= 'EnclosureV200'
|
38
38
|
end
|
39
39
|
|
40
|
-
|
41
40
|
# Method is not available
|
42
41
|
# @raise [OneviewSDK::MethodUnavailable] method is not available
|
43
42
|
def create(*)
|
@@ -55,15 +54,15 @@ module OneviewSDK
|
|
55
54
|
# @return [OneviewSDK::Enclosure] self
|
56
55
|
def add
|
57
56
|
ensure_client
|
58
|
-
required_attributes = %w
|
57
|
+
required_attributes = %w[enclosureGroupUri hostname username password licensingIntent]
|
59
58
|
required_attributes.each { |k| raise IncompleteResource, "Missing required attribute: '#{k}'" unless @data.key?(k) }
|
60
59
|
|
61
|
-
optional_attrs = %w
|
60
|
+
optional_attrs = %w[enclosureUri firmwareBaselineUri force forceInstallFirmware state unmanagedEnclosure updateFirmwareOn]
|
62
61
|
temp_data = @data.select { |k, _v| required_attributes.include?(k) || optional_attrs.include?(k) }
|
63
62
|
response = @client.rest_post(self.class::BASE_URI, { 'body' => temp_data }, @api_version)
|
64
63
|
new_data = @client.response_handler(response)
|
65
|
-
old_name = @data.select { |k, _v| %w
|
66
|
-
%w
|
64
|
+
old_name = @data.select { |k, _v| %w[name rackName].include?(k) } # Save name (if given)
|
65
|
+
%w[username password hostname].each { |k| @data.delete(k) } # These are no longer needed
|
67
66
|
set_all(new_data)
|
68
67
|
set_all(old_name)
|
69
68
|
update
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -17,7 +17,7 @@ module OneviewSDK
|
|
17
17
|
class Interconnect < Resource
|
18
18
|
BASE_URI = '/rest/interconnects'.freeze
|
19
19
|
TYPE_URI = '/rest/interconnect-types'.freeze
|
20
|
-
UNIQUE_IDENTIFIERS = %w
|
20
|
+
UNIQUE_IDENTIFIERS = %w[name uri serialNumber].freeze
|
21
21
|
|
22
22
|
# Create a resource object, associate it with a client, and set its properties.
|
23
23
|
# @param [OneviewSDK::Client] client The client object for the OneView appliance
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -63,10 +63,9 @@ module OneviewSDK
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
end
|
66
|
+
return if entry_already_present
|
67
|
+
new_entry = new_interconnect_entry_template(bay, interconnect_type['uri'])
|
68
|
+
@data['interconnectMapTemplate']['interconnectMapEntryTemplates'] << new_entry
|
70
69
|
end
|
71
70
|
|
72
71
|
# Adds an uplink set
|
@@ -85,12 +84,13 @@ module OneviewSDK
|
|
85
84
|
|
86
85
|
# Create the resource on OneView using the current data
|
87
86
|
# @note Calls the refresh method to set additional data
|
87
|
+
# @param [Hash] header The header options for the request (key-value pairs)
|
88
88
|
# @raise [OneviewSDK::IncompleteResource] if the client is not set
|
89
89
|
# @raise [StandardError] if the resource creation fails
|
90
90
|
# @return [Resource] self
|
91
|
-
def create
|
91
|
+
def create(header = {})
|
92
92
|
verify_interconnects_before_save!
|
93
|
-
super
|
93
|
+
super(DEFAULT_REQUEST_HEADER.merge(header))
|
94
94
|
end
|
95
95
|
|
96
96
|
# Set data and save to OneView
|
@@ -31,16 +31,18 @@ module OneviewSDK
|
|
31
31
|
end
|
32
32
|
|
33
33
|
# Create method
|
34
|
+
# @param [Hash] header The header options for the request (key-value pairs)
|
34
35
|
# @raise [OneviewSDK::IncompleteResource] if the client is not set
|
35
36
|
# @raise [StandardError] if the resource creation fails
|
36
37
|
# @return [OneviewSDK::LogicalSwitch] self
|
37
|
-
def create
|
38
|
+
def create(header = {})
|
38
39
|
ensure_client
|
39
40
|
request_body = {}
|
40
41
|
request_body['logicalSwitchCredentials'] = generate_logical_switch_credentials
|
41
42
|
request_body['logicalSwitch'] = @data.clone
|
42
43
|
request_body['logicalSwitch']['switchCredentialConfiguration'] = generate_logical_switch_credential_configuration
|
43
|
-
|
44
|
+
options = DEFAULT_REQUEST_HEADER.merge(header).merge('body' => request_body)
|
45
|
+
response = @client.rest_post(self.class::BASE_URI, options, @api_version)
|
44
46
|
body = @client.response_handler(response)
|
45
47
|
set_all(body)
|
46
48
|
self
|
@@ -99,7 +101,7 @@ module OneviewSDK
|
|
99
101
|
# @return [Array] List of connection properties for each logical switch
|
100
102
|
def generate_logical_switch_credentials
|
101
103
|
credentials = []
|
102
|
-
@logical_switch_credentials.
|
104
|
+
@logical_switch_credentials.each_value do |switch|
|
103
105
|
switch_credentials = []
|
104
106
|
switch_credentials << {
|
105
107
|
'valueFormat' => 'Unknown',
|
File without changes
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# (C) Copyright 2017 Hewlett Packard Enterprise Development LP
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# You may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
6
|
+
#
|
7
|
+
# Unless required by applicable law or agreed to in writing, software distributed
|
8
|
+
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
9
|
+
# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
|
10
|
+
# language governing permissions and limitations under the License.
|
11
|
+
|
12
|
+
module OneviewSDK
|
13
|
+
module API200
|
14
|
+
# Login Details resource implementation
|
15
|
+
class LoginDetail
|
16
|
+
BASE_URI = '/rest/logindetails'.freeze
|
17
|
+
|
18
|
+
# Gets the login details
|
19
|
+
# @param [OneviewSDK::client] client access for resource endpoint
|
20
|
+
# @return [Hash] Response to the api call
|
21
|
+
def self.get_login_details(client)
|
22
|
+
response = client.rest_get(BASE_URI)
|
23
|
+
client.response_handler(response)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
@@ -16,7 +16,7 @@ module OneviewSDK
|
|
16
16
|
# Rack resource implementation
|
17
17
|
class Rack < Resource
|
18
18
|
BASE_URI = '/rest/racks'.freeze
|
19
|
-
UNIQUE_IDENTIFIERS = %w
|
19
|
+
UNIQUE_IDENTIFIERS = %w[name uri serialNumber].freeze
|
20
20
|
|
21
21
|
# Add the resource on OneView using the current data
|
22
22
|
# @note Calls the refresh method to set additional data
|
@@ -51,6 +51,13 @@ module OneviewSDK
|
|
51
51
|
unavailable_method
|
52
52
|
end
|
53
53
|
|
54
|
+
# Updates a rack
|
55
|
+
# @param [Hash] attributes attributes to be updated
|
56
|
+
# @return [OneviewSDK::Rack] self
|
57
|
+
def update(attributes = {}, header = { 'If-Match' => '*' })
|
58
|
+
super(attributes, header)
|
59
|
+
end
|
60
|
+
|
54
61
|
# Adds the rack resource with specified options
|
55
62
|
# @param [OneviewSDK::Resource] resource Resource to be added
|
56
63
|
# @param [String] options rack options
|