Class: OneviewSDK::API200::SANManager
- Defined in:
- lib/oneview-sdk/resource/api200/san_manager.rb
Overview
SAN manager resource implementation
Direct Known Subclasses
OneviewSDK::API300::C7000::SANManager, OneviewSDK::API300::Synergy::SANManager
Constant Summary collapse
- BASE_URI =
'/rest/fc-sans/device-managers'.freeze
- PROVIDERS_URI =
'/rest/fc-sans/providers'.freeze
Constants inherited from Resource
Resource::DEFAULT_REQUEST_HEADER, Resource::UNIQUE_IDENTIFIERS
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!, #deep_merge!, #each, #eql?, #exists?, find_by, find_with_pagination, from_file, get_all, get_all_with_query, #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.
29 30 31 32 33 |
# 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 |
Class Method Details
.get_default_connection_info(client, provider_name) ⇒ Hash
Retrieves the default connection information for a specific provider
72 73 74 75 76 77 |
# 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 |
Instance Method Details
#add ⇒ OneviewSDK::SANManager
Adds the resource on OneView using the current data
37 38 39 40 41 42 43 44 45 |
# 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 |
#create ⇒ Object
Method is not available
49 50 51 |
# File 'lib/oneview-sdk/resource/api200/san_manager.rb', line 49 def create(*) unavailable_method end |
#delete ⇒ Object
Method is not available
55 56 57 |
# File 'lib/oneview-sdk/resource/api200/san_manager.rb', line 55 def delete(*) unavailable_method end |
#remove ⇒ true
Remove resource from OneView
23 |
# File 'lib/oneview-sdk/resource/api200/san_manager.rb', line 23 alias remove delete |
#update(options) ⇒ Object
Refreshes the san manager state or change connection information
61 62 63 64 65 66 |
# File 'lib/oneview-sdk/resource/api200/san_manager.rb', line 61 def update() ensure_client && ensure_uri response = @client.rest_put(@data['uri'], 'body' => ) new_data = @client.response_handler(response) set_all(new_data) end |