class OneviewSDK::API200::ServerHardwareType
Server hardware type resource implementation
Constants
- BASE_URI
Public Class Methods
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/server_hardware_type.rb, line 28 def initialize(client, params = {}, api_ver = nil) super # Default values @data['type'] ||= 'server-hardware-type-4' end
Public Instance Methods
Method is not available @raise [OneviewSDK::MethodUnavailable] method is not available
# File lib/oneview-sdk/resource/api200/server_hardware_type.rb, line 36 def create(*) unavailable_method end
Method is not available @raise [OneviewSDK::MethodUnavailable] method is not available
# File lib/oneview-sdk/resource/api200/server_hardware_type.rb, line 42 def delete(*) unavailable_method end
Remove resource from OneView @return [true] if resource was removed successfully
Update resource attributes @param [Hash] attributes attributes to be updated @option attributes [String] :name server hardware type name @option attributes [String] :description server hardware type description @return [OneviewSDK::ServerHardwareType] self
# File lib/oneview-sdk/resource/api200/server_hardware_type.rb, line 51 def update(attributes = {}) set_all(attributes) ensure_client && ensure_uri data = @data.select { |k, _v| %w[name description].include?(k) } response = @client.rest_put(@data['uri'], { 'body' => data }, @api_version) @client.response_handler(response) self end