问题
I've done some searching online and can't seem to figure out why the OS format type is wrong. I Have done a query and the id and keyname is correct.
enduranceOrder = {
"location": 1441195,
"packageId": 240,
"quantity": 48,
"prices": [
{
"id": 45064 # endurance
},
{
"id": 45104 # block storage
},
{
"id": 178501 # 10 IOPS
},
{
"id": 178581 # 250 GB storage space
}
],
"osFormatType": {
"id": 12,
"keyName": "LINUX",
"complexType": "SoftLayer_Network_Storage_Iscsi_OS_Type"
}
}
is my order. I have tried it with and without the complex type.
SoftLayer.exceptions.SoftLayerAPIError: SoftLayerAPIError(SoftLayer_Exception_Order_InvalidData): Invalid data on the order for property: osFormatType. No OS format type key name set. Please provide a valid value
is the error
回答1:
because the API does not know what container your order is using, normally you do not need to specify it but in this case you need it.
Try this:
enduranceOrder = {
"complexType": "SoftLayer_Container_Product_Order_Network_Storage_Enterprise",
"location": 1441195,
"packageId": 240,
"quantity": 48,
"prices": [
{
"id": 45064 # endurance
},
{
"id": 45104 # block storage
},
{
"id": 178501 # 10 IOPS
},
{
"id": 178581 # 250 GB storage space
}
],
"osFormatType": {
"id": 12,
"keyName": "LINUX",
"complexType": "SoftLayer_Network_Storage_Iscsi_OS_Type"
}
}
Regards
来源:https://stackoverflow.com/questions/43007978/osformattype-endurance-block-storage-ordering-softlayer