Class: OneviewSDK::API200::ServerHardwareType
- Defined in:
- lib/oneview-sdk/resource/api200/server_hardware_type.rb
Overview
Server hardware type resource implementation
Direct Known Subclasses
OneviewSDK::API300::C7000::ServerHardwareType, OneviewSDK::API300::Synergy::ServerHardwareType
Constant Summary collapse
- BASE_URI =
'/rest/server-hardware-types'.freeze
Constants inherited from Resource
Resource::DEFAULT_REQUEST_HEADER, Resource::UNIQUE_IDENTIFIERS
Instance Attribute Summary
Attributes inherited from Resource
#api_version, #client, #data, #logger
Instance Method Summary collapse
-
#create ⇒ Object
Method is not available.
-
#delete ⇒ Object
Method is not available.
-
#initialize(client, params = {}, api_ver = nil) ⇒ ServerHardwareType
constructor
Create a resource object, associate it with a client, and set its properties.
-
#remove ⇒ true
Remove resource from OneView.
-
#update(attributes = {}) ⇒ OneviewSDK::ServerHardwareType
Update resource attributes.
Methods inherited from Resource
#==, #[], #[]=, build_query, #create!, #deep_merge!, #each, #eql?, #exists?, find_by, find_with_pagination, from_file, get_all, #like?, #refresh, #retrieve!, #schema, schema, #set, #set_all, #to_file
Constructor Details
#initialize(client, params = {}, api_ver = nil) ⇒ ServerHardwareType
Create a resource object, associate it with a client, and set its properties.
28 29 30 31 32 |
# 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 |
Instance Method Details
#create ⇒ Object
Method is not available
36 37 38 |
# File 'lib/oneview-sdk/resource/api200/server_hardware_type.rb', line 36 def create(*) unavailable_method end |
#delete ⇒ Object
Method is not available
42 43 44 |
# File 'lib/oneview-sdk/resource/api200/server_hardware_type.rb', line 42 def delete(*) unavailable_method end |
#remove ⇒ true
Remove resource from OneView
22 |
# File 'lib/oneview-sdk/resource/api200/server_hardware_type.rb', line 22 alias remove delete |
#update(attributes = {}) ⇒ OneviewSDK::ServerHardwareType
Update resource attributes
51 52 53 54 55 56 57 58 |
# 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 |