【问题标题】:Obtain create objects for VSI and Bare Metal by datacenter通过数据中心获取 VSI 和 Bare Metal 的创建对象
【发布时间】:2019-10-14 10:19:38
【问题描述】:

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

您能否就使用方法以及如何按数据中心进行过滤提供一些指导?谢谢。

【问题讨论】:

    标签: ibm-cloud-infrastructure virtual-server bare-metal-server


    【解决方案1】:

    如果您希望从特定日期中心检索项目,您可以使用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/

    【讨论】:

    • 所有数据中心的 VSI 包 id 835 或 Bare Metak Sever 包 id 200 是否相同?
    • 是的,但请记住,硬件视供应情况而定,并且可能因地区而异。
    • 我刚刚尝试了这个 URL api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/200/…{"itemPrices":{"pricingLocationGroup":{"locations":{"name":{"operation":"wdc07"}}}}} 和它返回了 [] 的内容我得到了相同的东西使用包号 835。
    • 对于 wdc 位置,商品价格是标准的,这意味着您可以使用 locationGroupId 为空的商品价格。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-12-01
    • 2014-10-20
    • 1970-01-01
    相关资源
    最近更新 更多