Python 对activeTransaction使用Softlayer对象筛选器

Python 对activeTransaction使用Softlayer对象筛选器,python,ibm-cloud-infrastructure,Python,Ibm Cloud Infrastructure,我正在尝试使用Python SoftLayer API返回一个虚拟服务器列表,这些虚拟服务器不具有处于“Reclain_WAIT”状态(即在SoftLayer中删除虚拟服务器时的状态)的活动事务。我希望能够取回所有根本没有activeTransaction的虚拟服务器,以及那些有activeTransaction但状态不是“Recreal_WAIT”的虚拟服务器 我给vs经理打电话时,我认为应该使用一个过滤器: f={'virtualGuests': {'activeTransaction':

我正在尝试使用Python SoftLayer API返回一个虚拟服务器列表,这些虚拟服务器不具有处于“Reclain_WAIT”状态(即在SoftLayer中删除虚拟服务器时的状态)的活动事务。我希望能够取回所有根本没有activeTransaction的虚拟服务器,以及那些有activeTransaction但状态不是“Recreal_WAIT”的虚拟服务器

我给vs经理打电话时,我认为应该使用一个过滤器:

f={'virtualGuests': {'activeTransaction': {'transactionStatus': {'name': {'operation': '!= RECLAIM_WAIT'}}}}}
instance = vs.list_instances(hostname="node5-0",filter=f)
但它只返回具有activeTransaction的实例(包括具有Recall\u WAIT状态的实例)

下面是该调用返回的实例的示例:

[{'status':{'keyName':'DISCONNECTED','name':'DISCONNECTED'},'datacenter':{'statusId':2,'id':265592,'name':'xxxx','longName':'xxx'},'domain':'xxxx','powerState':{'keyName':'stopped','maxCpu':2,'maxMemory':8192,'hostname':'node5-0','primaryIpAddress':'xxxx','activeTransaction':{'modifyDate':'2017-01-16T05:20:01-06:00','statusChangeDate':'2017-01-16T05:20:01-06:00','elapsedSeconds':22261','createDate':'2017-01-16T05:19:05-06:00','hardwareId':'46204349',transactionStatus':{'friendlyName':'这是客户可以取消服务器的缓冲时间,'name':'Reclain"WAIT'},'globalidentier':'xx','primaryBackendIpAddress':'xxx','id':xxx,'fullyQualifiedDomainName':'xxx'}]


过滤器有什么问题吗?

您的请求中没有错误,不幸的是,无法为其transactionStatus过滤事务,因为事务没有访问“transactionStatusId”键的权限,您可以检入事务数据类型,因为不存在本地属性中的“transactionStatusId”

因此,最好的方法是直接在代码中进行过滤