1

I am trying to use the SoftLayer_Product_Order/<package>/verifyOrder.json API to validate my JSON for ordering some Endurance NAS, but for many combinations.

I keep getting the error:

Order is missing the following category: Storage Space

But I seem to be providing a valid Storage Space type price.

The Combination of price objects are:

Type: 45064 (Endurance Storage)
IOPS: 45074 (LOW_INTENSITY_TIER) 
Storage: 45856 (20 GB Storage Space) 
Base Type: 45104 (Block Storage)

JSON:

{    "parameters" : [
      {
         "location" : "449494",
         "packageId" : 240,
         "osFormatType" : {
            "id" : 12,
            "keyName" : "LINUX"
         },
         "complexType" : "SoftLayer_Container_Product_Order_Network_Storage_Enterprise",
         "quantity" : 1,
         "prices" : [
            {
               "id" : "45064"
            },
            {
               "id" : "45074"
            },
            {
               "id" : "45856"
            },
            {
               "id" : "45104"
            }
         ]
      }    
    ] 
 }

REST call:

https://api.softlayer.com/rest/v3/SoftLayer_Product_Order/240/verifyOrder.json

Response:

$VAR1 = {
          'error' => 'Order is missing the following category: Storage Space.',
          'code' => 'SoftLayer_Exception_Order_MissingCategory'
        };

Not sure what I am missing.

clearlight
  • 12,255
  • 11
  • 57
  • 75
Chris Ratcliffe
  • 116
  • 1
  • 10

2 Answers2

0

I think the answer to

understanding undef locationGroupId entries in package items

answers this question for me.

Community
  • 1
  • 1
Chris Ratcliffe
  • 116
  • 1
  • 10
0

There is a mistake to define the price for storage, you are sending a size for Snapshot and not for the block endurance

  • Price: 45856 Category: Storage Snapshot Space
  • Price: 45124 Category: Storage Space

So you need to use the price belongs to "Storage Space" (45124), a request that could be help to identify them should be:

https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Product_Package/240/getItemPrices?objectFilter={"itemPrices":{"categories":{"name":{"operation":"Storage Space"}}}}&objectMask=mask[categories]

Method: Get

Try this please:

{  
    "parameters":[  
        {  
            "location":"449494",
            "packageId":240,
            "osFormatType":{  
                "id":12,
                "keyName":"LINUX"
            },
            "complexType":"SoftLayer_Container_Product_Order_Network_Storage_Enterprise",
            "quantity":1,
            "prices":[  
                {  
                    "id":"45064"
                },
                {  
                    "id":"45074"
                },
                {  
                    "id":"45124"
                },
                {  
                    "id":"45104"
                }
            ]
        }
    ]
}