Class: OneviewSDK::SANManager
- Defined in:
- lib/oneview-sdk/resource/san_manager.rb
Overview
SAN manager resource implementation
Constant Summary collapse
- BASE_URI =
'/rest/fc-sans/device-managers'.freeze
- PROVIDERS_URI =
'/rest/fc-sans/providers'.freeze
Instance Attribute Summary
Attributes inherited from Resource
#api_version, #client, #data, #logger
Class Method Summary collapse
-
.get_default_connection_info(client, provider_name) ⇒ Hash
Retrieves the default connection information for a specific provider.
Instance Method Summary collapse
-
#add ⇒ OneviewSDK::SANManager
Adds the resource on OneView using the current data.
-
#create ⇒ Object
Method is not available.
-
#delete ⇒ Object
Method is not available.
-
#initialize(client, params = {}, api_ver = nil) ⇒ SANManager
constructor
Create a resource object, associate it with a client, and set its properties.
-
#remove ⇒ true
Remove resource from OneView.
-
#update(options) ⇒ Object
Refreshes the san manager state or change connection information.
Methods inherited from Resource
#==, #[], #[]=, build_query, #create!, #each, #eql?, #exists?, find_by, from_file, get_all, #like?, #refresh, #retrieve!, #schema, schema, #set, #set_all, #to_file
Constructor Details
#initialize(client, params = {}, api_ver = nil) ⇒ SANManager
Create a resource object, associate it with a client, and set its properties.
26 27 28 29 30 |
# File 'lib/oneview-sdk/resource/san_manager.rb', line 26 def initialize(client, params = {}, api_ver = nil) super # Default values: @data['type'] = 'FCDeviceManagerV2' end |
Class Method Details
.get_default_connection_info(client, provider_name) ⇒ Hash
Retrieves the default connection information for a specific provider
69 70 71 72 73 74 |
# File 'lib/oneview-sdk/resource/san_manager.rb', line 69 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 |
Instance Method Details
#add ⇒ OneviewSDK::SANManager
Adds the resource on OneView using the current data
34 35 36 37 38 39 40 41 42 |
# File 'lib/oneview-sdk/resource/san_manager.rb', line 34 def add ensure_client fail '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 |
#create ⇒ Object
Method is not available
46 47 48 |
# File 'lib/oneview-sdk/resource/san_manager.rb', line 46 def create unavailable_method end |
#delete ⇒ Object
Method is not available
52 53 54 |
# File 'lib/oneview-sdk/resource/san_manager.rb', line 52 def delete unavailable_method end |
#remove ⇒ true
Remove resource from OneView
20 |
# File 'lib/oneview-sdk/resource/san_manager.rb', line 20 alias remove delete |
#update(options) ⇒ Object
Refreshes the san manager state or change connection information
58 59 60 61 62 63 |
# File 'lib/oneview-sdk/resource/san_manager.rb', line 58 def update() ensure_client && ensure_uri response = @client.rest_put(@data['uri'], 'body' => ) new_data = @client.response_handler(response) set_all(new_data) end |