File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,6 +108,10 @@ class VirtualServerOrder
108108 # Corresponds to +primaryBackendNetworkComponent.networkVlan.id+ in the +createObject+ documentation
109109 attr_accessor :user_metadata
110110
111+ # Hash, supplemental options - See https://sldn.softlayer.com/reference/datatypes/SoftLayer_Virtual_Guest_SupplementalCreateObjectOptions
112+ # Corresponds to +supplementalCreateObjectOptions+ in the +createObject+ documentation
113+ attr_accessor :supplementalCreateObjectOptions
114+
111115 # Create a new order that works through the given client connection
112116 def initialize ( client = nil )
113117 @softlayer_client = client || Client . default_client
@@ -170,11 +174,12 @@ def virtual_guest_template
170174 template [ 'primaryNetworkComponent' ] = { "networkVlan" => { "id" => @public_vlan_id . to_i } } if @public_vlan_id
171175 template [ 'primaryBackendNetworkComponent' ] = { "networkVlan" => { "id" => @private_vlan_id . to_i } } if @private_vlan_id
172176 template [ 'sshKeys' ] = @ssh_key_ids . collect { |ssh_key_id | { 'id' => ssh_key_id . to_i } } if @ssh_key_ids
177+ template [ 'supplementalCreateObjectOptions' ] = @supplementalCreateObjectOptions if @supplementalCreateObjectOptions
173178
174179 if @image_template
175- template [ 'blockDeviceTemplateGroup' ] = { "globalIdentifier" => @image_template . global_id }
180+ template [ 'blockDeviceTemplateGroup' ] = { "globalIdentifier" => @image_template . global_id }
176181 elsif @os_reference_code
177- template [ 'operatingSystemReferenceCode' ] = @os_reference_code
182+ template [ 'operatingSystemReferenceCode' ] = @os_reference_code
178183 end
179184
180185 if @disks && !@disks . empty?
Original file line number Diff line number Diff line change 175175 expect ( subject . virtual_guest_template [ 'networkComponents' ] ) . to eq [ { 'maxSpeed' => 1000 } ]
176176 end
177177
178+ it "puts the bootMode attribute into the template as supplementalCreateObjectOptions.bootMode" do
179+ expect ( subject . virtual_guest_template [ 'supplementalCreateObjectOptions' ] ) . to be_nil
180+ subject . supplementalCreateObjectOptions = { "bootMode" => 'HVM' }
181+ expect ( subject . virtual_guest_template [ 'supplementalCreateObjectOptions' ] ) . to eq ( { "bootMode" => "HVM" } )
182+ end
183+
178184 it "calls the softlayer API to validate an order template" do
179185 client = SoftLayer ::Client . new ( :username => "fakeusername" , :api_key => 'DEADBEEFBADF00D' )
180186
You can’t perform that action at this time.
0 commit comments