-2

我需要通过 API 配置服务器,配置 RAM:16GB,操作系统:Centos5.6 四核 64 位,HDD:1TB。

我使用的 API 请求 https://api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/createObject.json

请求发布数据:

{"parameters":[{"hostname":"jmblw","domain":"micron.com","startCpus":4,"maxMemory":16,"blockDevices":[{"device":0,"diskImage":{"capacity":100}},{"device":2,"diskImage":{"capacity":1000}}],"hourlyBillingFlag":true,"localDiskFlag":true,"operatingSystemReferenceCode":"CENTOS_5_64","datacenter":{"name":"sng01"}}]}

回复 :

{
"error": "Unable to find a price for block device 2.",
"code": "SoftLayer_Exception_NotFound"
}

你能告诉我如何使用 HDD 1 TB 配置服务器。请给我发送请求正文发布数据的结构

4

1 回答 1

0

SAN 磁盘的配置容量为 1TB(用于第二个磁盘),但“本地”磁盘的最大容量为 300GB。如果我们将“localDiskFlag”:true 更改为“false”,请求应该可以工作。

请尝试以下方法:

https://[usename]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/createObject.json

方法:POST

杰森:

{
  "parameters": [
    {
      "hostname": "jmblw",
      "domain": "micron.com",
      "startCpus": 4,
      "maxMemory": 16,
      "blockDevices": [
        {
          "device": 0,
          "diskImage": {
            "capacity": 100
          }
        },
        {
          "device": 2,
          "diskImage": {
            "capacity": 1000
          }
        }
      ],
      "hourlyBillingFlag": true,
      "localDiskFlag": false,
      "operatingSystemReferenceCode": "CENTOS_5_64",
      "datacenter": {
        "name": "sng01"
      }
    }
  ]
}
于 2015-11-30T15:52:07.033 回答