获取虚拟访客的标签时出现内部服务器错误

问题描述:

当我尝试获取客户帐户的虚拟访客的标签时,API返回内部服务器错误.

The API is returning Internal Server Error when I try to get the tags of the virtual guests of a customer account.

使用SoftLayer API库的代码示例:

Code example using the SoftLayer API library:

api = SoftLayer.Client(username=customer_id, api_key=customer_apikey)
api['Account'].getVirtualGuests(mask='fullyQualifiedDomainName,tagReferences.tag.name')

例外是:

File "scripts/getting_tags.py", line 16, in <module>
  for item in func(mask='fullyQualifiedDomainName,tagReferences.tag.name'):
File "/home/mfilipe/workspace/SoftLayerBilling/venv/lib/python2.7/site-packages/SoftLayer/API.py", line 362, in call_handler
  return self(name, *args, **kwargs)
File "/home/mfilipe/workspace/SoftLayerBilling/venv/lib/python2.7/site-packages/SoftLayer/API.py", line 330, in call
  return self.client.call(self.name, name, *args, **kwargs)
File "/home/mfilipe/workspace/SoftLayerBilling/venv/lib/python2.7/site-packages/SoftLayer/API.py", line 226, in call
  return self.transport(request)
File "/home/mfilipe/workspace/SoftLayerBilling/venv/lib/python2.7/site-packages/SoftLayer/transports.py", line 162, in __call__
  raise exceptions.TransportError(ex.response.status_code, str(ex))
SoftLayer.exceptions.TransportError: TransportError(500): 500 Server Error: Internal Server Error

几个月前,该API调用正常运行.当我对硬件(api ['Account'].getHardware)执行相同的调用或从掩码中删除tagReferences时,它就会起作用.

Couple months ago that API call was working properly. When I execute the same call for the hardware (api['Account'].getHardware) or remove tagReferences from mask, it works.

它看起来像是一个错误,因为响应包含大量数据,请尝试在您的请求中添加限制:

it looks like an error because the reponse contains a big amount of data try to add limits in your request:

api = SoftLayer.Client(username=customer_id, api_key=customer_apikey)
api['Account'].getVirtualGuests(mask='fullyQualifiedDomainName,tagReferences.tag.name',limit=10, offset=0)

有关限制的更多信息,请参见:

for more information about limits see:

http://softlayer-api-python-client.readthedocs.io/en/latest/api/client/

致谢