调用SoftLayer verifyOrder接口报InvalidContainer错误如何解决
问题排查与修复方案
错误产生原因
该报错是因为调用SoftLayer下单类接口时,未在请求参数中指定对应产品的专用订单容器类型,默认使用了禁止直接用于下单的通用基础容器SoftLayer_Container_Product_Order,触发了接口的参数校验规则。
你当前使用的packageId=10对应公共云虚拟服务器(VSI)产品,未声明专用容器类型是报错的直接原因。
修复方案
你需要在请求parameters数组的第一个参数对象中,新增complexType字段,指定公共云虚拟服务器对应的专用容器值:SoftLayer_Container_Product_Order_Virtual_Guest。
修改后的完整请求参数如下:
{ "parameters": [ { "complexType": "SoftLayer_Container_Product_Order_Virtual_Guest", "quantity": 1, "location": "DALLAS09", "packageId": 10, "properties": [ { "name": "orderOrigin", "value": "control" } ], "hardware": [ { "hostname": "vsiHostname", "domain": "domain.com" } ] } ] }
其他场景参考
如果后续下单其他类型的IBM Cloud(原SoftLayer)产品,可替换为对应类型的complexType值:
- 裸金属服务器:
SoftLayer_Container_Product_Order_Hardware_Server - 对象存储服务:
SoftLayer_Container_Product_Order_Network_Storage_Object - 带宽资源套餐:
SoftLayer_Container_Product_Order_Network_Bandwidth
内容的提问来源于stack exchange,提问作者Anupam Somani
相关产品推荐
相关产品推荐

