0

When using the command below, we get back a response with 145MB json payload:

curl -uuser:api-key https://api.softlayer.com/rest/v3/SoftLayer_Account/VirtualGuests?objectMask=powerState%3BoperatingSystem.passwords%3Bdatacenter%3BbillingItem%3BblockDevices.diskImage%3BtagReferences
% Total % Received % Xferd Average Speed Time Time Time Current
                           Dload Upload Total Spent Left Speed
12 145M 12 18.0M 0 0 321k 0 0:07:44 0:00:57 0:06:47 401k

Looking at our logs from a couple of weeks ago, the same call gave us a response of approximately ~300KB. We therefore believe this is a recent bug in the Softlayer API implementation.


Looking at the json response, there is a huge amount of repetition. The details of each VM is repeated 394 times.


We have experimented with different API calls, and have identified a workaround: to use tagReferences.tag.name instead of tagReferences:

curl -uuser:api-key https://api.softlayer.com/rest/v3/SoftLayer_Account/VirtualGuests?objectMask=powerState%3BoperatingSystem.passwords%3Bdatacenter%3BbillingItem%3BblockDevices.diskImage%3BtagReferences.tag.name
% Total % Received % Xferd Average Speed Time Time Time Current
                           Dload Upload Total Spent Left Speed
100 277k 100 277k 0 0 77421 0 0:00:03 0:00:03 --:--:-- 77426

We hit this problem in Apache Brooklyn, using jclouds (see the Brooklyn issue, and the workaround added to jclouds in https://github.com/jclouds/jclouds/pull/1020). Those using existing jclouds GA releases will continue to be impacted by this.

Can SoftLayer confirm whether this is a bug on their side, if and when it will be fixed, and whether there is a better workaround?

Aled Sage
  • 766
  • 7
  • 12

2 Answers2

0

This is not a bug, because you're using an objectMask to retrieve additional data. In this case the tagReferences are displaying "Object relational information". This is why the VM details are repeated more than a single time. Nevertheless you can control this information as you did in your second request: tagReferences.tag.name. Also, it's possible to get more than a single object attribute or nested attributes, such in this mask example:

objectMask=mask[tagReferences[id,tagTypeId,customer[address1,city]]]

As a side note, If you're sure that data is being repeated and it hasn't to do with relational attribute data, then I would suggest to submit a ticket to SoftLayer support.

  • I submitted a ticket to Softlayer support first - they said "Regarding your API questions, you should direct it to the following link as they would be able to better assist you in this case." – Aled Sage Oct 14 '16 at 22:45
  • Repeating each VM 394 times seems very excessive and surprising - I don't think it's just to do with relational attribute data. A couple of weeks ago, we were getting ~300KB; now we're getting 154MB in the response (without a significantly different number of VMs). I'll therefore raise it with Softlayer support again. – Aled Sage Oct 14 '16 at 22:54
0

Just stumbled upon this issue, not entirely sure if it is a bug but at least it is not obvious: when you mask by tagReferences.tag.name the API will filter the child object tagReferences.tag but it will leave the rest of the entire tagReferences, which includes a huge customer object that has a lot of unnecesary information (including child hardware).

The solution I've found is to filter by any other attribute apart from tag, even if you don't use it:

  • tagReferences[tag[name]] will return only the name attribute in tag but also return all of the attributes from tagReferences
  • tagReferences[id,tag[name]] will return only id and tag.name from tagReferences