如何从 SL-API 创建软层 Citrix 负载平衡器

how to create softlayer citrix load balancer from SL-API

我正在尝试创建 Citrix 负载平衡器我的代码是:

#
LocationForNetscaler = 168642
Netscaler=44958
staticIPAddress=27569
package = 192
ProdcutOrderService = client['SoftLayer_Product_Order']
orderContainers ={
                    "quantity": 1,
                    "location": LocationForNetscaler ,
                    "packageId": package,
                    "prices": [
                        {"id": Netscaler,
                         "complexType":"SoftLayer_Product_Item_Price"
                         },
                        {
                         "id":staticIPAddress,
                         "complexType":"SoftLayer_Product_Item_Price"
                         }

                    ]

                }
orderData = {
               'orderContainers' : [orderContainers ]
            }

receipt = ProdcutOrderService.verifyOrder(orderData)
print "Order Verification"
pprint(receipt)
#

但我收到以下错误: 追溯(最近一次通话): 文件“/home/abcd/Downloads/25-05-2016/28-05-2016-test.py”,第 84 行,位于 收据 = ProdcutOrderService.verifyOrder(orderData) 文件“/usr/local/lib/python2.7/dist-packages/SoftLayer/API.py”,第 373 行,在 call_handler 中 return 自我(名字,*args,**kwargs) 文件“/usr/local/lib/python2.7/dist-packages/SoftLayer/API.py”,第 341 行,在调用中 return self.client.call(self.name, 名称, *args, **kwargs) 文件“/usr/local/lib/python2.7/dist-packages/SoftLayer/API.py”,第 237 行,在调用中 return self.transport(请求) 文件“/usr/local/lib/python2.7/dist-packages/SoftLayer/transports.py”,第 187 行,在 call 中 提高 _ex(ex.faultCode, ex.faultString) SoftLayer.exceptions.SoftLayerAPIError: SoftLayerAPIError(SoftLayer_Exception_Order_Item_Invalid): Invalid price Citrix NetScaler VPX 10.5 10Mbps Standard (44958) provided on the order container.

#

请指导 谢谢

显然,SoftLayer_Product_Order::placeOrder 方法无法识别您发送的容器类型,尝试添加一个 complexType 属性,试试这个请:

LocationForNetscaler = 168642
Netscaler=44958
staticIPAddress=27569
package = 192
productService = client['SoftLayer_Product_Order']
orderContainers ={
                    "complexType": "SoftLayer_Container_Product_Order_Network_Application_Delivery_Controller",
                    "quantity": 1,
                    "location": LocationForNetscaler,
                    "packageId": package,
                    "prices": [
                        {
                         "complexType": "SoftLayer_Product_Item_Price", 
                         "id": Netscaler
                         },
                        {
                         "complexType": "SoftLayer_Product_Item_Price", 
                         "id": staticIPAddress
                         }

                    ]

                }


receipt = productService.verifyOrder(orderContainers)
print(receipt)