我使用以下网址来检索虚拟访客
https://api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/54947181.json?objectMask=mask[datacenter,status,globalIdentifier,primaryIpAddress,primaryBackendIpAddress,billingItem.categoryCode,billingItem.description,billingItem.createDate,billingItem.orderItem.order.userRecord.username,billingItem.orderItem.order.userRecord.email,users.username,users.email,users.userStatus,operatingSystemReferenceCode,softwareComponents.passwords,operatingSystem,hourlyBillingFlag,localDiskFlag,managedResourceFlag,privateNetworkOnlyFlag,powerState,blockDeviceTemplateGroup.name,blockDeviceTemplateGroup.id,blockDeviceTemplateGroup.blockDevices,blockDevices.diskImage,networkVlans,activeTransactionCount,activeTransactions,consoleIpAddressRecord.type,consoleIpAddressRecord.port,consoleIpAddressRecord.ipAddress.ipAddress,userDataCount,userData]
此掩码中没有任何内容表示VSI是vGPU虚拟客户端。必须指定哪个掩码来确定此VSI是否具有vGPU?
答案 0 :(得分:0)
要知道活动的VM是否有GPU,您可以使用此休息API:
方法:GET
https://[username]:[apiKey]@api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest/[virtualGuestId]/getObject?objectMask=mask[billingItem[orderItem[preset[computeGroup]]]]
您必须按预设数据进行搜索。
您将获得以下结果:
"preset": {
"description": "AC1.8x60x25\r\n",
"id": 405,
"isActive": "1",
"keyName": "AC1_8X60X25",
"name": "AC1.8x60x25",
"packageId": 835,
"computeGroup": {
"keyName": "GPU_PUBLIC_INSTANCE",
"name": "GPU"
}
}