0
votes

Is there a way to know the linkage between a datacenter and the flavors which datacenter supports. For example, DAL13 supports "GPU", while Mil01 supports "Balanced Local Storage - SSD", not "GPU", WDC01 supports "Balanced Local Storage", not "Balanced Local Storage - SSD". I can use the following SL API to get the creation options, but there lacks of the linkage to indicate which flavors a datacenter supports.

https://api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/CreateObjectOptions.json

Thanks,

Q.Z.

1

1 Answers

0
votes

There is a way to know the linkage between a flavor and the datacenters, in this case you can obtain this information through the flavors where you can obtain the datacenters available for each flavor.

Use the following rest api to get the linkage between a flavor and the datacenters available for it:

Method: GET

https://[username]:[apiKey]@api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/835/getActivePresets?objectMask=mask[locations]

e.g you will get a response like this example:

{
        "description": "AC1.16x120x25\r\n",
        "id": 409,
        "isActive": "1",
        "keyName": "AC1_16X120X25",
        "name": "AC1.16x120x25",
        "packageId": 835,
        "locations": [
            {
                "id": 1854895,
                "longName": "Dallas 13",
                "name": "dal13",
                "statusId": 2
            },
            {
                "id": 2124095,
                "longName": "London 6",
                "name": "lon06",
                "statusId": 2
            },
            {
                "id": 2017603,
                "longName": "Washington 7",
                "name": "wdc07",
                "statusId": 2
            }
        ]
    },

The flavor “AC1_16X120X25” can be in the followings datacenters:

Dallas 13, London 6 or Washington 7

You will find in the response that some flavor does not have locations, that's because all the datacenters are available for those flavors.

Reference:

https://softlayer.github.io/reference/services/SoftLayer_Product_Package/getActivePresets/