Api 为什么调用SoftLayer\u Billing\u Invoice::getItems接口时总是出现500错误?
最近我正在开发一个依赖于softlayer接口的项目。我想获得裸机服务器的发票详细信息。但是当我调用SoftLayer\u Billing\u Invoice::getItems接口时,我一直收到一个500错误。其他接口正常 问候~ 代码显示如下:Api 为什么调用SoftLayer\u Billing\u Invoice::getItems接口时总是出现500错误?,api,ibm-cloud-infrastructure,Api,Ibm Cloud Infrastructure,最近我正在开发一个依赖于softlayer接口的项目。我想获得裸机服务器的发票详细信息。但是当我调用SoftLayer\u Billing\u Invoice::getItems接口时,我一直收到一个500错误。其他接口正常 问候~ 代码显示如下: client = SoftLayer.create_client_from_env(username="username", api_key="api_key",
client = SoftLayer.create_client_from_env(username="username",
api_key="api_key",
proxy="proxy")
sl_billing_invoice = client['Billing_Invoice']
try:
result = sl_billing_invoice.getItems(id=id)
print result
except SoftLayer.SoftLayerAPIError as sl_exc:
msg = 'result:(%s, %s)' % (sl_exc.faultCode, sl_exc.faultString)
print msg
返回错误消息,如下所示:
结果:(500500服务器错误:内部服务器错误)
问题很可能是您的请求返回了大量数据,这种情况通常发生在发票和账单项目上。为了解决该问题,您有以下选项:
result=sl\u billing\u invoice.getItems(限额=50,抵销=0,id=id)
谢谢您的回答。我得到了它。界面正常。致意~