使用下面的命令时,我们会得到一个 145MB json 有效负载的响应:
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
查看我们几周前的日志,同一个电话给了我们大约 300KB 的响应。因此,我们认为这是 Softlayer API 实现中最近的一个错误。
查看json响应,有大量的重复。每个 VM 的详细信息重复 394 次。
我们已经尝试了不同的 API 调用,并确定了一种解决方法:使用tagReferences.tag.name
而不是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
我们在Apache Brooklyn中使用jclouds解决了这个问题(请参阅Brooklyn 问题,以及在https://github.com/jclouds/jclouds/pull/1020中添加到 jclouds 的解决方法)。使用现有 jclouds GA 版本的用户将继续受到此影响。
SoftLayer 能否确认这是否是他们方面的错误,是否以及何时修复,以及是否有更好的解决方法?