1/** 2 * Copyright 2016 IBM Corp. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17/** 18 * AUTOMATICALLY GENERATED CODE - DO NOT MODIFY 19 */ 20 21package services 22 23import ( 24 "fmt" 25 "strings" 26 27 "github.com/softlayer/softlayer-go/datatypes" 28 "github.com/softlayer/softlayer-go/session" 29 "github.com/softlayer/softlayer-go/sl" 30) 31 32// The SoftLayer_Product_Item_Category data type contains general category information for prices. 33type Product_Item_Category struct { 34 Session *session.Session 35 Options sl.Options 36} 37 38// GetProductItemCategoryService returns an instance of the Product_Item_Category SoftLayer service 39func GetProductItemCategoryService(sess *session.Session) Product_Item_Category { 40 return Product_Item_Category{Session: sess} 41} 42 43func (r Product_Item_Category) Id(id int) Product_Item_Category { 44 r.Options.Id = &id 45 return r 46} 47 48func (r Product_Item_Category) Mask(mask string) Product_Item_Category { 49 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 50 mask = fmt.Sprintf("mask[%s]", mask) 51 } 52 53 r.Options.Mask = mask 54 return r 55} 56 57func (r Product_Item_Category) Filter(filter string) Product_Item_Category { 58 r.Options.Filter = filter 59 return r 60} 61 62func (r Product_Item_Category) Limit(limit int) Product_Item_Category { 63 r.Options.Limit = &limit 64 return r 65} 66 67func (r Product_Item_Category) Offset(offset int) Product_Item_Category { 68 r.Options.Offset = &offset 69 return r 70} 71 72// Returns a list of of active Items in the "Additional Services" package with their active prices for a given product item category and sorts them by price. 73func (r Product_Item_Category) GetAdditionalProductsForCategory() (resp []datatypes.Product_Item, err error) { 74 err = r.Session.DoRequest("SoftLayer_Product_Item_Category", "getAdditionalProductsForCategory", nil, &r.Options, &resp) 75 return 76} 77 78// no documentation yet 79func (r Product_Item_Category) GetBandwidthCategories() (resp []datatypes.Product_Item_Category, err error) { 80 err = r.Session.DoRequest("SoftLayer_Product_Item_Category", "getBandwidthCategories", nil, &r.Options, &resp) 81 return 82} 83 84// Retrieve The billing items associated with an account that share a category code with an item category's category code. 85func (r Product_Item_Category) GetBillingItems() (resp []datatypes.Billing_Item, err error) { 86 err = r.Session.DoRequest("SoftLayer_Product_Item_Category", "getBillingItems", nil, &r.Options, &resp) 87 return 88} 89 90// This method returns a collection of computing categories. These categories are also top level items in a service offering. 91func (r Product_Item_Category) GetComputingCategories(resetCache *bool) (resp []datatypes.Product_Item_Category, err error) { 92 params := []interface{}{ 93 resetCache, 94 } 95 err = r.Session.DoRequest("SoftLayer_Product_Item_Category", "getComputingCategories", params, &r.Options, &resp) 96 return 97} 98 99// no documentation yet 100func (r Product_Item_Category) GetCustomUsageRatesCategories(resetCache *bool) (resp []datatypes.Product_Item_Category, err error) { 101 params := []interface{}{ 102 resetCache, 103 } 104 err = r.Session.DoRequest("SoftLayer_Product_Item_Category", "getCustomUsageRatesCategories", params, &r.Options, &resp) 105 return 106} 107 108// no documentation yet 109func (r Product_Item_Category) GetExternalResourceCategories() (resp []datatypes.Product_Item_Category, err error) { 110 err = r.Session.DoRequest("SoftLayer_Product_Item_Category", "getExternalResourceCategories", nil, &r.Options, &resp) 111 return 112} 113 114// Retrieve This invoice item's "item category group". 115func (r Product_Item_Category) GetGroup() (resp datatypes.Product_Item_Category_Group, err error) { 116 err = r.Session.DoRequest("SoftLayer_Product_Item_Category", "getGroup", nil, &r.Options, &resp) 117 return 118} 119 120// Retrieve A collection of service offering category groups. Each group contains a collection of items associated with this category. 121func (r Product_Item_Category) GetGroups() (resp []datatypes.Product_Package_Item_Category_Group, err error) { 122 err = r.Session.DoRequest("SoftLayer_Product_Item_Category", "getGroups", nil, &r.Options, &resp) 123 return 124} 125 126// Each product item price must be tied to a category for it to be sold. These categories describe how a particular product item is sold. For example, the 250GB hard drive can be sold as disk0, disk1, ... disk11. There are different prices for this product item depending on which category it is. This keeps down the number of products in total. 127func (r Product_Item_Category) GetObject() (resp datatypes.Product_Item_Category, err error) { 128 err = r.Session.DoRequest("SoftLayer_Product_Item_Category", "getObject", nil, &r.Options, &resp) 129 return 130} 131 132// no documentation yet 133func (r Product_Item_Category) GetObjectStorageCategories(resetCache *bool) (resp []datatypes.Product_Item_Category, err error) { 134 params := []interface{}{ 135 resetCache, 136 } 137 err = r.Session.DoRequest("SoftLayer_Product_Item_Category", "getObjectStorageCategories", params, &r.Options, &resp) 138 return 139} 140 141// Retrieve Any unique options associated with an item category. 142func (r Product_Item_Category) GetOrderOptions() (resp []datatypes.Product_Item_Category_Order_Option_Type, err error) { 143 err = r.Session.DoRequest("SoftLayer_Product_Item_Category", "getOrderOptions", nil, &r.Options, &resp) 144 return 145} 146 147// Retrieve A list of configuration available in this category.' 148func (r Product_Item_Category) GetPackageConfigurations() (resp []datatypes.Product_Package_Order_Configuration, err error) { 149 err = r.Session.DoRequest("SoftLayer_Product_Item_Category", "getPackageConfigurations", nil, &r.Options, &resp) 150 return 151} 152 153// Retrieve A list of preset configurations this category is used in.' 154func (r Product_Item_Category) GetPresetConfigurations() (resp []datatypes.Product_Package_Preset_Configuration, err error) { 155 err = r.Session.DoRequest("SoftLayer_Product_Item_Category", "getPresetConfigurations", nil, &r.Options, &resp) 156 return 157} 158 159// Retrieve The question references that are associated with an item category. 160func (r Product_Item_Category) GetQuestionReferences() (resp []datatypes.Product_Item_Category_Question_Xref, err error) { 161 err = r.Session.DoRequest("SoftLayer_Product_Item_Category", "getQuestionReferences", nil, &r.Options, &resp) 162 return 163} 164 165// Retrieve The questions that are associated with an item category. 166func (r Product_Item_Category) GetQuestions() (resp []datatypes.Product_Item_Category_Question, err error) { 167 err = r.Session.DoRequest("SoftLayer_Product_Item_Category", "getQuestions", nil, &r.Options, &resp) 168 return 169} 170 171// no documentation yet 172func (r Product_Item_Category) GetSoftwareCategories() (resp []datatypes.Product_Item_Category, err error) { 173 err = r.Session.DoRequest("SoftLayer_Product_Item_Category", "getSoftwareCategories", nil, &r.Options, &resp) 174 return 175} 176 177// This method returns a list of subnet categories. 178func (r Product_Item_Category) GetSubnetCategories() (resp []datatypes.Product_Item_Category, err error) { 179 err = r.Session.DoRequest("SoftLayer_Product_Item_Category", "getSubnetCategories", nil, &r.Options, &resp) 180 return 181} 182 183// This method returns a collection of computing categories. These categories are also top level items in a service offering. 184func (r Product_Item_Category) GetTopLevelCategories(resetCache *bool) (resp []datatypes.Product_Item_Category, err error) { 185 params := []interface{}{ 186 resetCache, 187 } 188 err = r.Session.DoRequest("SoftLayer_Product_Item_Category", "getTopLevelCategories", params, &r.Options, &resp) 189 return 190} 191 192// This method returns service product categories that can be canceled via API. You can use these categories to find the billing items you wish to cancel. 193func (r Product_Item_Category) GetValidCancelableServiceItemCategories() (resp []datatypes.Product_Item_Category, err error) { 194 err = r.Session.DoRequest("SoftLayer_Product_Item_Category", "getValidCancelableServiceItemCategories", nil, &r.Options, &resp) 195 return 196} 197 198// no documentation yet 199func (r Product_Item_Category) GetVlanCategories() (resp []datatypes.Product_Item_Category, err error) { 200 err = r.Session.DoRequest("SoftLayer_Product_Item_Category", "getVlanCategories", nil, &r.Options, &resp) 201 return 202} 203 204// The SoftLayer_Product_Item_Category_Group data type contains general category group information. 205type Product_Item_Category_Group struct { 206 Session *session.Session 207 Options sl.Options 208} 209 210// GetProductItemCategoryGroupService returns an instance of the Product_Item_Category_Group SoftLayer service 211func GetProductItemCategoryGroupService(sess *session.Session) Product_Item_Category_Group { 212 return Product_Item_Category_Group{Session: sess} 213} 214 215func (r Product_Item_Category_Group) Id(id int) Product_Item_Category_Group { 216 r.Options.Id = &id 217 return r 218} 219 220func (r Product_Item_Category_Group) Mask(mask string) Product_Item_Category_Group { 221 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 222 mask = fmt.Sprintf("mask[%s]", mask) 223 } 224 225 r.Options.Mask = mask 226 return r 227} 228 229func (r Product_Item_Category_Group) Filter(filter string) Product_Item_Category_Group { 230 r.Options.Filter = filter 231 return r 232} 233 234func (r Product_Item_Category_Group) Limit(limit int) Product_Item_Category_Group { 235 r.Options.Limit = &limit 236 return r 237} 238 239func (r Product_Item_Category_Group) Offset(offset int) Product_Item_Category_Group { 240 r.Options.Offset = &offset 241 return r 242} 243 244// Each product item category must be tied to a category group. These category groups describe how a particular product item category is categorized. For example, the disk0, disk1, ... disk11 can be categorized as Server and Attached Services. There are different groups for each of this product item category depending on the function of the item product in the subject category. 245func (r Product_Item_Category_Group) GetObject() (resp datatypes.Product_Item_Category_Group, err error) { 246 err = r.Session.DoRequest("SoftLayer_Product_Item_Category_Group", "getObject", nil, &r.Options, &resp) 247 return 248} 249 250// Represents the assignment of a policy to a product. The existence of a record means that the associated product is subject to the terms defined in the document content of the policy. 251type Product_Item_Policy_Assignment struct { 252 Session *session.Session 253 Options sl.Options 254} 255 256// GetProductItemPolicyAssignmentService returns an instance of the Product_Item_Policy_Assignment SoftLayer service 257func GetProductItemPolicyAssignmentService(sess *session.Session) Product_Item_Policy_Assignment { 258 return Product_Item_Policy_Assignment{Session: sess} 259} 260 261func (r Product_Item_Policy_Assignment) Id(id int) Product_Item_Policy_Assignment { 262 r.Options.Id = &id 263 return r 264} 265 266func (r Product_Item_Policy_Assignment) Mask(mask string) Product_Item_Policy_Assignment { 267 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 268 mask = fmt.Sprintf("mask[%s]", mask) 269 } 270 271 r.Options.Mask = mask 272 return r 273} 274 275func (r Product_Item_Policy_Assignment) Filter(filter string) Product_Item_Policy_Assignment { 276 r.Options.Filter = filter 277 return r 278} 279 280func (r Product_Item_Policy_Assignment) Limit(limit int) Product_Item_Policy_Assignment { 281 r.Options.Limit = &limit 282 return r 283} 284 285func (r Product_Item_Policy_Assignment) Offset(offset int) Product_Item_Policy_Assignment { 286 r.Options.Offset = &offset 287 return r 288} 289 290// Register the acceptance of the associated policy to product assignment, and link the created record to a Ticket. 291func (r Product_Item_Policy_Assignment) AcceptFromTicket(ticketId *int) (resp bool, err error) { 292 params := []interface{}{ 293 ticketId, 294 } 295 err = r.Session.DoRequest("SoftLayer_Product_Item_Policy_Assignment", "acceptFromTicket", params, &r.Options, &resp) 296 return 297} 298 299// no documentation yet 300func (r Product_Item_Policy_Assignment) GetObject() (resp datatypes.Product_Item_Policy_Assignment, err error) { 301 err = r.Session.DoRequest("SoftLayer_Product_Item_Policy_Assignment", "getObject", nil, &r.Options, &resp) 302 return 303} 304 305// Retrieve the binary contents of the associated PDF policy document. 306func (r Product_Item_Policy_Assignment) GetPolicyDocumentContents() (resp []byte, err error) { 307 err = r.Session.DoRequest("SoftLayer_Product_Item_Policy_Assignment", "getPolicyDocumentContents", nil, &r.Options, &resp) 308 return 309} 310 311// Retrieve The name of the assigned policy. 312func (r Product_Item_Policy_Assignment) GetPolicyName() (resp string, err error) { 313 err = r.Session.DoRequest("SoftLayer_Product_Item_Policy_Assignment", "getPolicyName", nil, &r.Options, &resp) 314 return 315} 316 317// Retrieve The [[SoftLayer_Product_Item]] for this policy assignment. 318func (r Product_Item_Policy_Assignment) GetProduct() (resp datatypes.Product_Item, err error) { 319 err = r.Session.DoRequest("SoftLayer_Product_Item_Policy_Assignment", "getProduct", nil, &r.Options, &resp) 320 return 321} 322 323// The SoftLayer_Product_Item_Price data type contains general information relating to a single SoftLayer product item price. You can find out what packages each price is in as well as which category under which this price is sold. All prices are returned in floating point values measured in US Dollars ($USD). 324type Product_Item_Price struct { 325 Session *session.Session 326 Options sl.Options 327} 328 329// GetProductItemPriceService returns an instance of the Product_Item_Price SoftLayer service 330func GetProductItemPriceService(sess *session.Session) Product_Item_Price { 331 return Product_Item_Price{Session: sess} 332} 333 334func (r Product_Item_Price) Id(id int) Product_Item_Price { 335 r.Options.Id = &id 336 return r 337} 338 339func (r Product_Item_Price) Mask(mask string) Product_Item_Price { 340 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 341 mask = fmt.Sprintf("mask[%s]", mask) 342 } 343 344 r.Options.Mask = mask 345 return r 346} 347 348func (r Product_Item_Price) Filter(filter string) Product_Item_Price { 349 r.Options.Filter = filter 350 return r 351} 352 353func (r Product_Item_Price) Limit(limit int) Product_Item_Price { 354 r.Options.Limit = &limit 355 return r 356} 357 358func (r Product_Item_Price) Offset(offset int) Product_Item_Price { 359 r.Options.Offset = &offset 360 return r 361} 362 363// Retrieve The account that the item price is restricted to. 364func (r Product_Item_Price) GetAccountRestrictions() (resp []datatypes.Product_Item_Price_Account_Restriction, err error) { 365 err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getAccountRestrictions", nil, &r.Options, &resp) 366 return 367} 368 369// Retrieve 370func (r Product_Item_Price) GetAttributes() (resp []datatypes.Product_Item_Price_Attribute, err error) { 371 err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getAttributes", nil, &r.Options, &resp) 372 return 373} 374 375// Retrieve Signifies pricing that is only available on a bare metal reserved capacity order. 376func (r Product_Item_Price) GetBareMetalReservedCapacityFlag() (resp bool, err error) { 377 err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getBareMetalReservedCapacityFlag", nil, &r.Options, &resp) 378 return 379} 380 381// Retrieve Whether the price is for Big Data OS/Journal disks only. (Deprecated) 382func (r Product_Item_Price) GetBigDataOsJournalDiskFlag() (resp bool, err error) { 383 err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getBigDataOsJournalDiskFlag", nil, &r.Options, &resp) 384 return 385} 386 387// Retrieve cross reference for bundles 388func (r Product_Item_Price) GetBundleReferences() (resp []datatypes.Product_Item_Bundles, err error) { 389 err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getBundleReferences", nil, &r.Options, &resp) 390 return 391} 392 393// Retrieve The maximum capacity value for which this price is suitable. 394func (r Product_Item_Price) GetCapacityRestrictionMaximum() (resp string, err error) { 395 err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getCapacityRestrictionMaximum", nil, &r.Options, &resp) 396 return 397} 398 399// Retrieve The minimum capacity value for which this price is suitable. 400func (r Product_Item_Price) GetCapacityRestrictionMinimum() (resp string, err error) { 401 err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getCapacityRestrictionMinimum", nil, &r.Options, &resp) 402 return 403} 404 405// Retrieve The type of capacity restriction by which this price must abide. 406func (r Product_Item_Price) GetCapacityRestrictionType() (resp string, err error) { 407 err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getCapacityRestrictionType", nil, &r.Options, &resp) 408 return 409} 410 411// Retrieve All categories which this item is a member. 412func (r Product_Item_Price) GetCategories() (resp []datatypes.Product_Item_Category, err error) { 413 err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getCategories", nil, &r.Options, &resp) 414 return 415} 416 417// Retrieve Signifies pricing that is only available on a dedicated host virtual server order. 418func (r Product_Item_Price) GetDedicatedHostInstanceFlag() (resp bool, err error) { 419 err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getDedicatedHostInstanceFlag", nil, &r.Options, &resp) 420 return 421} 422 423// Retrieve Whether this price defines a software license for its product item. 424func (r Product_Item_Price) GetDefinedSoftwareLicenseFlag() (resp bool, err error) { 425 err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getDefinedSoftwareLicenseFlag", nil, &r.Options, &resp) 426 return 427} 428 429// Retrieve Eligibility strategy to assess if a customer can order using this price. 430func (r Product_Item_Price) GetEligibilityStrategy() (resp string, err error) { 431 err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getEligibilityStrategy", nil, &r.Options, &resp) 432 return 433} 434 435// Retrieve The product item a price is tied to. 436func (r Product_Item_Price) GetItem() (resp datatypes.Product_Item, err error) { 437 err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getItem", nil, &r.Options, &resp) 438 return 439} 440 441// no documentation yet 442func (r Product_Item_Price) GetObject() (resp datatypes.Product_Item_Price, err error) { 443 err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getObject", nil, &r.Options, &resp) 444 return 445} 446 447// Retrieve 448func (r Product_Item_Price) GetOrderPremiums() (resp []datatypes.Product_Item_Price_Premium, err error) { 449 err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getOrderPremiums", nil, &r.Options, &resp) 450 return 451} 452 453// Retrieve cross reference for packages 454func (r Product_Item_Price) GetPackageReferences() (resp []datatypes.Product_Package_Item_Prices, err error) { 455 err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getPackageReferences", nil, &r.Options, &resp) 456 return 457} 458 459// Retrieve A price's packages under which this item is sold. 460func (r Product_Item_Price) GetPackages() (resp []datatypes.Product_Package, err error) { 461 err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getPackages", nil, &r.Options, &resp) 462 return 463} 464 465// Retrieve A list of preset configurations this price is used in.' 466func (r Product_Item_Price) GetPresetConfigurations() (resp []datatypes.Product_Package_Preset_Configuration, err error) { 467 err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getPresetConfigurations", nil, &r.Options, &resp) 468 return 469} 470 471// Retrieve The type keyname of this price which can be STANDARD, TIERED, or TERM. 472func (r Product_Item_Price) GetPriceType() (resp string, err error) { 473 err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getPriceType", nil, &r.Options, &resp) 474 return 475} 476 477// Retrieve The pricing location group that this price is applicable for. Prices that have a pricing location group will only be available for ordering with the locations specified on the location group. 478func (r Product_Item_Price) GetPricingLocationGroup() (resp datatypes.Location_Group_Pricing, err error) { 479 err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getPricingLocationGroup", nil, &r.Options, &resp) 480 return 481} 482 483// Retrieve The number of server cores required to order this item. This is deprecated. Use [[SoftLayer_Product_Item_Price/getCapacityRestrictionMinimum|getCapacityRestrictionMinimum]] and [[SoftLayer_Product_Item_Price/getCapacityRestrictionMaximum|getCapacityRestrictionMaximum]] 484func (r Product_Item_Price) GetRequiredCoreCount() (resp int, err error) { 485 err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getRequiredCoreCount", nil, &r.Options, &resp) 486 return 487} 488 489// Retrieve Signifies pricing that is only available on a reserved capacity virtual server order. 490func (r Product_Item_Price) GetReservedCapacityInstanceFlag() (resp bool, err error) { 491 err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getReservedCapacityInstanceFlag", nil, &r.Options, &resp) 492 return 493} 494 495// Returns a collection of rate-based [[SoftLayer_Product_Item_Price]] objects associated with the [[SoftLayer_Product_Item]] objects and the [[SoftLayer_Location]] specified. The location is required to get the appropriate rate-based prices because the usage rates may vary from datacenter to datacenter. 496func (r Product_Item_Price) GetUsageRatePrices(location *datatypes.Location, items []datatypes.Product_Item) (resp []datatypes.Product_Item_Price, err error) { 497 params := []interface{}{ 498 location, 499 items, 500 } 501 err = r.Session.DoRequest("SoftLayer_Product_Item_Price", "getUsageRatePrices", params, &r.Options, &resp) 502 return 503} 504 505// no documentation yet 506type Product_Item_Price_Premium struct { 507 Session *session.Session 508 Options sl.Options 509} 510 511// GetProductItemPricePremiumService returns an instance of the Product_Item_Price_Premium SoftLayer service 512func GetProductItemPricePremiumService(sess *session.Session) Product_Item_Price_Premium { 513 return Product_Item_Price_Premium{Session: sess} 514} 515 516func (r Product_Item_Price_Premium) Id(id int) Product_Item_Price_Premium { 517 r.Options.Id = &id 518 return r 519} 520 521func (r Product_Item_Price_Premium) Mask(mask string) Product_Item_Price_Premium { 522 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 523 mask = fmt.Sprintf("mask[%s]", mask) 524 } 525 526 r.Options.Mask = mask 527 return r 528} 529 530func (r Product_Item_Price_Premium) Filter(filter string) Product_Item_Price_Premium { 531 r.Options.Filter = filter 532 return r 533} 534 535func (r Product_Item_Price_Premium) Limit(limit int) Product_Item_Price_Premium { 536 r.Options.Limit = &limit 537 return r 538} 539 540func (r Product_Item_Price_Premium) Offset(offset int) Product_Item_Price_Premium { 541 r.Options.Offset = &offset 542 return r 543} 544 545// Retrieve 546func (r Product_Item_Price_Premium) GetItemPrice() (resp datatypes.Product_Item_Price, err error) { 547 err = r.Session.DoRequest("SoftLayer_Product_Item_Price_Premium", "getItemPrice", nil, &r.Options, &resp) 548 return 549} 550 551// Retrieve 552func (r Product_Item_Price_Premium) GetLocation() (resp datatypes.Location, err error) { 553 err = r.Session.DoRequest("SoftLayer_Product_Item_Price_Premium", "getLocation", nil, &r.Options, &resp) 554 return 555} 556 557// no documentation yet 558func (r Product_Item_Price_Premium) GetObject() (resp datatypes.Product_Item_Price_Premium, err error) { 559 err = r.Session.DoRequest("SoftLayer_Product_Item_Price_Premium", "getObject", nil, &r.Options, &resp) 560 return 561} 562 563// Retrieve 564func (r Product_Item_Price_Premium) GetPackage() (resp datatypes.Product_Package, err error) { 565 err = r.Session.DoRequest("SoftLayer_Product_Item_Price_Premium", "getPackage", nil, &r.Options, &resp) 566 return 567} 568 569// no documentation yet 570type Product_Order struct { 571 Session *session.Session 572 Options sl.Options 573} 574 575// GetProductOrderService returns an instance of the Product_Order SoftLayer service 576func GetProductOrderService(sess *session.Session) Product_Order { 577 return Product_Order{Session: sess} 578} 579 580func (r Product_Order) Id(id int) Product_Order { 581 r.Options.Id = &id 582 return r 583} 584 585func (r Product_Order) Mask(mask string) Product_Order { 586 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 587 mask = fmt.Sprintf("mask[%s]", mask) 588 } 589 590 r.Options.Mask = mask 591 return r 592} 593 594func (r Product_Order) Filter(filter string) Product_Order { 595 r.Options.Filter = filter 596 return r 597} 598 599func (r Product_Order) Limit(limit int) Product_Order { 600 r.Options.Limit = &limit 601 return r 602} 603 604func (r Product_Order) Offset(offset int) Product_Order { 605 r.Options.Offset = &offset 606 return r 607} 608 609// no documentation yet 610func (r Product_Order) CheckItemAvailability(itemPrices []datatypes.Product_Item_Price, accountId *int, availabilityTypeKeyNames []string) (resp bool, err error) { 611 params := []interface{}{ 612 itemPrices, 613 accountId, 614 availabilityTypeKeyNames, 615 } 616 err = r.Session.DoRequest("SoftLayer_Product_Order", "checkItemAvailability", params, &r.Options, &resp) 617 return 618} 619 620// no documentation yet 621func (r Product_Order) CheckItemAvailabilityForImageTemplate(imageTemplateId *int, accountId *int, packageId *int, availabilityTypeKeyNames []string) (resp bool, err error) { 622 params := []interface{}{ 623 imageTemplateId, 624 accountId, 625 packageId, 626 availabilityTypeKeyNames, 627 } 628 err = r.Session.DoRequest("SoftLayer_Product_Order", "checkItemAvailabilityForImageTemplate", params, &r.Options, &resp) 629 return 630} 631 632// Check order items for conflicts 633func (r Product_Order) CheckItemConflicts(itemPrices []datatypes.Product_Item_Price) (resp bool, err error) { 634 params := []interface{}{ 635 itemPrices, 636 } 637 err = r.Session.DoRequest("SoftLayer_Product_Order", "checkItemConflicts", params, &r.Options, &resp) 638 return 639} 640 641// This method simply returns a receipt for a previously finalized payment authorization from PayPal. The response matches the response returned from placeOrder when the order was originally placed with PayPal as the payment type. 642func (r Product_Order) GetExternalPaymentAuthorizationReceipt(token *string, payerId *string) (resp datatypes.Container_Product_Order_Receipt, err error) { 643 params := []interface{}{ 644 token, 645 payerId, 646 } 647 err = r.Session.DoRequest("SoftLayer_Product_Order", "getExternalPaymentAuthorizationReceipt", params, &r.Options, &resp) 648 return 649} 650 651// This method returns a collection of [[SoftLayer_Container_Product_Order_Network]] objects. This will contain the available networks that can be used when ordering services. 652// 653// If a location id is supplied, the list of networks will be trimmed down to only those that are available at that particular datacenter. 654// 655// If a package id is supplied, the list of public VLANs and subnets will be trimmed down to those that are available for that particular package. 656// 657// The account id is for internal use only and will be ignored when supplied by customers. 658func (r Product_Order) GetNetworks(locationId *int, packageId *int, accountId *int) (resp []datatypes.Container_Product_Order_Network, err error) { 659 params := []interface{}{ 660 locationId, 661 packageId, 662 accountId, 663 } 664 err = r.Session.DoRequest("SoftLayer_Product_Order", "getNetworks", params, &r.Options, &resp) 665 return 666} 667 668// When the account is on an external reseller brand, this service will provide a SoftLayer_Product_Order with the the pricing adjusted by the external reseller. 669func (r Product_Order) GetResellerOrder(orderContainer *datatypes.Container_Product_Order) (resp datatypes.Container_Product_Order, err error) { 670 params := []interface{}{ 671 orderContainer, 672 } 673 err = r.Session.DoRequest("SoftLayer_Product_Order", "getResellerOrder", params, &r.Options, &resp) 674 return 675} 676 677// Sometimes taxes cannot be calculated immediately, so we start the calculations and let them run in the background. This method will return the current progress and information related to a specific tax calculation, which allows real-time progress updates on tax calculations. 678func (r Product_Order) GetTaxCalculationResult(orderHash *string) (resp datatypes.Container_Tax_Cache, err error) { 679 params := []interface{}{ 680 orderHash, 681 } 682 err = r.Session.DoRequest("SoftLayer_Product_Order", "getTaxCalculationResult", params, &r.Options, &resp) 683 return 684} 685 686// Return collections of public and private VLANs that are available during ordering. If a location ID is provided, the resulting VLANs will be limited to that location. If the Virtual Server package id (46) is provided, the VLANs will be narrowed down to those locations that contain routers with the VIRTUAL_IMAGE_STORE data attribute. 687// 688// For the selectedItems parameter, this is a comma-separated string of category codes and item values. For example: 689// 690// - `port_speed=10,guest_disk0=LOCAL_DISK` 691// 692// - `port_speed=100,disk0=SAN_DISK` 693// 694// - `port_speed=100,private_network_only=1,guest_disk0=LOCAL_DISK` 695// 696// This parameter is used to narrow the available results down even further. It's not necessary when selecting a VLAN, but it will help avoid errors when attempting to place an order. The only acceptable category codes are: 697// 698// - `port_speed` 699// 700// - A disk category, such as `guest_disk0` or `disk0`, with values of either `LOCAL_DISK` or `SAN_DISK` 701// 702// - `private_network_only` 703// 704// - `dual_path_network` 705// 706// For most customers, it's sufficient to only provide the first 2 parameters. 707func (r Product_Order) GetVlans(locationId *int, packageId *int, selectedItems *string, vlanIds []int, subnetIds []int, accountId *int, orderContainer *datatypes.Container_Product_Order, hardwareFirewallOrderedFlag *bool) (resp datatypes.Container_Product_Order_Network_Vlans, err error) { 708 params := []interface{}{ 709 locationId, 710 packageId, 711 selectedItems, 712 vlanIds, 713 subnetIds, 714 accountId, 715 orderContainer, 716 hardwareFirewallOrderedFlag, 717 } 718 err = r.Session.DoRequest("SoftLayer_Product_Order", "getVlans", params, &r.Options, &resp) 719 return 720} 721 722// 723// Use this method to place bare metal server, virtual server and additional service orders with SoftLayer. 724// Upon success, your credit card or PayPal account will incur charges for the monthly order total 725// (or prorated value if ordered mid billing cycle). If all products on the order are only billed hourly, 726// you will be charged on your billing anniversary date, which occurs monthly on the day you ordered your first 727// service with SoftLayer. For new customers, you are required to provide billing information when you place an order. 728// For existing customers, the credit card on file will be charged. If you're a PayPal customer, a URL will be 729// returned from the call to [[SoftLayer_Product_Order/placeOrder]] which is to be used to finish the authorization 730// process. This authorization tells PayPal that you indeed want to place an order with SoftLayer. 731// From PayPal's web site, you will be redirected back to SoftLayer for your order receipt. 732// 733// 734// When an order is placed, your order will be in a "pending approval" state. When all internal checks pass, 735// your order will be automatically approved. For orders that may need extra attention, a Sales representative 736// will review the order and contact you if necessary. Once the order is approved, your server or service will 737// be provisioned and available to you shortly thereafter. Depending on the type of server or service ordered, 738// provisioning times will vary. 739// 740// 741// ## Order Containers 742// 743// 744// 745// When placing API orders, it's important to order your server and services on the appropriate 746// [[SoftLayer_Container_Product_Order]]. Failing to provide the correct container may delay your server or service 747// from being provisioned in a timely manner. Some common order containers are included below. 748// 749// 750// **Note:** `SoftLayer_Container_Product_Order_` has been removed from the containers in the table below for readability. 751// 752// 753// | Product | Order Container | Package Type | 754// | ------- | --------------- | ------------ | 755// | Bare metal server by CPU | [[SoftLayer_Container_Product_Order_Hardware_Server]] | BARE_METAL_CPU | 756// | Bare metal server by core | [[SoftLayer_Container_Product_Order_Hardware_Server]] | BARE_METAL_CORE | 757// | Virtual server | [[SoftLayer_Container_Product_Order_Virtual_Guest]] | VIRTUAL_SERVER_INSTANCE | 758// | DNS domain registration | [[SoftLayer_Container_Product_Order_Dns_Domain_Registrationn]] | ADDITIONAL_SERVICES | 759// | Local & dedicated load balancers | [[SoftLayer_Container_Product_Order_Network_LoadBalancer]] | ADDITIONAL_SERVICES_LOAD_BALANCER | 760// | Content delivery network | [[SoftLayer_Container_Product_Order_Network_ContentDelivery_Account]] | ADDITIONAL_SERVICES_CDN | 761// | Content delivery network Addon | [[SoftLayer_Container_Product_Order_Network_ContentDelivery_Account_Addon]] | ADDITIONAL_SERVICES_CDN_ADDON | 762// | Hardware & software firewalls | [[SoftLayer_Container_Product_Order_Network_Protection_Firewall]] | ADDITIONAL_SERVICES_FIREWALL | 763// | Dedicated firewall | [[SoftLayer_Container_Product_Order_Network_Protection_Firewall_Dedicated]] | ADDITIONAL_SERVICES_FIREWALL | 764// | Object storage | [[SoftLayer_Container_Product_Order_Network_Storage_Object]] | ADDITIONAL_SERVICES_OBJECT_STORAGE | 765// | Object storage (hub) | [[SoftLayer_Container_Product_Order_Network_Storage_Hub]] | ADDITIONAL_SERVICES_OBJECT_STORAGE | 766// | Network attached storage | [[SoftLayer_Container_Product_Order_Network_Storage_Nas]] | ADDITIONAL_SERVICES_NETWORK_ATTACHED_STORAGE | 767// | Iscsi storage | [[SoftLayer_Container_Product_Order_Network_Storage_Iscsi]] | ADDITIONAL_SERVICES_ISCSI_STORAGE | 768// | Evault | [[SoftLayer_Container_Product_Order_Network_Storage_Backup_Evault_Vault]] | ADDITIONAL_SERVICES | 769// | Evault Plugin | [[SoftLayer_Container_Product_Order_Network_Storage_Backup_Evault_Plugin]] | ADDITIONAL_SERVICES | 770// | Application delivery appliance | [[SoftLayer_Container_Product_Order_Network_Application_Delivery_Controller]] | ADDITIONAL_SERVICES_APPLICATION_DELIVERY_APPLIANCE | 771// | Network subnet | [[SoftLayer_Container_Product_Order_Network_Subnet]] | ADDITIONAL_SERVICES | 772// | Global IPv4 | [[SoftLayer_Container_Product_Order_Network_Subnet]] | ADDITIONAL_SERVICES_GLOBAL_IP_ADDRESSES | 773// | Global IPv6 | [[SoftLayer_Container_Product_Order_Network_Subnet]] | ADDITIONAL_SERVICES_GLOBAL_IP_ADDRESSES | 774// | Network VLAN | [[SoftLayer_Container_Product_Order_Network_Vlan]] | ADDITIONAL_SERVICES_NETWORK_VLAN | 775// | Portable storage | [[SoftLayer_Container_Product_Order_Virtual_Disk_Image]] | ADDITIONAL_SERVICES_PORTABLE_STORAGE | 776// | SSL certificate | [[SoftLayer_Container_Product_Order_Security_Certificate]] | ADDITIONAL_SERVICES_SSL_CERTIFICATE | 777// | External authentication | [[SoftLayer_Container_Product_Order_User_Customer_External_Binding]] | ADDITIONAL_SERVICES | 778// | Dedicated Host | [[SoftLayer_Container_Product_Order_Virtual_DedicatedHost]] | DEDICATED_HOST | 779// 780// 781// ## Server example 782// 783// 784// 785// This example includes a single bare metal server being ordered with monthly billing. 786// 787// 788// **Warning:** the price ids provided below may be outdated or unavailable, so you will need to determine the 789// 790// available prices from the bare metal server [[SoftLayer_Product_Package/getAllObjects]], which have a 791// [[SoftLayer_Product_Package_Type]] of `BARE_METAL_CPU` or `BARE_METAL_CORE`. You can get a full list of 792// package types with [[SoftLayer_Product_Package_Type/getAllObjects]]. 793// 794// 795// ### Bare Metal Ordering 796// 797// ```xml 798// <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://api.service.softlayer.com/soap/v3/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 799// <SOAP-ENV:Header> 800// <ns1:authenticate> 801// <username>your username</username> 802// <apiKey>your api key</apiKey> 803// </ns1:authenticate> 804// </SOAP-ENV:Header> 805// <SOAP-ENV:Body> 806// <ns1:placeOrder> 807// <orderData xsi:type="ns1:SoftLayer_Container_Product_Order_Hardware_Server"> 808// <hardware SOAP-ENC:arrayType="ns1:SoftLayer_Hardware[1]" xsi:type="ns1:SoftLayer_HardwareArray"> 809// <item xsi:type="ns1:SoftLayer_Hardware"> 810// <domain xsi:type="xsd:string">example.com</domain> 811// <hostname xsi:type="xsd:string">server1</hostname> 812// </item> 813// </hardware> 814// <location xsi:type="xsd:string">138124</location> 815// <packageId xsi:type="xsd:int">142</packageId> 816// <prices SOAP-ENC:arrayType="ns1:SoftLayer_Product_Item_Price[14]" xsi:type="ns1:SoftLayer_Product_Item_PriceArray"> 817// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 818// <id xsi:type="xsd:int">58</id> 819// </item> 820// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 821// <id xsi:type="xsd:int">22337</id> 822// </item> 823// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 824// <id xsi:type="xsd:int">21189</id> 825// </item> 826// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 827// <id xsi:type="xsd:int">876</id> 828// </item> 829// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 830// <id xsi:type="xsd:int">57</id> 831// </item> 832// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 833// <id xsi:type="xsd:int">55</id> 834// </item> 835// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 836// <id xsi:type="xsd:int">21190</id> 837// </item> 838// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 839// <id xsi:type="xsd:int">36381</id> 840// </item> 841// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 842// <id xsi:type="xsd:int">21</id> 843// </item> 844// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 845// <id xsi:type="xsd:int">22013</id> 846// </item> 847// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 848// <id xsi:type="xsd:int">906</id> 849// </item> 850// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 851// <id xsi:type="xsd:int">420</id> 852// </item> 853// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 854// <id xsi:type="xsd:int">418</id> 855// </item> 856// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 857// <id xsi:type="xsd:int">342</id> 858// </item> 859// </prices> 860// <useHourlyPricing xsi:type="xsd:boolean">false</useHourlyPricing> 861// </orderData> 862// <saveAsQuote xsi:nil="true" /> 863// </ns1:placeOrder> 864// </SOAP-ENV:Body> 865// </SOAP-ENV:Envelope> 866// ``` 867// 868// 869// ## Virtual server example 870// 871// 872// 873// This example includes 2 identical virtual servers (except for hostname) being ordered for hourly billing. 874// It includes an optional image template id and VLAN data specified on the virtualGuest objects - 875// `primaryBackendNetworkComponent` and `primaryNetworkComponent`. 876// 877// 878// **Warning:** the price ids provided below may be outdated or unavailable, so you will need to determine the 879// 880// available prices from the virtual server package with [[SoftLayer_Product_Package/getAllObjects]], 881// which has a [[SoftLayer_Product_Package_Type]] of `VIRTUAL_SERVER_INSTANCE`. 882// 883// 884// #### Virtual Ordering 885// 886// ```xml 887// <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://api.service.softlayer.com/soap/v3/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 888// <SOAP-ENV:Header> 889// <ns1:authenticate> 890// <username>your username</username> 891// <apiKey>your api key</apiKey> 892// </ns1:authenticate> 893// </SOAP-ENV:Header> 894// <SOAP-ENV:Body> 895// <ns1:placeOrder> 896// <orderData xsi:type="ns1:SoftLayer_Container_Product_Order_Virtual_Guest"> 897// <imageTemplateId xsi:type="xsd:int">13251</imageTemplateId> 898// <location xsi:type="xsd:string">37473</location> 899// <packageId xsi:type="xsd:int">46</packageId> 900// <prices SOAP-ENC:arrayType="ns1:SoftLayer_Product_Item_Price[13]" xsi:type="ns1:SoftLayer_Product_Item_PriceArray"> 901// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 902// <id xsi:type="xsd:int">2159</id> 903// </item> 904// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 905// <id xsi:type="xsd:int">55</id> 906// </item> 907// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 908// <id xsi:type="xsd:int">13754</id> 909// </item> 910// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 911// <id xsi:type="xsd:int">1641</id> 912// </item> 913// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 914// <id xsi:type="xsd:int">905</id> 915// </item> 916// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 917// <id xsi:type="xsd:int">1800</id> 918// </item> 919// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 920// <id xsi:type="xsd:int">58</id> 921// </item> 922// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 923// <id xsi:type="xsd:int">21</id> 924// </item> 925// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 926// <id xsi:type="xsd:int">1645</id> 927// </item> 928// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 929// <id xsi:type="xsd:int">272</id> 930// </item> 931// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 932// <id xsi:type="xsd:int">57</id> 933// </item> 934// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 935// <id xsi:type="xsd:int">418</id> 936// </item> 937// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 938// <id xsi:type="xsd:int">420</id> 939// </item> 940// </prices> 941// <quantity xsi:type="xsd:int">2</quantity> 942// <useHourlyPricing xsi:type="xsd:boolean">true</useHourlyPricing> 943// <virtualGuests SOAP-ENC:arrayType="ns1:SoftLayer_Virtual_Guest[1]" xsi:type="ns1:SoftLayer_Virtual_GuestArray"> 944// <item xsi:type="ns1:SoftLayer_Virtual_Guest"> 945// <domain xsi:type="xsd:string">example.com</domain> 946// <hostname xsi:type="xsd:string">server1</hostname> 947// <primaryBackendNetworkComponent xsi:type="ns1:SoftLayer_Virtual_Guest_Network_Component"> 948// <networkVlan xsi:type="ns1:SoftLayer_Network_Vlan"> 949// <id xsi:type="xsd:int">12345</id> 950// </networkVlan> 951// </primaryBackendNetworkComponent> 952// <primaryNetworkComponent xsi:type="ns1:SoftLayer_Virtual_Guest_Network_Component"> 953// <networkVlan xsi:type="ns1:SoftLayer_Network_Vlan"> 954// <id xsi:type="xsd:int">67890</id> 955// </networkVlan> 956// </primaryNetworkComponent> 957// </item> 958// <item xsi:type="ns1:SoftLayer_Virtual_Guest"> 959// <domain xsi:type="xsd:string">example.com</domain> 960// <hostname xsi:type="xsd:string">server2</hostname> 961// <primaryBackendNetworkComponent xsi:type="ns1:SoftLayer_Virtual_Guest_Network_Component"> 962// <networkVlan xsi:type="ns1:SoftLayer_Network_Vlan"> 963// <id xsi:type="xsd:int">12345</id> 964// </networkVlan> 965// </primaryBackendNetworkComponent> 966// <primaryNetworkComponent xsi:type="ns1:SoftLayer_Virtual_Guest_Network_Component"> 967// <networkVlan xsi:type="ns1:SoftLayer_Network_Vlan"> 968// <id xsi:type="xsd:int">67890</id> 969// </networkVlan> 970// </primaryNetworkComponent> 971// </item> 972// </virtualGuests> 973// </orderData> 974// <saveAsQuote xsi:nil="true" /> 975// </ns1:placeOrder> 976// </SOAP-ENV:Body> 977// </SOAP-ENV:Envelope> 978// ``` 979// 980// 981// ## VLAN example 982// 983// 984// **Warning:** the price ids provided below may be outdated or unavailable, so you will need to determine the 985// 986// available prices from the additional services pacakge with [[SoftLayer_Product_Package/getAllObjects]], 987// which has a [[SoftLayer_Product_Package_Type]] of `ADDITIONAL_SERVICES`. 988// You can get a full list of [[SoftLayer_Product_Package_Type/getAllObjects|]] to find other available additional 989// service packages.<br/><br/> 990// 991// 992// ### VLAN Ordering 993// 994// ```xml 995// <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://api.service.softlayer.com/soap/v3/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 996// <SOAP-ENV:Header> 997// <ns1:authenticate> 998// <username>your username</username> 999// <apiKey>your api key</apiKey> 1000// </ns1:authenticate> 1001// </SOAP-ENV:Header> 1002// <SOAP-ENV:Body> 1003// <ns1:placeOrder> 1004// <orderData xsi:type="ns1:SoftLayer_Container_Product_Order_Network_Vlan"> 1005// <location xsi:type="xsd:string">154820</location> 1006// <packageId xsi:type="xsd:int">0</packageId> 1007// <prices SOAP-ENC:arrayType="ns1:SoftLayer_Product_Item_Price[2]" xsi:type="ns1:SoftLayer_Product_Item_PriceArray"> 1008// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 1009// <id xsi:type="xsd:int">2021</id> 1010// </item> 1011// <item xsi:type="ns1:SoftLayer_Product_Item_Price"> 1012// <id xsi:type="xsd:int">2018</id> 1013// </item> 1014// </prices> 1015// <useHourlyPricing xsi:type="xsd:boolean">true</useHourlyPricing> 1016// </orderData> 1017// <saveAsQuote xsi:nil="true" /> 1018// </ns1:placeOrder> 1019// </SOAP-ENV:Body> 1020// </SOAP-ENV:Envelope> 1021// ``` 1022// 1023// 1024// ## Multiple products example 1025// 1026// 1027// 1028// This example includes a combination of the above examples in a single order. Note that all the configuration 1029// options for each individual order container are the same as above, except now we encapsulate each one within 1030// the `orderContainers` property on the base [[SoftLayer_Container_Product_Order]]. 1031// 1032// 1033// **Warning:** not all products are available to be ordered with other products. For example, since 1034// 1035// SSL certificates require validation from a 3rd party, the approval process may take days or even weeks, 1036// and this would not be acceptable when you need your hourly virtual server right now. To better accommodate 1037// customers, we restrict several products to be ordered individually. 1038// 1039// 1040// ### Bare metal server + virtual server + VLAN 1041// 1042// 1043// 1044// ```xml 1045// <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://api.service.softlayer.com/soap/v3/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 1046// <SOAP-ENV:Header> 1047// <ns1:authenticate> 1048// <username>your username</username> 1049// <apiKey>your api key</apiKey> 1050// </ns1:authenticate> 1051// </SOAP-ENV:Header> 1052// <SOAP-ENV:Body> 1053// <ns1:placeOrder> 1054// <orderData xsi:type="ns1:SoftLayer_Container_Product_Order"> 1055// <orderContainers SOAP-ENC:arrayType="ns1:SoftLayer_Container_Product_Order[3]" xsi:type="ns1:SoftLayer_Container_Product_OrderArray"> 1056// <item xsi:type="ns1:SoftLayer_Container_Product_Order_Hardware_Server"> 1057// ... 1058// </item> 1059// <item xsi:type="ns1:SoftLayer_Container_Product_Order_Virtual_Guest"> 1060// ... 1061// </item> 1062// <item xsi:type="ns1:SoftLayer_Container_Product_Order_Network_Vlan"> 1063// ... 1064// </item> 1065// </orderContainers> 1066// </orderData> 1067// <saveAsQuote xsi:nil="true" /> 1068// </ns1:placeOrder> 1069// </SOAP-ENV:Body> 1070// </SOAP-ENV:Envelope> 1071// ``` 1072// 1073// 1074func (r Product_Order) PlaceOrder(orderData interface{}, saveAsQuote *bool) (resp datatypes.Container_Product_Order_Receipt, err error) { 1075 err = datatypes.SetComplexType(orderData) 1076 if err != nil { 1077 return 1078 } 1079 params := []interface{}{ 1080 orderData, 1081 saveAsQuote, 1082 } 1083 err = r.Session.DoRequest("SoftLayer_Product_Order", "placeOrder", params, &r.Options, &resp) 1084 return 1085} 1086 1087// Use this method for placing server quotes and additional services quotes. The same applies for this as with verifyOrder. Send in the SoftLayer_Container_Product_Order_Hardware_Server for server quotes. After placing the quote, you must go to this URL to finish the order process. After going to this URL, it will direct you back to a SoftLayer webpage that tells us you have finished the process. After this, it will go to sales for final approval. 1088func (r Product_Order) PlaceQuote(orderData interface{}) (resp datatypes.Container_Product_Order_Receipt, err error) { 1089 params := []interface{}{ 1090 orderData, 1091 } 1092 err = r.Session.DoRequest("SoftLayer_Product_Order", "placeQuote", params, &r.Options, &resp) 1093 return 1094} 1095 1096// This method simply finalizes an authorization from PayPal. It tells SoftLayer that the customer has completed the PayPal process. This is ONLY needed if you, the customer, have your own API into PayPal and wish to automate authorizations from PayPal and our system. For most, this method will not be needed. Once an order is placed using placeOrder() for PayPal customers, a URL is given back to the customer. In it is the token and PayerID. If you want to systematically pay with PayPal, do so then call this method with the token and PayerID. 1097func (r Product_Order) ProcessExternalPaymentAuthorization(token *string, payerId *string) (resp datatypes.Container_Product_Order, err error) { 1098 params := []interface{}{ 1099 token, 1100 payerId, 1101 } 1102 err = r.Session.DoRequest("SoftLayer_Product_Order", "processExternalPaymentAuthorization", params, &r.Options, &resp) 1103 return 1104} 1105 1106// Get list of items that are required with the item prices provided 1107func (r Product_Order) RequiredItems(itemPrices []datatypes.Product_Item_Price) (resp []datatypes.Product_Item, err error) { 1108 params := []interface{}{ 1109 itemPrices, 1110 } 1111 err = r.Session.DoRequest("SoftLayer_Product_Order", "requiredItems", params, &r.Options, &resp) 1112 return 1113} 1114 1115// This service is used to verify that an order meets all the necessary requirements to purchase a server, virtual server or service from SoftLayer. It will verify that the products requested do not conflict. For example, you cannot order a Windows firewall with a Linux operating system. It will also check to make sure you have provided all the products that are required for the [[SoftLayer_Product_Package_Order_Configuration]] associated with the [[SoftLayer_Product_Package]] on each of the [[SoftLayer_Container_Product_Order]] specified.<br/><br/> 1116// 1117// This service returns the same container that was provided, but with additional information that can be used for debugging or validation. It will also contain pricing information (prorated if applicable) for each of the products on the order. If an exception occurs during verification, a container with the <code>SoftLayer_Exception_Order</code> exception type will be specified in the result.<br/><br/> 1118// 1119// <code>verifyOrder</code> accepts the same [[SoftLayer_Container_Product_Order]] as <code>placeOrder</code>, so see [[SoftLayer_Product_Order/placeOrder]] for more details. 1120// 1121// 1122func (r Product_Order) VerifyOrder(orderData interface{}) (resp datatypes.Container_Product_Order, err error) { 1123 err = datatypes.SetComplexType(orderData) 1124 if err != nil { 1125 return 1126 } 1127 params := []interface{}{ 1128 orderData, 1129 } 1130 err = r.Session.DoRequest("SoftLayer_Product_Order", "verifyOrder", params, &r.Options, &resp) 1131 return 1132} 1133 1134// The SoftLayer_Product_Package data type contains information about packages from which orders can be generated. Packages contain general information regarding what is in them, where they are currently sold, availability, and pricing. 1135type Product_Package struct { 1136 Session *session.Session 1137 Options sl.Options 1138} 1139 1140// GetProductPackageService returns an instance of the Product_Package SoftLayer service 1141func GetProductPackageService(sess *session.Session) Product_Package { 1142 return Product_Package{Session: sess} 1143} 1144 1145func (r Product_Package) Id(id int) Product_Package { 1146 r.Options.Id = &id 1147 return r 1148} 1149 1150func (r Product_Package) Mask(mask string) Product_Package { 1151 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 1152 mask = fmt.Sprintf("mask[%s]", mask) 1153 } 1154 1155 r.Options.Mask = mask 1156 return r 1157} 1158 1159func (r Product_Package) Filter(filter string) Product_Package { 1160 r.Options.Filter = filter 1161 return r 1162} 1163 1164func (r Product_Package) Limit(limit int) Product_Package { 1165 r.Options.Limit = &limit 1166 return r 1167} 1168 1169func (r Product_Package) Offset(offset int) Product_Package { 1170 r.Options.Offset = &offset 1171 return r 1172} 1173 1174// Retrieve The preset configurations available only for the authenticated account and this package. 1175func (r Product_Package) GetAccountRestrictedActivePresets() (resp []datatypes.Product_Package_Preset, err error) { 1176 err = r.Session.DoRequest("SoftLayer_Product_Package", "getAccountRestrictedActivePresets", nil, &r.Options, &resp) 1177 return 1178} 1179 1180// Retrieve The results from this call are similar to [[SoftLayer_Product_Package/getCategories|getCategories]], but these ONLY include account-restricted prices. Not all accounts have restricted pricing. 1181func (r Product_Package) GetAccountRestrictedCategories() (resp []datatypes.Product_Item_Category, err error) { 1182 err = r.Session.DoRequest("SoftLayer_Product_Package", "getAccountRestrictedCategories", nil, &r.Options, &resp) 1183 return 1184} 1185 1186// Retrieve The flag to indicate if there are any restricted prices in a package for the currently-active account. 1187func (r Product_Package) GetAccountRestrictedPricesFlag() (resp bool, err error) { 1188 err = r.Session.DoRequest("SoftLayer_Product_Package", "getAccountRestrictedPricesFlag", nil, &r.Options, &resp) 1189 return 1190} 1191 1192// Return a list of Items in the package with their active prices. 1193func (r Product_Package) GetActiveItems() (resp []datatypes.Product_Item, err error) { 1194 err = r.Session.DoRequest("SoftLayer_Product_Package", "getActiveItems", nil, &r.Options, &resp) 1195 return 1196} 1197 1198// <strong>This method is deprecated and should not be used in production code.</strong> 1199// 1200// This method will return the [[SoftLayer_Product_Package]] objects from which you can order a bare metal server, virtual server, service (such as CDN or Object Storage) or other software filtered by an attribute type associated with the package. Once you have the package you want to order from, you may query one of various endpoints from that package to get specific information about its products and pricing. See [[SoftLayer_Product_Package/getCategories|getCategories]] or [[SoftLayer_Product_Package/getItems|getItems]] for more information. 1201func (r Product_Package) GetActivePackagesByAttribute(attributeKeyName *string) (resp []datatypes.Product_Package, err error) { 1202 params := []interface{}{ 1203 attributeKeyName, 1204 } 1205 err = r.Session.DoRequest("SoftLayer_Product_Package", "getActivePackagesByAttribute", params, &r.Options, &resp) 1206 return 1207} 1208 1209// Retrieve The available preset configurations for this package. 1210func (r Product_Package) GetActivePresets() (resp []datatypes.Product_Package_Preset, err error) { 1211 err = r.Session.DoRequest("SoftLayer_Product_Package", "getActivePresets", nil, &r.Options, &resp) 1212 return 1213} 1214 1215// [DEPRECATED] This method pulls all the active private hosted cloud packages. This will give you a basic description of the packages that are currently active and from which you can order private hosted cloud configurations. 1216func (r Product_Package) GetActivePrivateHostedCloudPackages() (resp []datatypes.Product_Package, err error) { 1217 err = r.Session.DoRequest("SoftLayer_Product_Package", "getActivePrivateHostedCloudPackages", nil, &r.Options, &resp) 1218 return 1219} 1220 1221// Retrieve A collection of valid RAM items available for purchase in this package. 1222func (r Product_Package) GetActiveRamItems() (resp []datatypes.Product_Item, err error) { 1223 err = r.Session.DoRequest("SoftLayer_Product_Package", "getActiveRamItems", nil, &r.Options, &resp) 1224 return 1225} 1226 1227// Retrieve A collection of valid server items available for purchase in this package. 1228func (r Product_Package) GetActiveServerItems() (resp []datatypes.Product_Item, err error) { 1229 err = r.Session.DoRequest("SoftLayer_Product_Package", "getActiveServerItems", nil, &r.Options, &resp) 1230 return 1231} 1232 1233// Retrieve A collection of valid software items available for purchase in this package. 1234func (r Product_Package) GetActiveSoftwareItems() (resp []datatypes.Product_Item, err error) { 1235 err = r.Session.DoRequest("SoftLayer_Product_Package", "getActiveSoftwareItems", nil, &r.Options, &resp) 1236 return 1237} 1238 1239// Retrieve A collection of [[SoftLayer_Product_Item_Price]] objects for pay-as-you-go usage. 1240func (r Product_Package) GetActiveUsagePrices() (resp []datatypes.Product_Item_Price, err error) { 1241 err = r.Session.DoRequest("SoftLayer_Product_Package", "getActiveUsagePrices", nil, &r.Options, &resp) 1242 return 1243} 1244 1245// This method returns a collection of active usage rate [[SoftLayer_Product_Item_Price]] objects for the current package and specified datacenter. Optionally you can retrieve the active usage rate prices for a particular [[SoftLayer_Product_Item_Category]] by specifying a category code as the first parameter. This information is useful so that you can see "pay as you go" rates (if any) for the current package, location and optionally category. 1246func (r Product_Package) GetActiveUsageRatePrices(locationId *int, categoryCode *string) (resp []datatypes.Product_Item_Price, err error) { 1247 params := []interface{}{ 1248 locationId, 1249 categoryCode, 1250 } 1251 err = r.Session.DoRequest("SoftLayer_Product_Package", "getActiveUsageRatePrices", params, &r.Options, &resp) 1252 return 1253} 1254 1255// Retrieve This flag indicates that the package is an additional service. 1256func (r Product_Package) GetAdditionalServiceFlag() (resp bool, err error) { 1257 err = r.Session.DoRequest("SoftLayer_Product_Package", "getAdditionalServiceFlag", nil, &r.Options, &resp) 1258 return 1259} 1260 1261// This method pulls all the active packages. This will give you a basic description of the packages that are currently active 1262func (r Product_Package) GetAllObjects() (resp []datatypes.Product_Package, err error) { 1263 err = r.Session.DoRequest("SoftLayer_Product_Package", "getAllObjects", nil, &r.Options, &resp) 1264 return 1265} 1266 1267// Retrieve 1268func (r Product_Package) GetAttributes() (resp []datatypes.Product_Package_Attribute, err error) { 1269 err = r.Session.DoRequest("SoftLayer_Product_Package", "getAttributes", nil, &r.Options, &resp) 1270 return 1271} 1272 1273// Retrieve A collection of valid locations for this package. (Deprecated - Use [[SoftLayer_Product_Package/getRegions|getRegions]]) 1274func (r Product_Package) GetAvailableLocations() (resp []datatypes.Product_Package_Locations, err error) { 1275 err = r.Session.DoRequest("SoftLayer_Product_Package", "getAvailableLocations", nil, &r.Options, &resp) 1276 return 1277} 1278 1279// no documentation yet 1280func (r Product_Package) GetAvailablePackagesForImageTemplate(imageTemplate *datatypes.Virtual_Guest_Block_Device_Template_Group) (resp []datatypes.Product_Package, err error) { 1281 params := []interface{}{ 1282 imageTemplate, 1283 } 1284 err = r.Session.DoRequest("SoftLayer_Product_Package", "getAvailablePackagesForImageTemplate", params, &r.Options, &resp) 1285 return 1286} 1287 1288// Retrieve The maximum number of available disk storage units associated with the servers in a package. 1289func (r Product_Package) GetAvailableStorageUnits() (resp uint, err error) { 1290 err = r.Session.DoRequest("SoftLayer_Product_Package", "getAvailableStorageUnits", nil, &r.Options, &resp) 1291 return 1292} 1293 1294// Retrieve This is a collection of categories ([[SoftLayer_Product_Item_Category]]) associated with a package which can be used for ordering. These categories have several objects prepopulated which are useful when determining the available products for purchase. The categories contain groups ([[SoftLayer_Product_Package_Item_Category_Group]]) that organize the products and prices by similar features. For example, operating systems will be grouped by their manufacturer and virtual server disks will be grouped by their disk type (SAN vs. local). Each group will contain prices ([[SoftLayer_Product_Item_Price]]) which you can use determine the cost of each product. Each price has a product ([[SoftLayer_Product_Item]]) which provides the name and other useful information about the server, service or software you may purchase. 1295func (r Product_Package) GetCategories() (resp []datatypes.Product_Item_Category, err error) { 1296 err = r.Session.DoRequest("SoftLayer_Product_Package", "getCategories", nil, &r.Options, &resp) 1297 return 1298} 1299 1300// no documentation yet 1301func (r Product_Package) GetCdnItems() (resp []datatypes.Product_Item, err error) { 1302 err = r.Session.DoRequest("SoftLayer_Product_Package", "getCdnItems", nil, &r.Options, &resp) 1303 return 1304} 1305 1306// no documentation yet 1307func (r Product_Package) GetCloudStorageItems(provider *int) (resp []datatypes.Product_Item, err error) { 1308 params := []interface{}{ 1309 provider, 1310 } 1311 err = r.Session.DoRequest("SoftLayer_Product_Package", "getCloudStorageItems", params, &r.Options, &resp) 1312 return 1313} 1314 1315// Retrieve The item categories associated with a package, including information detailing which item categories are required as part of a SoftLayer product order. 1316func (r Product_Package) GetConfiguration() (resp []datatypes.Product_Package_Order_Configuration, err error) { 1317 err = r.Session.DoRequest("SoftLayer_Product_Package", "getConfiguration", nil, &r.Options, &resp) 1318 return 1319} 1320 1321// Retrieve The default boot category code for the package. 1322func (r Product_Package) GetDefaultBootCategoryCode() (resp string, err error) { 1323 err = r.Session.DoRequest("SoftLayer_Product_Package", "getDefaultBootCategoryCode", nil, &r.Options, &resp) 1324 return 1325} 1326 1327// Retrieve A collection of valid RAM items available for purchase in this package. 1328func (r Product_Package) GetDefaultRamItems() (resp []datatypes.Product_Item, err error) { 1329 err = r.Session.DoRequest("SoftLayer_Product_Package", "getDefaultRamItems", nil, &r.Options, &resp) 1330 return 1331} 1332 1333// Retrieve The node type for a package in a solution deployment. 1334func (r Product_Package) GetDeploymentNodeType() (resp string, err error) { 1335 err = r.Session.DoRequest("SoftLayer_Product_Package", "getDeploymentNodeType", nil, &r.Options, &resp) 1336 return 1337} 1338 1339// Retrieve The packages that are allowed in a multi-server solution. (Deprecated) 1340func (r Product_Package) GetDeploymentPackages() (resp []datatypes.Product_Package, err error) { 1341 err = r.Session.DoRequest("SoftLayer_Product_Package", "getDeploymentPackages", nil, &r.Options, &resp) 1342 return 1343} 1344 1345// Retrieve The solution deployment type. 1346func (r Product_Package) GetDeploymentType() (resp string, err error) { 1347 err = r.Session.DoRequest("SoftLayer_Product_Package", "getDeploymentType", nil, &r.Options, &resp) 1348 return 1349} 1350 1351// Retrieve The package that represents a multi-server solution. (Deprecated) 1352func (r Product_Package) GetDeployments() (resp []datatypes.Product_Package, err error) { 1353 err = r.Session.DoRequest("SoftLayer_Product_Package", "getDeployments", nil, &r.Options, &resp) 1354 return 1355} 1356 1357// Retrieve This flag indicates the package does not allow custom disk partitions. 1358func (r Product_Package) GetDisallowCustomDiskPartitions() (resp bool, err error) { 1359 err = r.Session.DoRequest("SoftLayer_Product_Package", "getDisallowCustomDiskPartitions", nil, &r.Options, &resp) 1360 return 1361} 1362 1363// Retrieve The Softlayer order step is optionally step-based. This returns the first SoftLayer_Product_Package_Order_Step in the step-based order process. 1364func (r Product_Package) GetFirstOrderStep() (resp datatypes.Product_Package_Order_Step, err error) { 1365 err = r.Session.DoRequest("SoftLayer_Product_Package", "getFirstOrderStep", nil, &r.Options, &resp) 1366 return 1367} 1368 1369// Retrieve Whether the package is a specialized network gateway appliance package. 1370func (r Product_Package) GetGatewayApplianceFlag() (resp bool, err error) { 1371 err = r.Session.DoRequest("SoftLayer_Product_Package", "getGatewayApplianceFlag", nil, &r.Options, &resp) 1372 return 1373} 1374 1375// Retrieve This flag indicates that the package supports GPUs. 1376func (r Product_Package) GetGpuFlag() (resp bool, err error) { 1377 err = r.Session.DoRequest("SoftLayer_Product_Package", "getGpuFlag", nil, &r.Options, &resp) 1378 return 1379} 1380 1381// Retrieve Determines whether the package contains prices that can be ordered hourly. 1382func (r Product_Package) GetHourlyBillingAvailableFlag() (resp bool, err error) { 1383 err = r.Session.DoRequest("SoftLayer_Product_Package", "getHourlyBillingAvailableFlag", nil, &r.Options, &resp) 1384 return 1385} 1386 1387// Retrieve Packages with this flag do not allow monthly orders. 1388func (r Product_Package) GetHourlyOnlyOrders() (resp bool, err error) { 1389 err = r.Session.DoRequest("SoftLayer_Product_Package", "getHourlyOnlyOrders", nil, &r.Options, &resp) 1390 return 1391} 1392 1393// Returns a collection of SoftLayer_Product_Item_Attribute_Type objects. These item attribute types specifically deal with when an item, SoftLayer_Product_Item, from the product catalog may no longer be available. The keynames for these attribute types start with 'UNAVAILABLE_AFTER_DATE_*', where the '*' may represent any string. For example, 'UNAVAILABLE_AFTER_DATE_NEW_ORDERS', signifies that the item is not available for new orders. There is a catch all attribute type, 'UNAVAILABLE_AFTER_DATE_ALL'. If an item has one of these availability attributes set, the value should be a valid date in MM/DD/YYYY, indicating the date after which the item will no longer be available. 1394func (r Product_Package) GetItemAvailabilityTypes() (resp []datatypes.Product_Item_Attribute_Type, err error) { 1395 err = r.Session.DoRequest("SoftLayer_Product_Package", "getItemAvailabilityTypes", nil, &r.Options, &resp) 1396 return 1397} 1398 1399// Retrieve The item-item conflicts associated with a package. 1400func (r Product_Package) GetItemConflicts() (resp []datatypes.Product_Item_Resource_Conflict, err error) { 1401 err = r.Session.DoRequest("SoftLayer_Product_Package", "getItemConflicts", nil, &r.Options, &resp) 1402 return 1403} 1404 1405// Retrieve The item-location conflicts associated with a package. 1406func (r Product_Package) GetItemLocationConflicts() (resp []datatypes.Product_Item_Resource_Conflict, err error) { 1407 err = r.Session.DoRequest("SoftLayer_Product_Package", "getItemLocationConflicts", nil, &r.Options, &resp) 1408 return 1409} 1410 1411// Retrieve cross reference for item prices 1412func (r Product_Package) GetItemPriceReferences() (resp []datatypes.Product_Package_Item_Prices, err error) { 1413 err = r.Session.DoRequest("SoftLayer_Product_Package", "getItemPriceReferences", nil, &r.Options, &resp) 1414 return 1415} 1416 1417// Retrieve A collection of SoftLayer_Product_Item_Prices that are valid for this package. 1418func (r Product_Package) GetItemPrices() (resp []datatypes.Product_Item_Price, err error) { 1419 err = r.Session.DoRequest("SoftLayer_Product_Package", "getItemPrices", nil, &r.Options, &resp) 1420 return 1421} 1422 1423// Return a collection of SoftLayer_Item_Price objects from a collection of SoftLayer_Software_Description 1424func (r Product_Package) GetItemPricesFromSoftwareDescriptions(softwareDescriptions []datatypes.Software_Description, includeTranslationsFlag *bool, returnAllPricesFlag *bool) (resp []datatypes.Product_Item_Price, err error) { 1425 params := []interface{}{ 1426 softwareDescriptions, 1427 includeTranslationsFlag, 1428 returnAllPricesFlag, 1429 } 1430 err = r.Session.DoRequest("SoftLayer_Product_Package", "getItemPricesFromSoftwareDescriptions", params, &r.Options, &resp) 1431 return 1432} 1433 1434// Retrieve A collection of valid items available for purchase in this package. 1435func (r Product_Package) GetItems() (resp []datatypes.Product_Item, err error) { 1436 err = r.Session.DoRequest("SoftLayer_Product_Package", "getItems", nil, &r.Options, &resp) 1437 return 1438} 1439 1440// Return a collection of [[SoftLayer_Product_Item]] objects from a [[SoftLayer_Virtual_Guest_Block_Device_Template_Group]] object 1441func (r Product_Package) GetItemsFromImageTemplate(imageTemplate *datatypes.Virtual_Guest_Block_Device_Template_Group) (resp []datatypes.Product_Item, err error) { 1442 params := []interface{}{ 1443 imageTemplate, 1444 } 1445 err = r.Session.DoRequest("SoftLayer_Product_Package", "getItemsFromImageTemplate", params, &r.Options, &resp) 1446 return 1447} 1448 1449// Retrieve A collection of valid locations for this package. (Deprecated - Use [[SoftLayer_Product_Package/getRegions|getRegions]]) 1450func (r Product_Package) GetLocations() (resp []datatypes.Location, err error) { 1451 err = r.Session.DoRequest("SoftLayer_Product_Package", "getLocations", nil, &r.Options, &resp) 1452 return 1453} 1454 1455// Retrieve The lowest server [[SoftLayer_Product_Item_Price]] related to this package. 1456func (r Product_Package) GetLowestServerPrice() (resp datatypes.Product_Item_Price, err error) { 1457 err = r.Session.DoRequest("SoftLayer_Product_Package", "getLowestServerPrice", nil, &r.Options, &resp) 1458 return 1459} 1460 1461// Retrieve The maximum available network speed associated with the package. 1462func (r Product_Package) GetMaximumPortSpeed() (resp uint, err error) { 1463 err = r.Session.DoRequest("SoftLayer_Product_Package", "getMaximumPortSpeed", nil, &r.Options, &resp) 1464 return 1465} 1466 1467// no documentation yet 1468func (r Product_Package) GetMessageQueueItems() (resp []datatypes.Product_Item, err error) { 1469 err = r.Session.DoRequest("SoftLayer_Product_Package", "getMessageQueueItems", nil, &r.Options, &resp) 1470 return 1471} 1472 1473// Retrieve The minimum available network speed associated with the package. 1474func (r Product_Package) GetMinimumPortSpeed() (resp uint, err error) { 1475 err = r.Session.DoRequest("SoftLayer_Product_Package", "getMinimumPortSpeed", nil, &r.Options, &resp) 1476 return 1477} 1478 1479// Retrieve This flag indicates that this is a MongoDB engineered package. (Deprecated) 1480func (r Product_Package) GetMongoDbEngineeredFlag() (resp bool, err error) { 1481 err = r.Session.DoRequest("SoftLayer_Product_Package", "getMongoDbEngineeredFlag", nil, &r.Options, &resp) 1482 return 1483} 1484 1485// Retrieve Services ordered from this package cannot have upgrades or downgrades performed. 1486func (r Product_Package) GetNoUpgradesFlag() (resp bool, err error) { 1487 err = r.Session.DoRequest("SoftLayer_Product_Package", "getNoUpgradesFlag", nil, &r.Options, &resp) 1488 return 1489} 1490 1491// Retrieve Whether the package is not in compliance with EU support. 1492func (r Product_Package) GetNonEuCompliantFlag() (resp bool, err error) { 1493 err = r.Session.DoRequest("SoftLayer_Product_Package", "getNonEuCompliantFlag", nil, &r.Options, &resp) 1494 return 1495} 1496 1497// no documentation yet 1498func (r Product_Package) GetObject() (resp datatypes.Product_Package, err error) { 1499 err = r.Session.DoRequest("SoftLayer_Product_Package", "getObject", nil, &r.Options, &resp) 1500 return 1501} 1502 1503// This method will return a collection of [[SoftLayer_Container_Product_Order_Network_Storage_Hub_Datacenter]] objects which contain a datacenter location and all the associated active usage rate prices where object storage is available. This method is really only applicable to the object storage additional service package which has a [[SoftLayer_Product_Package_Type]] of '''ADDITIONAL_SERVICES_OBJECT_STORAGE'''. This information is useful so that you can see the "pay as you go" rates per datacenter. 1504func (r Product_Package) GetObjectStorageDatacenters() (resp []datatypes.Container_Product_Order_Network_Storage_Hub_Datacenter, err error) { 1505 err = r.Session.DoRequest("SoftLayer_Product_Package", "getObjectStorageDatacenters", nil, &r.Options, &resp) 1506 return 1507} 1508 1509// This method will return a collection of [[SoftLayer_Container_Product_Order_Network_Storage_ObjectStorage_LocationGroup]] objects which contain a location group and all the associated active usage rate prices where object storage is available. This method is really only applicable to the object storage additional service package which has a [[SoftLayer_Product_Package_Type]] of '''ADDITIONAL_SERVICES_OBJECT_STORAGE'''. This information is useful so that you can see the "pay as you go" rates per location group. 1510func (r Product_Package) GetObjectStorageLocationGroups() (resp []datatypes.Container_Product_Order_Network_Storage_ObjectStorage_LocationGroup, err error) { 1511 err = r.Session.DoRequest("SoftLayer_Product_Package", "getObjectStorageLocationGroups", nil, &r.Options, &resp) 1512 return 1513} 1514 1515// Retrieve The premium price modifiers associated with the [[SoftLayer_Product_Item_Price]] and [[SoftLayer_Location]] objects in a package. 1516func (r Product_Package) GetOrderPremiums() (resp []datatypes.Product_Item_Price_Premium, err error) { 1517 err = r.Session.DoRequest("SoftLayer_Product_Package", "getOrderPremiums", nil, &r.Options, &resp) 1518 return 1519} 1520 1521// Retrieve This flag indicates if the package may be available in PoP locations in addition to Datacenters. 1522func (r Product_Package) GetPopLocationAvailabilityFlag() (resp bool, err error) { 1523 err = r.Session.DoRequest("SoftLayer_Product_Package", "getPopLocationAvailabilityFlag", nil, &r.Options, &resp) 1524 return 1525} 1526 1527// Retrieve This flag indicates the package is pre-configured. (Deprecated) 1528func (r Product_Package) GetPreconfiguredFlag() (resp bool, err error) { 1529 err = r.Session.DoRequest("SoftLayer_Product_Package", "getPreconfiguredFlag", nil, &r.Options, &resp) 1530 return 1531} 1532 1533// Retrieve Whether the package requires the user to define a preset configuration. 1534func (r Product_Package) GetPresetConfigurationRequiredFlag() (resp bool, err error) { 1535 err = r.Session.DoRequest("SoftLayer_Product_Package", "getPresetConfigurationRequiredFlag", nil, &r.Options, &resp) 1536 return 1537} 1538 1539// Retrieve Whether the package prevents the user from specifying a Vlan. 1540func (r Product_Package) GetPreventVlanSelectionFlag() (resp bool, err error) { 1541 err = r.Session.DoRequest("SoftLayer_Product_Package", "getPreventVlanSelectionFlag", nil, &r.Options, &resp) 1542 return 1543} 1544 1545// Retrieve This flag indicates the package is for a private hosted cloud deployment. (Deprecated) 1546func (r Product_Package) GetPrivateHostedCloudPackageFlag() (resp bool, err error) { 1547 err = r.Session.DoRequest("SoftLayer_Product_Package", "getPrivateHostedCloudPackageFlag", nil, &r.Options, &resp) 1548 return 1549} 1550 1551// Retrieve The server role of the private hosted cloud deployment. (Deprecated) 1552func (r Product_Package) GetPrivateHostedCloudPackageType() (resp string, err error) { 1553 err = r.Session.DoRequest("SoftLayer_Product_Package", "getPrivateHostedCloudPackageType", nil, &r.Options, &resp) 1554 return 1555} 1556 1557// Retrieve Whether the package only has access to the private network. 1558func (r Product_Package) GetPrivateNetworkOnlyFlag() (resp bool, err error) { 1559 err = r.Session.DoRequest("SoftLayer_Product_Package", "getPrivateNetworkOnlyFlag", nil, &r.Options, &resp) 1560 return 1561} 1562 1563// Retrieve Whether the package is a specialized mass storage QuantaStor package. (Deprecated) 1564func (r Product_Package) GetQuantaStorPackageFlag() (resp bool, err error) { 1565 err = r.Session.DoRequest("SoftLayer_Product_Package", "getQuantaStorPackageFlag", nil, &r.Options, &resp) 1566 return 1567} 1568 1569// Retrieve This flag indicates the package does not allow different disks with RAID. 1570func (r Product_Package) GetRaidDiskRestrictionFlag() (resp bool, err error) { 1571 err = r.Session.DoRequest("SoftLayer_Product_Package", "getRaidDiskRestrictionFlag", nil, &r.Options, &resp) 1572 return 1573} 1574 1575// Retrieve This flag determines if the package contains a redundant power supply product. 1576func (r Product_Package) GetRedundantPowerFlag() (resp bool, err error) { 1577 err = r.Session.DoRequest("SoftLayer_Product_Package", "getRedundantPowerFlag", nil, &r.Options, &resp) 1578 return 1579} 1580 1581// Retrieve The regional locations that a package is available in. 1582func (r Product_Package) GetRegions() (resp []datatypes.Location_Region, err error) { 1583 err = r.Session.DoRequest("SoftLayer_Product_Package", "getRegions", nil, &r.Options, &resp) 1584 return 1585} 1586 1587// Retrieve The resource group template that describes a multi-server solution. (Deprecated) 1588func (r Product_Package) GetResourceGroupTemplate() (resp datatypes.Resource_Group_Template, err error) { 1589 err = r.Session.DoRequest("SoftLayer_Product_Package", "getResourceGroupTemplate", nil, &r.Options, &resp) 1590 return 1591} 1592 1593// This call is similar to [[SoftLayer_Product_Package/getCategories|getCategories]], except that it does not include account-restricted pricing. Not all accounts have restricted pricing. 1594func (r Product_Package) GetStandardCategories() (resp []datatypes.Product_Item_Category, err error) { 1595 err = r.Session.DoRequest("SoftLayer_Product_Package", "getStandardCategories", nil, &r.Options, &resp) 1596 return 1597} 1598 1599// Retrieve The top level category code for this service offering. 1600func (r Product_Package) GetTopLevelItemCategoryCode() (resp string, err error) { 1601 err = r.Session.DoRequest("SoftLayer_Product_Package", "getTopLevelItemCategoryCode", nil, &r.Options, &resp) 1602 return 1603} 1604 1605// Retrieve The type of service offering. This property can be used to help filter packages. 1606func (r Product_Package) GetType() (resp datatypes.Product_Package_Type, err error) { 1607 err = r.Session.DoRequest("SoftLayer_Product_Package", "getType", nil, &r.Options, &resp) 1608 return 1609} 1610 1611// Package presets are used to simplify ordering by eliminating the need for price ids when submitting orders. 1612// 1613// Orders submitted with a preset id defined will use the prices included in the package preset. Prices submitted on an order with a preset id will replace the prices included in the package preset for that prices category. If the package preset has a fixed configuration flag <em>(fixedConfigurationFlag)</em> set then the prices included in the preset configuration cannot be replaced by prices submitted on the order. The only exception to the fixed configuration flag would be if a price submitted on the order is an account-restricted price for the same product item. 1614type Product_Package_Preset struct { 1615 Session *session.Session 1616 Options sl.Options 1617} 1618 1619// GetProductPackagePresetService returns an instance of the Product_Package_Preset SoftLayer service 1620func GetProductPackagePresetService(sess *session.Session) Product_Package_Preset { 1621 return Product_Package_Preset{Session: sess} 1622} 1623 1624func (r Product_Package_Preset) Id(id int) Product_Package_Preset { 1625 r.Options.Id = &id 1626 return r 1627} 1628 1629func (r Product_Package_Preset) Mask(mask string) Product_Package_Preset { 1630 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 1631 mask = fmt.Sprintf("mask[%s]", mask) 1632 } 1633 1634 r.Options.Mask = mask 1635 return r 1636} 1637 1638func (r Product_Package_Preset) Filter(filter string) Product_Package_Preset { 1639 r.Options.Filter = filter 1640 return r 1641} 1642 1643func (r Product_Package_Preset) Limit(limit int) Product_Package_Preset { 1644 r.Options.Limit = &limit 1645 return r 1646} 1647 1648func (r Product_Package_Preset) Offset(offset int) Product_Package_Preset { 1649 r.Options.Offset = &offset 1650 return r 1651} 1652 1653// This method returns all the active package presets. 1654func (r Product_Package_Preset) GetAllObjects() (resp []datatypes.Product_Package_Preset, err error) { 1655 err = r.Session.DoRequest("SoftLayer_Product_Package_Preset", "getAllObjects", nil, &r.Options, &resp) 1656 return 1657} 1658 1659// Retrieve 1660func (r Product_Package_Preset) GetAvailableStorageUnits() (resp uint, err error) { 1661 err = r.Session.DoRequest("SoftLayer_Product_Package_Preset", "getAvailableStorageUnits", nil, &r.Options, &resp) 1662 return 1663} 1664 1665// Retrieve When true this preset is for ordering a Bare Metal Reserved server. 1666func (r Product_Package_Preset) GetBareMetalReservedFlag() (resp bool, err error) { 1667 err = r.Session.DoRequest("SoftLayer_Product_Package_Preset", "getBareMetalReservedFlag", nil, &r.Options, &resp) 1668 return 1669} 1670 1671// Retrieve The item categories that are included in this package preset configuration. 1672func (r Product_Package_Preset) GetCategories() (resp []datatypes.Product_Item_Category, err error) { 1673 err = r.Session.DoRequest("SoftLayer_Product_Package_Preset", "getCategories", nil, &r.Options, &resp) 1674 return 1675} 1676 1677// Retrieve The compute family this configuration belongs to. 1678func (r Product_Package_Preset) GetComputeGroup() (resp datatypes.Product_Item_Server_Group, err error) { 1679 err = r.Session.DoRequest("SoftLayer_Product_Package_Preset", "getComputeGroup", nil, &r.Options, &resp) 1680 return 1681} 1682 1683// Retrieve The preset configuration (category and price). 1684func (r Product_Package_Preset) GetConfiguration() (resp []datatypes.Product_Package_Preset_Configuration, err error) { 1685 err = r.Session.DoRequest("SoftLayer_Product_Package_Preset", "getConfiguration", nil, &r.Options, &resp) 1686 return 1687} 1688 1689// Retrieve When true this preset is only allowed to upgrade/downgrade to other presets in the same compute family. 1690func (r Product_Package_Preset) GetDisallowedComputeGroupUpgradeFlag() (resp bool, err error) { 1691 err = r.Session.DoRequest("SoftLayer_Product_Package_Preset", "getDisallowedComputeGroupUpgradeFlag", nil, &r.Options, &resp) 1692 return 1693} 1694 1695// Retrieve A package preset with this flag set will not allow the price's defined in the preset configuration to be overriden during order placement. 1696func (r Product_Package_Preset) GetFixedConfigurationFlag() (resp bool, err error) { 1697 err = r.Session.DoRequest("SoftLayer_Product_Package_Preset", "getFixedConfigurationFlag", nil, &r.Options, &resp) 1698 return 1699} 1700 1701// Retrieve The locations this preset configuration is available in. If empty the preset is available in all locations the package is available in. 1702func (r Product_Package_Preset) GetLocations() (resp []datatypes.Location, err error) { 1703 err = r.Session.DoRequest("SoftLayer_Product_Package_Preset", "getLocations", nil, &r.Options, &resp) 1704 return 1705} 1706 1707// Retrieve The lowest server prices related to this package preset. 1708func (r Product_Package_Preset) GetLowestPresetServerPrice() (resp datatypes.Product_Item_Price, err error) { 1709 err = r.Session.DoRequest("SoftLayer_Product_Package_Preset", "getLowestPresetServerPrice", nil, &r.Options, &resp) 1710 return 1711} 1712 1713// no documentation yet 1714func (r Product_Package_Preset) GetObject() (resp datatypes.Product_Package_Preset, err error) { 1715 err = r.Session.DoRequest("SoftLayer_Product_Package_Preset", "getObject", nil, &r.Options, &resp) 1716 return 1717} 1718 1719// Retrieve The package this preset belongs to. 1720func (r Product_Package_Preset) GetPackage() (resp datatypes.Product_Package, err error) { 1721 err = r.Session.DoRequest("SoftLayer_Product_Package_Preset", "getPackage", nil, &r.Options, &resp) 1722 return 1723} 1724 1725// Retrieve The item categories associated with a package preset, including information detailing which item categories are required as part of a SoftLayer product order. 1726func (r Product_Package_Preset) GetPackageConfiguration() (resp []datatypes.Product_Package_Order_Configuration, err error) { 1727 err = r.Session.DoRequest("SoftLayer_Product_Package_Preset", "getPackageConfiguration", nil, &r.Options, &resp) 1728 return 1729} 1730 1731// Retrieve The item prices that are included in this package preset configuration. 1732func (r Product_Package_Preset) GetPrices() (resp []datatypes.Product_Item_Price, err error) { 1733 err = r.Session.DoRequest("SoftLayer_Product_Package_Preset", "getPrices", nil, &r.Options, &resp) 1734 return 1735} 1736 1737// Retrieve Describes how all disks in this preset will be configured. 1738func (r Product_Package_Preset) GetStorageGroupTemplateArrays() (resp []datatypes.Configuration_Storage_Group_Template_Group, err error) { 1739 err = r.Session.DoRequest("SoftLayer_Product_Package_Preset", "getStorageGroupTemplateArrays", nil, &r.Options, &resp) 1740 return 1741} 1742 1743// Retrieve The starting hourly price for this configuration. Additional options not defined in the preset may increase the cost. 1744func (r Product_Package_Preset) GetTotalMinimumHourlyFee() (resp datatypes.Float64, err error) { 1745 err = r.Session.DoRequest("SoftLayer_Product_Package_Preset", "getTotalMinimumHourlyFee", nil, &r.Options, &resp) 1746 return 1747} 1748 1749// Retrieve The starting monthly price for this configuration. Additional options not defined in the preset may increase the cost. 1750func (r Product_Package_Preset) GetTotalMinimumRecurringFee() (resp datatypes.Float64, err error) { 1751 err = r.Session.DoRequest("SoftLayer_Product_Package_Preset", "getTotalMinimumRecurringFee", nil, &r.Options, &resp) 1752 return 1753} 1754 1755// The SoftLayer_Product_Package_Server data type contains summarized information for bare metal servers regarding pricing, processor stats, and feature sets. 1756type Product_Package_Server struct { 1757 Session *session.Session 1758 Options sl.Options 1759} 1760 1761// GetProductPackageServerService returns an instance of the Product_Package_Server SoftLayer service 1762func GetProductPackageServerService(sess *session.Session) Product_Package_Server { 1763 return Product_Package_Server{Session: sess} 1764} 1765 1766func (r Product_Package_Server) Id(id int) Product_Package_Server { 1767 r.Options.Id = &id 1768 return r 1769} 1770 1771func (r Product_Package_Server) Mask(mask string) Product_Package_Server { 1772 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 1773 mask = fmt.Sprintf("mask[%s]", mask) 1774 } 1775 1776 r.Options.Mask = mask 1777 return r 1778} 1779 1780func (r Product_Package_Server) Filter(filter string) Product_Package_Server { 1781 r.Options.Filter = filter 1782 return r 1783} 1784 1785func (r Product_Package_Server) Limit(limit int) Product_Package_Server { 1786 r.Options.Limit = &limit 1787 return r 1788} 1789 1790func (r Product_Package_Server) Offset(offset int) Product_Package_Server { 1791 r.Options.Offset = &offset 1792 return r 1793} 1794 1795// This method will grab all the package servers. 1796func (r Product_Package_Server) GetAllObjects() (resp []datatypes.Product_Package_Server, err error) { 1797 err = r.Session.DoRequest("SoftLayer_Product_Package_Server", "getAllObjects", nil, &r.Options, &resp) 1798 return 1799} 1800 1801// Retrieve 1802func (r Product_Package_Server) GetCatalog() (resp datatypes.Product_Catalog, err error) { 1803 err = r.Session.DoRequest("SoftLayer_Product_Package_Server", "getCatalog", nil, &r.Options, &resp) 1804 return 1805} 1806 1807// Retrieve 1808func (r Product_Package_Server) GetItem() (resp datatypes.Product_Item, err error) { 1809 err = r.Session.DoRequest("SoftLayer_Product_Package_Server", "getItem", nil, &r.Options, &resp) 1810 return 1811} 1812 1813// Retrieve 1814func (r Product_Package_Server) GetItemPrice() (resp datatypes.Product_Item_Price, err error) { 1815 err = r.Session.DoRequest("SoftLayer_Product_Package_Server", "getItemPrice", nil, &r.Options, &resp) 1816 return 1817} 1818 1819// no documentation yet 1820func (r Product_Package_Server) GetObject() (resp datatypes.Product_Package_Server, err error) { 1821 err = r.Session.DoRequest("SoftLayer_Product_Package_Server", "getObject", nil, &r.Options, &resp) 1822 return 1823} 1824 1825// Retrieve 1826func (r Product_Package_Server) GetPackage() (resp datatypes.Product_Package, err error) { 1827 err = r.Session.DoRequest("SoftLayer_Product_Package_Server", "getPackage", nil, &r.Options, &resp) 1828 return 1829} 1830 1831// Retrieve 1832func (r Product_Package_Server) GetPreset() (resp datatypes.Product_Package_Preset, err error) { 1833 err = r.Session.DoRequest("SoftLayer_Product_Package_Server", "getPreset", nil, &r.Options, &resp) 1834 return 1835} 1836 1837// The [[SoftLayer_Product_Package_Server_Option]] data type contains various data points associated with package servers that can be used in selection criteria. 1838type Product_Package_Server_Option struct { 1839 Session *session.Session 1840 Options sl.Options 1841} 1842 1843// GetProductPackageServerOptionService returns an instance of the Product_Package_Server_Option SoftLayer service 1844func GetProductPackageServerOptionService(sess *session.Session) Product_Package_Server_Option { 1845 return Product_Package_Server_Option{Session: sess} 1846} 1847 1848func (r Product_Package_Server_Option) Id(id int) Product_Package_Server_Option { 1849 r.Options.Id = &id 1850 return r 1851} 1852 1853func (r Product_Package_Server_Option) Mask(mask string) Product_Package_Server_Option { 1854 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 1855 mask = fmt.Sprintf("mask[%s]", mask) 1856 } 1857 1858 r.Options.Mask = mask 1859 return r 1860} 1861 1862func (r Product_Package_Server_Option) Filter(filter string) Product_Package_Server_Option { 1863 r.Options.Filter = filter 1864 return r 1865} 1866 1867func (r Product_Package_Server_Option) Limit(limit int) Product_Package_Server_Option { 1868 r.Options.Limit = &limit 1869 return r 1870} 1871 1872func (r Product_Package_Server_Option) Offset(offset int) Product_Package_Server_Option { 1873 r.Options.Offset = &offset 1874 return r 1875} 1876 1877// This method will grab all the package server options. 1878func (r Product_Package_Server_Option) GetAllOptions() (resp []datatypes.Product_Package_Server_Option, err error) { 1879 err = r.Session.DoRequest("SoftLayer_Product_Package_Server_Option", "getAllOptions", nil, &r.Options, &resp) 1880 return 1881} 1882 1883// no documentation yet 1884func (r Product_Package_Server_Option) GetObject() (resp datatypes.Product_Package_Server_Option, err error) { 1885 err = r.Session.DoRequest("SoftLayer_Product_Package_Server_Option", "getObject", nil, &r.Options, &resp) 1886 return 1887} 1888 1889// This method will grab all the package server options for the specified type. 1890func (r Product_Package_Server_Option) GetOptions(typ *string) (resp []datatypes.Product_Package_Server_Option, err error) { 1891 params := []interface{}{ 1892 typ, 1893 } 1894 err = r.Session.DoRequest("SoftLayer_Product_Package_Server_Option", "getOptions", params, &r.Options, &resp) 1895 return 1896} 1897 1898// The [[SoftLayer_Product_Package_Type]] object indicates the type for a service offering (package). The type can be used to filter packages. For example, if you are looking for the package representing virtual servers, you can filter on the type's key name of '''VIRTUAL_SERVER_INSTANCE'''. For bare metal servers by core or CPU, filter on '''BARE_METAL_CORE''' or '''BARE_METAL_CPU''', respectively. 1899type Product_Package_Type struct { 1900 Session *session.Session 1901 Options sl.Options 1902} 1903 1904// GetProductPackageTypeService returns an instance of the Product_Package_Type SoftLayer service 1905func GetProductPackageTypeService(sess *session.Session) Product_Package_Type { 1906 return Product_Package_Type{Session: sess} 1907} 1908 1909func (r Product_Package_Type) Id(id int) Product_Package_Type { 1910 r.Options.Id = &id 1911 return r 1912} 1913 1914func (r Product_Package_Type) Mask(mask string) Product_Package_Type { 1915 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 1916 mask = fmt.Sprintf("mask[%s]", mask) 1917 } 1918 1919 r.Options.Mask = mask 1920 return r 1921} 1922 1923func (r Product_Package_Type) Filter(filter string) Product_Package_Type { 1924 r.Options.Filter = filter 1925 return r 1926} 1927 1928func (r Product_Package_Type) Limit(limit int) Product_Package_Type { 1929 r.Options.Limit = &limit 1930 return r 1931} 1932 1933func (r Product_Package_Type) Offset(offset int) Product_Package_Type { 1934 r.Options.Offset = &offset 1935 return r 1936} 1937 1938// This method will return all of the available package types. 1939func (r Product_Package_Type) GetAllObjects() (resp []datatypes.Product_Package_Type, err error) { 1940 err = r.Session.DoRequest("SoftLayer_Product_Package_Type", "getAllObjects", nil, &r.Options, &resp) 1941 return 1942} 1943 1944// no documentation yet 1945func (r Product_Package_Type) GetObject() (resp datatypes.Product_Package_Type, err error) { 1946 err = r.Session.DoRequest("SoftLayer_Product_Package_Type", "getObject", nil, &r.Options, &resp) 1947 return 1948} 1949 1950// Retrieve All the packages associated with the given package type. 1951func (r Product_Package_Type) GetPackages() (resp []datatypes.Product_Package, err error) { 1952 err = r.Session.DoRequest("SoftLayer_Product_Package_Type", "getPackages", nil, &r.Options, &resp) 1953 return 1954} 1955 1956// no documentation yet 1957type Product_Promotion struct { 1958 Session *session.Session 1959 Options sl.Options 1960} 1961 1962// GetProductPromotionService returns an instance of the Product_Promotion SoftLayer service 1963func GetProductPromotionService(sess *session.Session) Product_Promotion { 1964 return Product_Promotion{Session: sess} 1965} 1966 1967func (r Product_Promotion) Id(id int) Product_Promotion { 1968 r.Options.Id = &id 1969 return r 1970} 1971 1972func (r Product_Promotion) Mask(mask string) Product_Promotion { 1973 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 1974 mask = fmt.Sprintf("mask[%s]", mask) 1975 } 1976 1977 r.Options.Mask = mask 1978 return r 1979} 1980 1981func (r Product_Promotion) Filter(filter string) Product_Promotion { 1982 r.Options.Filter = filter 1983 return r 1984} 1985 1986func (r Product_Promotion) Limit(limit int) Product_Promotion { 1987 r.Options.Limit = &limit 1988 return r 1989} 1990 1991func (r Product_Promotion) Offset(offset int) Product_Promotion { 1992 r.Options.Offset = &offset 1993 return r 1994} 1995 1996// Retrieves a promotion using its code. 1997func (r Product_Promotion) FindByPromoCode(code *string) (resp datatypes.Container_Product_Promotion, err error) { 1998 params := []interface{}{ 1999 code, 2000 } 2001 err = r.Session.DoRequest("SoftLayer_Product_Promotion", "findByPromoCode", params, &r.Options, &resp) 2002 return 2003} 2004 2005// no documentation yet 2006func (r Product_Promotion) GetObject() (resp datatypes.Product_Promotion, err error) { 2007 err = r.Session.DoRequest("SoftLayer_Product_Promotion", "getObject", nil, &r.Options, &resp) 2008 return 2009} 2010 2011// The SoftLayer_Product_Upgrade_Request data type contains general information relating to a hardware, virtual server, or service upgrade. It also relates a [[SoftLayer_Billing_Order]] to a [[SoftLayer_Ticket]]. 2012type Product_Upgrade_Request struct { 2013 Session *session.Session 2014 Options sl.Options 2015} 2016 2017// GetProductUpgradeRequestService returns an instance of the Product_Upgrade_Request SoftLayer service 2018func GetProductUpgradeRequestService(sess *session.Session) Product_Upgrade_Request { 2019 return Product_Upgrade_Request{Session: sess} 2020} 2021 2022func (r Product_Upgrade_Request) Id(id int) Product_Upgrade_Request { 2023 r.Options.Id = &id 2024 return r 2025} 2026 2027func (r Product_Upgrade_Request) Mask(mask string) Product_Upgrade_Request { 2028 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 2029 mask = fmt.Sprintf("mask[%s]", mask) 2030 } 2031 2032 r.Options.Mask = mask 2033 return r 2034} 2035 2036func (r Product_Upgrade_Request) Filter(filter string) Product_Upgrade_Request { 2037 r.Options.Filter = filter 2038 return r 2039} 2040 2041func (r Product_Upgrade_Request) Limit(limit int) Product_Upgrade_Request { 2042 r.Options.Limit = &limit 2043 return r 2044} 2045 2046func (r Product_Upgrade_Request) Offset(offset int) Product_Upgrade_Request { 2047 r.Options.Offset = &offset 2048 return r 2049} 2050 2051// When a change is made to an upgrade by Sales, this method will approve the changes that were made. A customer must acknowledge the change and approve it so that the upgrade request can proceed. 2052func (r Product_Upgrade_Request) ApproveChanges() (resp bool, err error) { 2053 err = r.Session.DoRequest("SoftLayer_Product_Upgrade_Request", "approveChanges", nil, &r.Options, &resp) 2054 return 2055} 2056 2057// Retrieve The account that an order belongs to 2058func (r Product_Upgrade_Request) GetAccount() (resp datatypes.Account, err error) { 2059 err = r.Session.DoRequest("SoftLayer_Product_Upgrade_Request", "getAccount", nil, &r.Options, &resp) 2060 return 2061} 2062 2063// Retrieve Indicates that the upgrade request has completed or has been cancelled. 2064func (r Product_Upgrade_Request) GetCompletedFlag() (resp bool, err error) { 2065 err = r.Session.DoRequest("SoftLayer_Product_Upgrade_Request", "getCompletedFlag", nil, &r.Options, &resp) 2066 return 2067} 2068 2069// Retrieve This is the invoice associated with the upgrade request. For hourly servers or services, an invoice will not be available. 2070func (r Product_Upgrade_Request) GetInvoice() (resp datatypes.Billing_Invoice, err error) { 2071 err = r.Session.DoRequest("SoftLayer_Product_Upgrade_Request", "getInvoice", nil, &r.Options, &resp) 2072 return 2073} 2074 2075// getObject retrieves a SoftLayer_Product_Upgrade_Request object on your account whose ID corresponds to the ID of the init parameter passed to the SoftLayer_Product_Upgrade_Request service. 2076func (r Product_Upgrade_Request) GetObject() (resp datatypes.Product_Upgrade_Request, err error) { 2077 err = r.Session.DoRequest("SoftLayer_Product_Upgrade_Request", "getObject", nil, &r.Options, &resp) 2078 return 2079} 2080 2081// Retrieve An order record associated to the upgrade request 2082func (r Product_Upgrade_Request) GetOrder() (resp datatypes.Billing_Order, err error) { 2083 err = r.Session.DoRequest("SoftLayer_Product_Upgrade_Request", "getOrder", nil, &r.Options, &resp) 2084 return 2085} 2086 2087// Retrieve A server object associated with the upgrade request if any. 2088func (r Product_Upgrade_Request) GetServer() (resp datatypes.Hardware, err error) { 2089 err = r.Session.DoRequest("SoftLayer_Product_Upgrade_Request", "getServer", nil, &r.Options, &resp) 2090 return 2091} 2092 2093// Retrieve The current status of the upgrade request. 2094func (r Product_Upgrade_Request) GetStatus() (resp datatypes.Product_Upgrade_Request_Status, err error) { 2095 err = r.Session.DoRequest("SoftLayer_Product_Upgrade_Request", "getStatus", nil, &r.Options, &resp) 2096 return 2097} 2098 2099// Retrieve The ticket that is used to coordinate the upgrade process. 2100func (r Product_Upgrade_Request) GetTicket() (resp datatypes.Ticket, err error) { 2101 err = r.Session.DoRequest("SoftLayer_Product_Upgrade_Request", "getTicket", nil, &r.Options, &resp) 2102 return 2103} 2104 2105// Retrieve The user that placed the order. 2106func (r Product_Upgrade_Request) GetUser() (resp datatypes.User_Customer, err error) { 2107 err = r.Session.DoRequest("SoftLayer_Product_Upgrade_Request", "getUser", nil, &r.Options, &resp) 2108 return 2109} 2110 2111// Retrieve A virtual server object associated with the upgrade request if any. 2112func (r Product_Upgrade_Request) GetVirtualGuest() (resp datatypes.Virtual_Guest, err error) { 2113 err = r.Session.DoRequest("SoftLayer_Product_Upgrade_Request", "getVirtualGuest", nil, &r.Options, &resp) 2114 return 2115} 2116 2117// In case an upgrade cannot be performed, the maintenance window needs to be updated to a future date. 2118func (r Product_Upgrade_Request) UpdateMaintenanceWindow(maintenanceStartTime *datatypes.Time, maintenanceWindowId *int) (resp bool, err error) { 2119 params := []interface{}{ 2120 maintenanceStartTime, 2121 maintenanceWindowId, 2122 } 2123 err = r.Session.DoRequest("SoftLayer_Product_Upgrade_Request", "updateMaintenanceWindow", params, &r.Options, &resp) 2124 return 2125} 2126