module OneviewSDK::ImageStreamer
Module Image Streamer
Module Image Streamer
Module Image Streamer
Module Image Streamer
Module Image Streamer
Module Image Streamer
Module Image Streamer
Module Image Streamer
Module Image Streamer
Module Image Streamer
Module for interacting with the Image Streamer
Constants
- DEFAULT_API_VERSION
- SUPPORTED_API_VERSIONS
Public Class Methods
api_version()
click to toggle source
Get the current API version
# File lib/oneview-sdk/image_streamer.rb, line 28 def self.api_version @api_version end
api_version=(version)
click to toggle source
Set the default API version
# File lib/oneview-sdk/image_streamer.rb, line 33 def self.api_version=(version) version = version.to_i rescue version raise "API version #{version} is not supported!" unless SUPPORTED_API_VERSIONS.include?(version) raise "The module for API version #{@api_version} is undefined" unless constants.include?("API#{@api_version}".to_sym) @api_version_updated = true @api_version = version end
api_version_updated?()
click to toggle source
Has the API version been set by the user? @return [TrueClass, FalseClass]
# File lib/oneview-sdk/image_streamer.rb, line 43 def self.api_version_updated? @api_version_updated end
const_missing(const)
click to toggle source
Helps redirect resources to the correct API module for Image Streamer
# File lib/oneview-sdk/image_streamer.rb, line 48 def self.const_missing(const) api_module = OneviewSDK::ImageStreamer.const_get("API#{@api_version}") api_module.const_get(const) rescue NameError raise NameError, "The #{const} method or resource does not exist for Image Streamer API version #{@api_version}." end
resource_named(type, api_ver = @api_version, variant = nil)
click to toggle source
Get resource class that matches the type given @param [String] type Name of the desired class type @param [Fixnum] api_ver API module version to fetch resource from @param [String] variant API module variant to fetch resource from @return [Class] Resource
class or nil if not found
# File lib/oneview-sdk/image_streamer.rb, line 60 def self.resource_named(type, api_ver = @api_version, variant = nil) unless SUPPORTED_API_VERSIONS.include?(api_ver) raise UnsupportedVersion, "API version #{api_ver} is not supported! Try one of: #{SUPPORTED_API_VERSIONS}" end api_module = OneviewSDK::ImageStreamer.const_get("API#{api_ver}") variant ? api_module.resource_named(type, variant) : api_module.resource_named(type) end