0

i get the following error when i attempt to generate an order template with the softlayer API SoftLayer_Hardware::generateOrderTemplate.

{ "error": "A template hardware record is required to use this method.", "code": "SoftLayer_Exception_MissingParameter" }

my request looks like this:

{ 
    "datacenter" : { "name" : "dal02" },
    "hostname": "deleteme", 
    "domain": "ciber-itc.local", 
    "hourlyBillingFlag": true, 
    "processorCoreAmount": 4,
    "memoryCapacity": 8192,
    "operatingSystemReferenceCode": "UBUNTU_LATEST",

    "networkComponents": [ 
        { "maxSpeed": 1000 } 
    ],
    "hardDrives": [ 
        {"capacity": 500 } 
    ] }

and my api call is formed like this: https://username:apikey@api.softlayer.com:443/rest/v3/SoftLayer_Hardware/generateOrderTemplate.json.

A similar question is posted in this stackoverflow thread. However the article relates to a virtual guest, whereas i am attempting to create a hardware vsi. So i can't relate getting block devices or archive transactions for a virtual guest to this api in the hardware context.

i have tried variations of the json request - using fixed configurations and always ensuring all required parameters are presented.

Community
  • 1
  • 1
Blaarfengard
  • 17
  • 1
  • 3

1 Answers1

0

Can you try this:

{  
   "parameters":[  
      {  
         "datacenter":{  
            "name":"dal02"
         },
         "hostname":"deleteme",
         "domain":"ciber-itc.local",
         "hourlyBillingFlag":true,
         "processorCoreAmount":8,
         "memoryCapacity":8,
         "operatingSystemReferenceCode":"UBUNTU_LATEST",
         "networkComponents":[  
            {  
               "maxSpeed":1000
            }
         ],
         "hardDrives":[  
            {  
               "capacity":500
            }
         ]
      }
   ]
}

You need to specify "parameters" at the start of the template. Also, it's not possible to order processorCoreAmount: 4 and memoryCapacity: 8192, because it's a not valid configuration. for that reason, I replaced "processorCoreAmount" with 8.

To get available configurations or options, you need to use the following method:

Rest example:

https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Hardware/getCreateObjectOptions

Method: Get
  • This is the solution! thanks very much. i thought i tried that previously, but i must have had something else wrong in the structure. – Blaarfengard Nov 14 '16 at 15:23