2016-04-25 51 views
0

我一直在搜索SLAPI以訂購具有操作系統分區模板的裸機服務器。SoftLayer API獲取操作系統分區模板的ID

當我閱讀一些文章訂購RAID並配置分區模板數據後,發現需要獲取模板數據的操作系統的ID或說明。

所以,我試圖用SLAPI獲得這些OS的信息,但我不能。

對於'CentOS 7.x(64位)',操作系統描述應該是'linux',但我不知道如何得到它,操作系統商品ID是5920,商品價格ID是44988 dal03。

在這裏被稱爲文章:Configuring Softlayer Disk Partitions at Order Time

和從調用響應[服務/ SoftLayer_Hardware_Component_Partition_OperatingSystem]/getAllobjects

[{ 
    "description": "linux", 
    "id": 1, 
    "notes": "All flavors" 
}, { 
    "description": "windows", 
    "id": 2, 
    "notes": "All RH-based or closely related" 
}, { 
    "description": "freebsd", 
    "id": 3, 
    "notes": "FreeBSD, etc.." 
}] 

和項目的價格的響應(44988)是:

{ 
    "currentPriceFlag": null, 
    "hourlyRecurringFee": "0", 
    "id": 44988, 
    "itemId": 5920, 
    "laborFee": "0", 
    "locationGroupId": null, 
    "onSaleFlag": null, 
    "oneTimeFee": "0", 
    "quantity": null, 
    "recurringFee": "0", 
    "setupFee": "0", 
    "sort": 0, 
    "item": { 
     "capacity": "0", 
     "description": "CentOS 7.x (64 bit)", 
     "id": 5920, 
     "itemTaxCategoryId": 166, 
     "keyName": "OS_CENTOS_7_X_64_BIT", 
     "softwareDescriptionId": 1400, 
     "units": "N/A", 
     "upgradeItemId": null, 
     "itemCategory": { 
      "categoryCode": "os", 
      "id": 12, 
      "name": "Operating System", 
      "quantityLimit": 0 
     }, 
     "softwareDescription": { 
      "controlPanel": 0, 
      "id": 1400, 
      "licenseTermValue": null, 
      "longDescription": "CentOS/CentOS/7.0-64", 
      "manufacturer": "CentOS", 
      "name": "CentOS", 
      "operatingSystem": 1, 
      "referenceCode": "CENTOS_7_64", 
      "upgradeSoftwareDescriptionId": null, 
      "upgradeSwDescId": null, 
      "version": "7.0-64", 
      "virtualLicense": 0, 
      "virtualizationPlatform": 0, 
      "requiredUser": "root" 
     } 
    } 
} 

回答

0

該信息不在API中,您必須使用自己的代碼才能挑選出正確的模板,爲此您可以使用該項目的描述,例如 如果項目說明包含的CentOS或Ubuntu或者RedHat的Linux使用 如果項目描述包含Windows使用windows 如果項目說明包含的FreeBSD使用FreeBSD

問候

+0

謝謝您的幫助 –