如何将 awx cli 结果限制增加到 25

如何将 awx cli 结果限制增加到 25

我正在拥有超过 100 台服务器的环境中使用 awx cli(19.1.0)和 awx(13.0.0)

当(例如)查询失败或者结果发生变化时:

awx --conf.host https://my.awx --conf.username myuser --conf.password mypass -k -f human --filter 'event_display,event_data,host_name,play,task,stdout' job_events list --job 1234 --event runner_on_ok --changed true > /tmp/tmp

我只得到了 25 个结果。
(这符合 awx api 的分页吗?!)
有没有选项可以获取 awx 运行的每个结果?
阿拉是 CLI 的绝佳替代品,但它不适用于我的环境/任务)


更新/提示 我不知道似乎只有--help成功通过身份验证才能获得正确的命令行帮助(请参阅我对答案的评论

答案1

要获取所有结果,请在查询中添加标志 --all。

usage: awx job_events list [-h] [--all] [-f {json,yaml,jq,human}]
                       [--filter TEXT] [--conf.color BOOLEAN] [-v]
                       [--type {job_event}] [--created CREATED]
                       [--modified MODIFIED] [--job ID]
                       [--event {runner_on_failed,runner_on_start,runner_on_ok,runner_on_error,runner_on_skipped,runner_on_unreachable,runner_on_no_hosts,runner_on_async_poll,runner_on_async_ok,runner_on_async_failed,runner_item_on_ok,runner_item_on_failed,runner_item_on_skipped,runner_retry,runner_on_file_diff,playbook_on_start,playbook_on_notify,playbook_on_include,playbook_on_no_hosts_matched,playbook_on_no_hosts_remaining,playbook_on_task_start,playbook_on_vars_prompt,playbook_on_setup,playbook_on_import_for_host,playbook_on_not_import_for_host,playbook_on_play_start,playbook_on_stats,debug,verbose,deprecated,warning,system_warning,error}]
                       [--counter INTEGER] [--event_data JSON/YAML]
                       [--failed BOOLEAN] [--changed BOOLEAN]
                       [--uuid TEXT] [--parent_uuid TEXT] [--host ID]
                       [--host_name TEXT] [--playbook TEXT] [--play TEXT]
                       [--task TEXT] [--role TEXT] [--stdout TEXT]
                       [--start_line INTEGER] [--end_line INTEGER]
                       [--verbosity INTEGER]

--all

    fetch all pages of content from the API when returning results (instead of just the first page)

参考:Ansible Tower/AWX CLI v3.8.3 用户指南

相关内容