class OneviewSDK::API200::Switch

Switch resource implementation

Constants

BASE_URI
TYPE_URI
UNIQUE_IDENTIFIERS

Public Class Methods

get_type(client, name) click to toggle source

Retrieves the switch type with the name @param [OneviewSDK::Client] client The client object for the OneView appliance @param [String] name Switch type name @return [Array] Switch type

# 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) click to toggle source

Retrieves the switch types @param [OneviewSDK::Client] client The client object for the OneView appliance @return [Array] All the Switch types

# 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

Public Instance Methods

create(*) click to toggle source

Method is not available @raise [OneviewSDK::MethodUnavailable] method is not available

# File lib/oneview-sdk/resource/api200/switch.rb, line 28
def create(*)
  unavailable_method
end
delete(*) click to toggle source

Method is not available @raise [OneviewSDK::MethodUnavailable] method is not available

# File lib/oneview-sdk/resource/api200/switch.rb, line 46
def delete(*)
  unavailable_method
end
Also aliased as: remove
environmental_configuration() click to toggle source

Get settings that describe the environmental configuration @return [Hash] Configuration parameters

# File lib/oneview-sdk/resource/api200/switch.rb, line 78
def environmental_configuration
  ensure_client && ensure_uri
  response = @client.rest_get(@data['uri'] + '/environmentalConfiguration', {}, @api_version)
  @client.response_handler(response)
end
refresh(*) click to toggle source

Method is not available @raise [OneviewSDK::MethodUnavailable] method is not available

# File lib/oneview-sdk/resource/api200/switch.rb, line 40
def refresh(*)
  unavailable_method
end
remove(*)

Remove resource from OneView @return [true] if resource was removed successfully

Alias for: delete
statistics(port_name = nil) click to toggle source

Get statistics for a switch or for the specified port. @param [String] port_name port to retrieve statistics @return [Hash] Switch statistics

# File lib/oneview-sdk/resource/api200/switch.rb, line 71
def statistics(port_name = nil)
  response = @client.rest_get("#{@data['uri']}/statistics/#{port_name}")
  response.body
end
update(*) click to toggle source

Method is not available @raise [OneviewSDK::MethodUnavailable] method is not available

# File lib/oneview-sdk/resource/api200/switch.rb, line 34
def update(*)
  unavailable_method
end