在SoftLayer API中将版本添加到vs get_instance

时间:2016-06-22 02:08:14

标签: ibm-cloud-infrastructure

操作系统版本是否可以添加到vsManager get_instance输出中,与硬件管理器get_hardware输出相同。

或者:如何从" softwareDescriptionId"中查找操作系统版本。对于VS实例?

# DEBUG
hardwareManager.get_hardware(hardware_id)
...
"operatingSystem": {
  "softwareLicense": {
    "id": 1064,
    "softwareDescription": {
      "manufacturer": "CentOS",
      "name": "CentOS",
      "referenceCode": "CENTOS_5_64",
      "version": "5.8-64"
    },
    "softwareDescriptionId": 992
  }
},
...


vsManager.get_instance(instance_id)
...
"operatingSystem": {
  "softwareLicense": {
    "id": 902,
    "softwareDescription": {
      "name": "CentOS"
    },
  "softwareDescriptionId": 887
  }
},
...

1 个答案:

答案 0 :(得分:0)

VSManager的默认掩码似乎没有显示版本,但是,添加对象掩码可以解决,请在代码中进行以下更改:

vsManager.get_instance(instance_id, mask="mask[operatingSystem[softwareLicense[softwareDescription]]]")