Module: OneviewSDK::API1200
- Defined in:
- lib/oneview-sdk/resource/api1200.rb,
lib/oneview-sdk/resource/api1200/c7000.rb,
lib/oneview-sdk/resource/api1200/synergy.rb,
lib/oneview-sdk/resource/api1200/c7000/scope.rb,
lib/oneview-sdk/resource/api1200/c7000/volume.rb,
lib/oneview-sdk/resource/api1200/synergy/scope.rb,
lib/oneview-sdk/resource/api1200/synergy/volume.rb,
lib/oneview-sdk/resource/api1200/c7000/enclosure.rb,
lib/oneview-sdk/resource/api1200/c7000/fc_network.rb,
lib/oneview-sdk/resource/api1200/c7000/uplink_set.rb,
lib/oneview-sdk/resource/api1200/c7000/network_set.rb,
lib/oneview-sdk/resource/api1200/synergy/enclosure.rb,
lib/oneview-sdk/resource/api1200/c7000/fcoe_network.rb,
lib/oneview-sdk/resource/api1200/c7000/interconnect.rb,
lib/oneview-sdk/resource/api1200/c7000/storage_pool.rb,
lib/oneview-sdk/resource/api1200/synergy/fc_network.rb,
lib/oneview-sdk/resource/api1200/synergy/uplink_set.rb,
lib/oneview-sdk/resource/api1200/synergy/network_set.rb,
lib/oneview-sdk/resource/api1200/c7000/lig_uplink_set.rb,
lib/oneview-sdk/resource/api1200/c7000/server_profile.rb,
lib/oneview-sdk/resource/api1200/c7000/storage_system.rb,
lib/oneview-sdk/resource/api1200/synergy/fcoe_network.rb,
lib/oneview-sdk/resource/api1200/synergy/interconnect.rb,
lib/oneview-sdk/resource/api1200/synergy/storage_pool.rb,
lib/oneview-sdk/resource/api1200/c7000/enclosure_group.rb,
lib/oneview-sdk/resource/api1200/c7000/firmware_driver.rb,
lib/oneview-sdk/resource/api1200/c7000/server_hardware.rb,
lib/oneview-sdk/resource/api1200/c7000/volume_template.rb,
lib/oneview-sdk/resource/api1200/c7000/ethernet_network.rb,
lib/oneview-sdk/resource/api1200/synergy/lig_uplink_set.rb,
lib/oneview-sdk/resource/api1200/synergy/server_profile.rb,
lib/oneview-sdk/resource/api1200/synergy/storage_system.rb,
lib/oneview-sdk/resource/api1200/c7000/logical_enclosure.rb,
lib/oneview-sdk/resource/api1200/c7000/volume_attachment.rb,
lib/oneview-sdk/resource/api1200/synergy/enclosure_group.rb,
lib/oneview-sdk/resource/api1200/synergy/firmware_driver.rb,
lib/oneview-sdk/resource/api1200/synergy/server_hardware.rb,
lib/oneview-sdk/resource/api1200/synergy/volume_template.rb,
lib/oneview-sdk/resource/api1200/c7000/hypervisor_manager.rb,
lib/oneview-sdk/resource/api1200/c7000/server_certificate.rb,
lib/oneview-sdk/resource/api1200/synergy/ethernet_network.rb,
lib/oneview-sdk/resource/api1200/c7000/connection_template.rb,
lib/oneview-sdk/resource/api1200/synergy/logical_enclosure.rb,
lib/oneview-sdk/resource/api1200/synergy/volume_attachment.rb,
lib/oneview-sdk/resource/api1200/c7000/logical_interconnect.rb,
lib/oneview-sdk/resource/api1200/c7000/server_hardware_type.rb,
lib/oneview-sdk/resource/api1200/synergy/hypervisor_manager.rb,
lib/oneview-sdk/resource/api1200/synergy/os_deployment_plan.rb,
lib/oneview-sdk/resource/api1200/synergy/server_certificate.rb,
lib/oneview-sdk/resource/api1200/synergy/connection_template.rb,
lib/oneview-sdk/resource/api1200/synergy/logical_interconnect.rb,
lib/oneview-sdk/resource/api1200/synergy/server_hardware_type.rb,
lib/oneview-sdk/resource/api1200/c7000/server_profile_template.rb,
lib/oneview-sdk/resource/api1200/synergy/server_profile_template.rb,
lib/oneview-sdk/resource/api1200/c7000/hypervisor_cluster_profile.rb,
lib/oneview-sdk/resource/api1200/c7000/logical_interconnect_group.rb,
lib/oneview-sdk/resource/api1200/synergy/hypervisor_cluster_profile.rb,
lib/oneview-sdk/resource/api1200/synergy/logical_interconnect_group.rb,
lib/oneview-sdk/resource/api1200/synergy/sas_logical_interconnect_group.rb
Overview
Module for API v1200
Defined Under Namespace
Constant Summary collapse
- SUPPORTED_VARIANTS =
%w[C7000 Synergy].freeze
- DEFAULT_VARIANT =
'C7000'.freeze
Class Method Summary collapse
-
.const_missing(const) ⇒ Object
Helps redirect resources to the correct API1200 variant.
-
.resource_named(type, variant = @variant) ⇒ Class
Get resource class that matches the type given.
-
.variant ⇒ Object
Get the current API1200 variant.
-
.variant=(variant) ⇒ Object
Sets the API1200 variant.
-
.variant_updated? ⇒ TrueClass, FalseClass
Has the API1200 variant been set by the user?.
Class Method Details
.const_missing(const) ⇒ Object
Helps redirect resources to the correct API1200 variant
56 57 58 59 60 61 |
# File 'lib/oneview-sdk/resource/api1200.rb', line 56 def self.const_missing(const) api1200_module = OneviewSDK::API1200.const_get(@variant.to_s) api1200_module.const_get(const) rescue NameError raise NameError, "The #{const} method or resource does not exist for OneView API1200 variant #{@variant}." end |
.resource_named(type, variant = @variant) ⇒ Class
Get resource class that matches the type given
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/oneview-sdk/resource/api1200.rb', line 24 def self.resource_named(type, variant = @variant) raise "API1200 variant '#{variant}' is not supported! Try one of #{SUPPORTED_VARIANTS}" unless SUPPORTED_VARIANTS.include?(variant.to_s) new_type = type.to_s.downcase.gsub(/[ -_]/, '') api_module = OneviewSDK::API1200.const_get(variant) api_module.constants.each do |c| klass = api_module.const_get(c) next unless klass.is_a?(Class) name = klass.name.split('::').last.downcase.delete('_').delete('-') return klass if new_type =~ /^#{name}[s]?$/ end nil end |
.variant ⇒ Object
Get the current API1200 variant
38 39 40 |
# File 'lib/oneview-sdk/resource/api1200.rb', line 38 def self.variant @variant end |
.variant=(variant) ⇒ Object
Sets the API1200 variant
49 50 51 52 53 |
# File 'lib/oneview-sdk/resource/api1200.rb', line 49 def self.variant=(variant) raise "API1200 variant '#{variant}' is not supported! Try one of #{SUPPORTED_VARIANTS}" unless SUPPORTED_VARIANTS.include?(variant) @variant_updated = true @variant = variant end |
.variant_updated? ⇒ TrueClass, FalseClass
Has the API1200 variant been set by the user?
44 45 46 |
# File 'lib/oneview-sdk/resource/api1200.rb', line 44 def self.variant_updated? @variant_updated end |