@@ -32,7 +32,7 @@ const (
3232
3333var existDatacenter = false
3434
35- //Manages SoftLayer Dedicated host.
35+ // Manages SoftLayer Dedicated host.
3636type DedicatedHostManager interface {
3737 ListGuests (identifier int , cpu int , domain string , hostname string , memory int , tags []string , mask string ) ([]datatypes.Virtual_Guest , error )
3838 GenerateOrderTemplate (size , hostname , domain , datacenter string , billing string , routerId int ) (datatypes.Container_Product_Order_Virtual_DedicatedHost , error )
@@ -64,8 +64,8 @@ func NewDedicatedhostManager(session *session.Session) *dedicatedhostManager {
6464 }
6565}
6666
67- //Cancel an instance immediately, deleting all its data.
68- //id: the instance ID to cancel
67+ // Cancel an instance immediately, deleting all its data.
68+ // id: the instance ID to cancel
6969func (d dedicatedhostManager ) CancelGuests (id int ) ([]StatusInfo , error ) {
7070 guests , err := d .VirtualDedicatedHost .Id (id ).GetGuests ()
7171 var listCaneledGuests []StatusInfo
@@ -88,7 +88,7 @@ func (d dedicatedhostManager) CancelGuests(id int) ([]StatusInfo, error) {
8888 return listCaneledGuests , nil
8989}
9090
91- //Deletes a guest and returns 'Cancelled' or and Exception message
91+ // Deletes a guest and returns 'Cancelled' or and Exception message
9292func (d dedicatedhostManager ) DeleteGuest (Id int ) (string , error ) {
9393 status := "Cancelled"
9494 _ , err := d .VirtualGuestService .Id (Id ).DeleteObject ()
@@ -98,13 +98,13 @@ func (d dedicatedhostManager) DeleteGuest(Id int) (string, error) {
9898 return status , nil
9999}
100100
101- //Retrieve a list of all virtual servers on the dedicated host.
102- //integer identifier: The identifier of a dedicated host.
103- //integer cpus: filter based on number of CPUS.
104- //string domain: filter based on domain.
105- //string hostname: filter based on hostname.
106- //integer memory: filter based on amount of memory.
107- //list tags: filter based on list of tags.
101+ // Retrieve a list of all virtual servers on the dedicated host.
102+ // integer identifier: The identifier of a dedicated host.
103+ // integer cpus: filter based on number of CPUS.
104+ // string domain: filter based on domain.
105+ // string hostname: filter based on hostname.
106+ // integer memory: filter based on amount of memory.
107+ // list tags: filter based on list of tags.
108108func (d dedicatedhostManager ) ListGuests (identifier int , cpu int , domain string , hostname string , memory int , tags []string , mask string ) ([]datatypes.Virtual_Guest , error ) {
109109 filters := filter .New ()
110110 if cpu != 0 {
@@ -134,17 +134,17 @@ func (d dedicatedhostManager) ListGuests(identifier int, cpu int, domain string,
134134 return guestList , nil
135135}
136136
137- //Get details about a dedicatedhost instance.
138- //id: the instance ID
139- //mask: mask of properties
137+ // Get details about a dedicatedhost instance.
138+ // id: the instance ID
139+ // mask: mask of properties
140140func (d dedicatedhostManager ) GetInstance (id int , mask string ) (datatypes.Virtual_DedicatedHost , error ) {
141141 if mask == "" {
142142 mask = DEDICATEDHOST_DETAIL_MASK
143143 }
144144 return d .VirtualDedicatedHost .Id (id ).Mask (mask ).GetObject ()
145145}
146146
147- //Generate dedicated host payload.
147+ // Generate dedicated host payload.
148148func (d dedicatedhostManager ) GenerateOrderTemplate (size , hostname , domain , datacenter string , billing string , routerId int ) (datatypes.Container_Product_Order_Virtual_DedicatedHost , error ) {
149149 mask := "items[keyName,capacity,description,attributes[id,attributeTypeKeyName],itemCategory[id,categoryCode],softwareDescription[id,referenceCode,longDescription],prices],activePresets,regions[location[location[priceGroups]]]"
150150 packages , err := d .PackageService .Mask (mask ).Filter (filter .Path ("keyName" ).Eq ("DEDICATED_HOST" ).Build ()).GetAllObjects ()
@@ -187,17 +187,17 @@ func (d dedicatedhostManager) GenerateOrderTemplate(size, hostname, domain, data
187187 return order , nil
188188}
189189
190- //Verify the dedicated host order.
190+ // Verify the dedicated host order.
191191func (d dedicatedhostManager ) VerifyInstanceCreation (orderTemplate datatypes.Container_Product_Order_Virtual_DedicatedHost ) (datatypes.Container_Product_Order , error ) {
192192 return d .OrderService .VerifyOrder (& orderTemplate )
193193}
194194
195- //Order a dedicated host.
195+ // Order a dedicated host.
196196func (d dedicatedhostManager ) OrderInstance (orderTemplate datatypes.Container_Product_Order_Virtual_DedicatedHost ) (datatypes.Container_Product_Order_Receipt , error ) {
197197 return d .OrderService .PlaceOrder (& orderTemplate , sl .Bool (false ))
198198}
199199
200- //Get the package related to simple dedicatedhost ordering
200+ // Get the package related to simple dedicatedhost ordering
201201func (d dedicatedhostManager ) GetPackage () (datatypes.Product_Package , error ) {
202202 mask := "items[id,description,prices,capacity,keyName,itemCategory[categoryCode],bundleItems[capacity,keyName,categories[categoryCode],hardwareGenericComponentModel[id,hardwareComponentType[keyName]]]],regions[location[location[priceGroups]]]"
203203 filters := filter .New ()
@@ -212,7 +212,7 @@ func (d dedicatedhostManager) GetPackage() (datatypes.Product_Package, error) {
212212 return packages [0 ], nil
213213}
214214
215- //Returns valid options for ordering hardware.
215+ // Returns valid options for ordering hardware.
216216func (d dedicatedhostManager ) GetCreateOptions (productPackage datatypes.Product_Package ) map [string ]map [string ]string {
217217 //locations
218218 locations := make (map [string ]string )
@@ -237,7 +237,7 @@ func (d dedicatedhostManager) GetCreateOptions(productPackage datatypes.Product_
237237 }
238238}
239239
240- //Get the private vlans in the account.
240+ // Get the private vlans in the account.
241241func (d dedicatedhostManager ) GetVlansOptions (datacenter string , flavor string , productPackage datatypes.Product_Package ) ([]datatypes.Network_Vlan , error ) {
242242 maskVlans := "primaryRouter[datacenter]"
243243 maskItemPrices := "pricingLocationGroup[locations]"
0 commit comments