首页 > 解决方案 > 通过数据中心获取 VSI 和 Bare Metal 的创建对象

问题描述

我正在研究一种使用 REST API 来获取有效对象的方法,我可以在特定数据中心中创建 VSI 或裸机时使用这些对象。所需信息: 1. 专用网络速度 10Gbs 或 1Gbs 2. 支持的机器类型,如果支持 vGPU,机器类型是 V100 或 P100。

你能帮我一些关于使用方法以及如何按数据中心过滤的指导吗?谢谢。

标签: ibm-cloud-infrastructurevirtual-serverbare-metal-server

解决方案


如果您希望从特定日期中心检索项目,您可以使用SoftLayer_Product_Package::getItemPrices,例如,下面的其余 API 调用检索 ams01 中所有大于 1000 Mbps 的 VSI 包 Id 的网络速度项目(例如 835 "PUBLIC_CLOUD_SERVER "):

方法:获取

https://username:apikey@api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/835/getItemPrices?objectMask=mask[id,item,pricingLocationGroup[locations[name]]]&objectFilter={"itemPrices":{"pricingLocationGroup":{"locations":{"name":{"operation":"ams01"}}},"item":{"itemCategory":{"categoryCode":{"operation":"port_speed"}},"capacity":{"operation":">=1000"}}}}

您可以使用裸机包 ID(例如 200“BARE_METAL_SERVER”)来检索裸机的项目。另外,我建议您使用标准价格并将其用于任何数据中心。

方法:获取

https://username:apikey@api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/200/getItemPrices?objectMask=mask[id,locationGroupId,item[itemCategory],pricingLocationGroup[locations[name]]]&objectFilter={"itemPrices":{"locationGroupId":{"operation":"is null"},"item":{"itemCategory":{"categoryCode":{"operation":"port_speed"}},"capacity":{"operation":">=1000"}}}}

请记住,上面的 API 调用会检索裸机的标准价格,如果您希望获得 VSI 的标准价格,则必须使用 VSI 的包 ID。

参考:

https://sldn.softlayer.com/article/understanding-ordering/ https://sldn.softlayer.com/python/ordering_slcli/


推荐阅读