为activeTransaction使用Softlayer对象过滤器

2024-09-21 01:17:37 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图使用Python软层API返回一个虚拟服务器的列表,这些服务器是do不是有一个活动事务处于“RECLAIM_WAIT”状态(这是在SoftLayer中删除虚拟服务器时的状态)。我希望取回所有根本没有activeTransaction的虚拟服务器,以及具有activeTransaction但状态不是“RECLAIM廑WAIT”的虚拟服务器。在

我给vs经理打了一个我认为应该有效的过滤器:

f={'virtualGuests': {'activeTransaction': {'transactionStatus': {'name': {'operation': '!= RECLAIM_WAIT'}}}}}
instance = vs.list_instances(hostname="node5-0",filter=f)

但它只返回具有activeTransaction的实例(包括具有RECLAIM\u WAIT状态的实例)。在

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

[{'status': {'keyName': 'DISCONNECTED', 'name': 'Disconnected'}, 'datacenter': {'statusId': 2, 'id': 265592, 'name': 'xxxx', 'longName': 'xxx'}, 'domain': 'xxxx', 'powerState': {'keyName': 'HALTED', 'name': 'Halted'}, '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': '', 'guestId': 27490599, 'id': 46204349, 'transactionStatus': {'friendlyName': 'This is a buffer time in which the customer may cancel the server', 'name': 'RECLAIM_WAIT'}}, 'globalIdentifier': 'xx', 'primaryBackendIpAddress': 'xxx', 'id': xxx, 'fullyQualifiedDomainName': 'xxx'}]

我的过滤器怎么了?在


Tags: 实例name服务器id过滤器状态hostnamexxx
1条回答
网友
1楼 · 发布于 2024-09-21 01:17:37

您的请求没有任何错误,很遗憾,无法为其transactionStatus筛选事务,因为事务没有访问“transactionStatusId”键的权限,您可以签入事务数据类型,本地属性中不存在“transactionStatusId”。在

最好是直接过滤代码。在

相关问题 更多 >

    热门问题