test-oneview 5.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +758 -0
- data/Dockerfile +21 -0
- data/Gemfile +14 -0
- data/Guardfile +26 -0
- data/LICENSE +201 -0
- data/README.md +516 -0
- data/Rakefile +126 -0
- data/TESTING.md +61 -0
- data/bin/oneview-sdk-ruby +4 -0
- data/endpoints-support.md +552 -0
- data/lib/oneview-sdk.rb +65 -0
- data/lib/oneview-sdk/cli.rb +639 -0
- data/lib/oneview-sdk/client.rb +220 -0
- data/lib/oneview-sdk/config_loader.rb +31 -0
- data/lib/oneview-sdk/exceptions.rb +91 -0
- data/lib/oneview-sdk/image-streamer/client.rb +99 -0
- data/lib/oneview-sdk/image-streamer/resource/api1000.rb +39 -0
- data/lib/oneview-sdk/image-streamer/resource/api1000/artifact_bundle.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api1000/build_plan.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api1000/deployment_group.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api1000/deployment_plan.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api1000/golden_image.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api1000/os_volume.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api1000/plan_script.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api1020.rb +39 -0
- data/lib/oneview-sdk/image-streamer/resource/api1020/artifact_bundle.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api1020/build_plan.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api1020/deployment_group.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api1020/deployment_plan.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api1020/golden_image.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api1020/os_volume.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api1020/plan_script.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api1600.rb +39 -0
- data/lib/oneview-sdk/image-streamer/resource/api1600/artifact_bundle.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api1600/build_plan.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api1600/deployment_group.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api1600/deployment_plan.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api1600/golden_image.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api1600/os_volume.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api1600/plan_script.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api300.rb +39 -0
- data/lib/oneview-sdk/image-streamer/resource/api300/artifact_bundle.rb +213 -0
- data/lib/oneview-sdk/image-streamer/resource/api300/build_plan.rb +33 -0
- data/lib/oneview-sdk/image-streamer/resource/api300/deployment_group.rb +41 -0
- data/lib/oneview-sdk/image-streamer/resource/api300/deployment_plan.rb +33 -0
- data/lib/oneview-sdk/image-streamer/resource/api300/golden_image.rb +89 -0
- data/lib/oneview-sdk/image-streamer/resource/api300/os_volume.rb +49 -0
- data/lib/oneview-sdk/image-streamer/resource/api300/plan_script.rb +42 -0
- data/lib/oneview-sdk/image-streamer/resource/api300/resource.rb +21 -0
- data/lib/oneview-sdk/image-streamer/resource/api500.rb +39 -0
- data/lib/oneview-sdk/image-streamer/resource/api500/artifact_bundle.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api500/build_plan.rb +32 -0
- data/lib/oneview-sdk/image-streamer/resource/api500/deployment_group.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api500/deployment_plan.rb +42 -0
- data/lib/oneview-sdk/image-streamer/resource/api500/golden_image.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api500/os_volume.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api500/plan_script.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api600.rb +39 -0
- data/lib/oneview-sdk/image-streamer/resource/api600/artifact_bundle.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api600/build_plan.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api600/deployment_group.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api600/deployment_plan.rb +31 -0
- data/lib/oneview-sdk/image-streamer/resource/api600/golden_image.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api600/os_volume.rb +39 -0
- data/lib/oneview-sdk/image-streamer/resource/api600/plan_script.rb +31 -0
- data/lib/oneview-sdk/image-streamer/resource/api800.rb +39 -0
- data/lib/oneview-sdk/image-streamer/resource/api800/artifact_bundle.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api800/build_plan.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api800/deployment_group.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api800/deployment_plan.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api800/golden_image.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api800/os_volume.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api800/plan_script.rb +22 -0
- data/lib/oneview-sdk/image_streamer.rb +68 -0
- data/lib/oneview-sdk/resource.rb +431 -0
- data/lib/oneview-sdk/resource/api1000.rb +66 -0
- data/lib/oneview-sdk/resource/api1000/c7000.rb +27 -0
- data/lib/oneview-sdk/resource/api1000/c7000/connection_template.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/c7000/enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/c7000/enclosure_group.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/c7000/ethernet_network.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/c7000/fc_network.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/c7000/fcoe_network.rb +23 -0
- data/lib/oneview-sdk/resource/api1000/c7000/firmware_driver.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/c7000/hypervisor_cluster_profile.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/c7000/hypervisor_manager.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/c7000/interconnect.rb +23 -0
- data/lib/oneview-sdk/resource/api1000/c7000/lig_uplink_set.rb +21 -0
- data/lib/oneview-sdk/resource/api1000/c7000/logical_enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/c7000/logical_interconnect.rb +32 -0
- data/lib/oneview-sdk/resource/api1000/c7000/logical_interconnect_group.rb +32 -0
- data/lib/oneview-sdk/resource/api1000/c7000/network_set.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/c7000/scope.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/c7000/server_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/c7000/server_hardware.rb +32 -0
- data/lib/oneview-sdk/resource/api1000/c7000/server_hardware_type.rb +32 -0
- data/lib/oneview-sdk/resource/api1000/c7000/server_profile.rb +32 -0
- data/lib/oneview-sdk/resource/api1000/c7000/server_profile_template.rb +33 -0
- data/lib/oneview-sdk/resource/api1000/c7000/storage_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/c7000/storage_system.rb +35 -0
- data/lib/oneview-sdk/resource/api1000/c7000/uplink_set.rb +32 -0
- data/lib/oneview-sdk/resource/api1000/c7000/volume.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/c7000/volume_attachment.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/c7000/volume_template.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/synergy.rb +27 -0
- data/lib/oneview-sdk/resource/api1000/synergy/connection_template.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/synergy/enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/synergy/enclosure_group.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/synergy/ethernet_network.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/synergy/fc_network.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/synergy/fcoe_network.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/synergy/firmware_driver.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/synergy/hypervisor_cluster_profile.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/synergy/hypervisor_manager.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/synergy/interconnect.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/synergy/lig_uplink_set.rb +21 -0
- data/lib/oneview-sdk/resource/api1000/synergy/logical_enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/synergy/logical_interconnect.rb +32 -0
- data/lib/oneview-sdk/resource/api1000/synergy/logical_interconnect_group.rb +33 -0
- data/lib/oneview-sdk/resource/api1000/synergy/network_set.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/synergy/os_deployment_plan.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/synergy/sas_logical_interconnect_group.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/synergy/scope.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/synergy/server_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/synergy/server_hardware.rb +32 -0
- data/lib/oneview-sdk/resource/api1000/synergy/server_hardware_type.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/synergy/server_profile.rb +25 -0
- data/lib/oneview-sdk/resource/api1000/synergy/server_profile_template.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/synergy/storage_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/synergy/storage_system.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/synergy/uplink_set.rb +32 -0
- data/lib/oneview-sdk/resource/api1000/synergy/volume.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/synergy/volume_attachment.rb +22 -0
- data/lib/oneview-sdk/resource/api1000/synergy/volume_template.rb +22 -0
- data/lib/oneview-sdk/resource/api1200.rb +66 -0
- data/lib/oneview-sdk/resource/api1200/c7000.rb +27 -0
- data/lib/oneview-sdk/resource/api1200/c7000/connection_template.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/c7000/enclosure.rb +32 -0
- data/lib/oneview-sdk/resource/api1200/c7000/enclosure_group.rb +36 -0
- data/lib/oneview-sdk/resource/api1200/c7000/ethernet_network.rb +35 -0
- data/lib/oneview-sdk/resource/api1200/c7000/fc_network.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/c7000/fcoe_network.rb +23 -0
- data/lib/oneview-sdk/resource/api1200/c7000/firmware_driver.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/c7000/hypervisor_cluster_profile.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/c7000/hypervisor_manager.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/c7000/interconnect.rb +33 -0
- data/lib/oneview-sdk/resource/api1200/c7000/lig_uplink_set.rb +21 -0
- data/lib/oneview-sdk/resource/api1200/c7000/logical_enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/c7000/logical_interconnect.rb +32 -0
- data/lib/oneview-sdk/resource/api1200/c7000/logical_interconnect_group.rb +32 -0
- data/lib/oneview-sdk/resource/api1200/c7000/network_set.rb +32 -0
- data/lib/oneview-sdk/resource/api1200/c7000/scope.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/c7000/server_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/c7000/server_hardware.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/c7000/server_hardware_type.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/c7000/server_profile.rb +32 -0
- data/lib/oneview-sdk/resource/api1200/c7000/server_profile_template.rb +33 -0
- data/lib/oneview-sdk/resource/api1200/c7000/storage_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/c7000/storage_system.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/c7000/uplink_set.rb +32 -0
- data/lib/oneview-sdk/resource/api1200/c7000/volume.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/c7000/volume_attachment.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/c7000/volume_template.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/synergy.rb +27 -0
- data/lib/oneview-sdk/resource/api1200/synergy/connection_template.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/synergy/enclosure.rb +32 -0
- data/lib/oneview-sdk/resource/api1200/synergy/enclosure_group.rb +36 -0
- data/lib/oneview-sdk/resource/api1200/synergy/ethernet_network.rb +35 -0
- data/lib/oneview-sdk/resource/api1200/synergy/fc_network.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/synergy/fcoe_network.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/synergy/firmware_driver.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/synergy/hypervisor_cluster_profile.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/synergy/hypervisor_manager.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/synergy/interconnect.rb +32 -0
- data/lib/oneview-sdk/resource/api1200/synergy/lig_uplink_set.rb +21 -0
- data/lib/oneview-sdk/resource/api1200/synergy/logical_enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/synergy/logical_interconnect.rb +32 -0
- data/lib/oneview-sdk/resource/api1200/synergy/logical_interconnect_group.rb +32 -0
- data/lib/oneview-sdk/resource/api1200/synergy/network_set.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/synergy/os_deployment_plan.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/synergy/sas_logical_interconnect_group.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/synergy/scope.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/synergy/server_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/synergy/server_hardware.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/synergy/server_hardware_type.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/synergy/server_profile.rb +25 -0
- data/lib/oneview-sdk/resource/api1200/synergy/server_profile_template.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/synergy/storage_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/synergy/storage_system.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/synergy/uplink_set.rb +32 -0
- data/lib/oneview-sdk/resource/api1200/synergy/volume.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/synergy/volume_attachment.rb +22 -0
- data/lib/oneview-sdk/resource/api1200/synergy/volume_template.rb +22 -0
- data/lib/oneview-sdk/resource/api1600.rb +66 -0
- data/lib/oneview-sdk/resource/api1600/c7000.rb +27 -0
- data/lib/oneview-sdk/resource/api1600/c7000/connection_template.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/c7000/enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/c7000/enclosure_group.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/c7000/ethernet_network.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/c7000/fc_network.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/c7000/fcoe_network.rb +23 -0
- data/lib/oneview-sdk/resource/api1600/c7000/firmware_driver.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/c7000/hypervisor_cluster_profile.rb +36 -0
- data/lib/oneview-sdk/resource/api1600/c7000/hypervisor_manager.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/c7000/interconnect.rb +26 -0
- data/lib/oneview-sdk/resource/api1600/c7000/lig_uplink_set.rb +21 -0
- data/lib/oneview-sdk/resource/api1600/c7000/logical_enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/c7000/logical_interconnect.rb +32 -0
- data/lib/oneview-sdk/resource/api1600/c7000/logical_interconnect_group.rb +36 -0
- data/lib/oneview-sdk/resource/api1600/c7000/network_set.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/c7000/scope.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/c7000/server_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/c7000/server_hardware.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/c7000/server_hardware_type.rb +25 -0
- data/lib/oneview-sdk/resource/api1600/c7000/server_profile.rb +40 -0
- data/lib/oneview-sdk/resource/api1600/c7000/server_profile_template.rb +32 -0
- data/lib/oneview-sdk/resource/api1600/c7000/storage_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/c7000/storage_system.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/c7000/uplink_set.rb +32 -0
- data/lib/oneview-sdk/resource/api1600/c7000/volume.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/c7000/volume_attachment.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/c7000/volume_template.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/synergy.rb +27 -0
- data/lib/oneview-sdk/resource/api1600/synergy/connection_template.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/synergy/enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/synergy/enclosure_group.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/synergy/ethernet_network.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/synergy/fc_network.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/synergy/fcoe_network.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/synergy/firmware_driver.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/synergy/hypervisor_cluster_profile.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/synergy/hypervisor_manager.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/synergy/interconnect.rb +25 -0
- data/lib/oneview-sdk/resource/api1600/synergy/lig_uplink_set.rb +21 -0
- data/lib/oneview-sdk/resource/api1600/synergy/logical_enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/synergy/logical_interconnect.rb +32 -0
- data/lib/oneview-sdk/resource/api1600/synergy/logical_interconnect_group.rb +36 -0
- data/lib/oneview-sdk/resource/api1600/synergy/network_set.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/synergy/os_deployment_plan.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/synergy/scope.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/synergy/server_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/synergy/server_hardware.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/synergy/server_hardware_type.rb +25 -0
- data/lib/oneview-sdk/resource/api1600/synergy/server_profile.rb +25 -0
- data/lib/oneview-sdk/resource/api1600/synergy/server_profile_template.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/synergy/storage_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/synergy/storage_system.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/synergy/uplink_set.rb +32 -0
- data/lib/oneview-sdk/resource/api1600/synergy/volume.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/synergy/volume_attachment.rb +22 -0
- data/lib/oneview-sdk/resource/api1600/synergy/volume_template.rb +22 -0
- data/lib/oneview-sdk/resource/api1800.rb +66 -0
- data/lib/oneview-sdk/resource/api1800/c7000.rb +27 -0
- data/lib/oneview-sdk/resource/api1800/c7000/connection_template.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/c7000/enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/c7000/enclosure_group.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/c7000/ethernet_network.rb +28 -0
- data/lib/oneview-sdk/resource/api1800/c7000/fc_network.rb +28 -0
- data/lib/oneview-sdk/resource/api1800/c7000/fcoe_network.rb +28 -0
- data/lib/oneview-sdk/resource/api1800/c7000/firmware_driver.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/c7000/hypervisor_cluster_profile.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/c7000/hypervisor_manager.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/c7000/interconnect.rb +26 -0
- data/lib/oneview-sdk/resource/api1800/c7000/lig_uplink_set.rb +21 -0
- data/lib/oneview-sdk/resource/api1800/c7000/logical_enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/c7000/logical_interconnect.rb +42 -0
- data/lib/oneview-sdk/resource/api1800/c7000/logical_interconnect_group.rb +25 -0
- data/lib/oneview-sdk/resource/api1800/c7000/network_set.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/c7000/scope.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/c7000/server_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/c7000/server_hardware.rb +51 -0
- data/lib/oneview-sdk/resource/api1800/c7000/server_hardware_type.rb +25 -0
- data/lib/oneview-sdk/resource/api1800/c7000/server_profile.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/c7000/server_profile_template.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/c7000/storage_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/c7000/storage_system.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/c7000/uplink_set.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/c7000/volume.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/c7000/volume_attachment.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/c7000/volume_template.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/synergy.rb +27 -0
- data/lib/oneview-sdk/resource/api1800/synergy/connection_template.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/synergy/enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/synergy/enclosure_group.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/synergy/ethernet_network.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/synergy/fc_network.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/synergy/fcoe_network.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/synergy/firmware_driver.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/synergy/hypervisor_cluster_profile.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/synergy/hypervisor_manager.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/synergy/interconnect.rb +25 -0
- data/lib/oneview-sdk/resource/api1800/synergy/lig_uplink_set.rb +21 -0
- data/lib/oneview-sdk/resource/api1800/synergy/logical_enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/synergy/logical_interconnect.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/synergy/logical_interconnect_group.rb +25 -0
- data/lib/oneview-sdk/resource/api1800/synergy/network_set.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/synergy/os_deployment_plan.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/synergy/scope.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/synergy/server_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/synergy/server_hardware.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/synergy/server_hardware_type.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/synergy/server_profile.rb +25 -0
- data/lib/oneview-sdk/resource/api1800/synergy/server_profile_template.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/synergy/storage_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/synergy/storage_system.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/synergy/uplink_set.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/synergy/volume.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/synergy/volume_attachment.rb +22 -0
- data/lib/oneview-sdk/resource/api1800/synergy/volume_template.rb +22 -0
- data/lib/oneview-sdk/resource/api200.rb +34 -0
- data/lib/oneview-sdk/resource/api200/alerts.rb +39 -0
- data/lib/oneview-sdk/resource/api200/client_certificate.rb +134 -0
- data/lib/oneview-sdk/resource/api200/connection_template.rb +53 -0
- data/lib/oneview-sdk/resource/api200/datacenter.rb +81 -0
- data/lib/oneview-sdk/resource/api200/enclosure.rb +192 -0
- data/lib/oneview-sdk/resource/api200/enclosure_group.rb +93 -0
- data/lib/oneview-sdk/resource/api200/ethernet_network.rb +60 -0
- data/lib/oneview-sdk/resource/api200/event.rb +43 -0
- data/lib/oneview-sdk/resource/api200/fabric.rb +45 -0
- data/lib/oneview-sdk/resource/api200/fc_network.rb +34 -0
- data/lib/oneview-sdk/resource/api200/fcoe_network.rb +32 -0
- data/lib/oneview-sdk/resource/api200/firmware_bundle.rb +31 -0
- data/lib/oneview-sdk/resource/api200/firmware_driver.rb +37 -0
- data/lib/oneview-sdk/resource/api200/id_pool.rb +124 -0
- data/lib/oneview-sdk/resource/api200/interconnect.rb +114 -0
- data/lib/oneview-sdk/resource/api200/lig_uplink_set.rb +106 -0
- data/lib/oneview-sdk/resource/api200/logical_downlink.rb +57 -0
- data/lib/oneview-sdk/resource/api200/logical_enclosure.rb +88 -0
- data/lib/oneview-sdk/resource/api200/logical_interconnect.rb +267 -0
- data/lib/oneview-sdk/resource/api200/logical_interconnect_group.rb +134 -0
- data/lib/oneview-sdk/resource/api200/logical_switch.rb +188 -0
- data/lib/oneview-sdk/resource/api200/logical_switch_group.rb +70 -0
- data/lib/oneview-sdk/resource/api200/login_detail.rb +27 -0
- data/lib/oneview-sdk/resource/api200/managed_san.rb +83 -0
- data/lib/oneview-sdk/resource/api200/network_set.rb +68 -0
- data/lib/oneview-sdk/resource/api200/power_device.rb +178 -0
- data/lib/oneview-sdk/resource/api200/rack.rb +95 -0
- data/lib/oneview-sdk/resource/api200/resource.rb +18 -0
- data/lib/oneview-sdk/resource/api200/san_manager.rb +92 -0
- data/lib/oneview-sdk/resource/api200/server_hardware.rb +250 -0
- data/lib/oneview-sdk/resource/api200/server_hardware_type.rb +61 -0
- data/lib/oneview-sdk/resource/api200/server_profile.rb +396 -0
- data/lib/oneview-sdk/resource/api200/server_profile_template.rb +227 -0
- data/lib/oneview-sdk/resource/api200/storage_pool.rb +99 -0
- data/lib/oneview-sdk/resource/api200/storage_system.rb +159 -0
- data/lib/oneview-sdk/resource/api200/switch.rb +85 -0
- data/lib/oneview-sdk/resource/api200/unmanaged_device.rb +59 -0
- data/lib/oneview-sdk/resource/api200/uplink_set.rb +92 -0
- data/lib/oneview-sdk/resource/api200/user.rb +98 -0
- data/lib/oneview-sdk/resource/api200/version.rb +27 -0
- data/lib/oneview-sdk/resource/api200/volume.rb +191 -0
- data/lib/oneview-sdk/resource/api200/volume_attachment.rb +85 -0
- data/lib/oneview-sdk/resource/api200/volume_snapshot.rb +50 -0
- data/lib/oneview-sdk/resource/api200/volume_template.rb +96 -0
- data/lib/oneview-sdk/resource/api200/web_server_certificate.rb +97 -0
- data/lib/oneview-sdk/resource/api2000.rb +66 -0
- data/lib/oneview-sdk/resource/api2000/c7000.rb +27 -0
- data/lib/oneview-sdk/resource/api2000/c7000/connection_template.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/c7000/enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/c7000/enclosure_group.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/c7000/ethernet_network.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/c7000/fc_network.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/c7000/fcoe_network.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/c7000/firmware_driver.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/c7000/hypervisor_cluster_profile.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/c7000/hypervisor_manager.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/c7000/interconnect.rb +26 -0
- data/lib/oneview-sdk/resource/api2000/c7000/lig_uplink_set.rb +21 -0
- data/lib/oneview-sdk/resource/api2000/c7000/logical_enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/c7000/logical_interconnect.rb +33 -0
- data/lib/oneview-sdk/resource/api2000/c7000/logical_interconnect_group.rb +25 -0
- data/lib/oneview-sdk/resource/api2000/c7000/network_set.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/c7000/scope.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/c7000/server_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/c7000/server_hardware.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/c7000/server_hardware_type.rb +25 -0
- data/lib/oneview-sdk/resource/api2000/c7000/server_profile.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/c7000/server_profile_template.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/c7000/storage_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/c7000/storage_system.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/c7000/uplink_set.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/c7000/volume.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/c7000/volume_attachment.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/c7000/volume_template.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/synergy.rb +27 -0
- data/lib/oneview-sdk/resource/api2000/synergy/connection_template.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/synergy/enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/synergy/enclosure_group.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/synergy/ethernet_network.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/synergy/fc_network.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/synergy/fcoe_network.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/synergy/firmware_driver.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/synergy/hypervisor_cluster_profile.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/synergy/hypervisor_manager.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/synergy/interconnect.rb +25 -0
- data/lib/oneview-sdk/resource/api2000/synergy/lig_uplink_set.rb +21 -0
- data/lib/oneview-sdk/resource/api2000/synergy/logical_enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/synergy/logical_interconnect.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/synergy/logical_interconnect_group.rb +25 -0
- data/lib/oneview-sdk/resource/api2000/synergy/network_set.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/synergy/os_deployment_plan.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/synergy/scope.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/synergy/server_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/synergy/server_hardware.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/synergy/server_hardware_type.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/synergy/server_profile.rb +25 -0
- data/lib/oneview-sdk/resource/api2000/synergy/server_profile_template.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/synergy/storage_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/synergy/storage_system.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/synergy/uplink_set.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/synergy/volume.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/synergy/volume_attachment.rb +22 -0
- data/lib/oneview-sdk/resource/api2000/synergy/volume_template.rb +22 -0
- data/lib/oneview-sdk/resource/api300.rb +66 -0
- data/lib/oneview-sdk/resource/api300/c7000.rb +27 -0
- data/lib/oneview-sdk/resource/api300/c7000/alerts.rb +22 -0
- data/lib/oneview-sdk/resource/api300/c7000/client_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api300/c7000/connection_template.rb +22 -0
- data/lib/oneview-sdk/resource/api300/c7000/datacenter.rb +22 -0
- data/lib/oneview-sdk/resource/api300/c7000/enclosure.rb +36 -0
- data/lib/oneview-sdk/resource/api300/c7000/enclosure_group.rb +89 -0
- data/lib/oneview-sdk/resource/api300/c7000/ethernet_network.rb +37 -0
- data/lib/oneview-sdk/resource/api300/c7000/event.rb +22 -0
- data/lib/oneview-sdk/resource/api300/c7000/fabric.rb +22 -0
- data/lib/oneview-sdk/resource/api300/c7000/fc_network.rb +39 -0
- data/lib/oneview-sdk/resource/api300/c7000/fcoe_network.rb +37 -0
- data/lib/oneview-sdk/resource/api300/c7000/firmware_bundle.rb +21 -0
- data/lib/oneview-sdk/resource/api300/c7000/firmware_driver.rb +22 -0
- data/lib/oneview-sdk/resource/api300/c7000/id_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api300/c7000/interconnect.rb +33 -0
- data/lib/oneview-sdk/resource/api300/c7000/internal_link_set.rb +58 -0
- data/lib/oneview-sdk/resource/api300/c7000/lig_uplink_set.rb +21 -0
- data/lib/oneview-sdk/resource/api300/c7000/logical_downlink.rb +34 -0
- data/lib/oneview-sdk/resource/api300/c7000/logical_enclosure.rb +37 -0
- data/lib/oneview-sdk/resource/api300/c7000/logical_interconnect.rb +45 -0
- data/lib/oneview-sdk/resource/api300/c7000/logical_interconnect_group.rb +35 -0
- data/lib/oneview-sdk/resource/api300/c7000/logical_switch.rb +36 -0
- data/lib/oneview-sdk/resource/api300/c7000/logical_switch_group.rb +35 -0
- data/lib/oneview-sdk/resource/api300/c7000/login_detail.rb +23 -0
- data/lib/oneview-sdk/resource/api300/c7000/managed_san.rb +36 -0
- data/lib/oneview-sdk/resource/api300/c7000/network_set.rb +39 -0
- data/lib/oneview-sdk/resource/api300/c7000/power_device.rb +21 -0
- data/lib/oneview-sdk/resource/api300/c7000/rack.rb +22 -0
- data/lib/oneview-sdk/resource/api300/c7000/resource.rb +21 -0
- data/lib/oneview-sdk/resource/api300/c7000/san_manager.rb +22 -0
- data/lib/oneview-sdk/resource/api300/c7000/scope.rb +140 -0
- data/lib/oneview-sdk/resource/api300/c7000/server_hardware.rb +67 -0
- data/lib/oneview-sdk/resource/api300/c7000/server_hardware_type.rb +21 -0
- data/lib/oneview-sdk/resource/api300/c7000/server_profile.rb +33 -0
- data/lib/oneview-sdk/resource/api300/c7000/server_profile_template.rb +50 -0
- data/lib/oneview-sdk/resource/api300/c7000/storage_pool.rb +29 -0
- data/lib/oneview-sdk/resource/api300/c7000/storage_system.rb +21 -0
- data/lib/oneview-sdk/resource/api300/c7000/switch.rb +43 -0
- data/lib/oneview-sdk/resource/api300/c7000/unmanaged_device.rb +22 -0
- data/lib/oneview-sdk/resource/api300/c7000/uplink_set.rb +33 -0
- data/lib/oneview-sdk/resource/api300/c7000/user.rb +22 -0
- data/lib/oneview-sdk/resource/api300/c7000/version.rb +23 -0
- data/lib/oneview-sdk/resource/api300/c7000/volume.rb +22 -0
- data/lib/oneview-sdk/resource/api300/c7000/volume_attachment.rb +22 -0
- data/lib/oneview-sdk/resource/api300/c7000/volume_snapshot.rb +21 -0
- data/lib/oneview-sdk/resource/api300/c7000/volume_template.rb +32 -0
- data/lib/oneview-sdk/resource/api300/c7000/web_server_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy.rb +27 -0
- data/lib/oneview-sdk/resource/api300/synergy/alerts.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/client_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/connection_template.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/datacenter.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/drive_enclosure.rb +71 -0
- data/lib/oneview-sdk/resource/api300/synergy/enclosure.rb +83 -0
- data/lib/oneview-sdk/resource/api300/synergy/enclosure_group.rb +40 -0
- data/lib/oneview-sdk/resource/api300/synergy/ethernet_network.rb +37 -0
- data/lib/oneview-sdk/resource/api300/synergy/event.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/fabric.rb +46 -0
- data/lib/oneview-sdk/resource/api300/synergy/fc_network.rb +39 -0
- data/lib/oneview-sdk/resource/api300/synergy/fcoe_network.rb +24 -0
- data/lib/oneview-sdk/resource/api300/synergy/firmware_bundle.rb +21 -0
- data/lib/oneview-sdk/resource/api300/synergy/firmware_driver.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/id_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/interconnect.rb +53 -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 +21 -0
- data/lib/oneview-sdk/resource/api300/synergy/logical_downlink.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/logical_enclosure.rb +59 -0
- data/lib/oneview-sdk/resource/api300/synergy/logical_interconnect.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/logical_interconnect_group.rb +122 -0
- data/lib/oneview-sdk/resource/api300/synergy/login_detail.rb +23 -0
- data/lib/oneview-sdk/resource/api300/synergy/managed_san.rb +23 -0
- data/lib/oneview-sdk/resource/api300/synergy/network_set.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/os_deployment_plan.rb +41 -0
- data/lib/oneview-sdk/resource/api300/synergy/power_device.rb +21 -0
- data/lib/oneview-sdk/resource/api300/synergy/rack.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/resource.rb +21 -0
- data/lib/oneview-sdk/resource/api300/synergy/san_manager.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/sas_interconnect.rb +87 -0
- data/lib/oneview-sdk/resource/api300/synergy/sas_logical_interconnect.rb +103 -0
- data/lib/oneview-sdk/resource/api300/synergy/sas_logical_interconnect_group.rb +87 -0
- data/lib/oneview-sdk/resource/api300/synergy/scope.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/server_hardware.rb +30 -0
- data/lib/oneview-sdk/resource/api300/synergy/server_hardware_type.rb +21 -0
- data/lib/oneview-sdk/resource/api300/synergy/server_profile.rb +88 -0
- data/lib/oneview-sdk/resource/api300/synergy/server_profile_template.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/storage_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/storage_system.rb +21 -0
- data/lib/oneview-sdk/resource/api300/synergy/switch.rb +37 -0
- data/lib/oneview-sdk/resource/api300/synergy/unmanaged_device.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/uplink_set.rb +33 -0
- data/lib/oneview-sdk/resource/api300/synergy/user.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/version.rb +23 -0
- data/lib/oneview-sdk/resource/api300/synergy/volume.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/volume_attachment.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/volume_snapshot.rb +21 -0
- data/lib/oneview-sdk/resource/api300/synergy/volume_template.rb +32 -0
- data/lib/oneview-sdk/resource/api300/synergy/web_server_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api500.rb +66 -0
- data/lib/oneview-sdk/resource/api500/c7000.rb +27 -0
- data/lib/oneview-sdk/resource/api500/c7000/alerts.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/client_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/connection_template.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/datacenter.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/enclosure.rb +57 -0
- data/lib/oneview-sdk/resource/api500/c7000/enclosure_group.rb +43 -0
- data/lib/oneview-sdk/resource/api500/c7000/ethernet_network.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/event.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/fabric.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/fc_network.rb +24 -0
- data/lib/oneview-sdk/resource/api500/c7000/fcoe_network.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/firmware_bundle.rb +21 -0
- data/lib/oneview-sdk/resource/api500/c7000/firmware_driver.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/id_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/interconnect.rb +31 -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 +21 -0
- data/lib/oneview-sdk/resource/api500/c7000/logical_downlink.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/logical_enclosure.rb +62 -0
- data/lib/oneview-sdk/resource/api500/c7000/logical_interconnect.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/logical_interconnect_group.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/logical_switch.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/logical_switch_group.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/login_detail.rb +23 -0
- data/lib/oneview-sdk/resource/api500/c7000/managed_san.rb +32 -0
- data/lib/oneview-sdk/resource/api500/c7000/network_set.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/power_device.rb +21 -0
- data/lib/oneview-sdk/resource/api500/c7000/rack.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/resource.rb +21 -0
- data/lib/oneview-sdk/resource/api500/c7000/san_manager.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/scope.rb +71 -0
- data/lib/oneview-sdk/resource/api500/c7000/server_hardware.rb +42 -0
- data/lib/oneview-sdk/resource/api500/c7000/server_hardware_type.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/server_profile.rb +81 -0
- data/lib/oneview-sdk/resource/api500/c7000/server_profile_template.rb +108 -0
- data/lib/oneview-sdk/resource/api500/c7000/storage_pool.rb +116 -0
- data/lib/oneview-sdk/resource/api500/c7000/storage_system.rb +154 -0
- data/lib/oneview-sdk/resource/api500/c7000/switch.rb +29 -0
- data/lib/oneview-sdk/resource/api500/c7000/unmanaged_device.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/uplink_set.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/user.rb +22 -0
- data/lib/oneview-sdk/resource/api500/c7000/version.rb +23 -0
- data/lib/oneview-sdk/resource/api500/c7000/volume.rb +221 -0
- data/lib/oneview-sdk/resource/api500/c7000/volume_attachment.rb +45 -0
- data/lib/oneview-sdk/resource/api500/c7000/volume_snapshot.rb +32 -0
- data/lib/oneview-sdk/resource/api500/c7000/volume_template.rb +111 -0
- data/lib/oneview-sdk/resource/api500/c7000/web_server_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy.rb +27 -0
- data/lib/oneview-sdk/resource/api500/synergy/alerts.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/client_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/connection_template.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/datacenter.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/drive_enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/enclosure.rb +57 -0
- data/lib/oneview-sdk/resource/api500/synergy/enclosure_group.rb +49 -0
- data/lib/oneview-sdk/resource/api500/synergy/ethernet_network.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/event.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/fabric.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/fc_network.rb +24 -0
- data/lib/oneview-sdk/resource/api500/synergy/fcoe_network.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/firmware_bundle.rb +21 -0
- data/lib/oneview-sdk/resource/api500/synergy/firmware_driver.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/id_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/interconnect.rb +38 -0
- data/lib/oneview-sdk/resource/api500/synergy/internal_link_set.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/lig_uplink_set.rb +21 -0
- data/lib/oneview-sdk/resource/api500/synergy/logical_downlink.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/logical_enclosure.rb +39 -0
- data/lib/oneview-sdk/resource/api500/synergy/logical_interconnect.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/logical_interconnect_group.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/login_detail.rb +23 -0
- data/lib/oneview-sdk/resource/api500/synergy/managed_san.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/network_set.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/os_deployment_plan.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/power_device.rb +21 -0
- data/lib/oneview-sdk/resource/api500/synergy/rack.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/resource.rb +21 -0
- data/lib/oneview-sdk/resource/api500/synergy/san_manager.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/sas_interconnect.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/sas_logical_interconnect.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/sas_logical_interconnect_group.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/scope.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/server_hardware.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/server_hardware_type.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/server_profile.rb +25 -0
- data/lib/oneview-sdk/resource/api500/synergy/server_profile_template.rb +36 -0
- data/lib/oneview-sdk/resource/api500/synergy/storage_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/storage_system.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/switch.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/unmanaged_device.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/uplink_set.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/user.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/version.rb +23 -0
- data/lib/oneview-sdk/resource/api500/synergy/volume.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/volume_attachment.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/volume_snapshot.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/volume_template.rb +22 -0
- data/lib/oneview-sdk/resource/api500/synergy/web_server_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api600.rb +66 -0
- data/lib/oneview-sdk/resource/api600/c7000.rb +27 -0
- data/lib/oneview-sdk/resource/api600/c7000/alerts.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/client_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/connection_template.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/datacenter.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/enclosure.rb +71 -0
- data/lib/oneview-sdk/resource/api600/c7000/enclosure_group.rb +39 -0
- data/lib/oneview-sdk/resource/api600/c7000/ethernet_network.rb +47 -0
- data/lib/oneview-sdk/resource/api600/c7000/event.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/fabric.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/fc_network.rb +35 -0
- data/lib/oneview-sdk/resource/api600/c7000/fcoe_network.rb +33 -0
- data/lib/oneview-sdk/resource/api600/c7000/firmware_bundle.rb +21 -0
- data/lib/oneview-sdk/resource/api600/c7000/firmware_driver.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/id_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/interconnect.rb +34 -0
- data/lib/oneview-sdk/resource/api600/c7000/internal_link_set.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/lig_uplink_set.rb +21 -0
- data/lib/oneview-sdk/resource/api600/c7000/logical_downlink.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/logical_enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/logical_interconnect.rb +39 -0
- data/lib/oneview-sdk/resource/api600/c7000/logical_interconnect_group.rb +33 -0
- data/lib/oneview-sdk/resource/api600/c7000/logical_switch.rb +32 -0
- data/lib/oneview-sdk/resource/api600/c7000/logical_switch_group.rb +32 -0
- data/lib/oneview-sdk/resource/api600/c7000/login_detail.rb +23 -0
- data/lib/oneview-sdk/resource/api600/c7000/managed_san.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/network_set.rb +32 -0
- data/lib/oneview-sdk/resource/api600/c7000/power_device.rb +21 -0
- data/lib/oneview-sdk/resource/api600/c7000/rack.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/resource.rb +21 -0
- data/lib/oneview-sdk/resource/api600/c7000/san_manager.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/scope.rb +103 -0
- data/lib/oneview-sdk/resource/api600/c7000/server_certificate.rb +63 -0
- data/lib/oneview-sdk/resource/api600/c7000/server_hardware.rb +44 -0
- data/lib/oneview-sdk/resource/api600/c7000/server_hardware_type.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/server_profile.rb +82 -0
- data/lib/oneview-sdk/resource/api600/c7000/server_profile_template.rb +49 -0
- data/lib/oneview-sdk/resource/api600/c7000/storage_pool.rb +32 -0
- data/lib/oneview-sdk/resource/api600/c7000/storage_system.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/switch.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/unmanaged_device.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/uplink_set.rb +33 -0
- data/lib/oneview-sdk/resource/api600/c7000/user.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/version.rb +23 -0
- data/lib/oneview-sdk/resource/api600/c7000/volume.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/volume_attachment.rb +45 -0
- data/lib/oneview-sdk/resource/api600/c7000/volume_snapshot.rb +32 -0
- data/lib/oneview-sdk/resource/api600/c7000/volume_template.rb +34 -0
- data/lib/oneview-sdk/resource/api600/c7000/web_server_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy.rb +27 -0
- data/lib/oneview-sdk/resource/api600/synergy/alerts.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/client_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/connection_template.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/datacenter.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/drive_enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/enclosure.rb +71 -0
- data/lib/oneview-sdk/resource/api600/synergy/enclosure_group.rb +41 -0
- data/lib/oneview-sdk/resource/api600/synergy/ethernet_network.rb +47 -0
- data/lib/oneview-sdk/resource/api600/synergy/event.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/fabric.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/fc_network.rb +35 -0
- data/lib/oneview-sdk/resource/api600/synergy/fcoe_network.rb +33 -0
- data/lib/oneview-sdk/resource/api600/synergy/firmware_bundle.rb +21 -0
- data/lib/oneview-sdk/resource/api600/synergy/firmware_driver.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/id_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/interconnect.rb +38 -0
- data/lib/oneview-sdk/resource/api600/synergy/internal_link_set.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/lig_uplink_set.rb +21 -0
- data/lib/oneview-sdk/resource/api600/synergy/logical_downlink.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/logical_enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/logical_interconnect.rb +39 -0
- data/lib/oneview-sdk/resource/api600/synergy/logical_interconnect_group.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/login_detail.rb +23 -0
- data/lib/oneview-sdk/resource/api600/synergy/managed_san.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/network_set.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/os_deployment_plan.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/power_device.rb +21 -0
- data/lib/oneview-sdk/resource/api600/synergy/rack.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/resource.rb +21 -0
- data/lib/oneview-sdk/resource/api600/synergy/san_manager.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/sas_interconnect.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/sas_logical_interconnect.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/sas_logical_interconnect_group.rb +33 -0
- data/lib/oneview-sdk/resource/api600/synergy/scope.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/server_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/server_hardware.rb +33 -0
- data/lib/oneview-sdk/resource/api600/synergy/server_hardware_type.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/server_profile.rb +25 -0
- data/lib/oneview-sdk/resource/api600/synergy/server_profile_template.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/storage_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/storage_system.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/switch.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/unmanaged_device.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/uplink_set.rb +33 -0
- data/lib/oneview-sdk/resource/api600/synergy/user.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/version.rb +23 -0
- data/lib/oneview-sdk/resource/api600/synergy/volume.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/volume_attachment.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/volume_snapshot.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/volume_template.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/web_server_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api800.rb +66 -0
- data/lib/oneview-sdk/resource/api800/c7000.rb +27 -0
- data/lib/oneview-sdk/resource/api800/c7000/connection_template.rb +22 -0
- data/lib/oneview-sdk/resource/api800/c7000/enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api800/c7000/enclosure_group.rb +22 -0
- data/lib/oneview-sdk/resource/api800/c7000/ethernet_network.rb +22 -0
- data/lib/oneview-sdk/resource/api800/c7000/fc_network.rb +22 -0
- data/lib/oneview-sdk/resource/api800/c7000/fcoe_network.rb +23 -0
- data/lib/oneview-sdk/resource/api800/c7000/firmware_driver.rb +22 -0
- data/lib/oneview-sdk/resource/api800/c7000/hypervisor_cluster_profile.rb +39 -0
- data/lib/oneview-sdk/resource/api800/c7000/hypervisor_manager.rb +33 -0
- data/lib/oneview-sdk/resource/api800/c7000/interconnect.rb +23 -0
- data/lib/oneview-sdk/resource/api800/c7000/lig_uplink_set.rb +21 -0
- data/lib/oneview-sdk/resource/api800/c7000/logical_enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api800/c7000/logical_interconnect.rb +32 -0
- data/lib/oneview-sdk/resource/api800/c7000/logical_interconnect_group.rb +32 -0
- data/lib/oneview-sdk/resource/api800/c7000/network_set.rb +22 -0
- data/lib/oneview-sdk/resource/api800/c7000/scope.rb +22 -0
- data/lib/oneview-sdk/resource/api800/c7000/server_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api800/c7000/server_hardware.rb +22 -0
- data/lib/oneview-sdk/resource/api800/c7000/server_hardware_type.rb +32 -0
- data/lib/oneview-sdk/resource/api800/c7000/server_profile.rb +32 -0
- data/lib/oneview-sdk/resource/api800/c7000/server_profile_template.rb +33 -0
- data/lib/oneview-sdk/resource/api800/c7000/storage_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api800/c7000/storage_system.rb +22 -0
- data/lib/oneview-sdk/resource/api800/c7000/uplink_set.rb +22 -0
- data/lib/oneview-sdk/resource/api800/c7000/volume.rb +22 -0
- data/lib/oneview-sdk/resource/api800/c7000/volume_attachment.rb +22 -0
- data/lib/oneview-sdk/resource/api800/c7000/volume_template.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy.rb +27 -0
- data/lib/oneview-sdk/resource/api800/synergy/connection_template.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy/enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy/enclosure_group.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy/ethernet_network.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy/fc_network.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy/fcoe_network.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy/firmware_driver.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy/hypervisor_cluster_profile.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy/hypervisor_manager.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy/interconnect.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy/lig_uplink_set.rb +21 -0
- data/lib/oneview-sdk/resource/api800/synergy/logical_enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy/logical_interconnect.rb +32 -0
- data/lib/oneview-sdk/resource/api800/synergy/logical_interconnect_group.rb +33 -0
- data/lib/oneview-sdk/resource/api800/synergy/network_set.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy/os_deployment_plan.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy/sas_logical_interconnect_group.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy/scope.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy/server_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy/server_hardware.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy/server_hardware_type.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy/server_profile.rb +25 -0
- data/lib/oneview-sdk/resource/api800/synergy/server_profile_template.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy/storage_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy/storage_system.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy/uplink_set.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy/volume.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy/volume_attachment.rb +22 -0
- data/lib/oneview-sdk/resource/api800/synergy/volume_template.rb +22 -0
- data/lib/oneview-sdk/resource_helper.rb +44 -0
- data/lib/oneview-sdk/rest.rb +292 -0
- data/lib/oneview-sdk/scmb.rb +71 -0
- data/lib/oneview-sdk/ssl_helper.rb +87 -0
- data/lib/oneview-sdk/version.rb +15 -0
- data/oneview-sdk.gemspec +48 -0
- metadata +1012 -0
data/lib/oneview-sdk.rb
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
# (c) Copyright 2020 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
|
+
require_relative 'oneview-sdk/version'
|
13
|
+
require_relative 'oneview-sdk/exceptions'
|
14
|
+
require_relative 'oneview-sdk/client'
|
15
|
+
require_relative 'oneview-sdk/resource'
|
16
|
+
require_relative 'oneview-sdk/resource_helper'
|
17
|
+
Dir[File.dirname(__FILE__) + '/oneview-sdk/resource/*.rb'].each { |file| require file }
|
18
|
+
require_relative 'oneview-sdk/scmb'
|
19
|
+
require_relative 'oneview-sdk/image_streamer'
|
20
|
+
require_relative 'oneview-sdk/cli'
|
21
|
+
|
22
|
+
# Module for interacting with the HPE OneView API
|
23
|
+
module OneviewSDK
|
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]
|
27
|
+
ENV_VARS = env_sdk.concat(env_i3s).freeze
|
28
|
+
|
29
|
+
SUPPORTED_API_VERSIONS = [200, 300, 500, 600, 800, 1000, 1200, 1600, 1800, 2000].freeze
|
30
|
+
DEFAULT_API_VERSION = 200
|
31
|
+
@api_version = DEFAULT_API_VERSION
|
32
|
+
@api_version_updated = false # Whether or not the API version has been set by the user
|
33
|
+
|
34
|
+
# Get the current API version
|
35
|
+
def self.api_version
|
36
|
+
@api_version
|
37
|
+
end
|
38
|
+
|
39
|
+
# Set the default API version
|
40
|
+
def self.api_version=(version)
|
41
|
+
version = version.to_i rescue version
|
42
|
+
raise UnsupportedVersion, "API version #{version} is not supported!"\
|
43
|
+
unless SUPPORTED_API_VERSIONS.include?(version)
|
44
|
+
raise UnsupportedVariant, "The module for API version #{@api_version} is undefined"\
|
45
|
+
unless constants.include?("API#{@api_version}".to_sym)
|
46
|
+
@api_version_updated = true
|
47
|
+
@api_version = version
|
48
|
+
end
|
49
|
+
|
50
|
+
# Has the API version been set by the user?
|
51
|
+
# @return [TrueClass, FalseClass]
|
52
|
+
def self.api_version_updated?
|
53
|
+
@api_version_updated
|
54
|
+
end
|
55
|
+
|
56
|
+
# This method will help redirect to resources within the API module that is currently in use.
|
57
|
+
# It should NOT be called directly. For example, if @@api_version is set to 200, then accessing
|
58
|
+
# OneviewSDK::EthernetNetwork will redirect to OneviewSDK::API200::EthernetNetwork
|
59
|
+
def self.const_missing(const)
|
60
|
+
api_module = OneviewSDK.const_get("API#{@api_version}")
|
61
|
+
api_module.const_get(const)
|
62
|
+
rescue NameError
|
63
|
+
raise NameError, "The #{const} method or resource does not exist for OneView API version #{@api_version}."
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,639 @@
|
|
1
|
+
# (c) Copyright 2016 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
|
+
require 'thor'
|
13
|
+
require 'json'
|
14
|
+
require 'yaml'
|
15
|
+
require 'highline/import'
|
16
|
+
|
17
|
+
module OneviewSDK
|
18
|
+
# command-line-interface for oneview-sdk
|
19
|
+
# When you install this gem, this cli should be available to you by running: `$ oneview-sdk-ruby`
|
20
|
+
class Cli < Thor
|
21
|
+
# Runner class to enable testing
|
22
|
+
class Runner
|
23
|
+
def initialize(argv, stdin = STDIN, stdout = STDOUT, stderr = STDERR, kernel = Kernel)
|
24
|
+
@argv = argv
|
25
|
+
@stdin = stdin
|
26
|
+
@stdout = stdout
|
27
|
+
@stderr = stderr
|
28
|
+
@kernel = kernel
|
29
|
+
end
|
30
|
+
|
31
|
+
def execute!
|
32
|
+
exit_code = begin
|
33
|
+
$stderr = @stderr
|
34
|
+
$stdin = @stdin
|
35
|
+
$stdout = @stdout
|
36
|
+
|
37
|
+
OneviewSDK::Cli.start(@argv)
|
38
|
+
0
|
39
|
+
rescue StandardError => e
|
40
|
+
b = e.backtrace
|
41
|
+
@stderr.puts("#{b.shift}: #{e.message} (#{e.class})")
|
42
|
+
@stderr.puts(b.map { |s| "\tfrom #{s}" }.join("\n"))
|
43
|
+
1
|
44
|
+
rescue SystemExit => e
|
45
|
+
e.status
|
46
|
+
end
|
47
|
+
|
48
|
+
# Proxy our exit code back to the injected kernel.
|
49
|
+
@kernel.exit(exit_code)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
SUPPORTED_VARIANTS = OneviewSDK::API300::SUPPORTED_VARIANTS
|
54
|
+
|
55
|
+
class_option :ssl_verify,
|
56
|
+
type: :boolean,
|
57
|
+
desc: 'Enable/Disable SSL verification for requests. Uses ENV[\'ONEVIEWSDK_SSL_ENABLED\']',
|
58
|
+
default: nil
|
59
|
+
|
60
|
+
class_option :url,
|
61
|
+
desc: "URL of OneView appliance. Uses ENV['ONEVIEWSDK_URL']",
|
62
|
+
aliases: '-u'
|
63
|
+
|
64
|
+
class_option :api_version,
|
65
|
+
type: :numeric,
|
66
|
+
banner: 'VERSION',
|
67
|
+
desc: "API version to use. Uses ENV['ONEVIEWSDK_API_VERSION']"
|
68
|
+
|
69
|
+
class_option :variant,
|
70
|
+
desc: "API variant to use. Uses ENV['ONEVIEWSDK_VARIANT']",
|
71
|
+
enum: SUPPORTED_VARIANTS
|
72
|
+
|
73
|
+
class_option :log_level,
|
74
|
+
desc: 'Log level to use',
|
75
|
+
aliases: '-l',
|
76
|
+
enum: %w[debug info warn error],
|
77
|
+
default: :warn
|
78
|
+
|
79
|
+
map ['-v', '--version'] => :version
|
80
|
+
|
81
|
+
|
82
|
+
desc 'console', 'Open a Ruby console with a connection to OneView'
|
83
|
+
# Open a Ruby console with a connection to OneView
|
84
|
+
def console
|
85
|
+
client_setup({}, true, true)
|
86
|
+
puts "Console Connected to #{@client.url}"
|
87
|
+
puts "HINT: The @client object is available to you\n\n"
|
88
|
+
rescue
|
89
|
+
puts "WARNING: Couldn't connect to #{@options['url'] || ENV['ONEVIEWSDK_URL']}\n\n"
|
90
|
+
ensure
|
91
|
+
require 'pry'
|
92
|
+
Pry.config.prompt = proc { '> ' }
|
93
|
+
Pry.plugins['stack_explorer'] && Pry.plugins['stack_explorer'].disable!
|
94
|
+
Pry.plugins['byebug'] && Pry.plugins['byebug'].disable!
|
95
|
+
Pry.start(OneviewSDK::Console.new(@client))
|
96
|
+
end
|
97
|
+
|
98
|
+
desc 'version', 'Print gem and OneView appliance versions'
|
99
|
+
# Print gem and OneView appliance versions
|
100
|
+
def version
|
101
|
+
puts "Gem Version: #{OneviewSDK::VERSION}"
|
102
|
+
client_setup({ 'log_level' => :error }, true)
|
103
|
+
puts "OneView appliance API version at '#{@client.url}' = #{@client.max_api_version}"
|
104
|
+
rescue StandardError, SystemExit
|
105
|
+
puts 'OneView appliance API version unknown'
|
106
|
+
end
|
107
|
+
|
108
|
+
method_option :format,
|
109
|
+
desc: 'Output format',
|
110
|
+
aliases: '-f',
|
111
|
+
enum: %w[json yaml human],
|
112
|
+
default: 'human'
|
113
|
+
desc 'env', 'Show environment variables for oneview-sdk-ruby'
|
114
|
+
# Show environment variables for oneview-sdk-ruby
|
115
|
+
def env
|
116
|
+
data = {}
|
117
|
+
OneviewSDK::ENV_VARS.each { |k| data[k] = ENV[k] }
|
118
|
+
if @options['format'] == 'human'
|
119
|
+
data.each do |key, value|
|
120
|
+
value = "'#{value}'" if value && !%w[true false].include?(value)
|
121
|
+
printf "%-#{data.keys.max_by(&:length).length}s = %s\n", key, value || 'nil'
|
122
|
+
end
|
123
|
+
else
|
124
|
+
output(parse_hash(data, true))
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
desc 'login', 'Attempt authentication and return token'
|
129
|
+
# Attempt authentication and return token
|
130
|
+
def login
|
131
|
+
client_setup
|
132
|
+
puts "Login Successful! Token = #{@client.token}"
|
133
|
+
end
|
134
|
+
|
135
|
+
method_option :format,
|
136
|
+
desc: 'Output format',
|
137
|
+
aliases: '-f',
|
138
|
+
enum: %w[json yaml human],
|
139
|
+
default: 'human'
|
140
|
+
method_option :attribute,
|
141
|
+
type: :string,
|
142
|
+
desc: 'Comma-separated list of attributes to show. Supports nesting/chaining with periods',
|
143
|
+
aliases: '-a'
|
144
|
+
list_examples = "\n oneview-sdk-ruby list ServerProfiles"
|
145
|
+
list_examples << "\n oneview-sdk-ruby list ServerHardware -a serialNumber,mpHostInfo.mpHostName"
|
146
|
+
desc 'list TYPE', "List resources. Examples:#{list_examples}"
|
147
|
+
# List names of resources (and optionally, specific attributes)
|
148
|
+
def list(type)
|
149
|
+
resource_class = parse_type(type)
|
150
|
+
client_setup
|
151
|
+
all = resource_class.get_all(@client)
|
152
|
+
if options['attribute']
|
153
|
+
data = select_attributes_from_multiple(options['attribute'], all)
|
154
|
+
output data, -2 # Shift left by 2 so things look right
|
155
|
+
else # List names only by default
|
156
|
+
names = []
|
157
|
+
all.each { |r| names.push(r['name']) }
|
158
|
+
output names
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
method_option :format,
|
163
|
+
desc: 'Output format',
|
164
|
+
aliases: '-f',
|
165
|
+
enum: %w[json yaml human],
|
166
|
+
default: 'human'
|
167
|
+
method_option :attribute,
|
168
|
+
type: :string,
|
169
|
+
desc: 'Comma-separated list of attributes to show. Supports nesting/chaining with periods',
|
170
|
+
aliases: '-a'
|
171
|
+
desc 'show TYPE NAME', 'Show resource details'
|
172
|
+
show_examples = "\n oneview-sdk-ruby show ServerProfile 'Profile 1'"
|
173
|
+
show_examples << "\n oneview-sdk-ruby show ServerHardware 'Rack1, bay 1' -a serialNumber,mpHostInfo.mpHostName"
|
174
|
+
desc 'show TYPE NAME', "Show resource details. Examples:#{show_examples}"
|
175
|
+
# Show resource details
|
176
|
+
def show(type, name)
|
177
|
+
resource_class = parse_type(type)
|
178
|
+
client_setup
|
179
|
+
matches = resource_class.find_by(@client, name: name)
|
180
|
+
fail_nice 'Not Found' if matches.empty?
|
181
|
+
data = matches.first.data
|
182
|
+
if options['attribute']
|
183
|
+
data = select_attributes(options['attribute'], data)
|
184
|
+
end
|
185
|
+
output data
|
186
|
+
end
|
187
|
+
|
188
|
+
method_option :format,
|
189
|
+
desc: 'Output format',
|
190
|
+
aliases: '-f',
|
191
|
+
enum: %w[json yaml human],
|
192
|
+
default: 'human'
|
193
|
+
method_option :attribute,
|
194
|
+
type: :string,
|
195
|
+
desc: 'Comma-separated list of attributes to show. Supports nesting/chaining with periods',
|
196
|
+
aliases: '-a'
|
197
|
+
method_option :filter,
|
198
|
+
type: :hash,
|
199
|
+
desc: 'Hash of key/value pairs to filter on',
|
200
|
+
required: true
|
201
|
+
search_examples = "\n oneview-sdk-ruby search ServerProfiles --filter=status:Critical"
|
202
|
+
search_examples << "\n oneview-sdk-ruby search ServerHardware --filter=state:ProfileApplied -a mpHostInfo.mpHostName"
|
203
|
+
desc 'search TYPE', "Search for resource by key/value pair(s). Examples:#{search_examples}"
|
204
|
+
|
205
|
+
# Search for resource by key/value pair(s)
|
206
|
+
def search(type)
|
207
|
+
resource_class = parse_type(type)
|
208
|
+
client_setup
|
209
|
+
filter = parse_hash(options['filter'])
|
210
|
+
matches = resource_class.find_by(@client, filter)
|
211
|
+
if matches.empty? # Search with integers & booleans converted
|
212
|
+
filter = parse_hash(options['filter'], true)
|
213
|
+
matches = resource_class.find_by(@client, filter) unless filter == options['filter']
|
214
|
+
end
|
215
|
+
if options['attribute']
|
216
|
+
data = select_attributes_from_multiple(options['attribute'], matches)
|
217
|
+
output data, -2 # Shift left by 2 so things look right
|
218
|
+
else # List names only by default
|
219
|
+
names = []
|
220
|
+
matches.each { |m| names.push(m['name']) }
|
221
|
+
output names
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
method_option :format,
|
226
|
+
desc: 'Output format',
|
227
|
+
aliases: '-f',
|
228
|
+
enum: %w[json yaml raw],
|
229
|
+
default: 'json'
|
230
|
+
method_option :data,
|
231
|
+
desc: 'Data to pass in the request body (in JSON format)',
|
232
|
+
aliases: '-d'
|
233
|
+
rest_examples = "\n oneview-sdk-ruby rest GET rest/fc-networks"
|
234
|
+
rest_examples << "\n oneview-sdk-ruby rest PUT rest/fc-networks/<id> -d '{\"linkStabilityTime\": 20, ...}'"
|
235
|
+
rest_examples << "\n oneview-sdk-ruby rest PUT rest/enclosures/<id>/configuration"
|
236
|
+
desc 'rest METHOD URI', "Make REST call to the OneView API. Examples:#{rest_examples}"
|
237
|
+
# Make REST call to the OneView API
|
238
|
+
def rest(method, uri)
|
239
|
+
log_level = @options['log_level'] == :warn ? :error : @options['log_level'].to_sym # Default to :error
|
240
|
+
client_setup('log_level' => log_level)
|
241
|
+
uri_copy = uri.dup
|
242
|
+
uri_copy.prepend('/') unless uri_copy.start_with?('/')
|
243
|
+
if @options['data']
|
244
|
+
begin
|
245
|
+
data = { body: JSON.parse(@options['data']) }
|
246
|
+
rescue JSON::ParserError => e
|
247
|
+
fail_nice("Failed to parse data as JSON\n#{e.message}")
|
248
|
+
end
|
249
|
+
end
|
250
|
+
data ||= {}
|
251
|
+
response = @client.rest_api(method, uri_copy, data)
|
252
|
+
if response.code.to_i.between?(200, 299)
|
253
|
+
case @options['format']
|
254
|
+
when 'yaml'
|
255
|
+
puts JSON.parse(response.body).to_yaml
|
256
|
+
when 'json'
|
257
|
+
puts JSON.pretty_generate(JSON.parse(response.body))
|
258
|
+
else # raw
|
259
|
+
puts response.body
|
260
|
+
end
|
261
|
+
else
|
262
|
+
body = JSON.pretty_generate(JSON.parse(response.body)) rescue response.body
|
263
|
+
fail_nice("Request failed: #{response.inspect}\nHeaders: #{response.to_hash}\nBody: #{body}")
|
264
|
+
end
|
265
|
+
rescue OneviewSDK::InvalidRequest => e
|
266
|
+
fail_nice(e.message)
|
267
|
+
end
|
268
|
+
|
269
|
+
method_option :hash,
|
270
|
+
type: :hash,
|
271
|
+
desc: 'Hash of key/value pairs to update',
|
272
|
+
aliases: '-h'
|
273
|
+
method_option :json,
|
274
|
+
desc: 'JSON data to pass in the request body',
|
275
|
+
aliases: '-j'
|
276
|
+
update_examples = "\n oneview-sdk-ruby update FCNetwork FC1 -h linkStabilityTime:20"
|
277
|
+
update_examples << "\n oneview-sdk-ruby update Volume VOL1 -j '{\"shareable\": true}'"
|
278
|
+
desc 'update TYPE NAME --[hash|json] <data>', "Update resource by name. Examples:#{update_examples}"
|
279
|
+
# Update resource by name
|
280
|
+
def update(type, name)
|
281
|
+
resource_class = parse_type(type)
|
282
|
+
client_setup
|
283
|
+
fail_nice 'Must set the hash or json option' unless @options['hash'] || @options['json']
|
284
|
+
fail_nice 'Must set the hash OR json option. Not both' if @options['hash'] && @options['json']
|
285
|
+
begin
|
286
|
+
data = @options['hash'] || JSON.parse(@options['json'])
|
287
|
+
rescue JSON::ParserError => e
|
288
|
+
fail_nice("Failed to parse json\n#{e.message}")
|
289
|
+
end
|
290
|
+
matches = resource_class.find_by(@client, name: name)
|
291
|
+
fail_nice 'Not Found' if matches.empty?
|
292
|
+
resource = matches.first
|
293
|
+
begin
|
294
|
+
resource.update(data)
|
295
|
+
puts 'Updated Successfully!'
|
296
|
+
rescue StandardError => e
|
297
|
+
fail_nice "Failed to update #{resource.class.name.split('::').last} '#{name}': #{e}"
|
298
|
+
end
|
299
|
+
end
|
300
|
+
|
301
|
+
method_option :force,
|
302
|
+
desc: 'Delete without confirmation',
|
303
|
+
type: :boolean,
|
304
|
+
aliases: '-f'
|
305
|
+
desc 'delete TYPE NAME', 'Delete resource by name'
|
306
|
+
# Delete resource by name
|
307
|
+
def delete(type, name)
|
308
|
+
resource_class = parse_type(type)
|
309
|
+
client_setup
|
310
|
+
matches = resource_class.find_by(@client, name: name)
|
311
|
+
fail_nice('Not Found', 2) if matches.empty?
|
312
|
+
resource = matches.first
|
313
|
+
return unless options['force'] || agree("Delete '#{name}'? [Y/N] ")
|
314
|
+
begin
|
315
|
+
resource.delete
|
316
|
+
puts 'Deleted Successfully!'
|
317
|
+
rescue StandardError => e
|
318
|
+
fail_nice "Failed to delete #{resource.class.name.split('::').last} '#{name}': #{e}"
|
319
|
+
end
|
320
|
+
end
|
321
|
+
|
322
|
+
method_option :force,
|
323
|
+
desc: 'Delete without confirmation',
|
324
|
+
type: :boolean,
|
325
|
+
aliases: '-f'
|
326
|
+
desc 'delete_from_file FILE_PATH', 'Delete resource defined in file'
|
327
|
+
# Delete resource defined in file
|
328
|
+
def delete_from_file(file_path)
|
329
|
+
client_setup
|
330
|
+
resource = OneviewSDK::Resource.from_file(@client, file_path)
|
331
|
+
fail_nice("#{resource.class.name.split('::').last} '#{resource[:name] || resource[:uri]}' Not Found", 2) unless resource.retrieve!
|
332
|
+
return unless options['force'] || agree("Delete '#{resource[:name]}'? [Y/N] ")
|
333
|
+
begin
|
334
|
+
resource.delete
|
335
|
+
puts 'Deleted Successfully!'
|
336
|
+
rescue StandardError => e
|
337
|
+
fail_nice "Failed to delete #{resource.class.name.split('::').last} '#{resource[:name]}': #{e}"
|
338
|
+
end
|
339
|
+
rescue IncompleteResource => e
|
340
|
+
fail_nice "Failed to delete #{resource.class.name.split('::').last} '#{resource[:name]}': #{e}"
|
341
|
+
rescue SystemCallError => e # File open errors
|
342
|
+
fail_nice e
|
343
|
+
end
|
344
|
+
|
345
|
+
method_option :if_missing,
|
346
|
+
desc: 'Only create if missing (Don\'t update)',
|
347
|
+
type: :boolean,
|
348
|
+
aliases: '-i'
|
349
|
+
desc 'create_from_file FILE_PATH', 'Create/Update resource defined in file'
|
350
|
+
# Create/Update resource defined in file
|
351
|
+
def create_from_file(file_path)
|
352
|
+
client_setup
|
353
|
+
resource = OneviewSDK::Resource.from_file(@client, file_path)
|
354
|
+
fail_nice 'Failed to determine resource type!' if resource.class == OneviewSDK::Resource
|
355
|
+
existing_resource = resource.class.new(@client, resource.data)
|
356
|
+
resource.data.delete('uri')
|
357
|
+
if existing_resource.retrieve!
|
358
|
+
if options['if_missing']
|
359
|
+
puts "Skipped: #{resource.class.name.split('::').last} '#{resource[:name]}' already exists.\n#{existing_resource[:uri]}"
|
360
|
+
return
|
361
|
+
end
|
362
|
+
if existing_resource.like?(resource.data)
|
363
|
+
puts "Skipped: #{resource.class.name.split('::').last} '#{resource[:name]}' is up to date.\n#{existing_resource[:uri]}"
|
364
|
+
return
|
365
|
+
end
|
366
|
+
begin
|
367
|
+
existing_resource.update(resource.data)
|
368
|
+
puts "Updated Successfully!\n#{existing_resource[:uri]}"
|
369
|
+
rescue StandardError => e
|
370
|
+
fail_nice "Failed to update #{resource.class.name.split('::').last} '#{resource[:name]}': #{e}"
|
371
|
+
end
|
372
|
+
else
|
373
|
+
begin
|
374
|
+
resource.create
|
375
|
+
puts "Created Successfully!\n#{resource[:uri]}"
|
376
|
+
rescue StandardError => e
|
377
|
+
fail_nice "Failed to create #{resource.class.name.split('::').last} '#{resource[:name]}': #{e}"
|
378
|
+
end
|
379
|
+
end
|
380
|
+
rescue IncompleteResource => e
|
381
|
+
fail_nice "Failed to create #{resource.class.name.split('::').last} '#{resource[:name]}': #{e}"
|
382
|
+
rescue SystemCallError => e # File open errors
|
383
|
+
fail_nice e
|
384
|
+
end
|
385
|
+
|
386
|
+
method_option :path,
|
387
|
+
desc: 'File path to save resource in',
|
388
|
+
type: :string,
|
389
|
+
aliases: '-p',
|
390
|
+
required: true
|
391
|
+
method_option :format,
|
392
|
+
desc: 'Output format',
|
393
|
+
aliases: '-f',
|
394
|
+
enum: %w[json yaml],
|
395
|
+
default: 'json'
|
396
|
+
desc 'to_file TYPE NAME', 'Save resource details to file'
|
397
|
+
# Save resource details to file
|
398
|
+
def to_file(type, name)
|
399
|
+
file = File.expand_path(options['path'])
|
400
|
+
resource_class = parse_type(type)
|
401
|
+
client_setup
|
402
|
+
resource = resource_class.find_by(@client, name: name).first
|
403
|
+
fail_nice "#{resource_class.name.split('::').last} '#{name}' not found" unless resource
|
404
|
+
resource.to_file(file, options['format'])
|
405
|
+
puts "Output to #{file}"
|
406
|
+
rescue SystemCallError => e
|
407
|
+
fail_nice "Failed to create file! (You may need to create the necessary directories). Message: #{e}"
|
408
|
+
end
|
409
|
+
|
410
|
+
desc 'cert check|import|list URL', 'Check, import, or list OneView certs'
|
411
|
+
# Check, import, or list OneView certs
|
412
|
+
def cert(type, url = ENV['ONEVIEWSDK_URL'])
|
413
|
+
case type.downcase
|
414
|
+
when 'check'
|
415
|
+
fail_nice 'Must specify a url' unless url
|
416
|
+
puts "Checking certificate for '#{url}' ..."
|
417
|
+
if OneviewSDK::SSLHelper.check_cert(url)
|
418
|
+
puts 'Certificate is valid!'
|
419
|
+
else
|
420
|
+
fail_nice 'Certificate Validation Failed!'
|
421
|
+
end
|
422
|
+
when 'import'
|
423
|
+
fail_nice 'Must specify a url' unless url
|
424
|
+
puts "Importing certificate for '#{url}' into '#{OneviewSDK::SSLHelper::CERT_STORE}'..."
|
425
|
+
OneviewSDK::SSLHelper.install_cert(url)
|
426
|
+
when 'list'
|
427
|
+
if File.file?(OneviewSDK::SSLHelper::CERT_STORE)
|
428
|
+
puts File.read(OneviewSDK::SSLHelper::CERT_STORE)
|
429
|
+
else
|
430
|
+
puts 'No certs imported!'
|
431
|
+
end
|
432
|
+
else fail_nice "Invalid action '#{type}'. Valid actions are [check, import, list]"
|
433
|
+
end
|
434
|
+
rescue StandardError => e
|
435
|
+
fail_nice e.message
|
436
|
+
end
|
437
|
+
|
438
|
+
method_option :route,
|
439
|
+
desc: 'Routing key to filter messages',
|
440
|
+
type: :string,
|
441
|
+
aliases: '-r',
|
442
|
+
default: OneviewSDK::SCMB::DEFAULT_ROUTING_KEY
|
443
|
+
method_option :format,
|
444
|
+
desc: 'Output format',
|
445
|
+
aliases: '-f',
|
446
|
+
enum: %w[json yaml raw],
|
447
|
+
default: 'json'
|
448
|
+
scmb_examples = "\n oneview-sdk-ruby scmb -r 'scmb.ethernet-networks.#'"
|
449
|
+
scmb_examples << "\n oneview-sdk-ruby scmb -r 'scmb.ethernet-networks.Created'"
|
450
|
+
scmb_examples << "\n oneview-sdk-ruby scmb -r 'scmb.ethernet-networks.Updated.<resource_uri>'"
|
451
|
+
desc 'scmb', "Subscribe to the OneView State Change Message Bus. Examples:#{scmb_examples}"
|
452
|
+
# Subscribe to the OneView SCMB
|
453
|
+
def scmb
|
454
|
+
client_setup
|
455
|
+
connection = OneviewSDK::SCMB.new_connection(@client)
|
456
|
+
q = OneviewSDK::SCMB.new_queue(connection, @options['route'])
|
457
|
+
puts 'Subscribing to OneView messages. To exit, press Ctrl + c'
|
458
|
+
q.subscribe(block: true) do |_delivery_info, _properties, payload|
|
459
|
+
data = JSON.parse(payload) rescue payload
|
460
|
+
puts "\n#{'=' * 50}\n\nReceived message with payload:"
|
461
|
+
@options['format'] == 'raw' ? puts(payload) : output(data)
|
462
|
+
end
|
463
|
+
end
|
464
|
+
|
465
|
+
private
|
466
|
+
|
467
|
+
def fail_nice(msg = nil, exit_code = 1)
|
468
|
+
puts "ERROR: #{msg}" if msg
|
469
|
+
exit exit_code
|
470
|
+
end
|
471
|
+
|
472
|
+
def client_setup(client_params = {}, quiet = false, throw_errors = false)
|
473
|
+
client_params['ssl_enabled'] = true if @options['ssl_verify'] == true
|
474
|
+
client_params['ssl_enabled'] = false if @options['ssl_verify'] == false
|
475
|
+
client_params['url'] ||= @options['url'] if @options['url']
|
476
|
+
client_params['log_level'] ||= @options['log_level'].to_sym if @options['log_level']
|
477
|
+
client_params['api_version'] ||= @options['api_version'].to_i if @options['api_version']
|
478
|
+
client_params['api_version'] ||= ENV['ONEVIEWSDK_API_VERSION'].to_i if ENV['ONEVIEWSDK_API_VERSION']
|
479
|
+
@client = OneviewSDK::Client.new(client_params)
|
480
|
+
rescue StandardError => e
|
481
|
+
raise e if throw_errors
|
482
|
+
fail_nice if quiet
|
483
|
+
fail_nice "Failed to login to OneView appliance at '#{client_params['url']}'. Message: #{e}"
|
484
|
+
end
|
485
|
+
|
486
|
+
# Get resource class from given string
|
487
|
+
def parse_type(type)
|
488
|
+
api_ver = (@options['api_version'] || ENV['ONEVIEWSDK_API_VERSION'] || OneviewSDK.api_version).to_i
|
489
|
+
unless OneviewSDK::SUPPORTED_API_VERSIONS.include?(api_ver)
|
490
|
+
# Find and use the best available match for the desired API version (round down to nearest)
|
491
|
+
valid_api_ver = OneviewSDK::SUPPORTED_API_VERSIONS.select { |x| x <= api_ver }.max || OneviewSDK::SUPPORTED_API_VERSIONS.min
|
492
|
+
puts "WARNING: Module API version #{api_ver} is not supported. Using #{valid_api_ver}"
|
493
|
+
api_ver = valid_api_ver
|
494
|
+
end
|
495
|
+
variant = @options['variant'] || ENV['ONEVIEWSDK_VARIANT']
|
496
|
+
variant ||= OneviewSDK::API300.variant if api_ver == 300
|
497
|
+
if variant && !SUPPORTED_VARIANTS.include?(variant)
|
498
|
+
fail_nice "Variant '#{variant}' is not supported. Try one of #{SUPPORTED_VARIANTS}"
|
499
|
+
end
|
500
|
+
r = OneviewSDK.resource_named(type, api_ver, variant)
|
501
|
+
# Try default API version as last resort
|
502
|
+
r ||= OneviewSDK.resource_named(type, OneviewSDK.api_version, variant) unless api_ver == OneviewSDK.api_version
|
503
|
+
return r if r && r.respond_to?(:find_by)
|
504
|
+
valid_classes = []
|
505
|
+
api_module = OneviewSDK.const_get("API#{api_ver}")
|
506
|
+
api_module = api_module.const_get(variant.to_s) unless api_ver.to_i == 200
|
507
|
+
api_module.constants.each do |c|
|
508
|
+
klass = api_module.const_get(c)
|
509
|
+
next unless klass.is_a?(Class) && klass.respond_to?(:find_by)
|
510
|
+
valid_classes.push(klass.name.split('::').last)
|
511
|
+
end
|
512
|
+
vc = valid_classes.sort_by!(&:downcase).join("\n ")
|
513
|
+
var = variant ? " (variant #{variant})" : ''
|
514
|
+
fail_nice("Invalid resource type: '#{type}'. Valid options for API version #{api_ver}#{var} are:\n #{vc}")
|
515
|
+
end
|
516
|
+
|
517
|
+
# Parse options hash from input. Handles chaining and keywords such as true/false & nil
|
518
|
+
# Returns new hash with proper nesting and formatting
|
519
|
+
def parse_hash(hash, convert_types = false)
|
520
|
+
new_hash = {}
|
521
|
+
hash.each do |k, v|
|
522
|
+
if convert_types
|
523
|
+
v = v.to_i if v && v.match(/^\d+$/)
|
524
|
+
v = true if v == 'true'
|
525
|
+
v = false if v == 'false'
|
526
|
+
v = nil if v == 'nil'
|
527
|
+
end
|
528
|
+
if k =~ /\./
|
529
|
+
sub_hash = new_hash
|
530
|
+
split = k.split('.')
|
531
|
+
split.each do |sub_key|
|
532
|
+
if sub_key == split.last
|
533
|
+
sub_hash[sub_key] = v
|
534
|
+
else
|
535
|
+
sub_hash[sub_key] ||= {}
|
536
|
+
sub_hash = sub_hash[sub_key]
|
537
|
+
end
|
538
|
+
end
|
539
|
+
new_hash[split.first] ||= {}
|
540
|
+
else
|
541
|
+
new_hash[k] = v
|
542
|
+
end
|
543
|
+
end
|
544
|
+
new_hash
|
545
|
+
end
|
546
|
+
|
547
|
+
# Select a subset of attributes from a given resource
|
548
|
+
# @param attributes [String, Array<Array<String>>] Comma-separated string or array of array of strings
|
549
|
+
# The reason it's a nested array is to allow retrieval of nested keys.
|
550
|
+
# For example, the following 2 attribute params will return the same result:
|
551
|
+
# - [['key1'], ['key2', 'subKey3']]
|
552
|
+
# - 'key1,key2.subKey3'
|
553
|
+
# @param data [Hash, OneviewSDK::Resource]
|
554
|
+
# @return [Hash] A Hash is returned. For example:
|
555
|
+
# { 'key1' => 'val1', 'key2' => { 'subKey3' => 'val2' } }
|
556
|
+
def select_attributes(attributes, data = {})
|
557
|
+
attributes = attributes.split(',').map(&:strip).reject(&:empty?).map { |a| a.split('.') } if attributes.is_a?(String)
|
558
|
+
r_data = data.is_a?(Hash) ? data : data.data
|
559
|
+
temp = {}
|
560
|
+
attributes.each do |attr|
|
561
|
+
temp_level = temp
|
562
|
+
attr = [attr] if attr.is_a?(String)
|
563
|
+
attr.each_with_index do |a, index|
|
564
|
+
# Safely retrieving and setting nested keys is not as easy, so loop to build a nested Hash structure for the result
|
565
|
+
if index == attr.size - 1
|
566
|
+
# Use r_data.dig(*attr) if we ever drop support for Ruby < 2.3
|
567
|
+
temp_level[a] = [*attr].reduce(r_data) { |m, k| m && m[k] } rescue nil
|
568
|
+
else
|
569
|
+
temp_level[a] ||= {}
|
570
|
+
temp_level = temp_level[a]
|
571
|
+
end
|
572
|
+
end
|
573
|
+
end
|
574
|
+
temp
|
575
|
+
end
|
576
|
+
|
577
|
+
# Select a subset of attributes from a given set of resources
|
578
|
+
# @param attributes [String, Array<Array<String>>] Comma-separated string or array of array of strings
|
579
|
+
# The reason it's a nested array is to allow retrieval of nested keys.
|
580
|
+
# For example, the following 2 attribute params will return the same result:
|
581
|
+
# - [['key1'], ['key2', 'subKey3']]
|
582
|
+
# - 'key1,key2.subKey3'
|
583
|
+
# @param data [Array<Hash>, Array<OneviewSDK::Resource>]
|
584
|
+
# @return [Array<Hash>] An Array of Hashes is returned. For example:
|
585
|
+
# [
|
586
|
+
# { 'resource_name1' => { 'key1' => 'val1', 'key2' => { 'subKey3' => 'val2' } } },
|
587
|
+
# { 'resource_name2' => { 'key1' => 'val3', 'key2' => { 'subKey3' => 'val4' } } },
|
588
|
+
# ]
|
589
|
+
def select_attributes_from_multiple(attributes, data = [])
|
590
|
+
attributes = attributes.split(',').map(&:strip).reject(&:empty?).map { |a| a.split('.') } if attributes.is_a?(String)
|
591
|
+
result = []
|
592
|
+
data.each do |r|
|
593
|
+
result.push(r['name'] => select_attributes(attributes, r))
|
594
|
+
end
|
595
|
+
result
|
596
|
+
end
|
597
|
+
|
598
|
+
# Print output in a given format.
|
599
|
+
def output(data = {}, indent = 0)
|
600
|
+
case @options['format']
|
601
|
+
when 'json'
|
602
|
+
puts JSON.pretty_generate(data)
|
603
|
+
when 'yaml'
|
604
|
+
puts data.to_yaml
|
605
|
+
else
|
606
|
+
# rubocop:disable Metrics/BlockNesting
|
607
|
+
if data.class == Hash || data.class <= OneviewSDK::Resource
|
608
|
+
data.each do |k, v|
|
609
|
+
if v.class == Hash || v.class == Array
|
610
|
+
puts "#{' ' * indent}#{k.nil? ? 'nil' : k}:"
|
611
|
+
output(v, indent + 2)
|
612
|
+
else
|
613
|
+
puts "#{' ' * indent}#{k.nil? ? 'nil' : k}: #{v.nil? ? 'nil' : v}"
|
614
|
+
end
|
615
|
+
end
|
616
|
+
elsif data.class == Array
|
617
|
+
data.each do |d|
|
618
|
+
if d.class == Hash || d.class == Array
|
619
|
+
output(d, indent + 2)
|
620
|
+
else
|
621
|
+
puts "#{' ' * indent}#{d.nil? ? 'nil' : d}"
|
622
|
+
end
|
623
|
+
end
|
624
|
+
puts "\nTotal: #{data.size}" if indent < 1
|
625
|
+
else
|
626
|
+
puts "#{' ' * indent}#{data.nil? ? 'nil' : data}"
|
627
|
+
end
|
628
|
+
# rubocop:enable Metrics/BlockNesting
|
629
|
+
end
|
630
|
+
end
|
631
|
+
end
|
632
|
+
|
633
|
+
# Console class
|
634
|
+
class Console
|
635
|
+
def initialize(client)
|
636
|
+
@client = client
|
637
|
+
end
|
638
|
+
end
|
639
|
+
end
|