Class: OneviewSDK::API200::Switch
- Defined in:
- lib/oneview-sdk/resource/api200/switch.rb
Overview
Switch resource implementation
Direct Known Subclasses
Constant Summary collapse
- BASE_URI =
'/rest/switches'.freeze
- TYPE_URI =
'/rest/switch-types'.freeze
- UNIQUE_IDENTIFIERS =
%w(name uri serialNumber).freeze
Instance Attribute Summary
Attributes inherited from Resource
#api_version, #client, #data, #logger
Class Method Summary collapse
-
.get_type(client, name) ⇒ Array
Retrieves the switch type with the name.
-
.get_types(client) ⇒ Array
Retrieves the switch types.
Instance Method Summary collapse
-
#create ⇒ Object
Method is not available.
-
#delete ⇒ Object
Method is not available.
-
#environmental_configuration ⇒ Hash
Get settings that describe the environmental configuration.
-
#refresh ⇒ Object
Method is not available.
-
#remove ⇒ true
Remove resource from OneView.
-
#statistics(port_name = nil, subport_number = nil) ⇒ Hash
Get statistics for an interconnect, for the specified port or subport.
-
#update ⇒ Object
Method is not available.
Methods inherited from Resource
#==, #[], #[]=, build_query, #create!, #each, #eql?, #exists?, find_by, find_with_pagination, from_file, get_all, #initialize, #like?, #retrieve!, #schema, schema, #set, #set_all, #to_file
Constructor Details
This class inherits a constructor from OneviewSDK::Resource
Class Method Details
.get_type(client, name) ⇒ Array
Retrieves the switch type with the name
63 64 65 66 |
# File 'lib/oneview-sdk/resource/api200/switch.rb', line 63 def self.get_type(client, name) results = get_types(client) results.find { |switch_type| switch_type['name'] == name } end |
.get_types(client) ⇒ Array
Retrieves the switch types
53 54 55 56 57 |
# File 'lib/oneview-sdk/resource/api200/switch.rb', line 53 def self.get_types(client) response = client.rest_get(TYPE_URI) response = client.response_handler(response) response['members'] end |
Instance Method Details
#create ⇒ Object
Method is not available
28 29 30 |
# File 'lib/oneview-sdk/resource/api200/switch.rb', line 28 def create(*) unavailable_method end |
#delete ⇒ Object
Method is not available
46 47 48 |
# File 'lib/oneview-sdk/resource/api200/switch.rb', line 46 def delete(*) unavailable_method end |
#environmental_configuration ⇒ Hash
Get settings that describe the environmental configuration
84 85 86 87 88 |
# File 'lib/oneview-sdk/resource/api200/switch.rb', line 84 def environmental_configuration ensure_client && ensure_uri response = @client.rest_get(@data['uri'] + '/environmentalConfiguration', @api_version) @client.response_handler(response) end |
#refresh ⇒ Object
Method is not available
40 41 42 |
# File 'lib/oneview-sdk/resource/api200/switch.rb', line 40 def refresh(*) unavailable_method end |
#remove ⇒ true
Remove resource from OneView
24 |
# File 'lib/oneview-sdk/resource/api200/switch.rb', line 24 alias remove delete |
#statistics(port_name = nil, subport_number = nil) ⇒ Hash
Get statistics for an interconnect, for the specified port or subport
72 73 74 75 76 77 78 79 80 |
# File 'lib/oneview-sdk/resource/api200/switch.rb', line 72 def statistics(port_name = nil, subport_number = nil) uri = if subport_number "#{@data['uri']}/statistics/#{port_name}/subport/#{subport_number}" else "#{@data['uri']}/statistics/#{port_name}" end response = @client.rest_get(uri) response.body end |
#update ⇒ Object
Method is not available
34 35 36 |
# File 'lib/oneview-sdk/resource/api200/switch.rb', line 34 def update(*) unavailable_method end |