Obtain create objects for VSI and Bare Metal by datacenter

96 Views Asked by At

I am investigating a method using REST API to obtain valid objects I can use on a create of a VSI or Bare Metal in a specific datacenters. Information needed: 1. Private network speed 10Gbs or 1Gbs 2. Machine types supported, if a vGPU is supported is machine type a V100 or P100.

Can you help me with some guidance on methods to use and how to filter by datacenter? Thanks.

1

There are 1 best solutions below

4
german eduardo On

If you wish to retrieve items from a specific datecenter, you can to use SoftLayer_Product_Package::getItemPrices, for example, the rest API call below retrieves all network speed items greater than 1000 Mbps in ams01 for the VSI package Id (eg. 835 "PUBLIC_CLOUD_SERVER"):

Method: GET

https://username:[email protected]/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"}}}}

You can use a bare metal package Id (eg. 200 "BARE_METAL_SERVER"), in order to retrieve items for Bare Metal. Also, I suggest you use standard prices and use them with any datacenter.

Method: GET

https://username:[email protected]/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"}}}}

Keep in mind that the API call above, retrieves standard prices for bare metal, and if you wish to get standard prices for VSI you will have to use a package Id for VSI.

References:

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