python boto3步骤功能列表执行过滤器
我过去试图使用list_executions
和descript_execution
在boto3
中检索特定的步骤函数执行输入,首先是检索所有调用然后获取执行输入(我不知道完整的状态机ARN,我无法直接使用Delcord_execution)。但是,list_executions
不接受过滤器参数(例如“名称”),因此无法返回部分匹配,而是返回所有(成功)执行。
目前,解决方案是列出所有执行,然后循环循环列表,然后选择正确的执行。问题在于,此功能可以返回最大1000个最新记录(根据文档),这很快就会成为一个问题,因为将有1000多个执行,我将需要获得旧的执行。
是否有一种方法可以在list_exections/docution_execution函数中指定过滤器,以检索执行的部分过滤。使用前缀?
import boto3
sf=boto3.client("stepfunctions").list_executions(
stateMachineArn="arn:aws:states:something-something",
statusFilter="SUCCEEDED",
maxResults=1000
)
I am trying to retrieve a specific step function execution input in the past using the list_executions
and describe_execution
functions in boto3
, first to retrieve all the calls and then to get the execution input (I can't use describe_execution directly as I do not know the full state machine ARN). However, list_executions
does not accept a filter argument (such as "name"), so there is no way to return partial matches, but rather it returns all (successful) executions.
The solution for now has been to list all the executions and then loop over the list and select the right one. The issue is that this function can return a max 1000 newest records (as per the documentation), which will soon be an issue as there will be more than 1000 executions and I will need to get old executions.
Is there a way to specify a filter in the list_executions/describe_execution function to retrieve execution partially filtered, for ex. using prefix?
import boto3
sf=boto3.client("stepfunctions").list_executions(
stateMachineArn="arn:aws:states:something-something",
statusFilter="SUCCEEDED",
maxResults=1000
)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是对的,SFN API喜欢不暴露其他过滤选项。尽管如此,这里有两个想法,可以使搜索执行输入的任务更加容易:
You are right that the SFN APIs like ListExecutions do not expose other filtering options. Nonetheless, here are two ideas to make your task of searching execution inputs easier: