如何通过Softlayer Rest API在IBM云中获取VM风味

时间:2019-06-24 07:19:39

标签: api virtual-machine ibm-cloud-infrastructure

我想使用Softlayer Rest API获得VM风味(计算C1.2x2,平衡B1.2x8)。我没有找到任何与获取风味有关的API引用。

1 个答案:

答案 0 :(得分:0)

要检索活动的VM风味,请使用以下rest api调用:

方法:GET

https://[username]:[apiKey]@api.softlayer.com/rest/v3/SoftLayer_Product_Package/835/getActivePresets

您将收到以下示例的回复:

[
  {
        "description": "B1.16x64x100",
        "id": 351,
        "isActive": "1",
        "keyName": "B1_16X64X100",
        "name": "B1.16x64x100",
        "packageId": 835
    },
    {
        "description": "C1.1x1x100",
        "id": 359,
        "isActive": "1",
        "keyName": "C1_1X1X100",
        "name": "C1.1x1x100",
        "packageId": 835
    },
]