Class: OneviewSDK::ServerProfileTemplate
- Defined in:
- lib/oneview-sdk/resource/server_profile_template.rb
Overview
Server profile template resource implementation
Constant Summary collapse
- BASE_URI =
'/rest/server-profile-templates'.freeze
Instance Attribute Summary
Attributes inherited from Resource
#api_version, #client, #data, #logger
Instance Method Summary collapse
-
#initialize(client, params = {}, api_ver = nil) ⇒ ServerProfileTemplate
constructor
A new instance of ServerProfileTemplate.
-
#new_profile(name = nil) ⇒ ServerProfile
Create ServerProfile using this template.
Methods inherited from Resource
#==, #[], #[]=, #create, #create!, #delete, #each, #eql?, #exists?, find_by, from_file, get_all, #like?, #refresh, #retrieve!, schema, #schema, #set, #set_all, #to_file, #update
Constructor Details
#initialize(client, params = {}, api_ver = nil) ⇒ ServerProfileTemplate
Returns a new instance of ServerProfileTemplate.
6 7 8 9 10 |
# File 'lib/oneview-sdk/resource/server_profile_template.rb', line 6 def initialize(client, params = {}, api_ver = nil) super # Default values @data['type'] ||= 'ServerProfileTemplateV1' end |
Instance Method Details
#new_profile(name = nil) ⇒ ServerProfile
Create ServerProfile using this template
16 17 18 19 20 21 22 |
# File 'lib/oneview-sdk/resource/server_profile_template.rb', line 16 def new_profile(name = nil) ensure_client && ensure_uri = @client.rest_get("#{@data['uri']}/new-profile") profile = OneviewSDK::ServerProfile.new(@client, ) profile[:name] = name if name && name.size > 0 profile end |