osFormatType Endurance Block Storage ordering Softlayer

牧云@^-^@ 提交于 2019-12-12 03:39:30

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!