簡體   English   中英

使用REST API創建子網

[英]Creating a subnet using REST API

我正在嘗試使用以下REST調用來配置子網

curl -H "Content-Type: application/json" --data @subnet-data.json https://<userid>:<apikey>@api.softlayer.com/rest/v3.1/SoftLayer_Network/4601/createSubnet

其中4601是我的網絡的ID。

JSON有效負載為:

{
"parameters": [
    {
        "networkIdentifier": "172.31.10.0",
        "cidr": 24,
        "podName": "dal09.pod01",
    }
]

}

但我收到以下錯誤

{"error":"Bad request","code":"SoftLayer_Exception_WebService_BadRequest"}

請讓我知道訂購子網的正確方法。 另外,如果您可以讓我知道如何找到正確的/必需的參數,那將會很好。

謝謝。

請看一下這個論壇:

如果您有任何疑問或疑問,請告訴我


更新

價格ID取決於目錄,請嘗試此請求,您將能夠看到Global IPv4的ID:

http://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Product_Package/0/getItemPrices?objectFilter={"itemPrices":{"item":{"description":{"operation":"Global IPv4"}}}}

Method: Get

如果沒有成功,請嘗試以下請求,有時有必要進行編碼,因為我們使用的是ObjectFilter:

https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Product_Package/0/getItemPrices?objectFilter=%7B%22itemPrices%22%3A%7B%22item%22%3A%7B%22description%22%3A%7B%22operation%22%3A%22Global+IPv4%22%7D%7D%7D%7D

Method: Get

用您自己的信息替換: $ user$ apiKey

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM