class OneviewSDK::API200::SANManager
SAN manager resource implementation
Constants
- BASE_URI
- PROVIDERS_URI
Public Class Methods
Retrieves the default connection information for a specific provider @param [OneviewSDK::Client] client The client object for the OneView appliance @param [String] provider_name Providers name @return [Hash] A hash with default connectionInfo information
# File lib/oneview-sdk/resource/api200/san_manager.rb, line 72 def self.get_default_connection_info(client, provider_name) response = client.rest_get(PROVIDERS_URI) providers = client.response_handler(response)['members'] desired_provider = providers.find { |provider| provider['displayName'] == provider_name || provider['name'] == provider_name } desired_provider['defaultConnectionInfo'] end
Create a resource object, associate it with a client, and set its properties. @param [OneviewSDK::Client] client The client object for the OneView appliance @param [Hash] params The options for this resource (key-value pairs) @param [Integer] api_ver The api version to use when interracting with this resource.
OneviewSDK::Resource::new
# File lib/oneview-sdk/resource/api200/san_manager.rb, line 29 def initialize(client, params = {}, api_ver = nil) super # Default values: @data['type'] = 'FCDeviceManagerV2' end
Public Instance Methods
Adds the resource on OneView using the current data @return [OneviewSDK::SANManager] self
# File lib/oneview-sdk/resource/api200/san_manager.rb, line 37 def add ensure_client raise 'providerDisplayName' unless @data['providerDisplayName'] @data['providerUri'] = get_provider_uri response = @client.rest_post(@data['providerUri'] + '/device-managers', { 'body' => @data }, @api_version) body = @client.response_handler(response) set_all(body) self end
Method is not available @raise [OneviewSDK::MethodUnavailable] method is not available
# File lib/oneview-sdk/resource/api200/san_manager.rb, line 49 def create(*) unavailable_method end
Method is not available @raise [OneviewSDK::MethodUnavailable] method is not available
# File lib/oneview-sdk/resource/api200/san_manager.rb, line 55 def delete(*) unavailable_method end
Remove resource from OneView @return [true] if resource was removed successfully
Refreshes the san manager state or change connection information @param [Hash] options
# File lib/oneview-sdk/resource/api200/san_manager.rb, line 61 def update(options) ensure_client && ensure_uri response = @client.rest_put(@data['uri'], 'body' => options) new_data = @client.response_handler(response) set_all(new_data) end
Private Instance Methods
Gets the provider uri @return [String] provider uri
# File lib/oneview-sdk/resource/api200/san_manager.rb, line 83 def get_provider_uri return @data['providerUri'] if @data['providerUri'] response = @client.rest_get(PROVIDERS_URI) providers = @client.response_handler(response)['members'] desired_provider = providers.find { |provider| provider['displayName'] == @data['providerDisplayName'] } desired_provider['uri'] end