0

When using the API to place an order for a VIP, it is failing with a non intuitive error message. Please see the following REST API call JSON and the ensuing error:

JSON:
{
  "loadBalancer": {
    "name": "lbName_TEST",
    "id" : 123, 
    "type": "HTTP",
    "sourcePort": 80,
    "virtualIpAddress": "123.123.123.123"
  }
}

REST API URL USED:
https://user.name:longid4235234532@api.softlayer.com/rest/v3/SoftLayer_Network_Application_Delivery_Controller/15293/createLiveLoadBalancer.json

{
  "error": "Invalid port supplied.",
  "code": "SoftLayer_Exception_Public"
}

The question that arises is this. We are trying to script the ordering of a VPX Netscaler and the addition of all related configurations to the created VPX, are we doing something out of order?

4

2 に答える 2

0

デバイスまたはサービスを注文するには、SoftLayer_Product_Order::placeOrder メソッドを使用する必要があります。ここでは、NetScaler を注文する例を示します

URL: https://api.softlayer.com/rest/v3/SoftLayer_Product_Order/placeOrder

Method: POST

PAYLOAD: {
    "parameters": [
        {
            "packageId": 192,
            "location": 265592,  
            "prices": [
                {
                    "id": 22315,
                    "complexType": "SoftLayer_Product_Item_Price"
                },
                {
                    "id": 17238,
                    "complexType": "SoftLayer_Product_Item_Price"
                }
            ],
            "complexType": "SoftLayer_Container_Product_Order_Network_Application_Delivery_Controller"
        }
    ]
}

価格 22315 は「Citrix NetScaler VPX 10.1 10Mbps Standard」の価格で、17238 は「2 つの静的パブリック IP アドレス」の価格です。すべての価格を取得するには、http: //sldn.softlayer.com/reference/services/SoftLayer_Product_Package/getItems を使用します方法

于 2015-12-23T14:24:49.847 に答える
0

loadBalancer の作成に関連して、JSON が間違っています。次の JSON を試してください。

{
"parameters": [
    {
         "name": "lbName_TEST",
         "type": "HTTP",
         "sourcePort": 80,
         "virtualIpAddress": "123.123.123.123",
         "loadBalancingMethod": "pi"
    }
]

}

よろしく

于 2015-12-23T15:57:08.607 に答える