ansible/awx

Support date ranges with awxkit --created --modified parameters

Open

#8517 opened on Nov 2, 2020

View on GitHub
 (1 comment) (0 reactions) (0 assignees)Python (13,071 stars) (3,333 forks)batch import
component:clihelp wantedtype:enhancement

Description

ISSUE TYPE
  • Feature Idea
SUMMARY

Currently the --modified and --created options for awxkit are not useful, as they require an exact match. I.e. this returns the results of the one job modified at exactly this microsecond timestamp:

awx job list --modified "2020-07-04T03:50:03.895868Z"

But it is not possible to get a list of jobs created/modified on this day. This returns nothing:

awx job list --modified "2020-07-04"

As far as I can tell there is NO way to list jobs via the CLI in a way that I can just get the most recent x jobs (by count, or hour, or other duration) or the jobs in a general range without getting ALL the jobs and sorting externally.

Date parameters should support the ISO 8601 Time intervals such that:

  • 2020-07-04 means "any time on 2020-07-04"
  • 2020-07-04T03 means "any time within hour 3 of 2020-07-04"
  • P60M means "any time within the last 60 minutes"
  • P1H means "any time within the current hour"
  • 2020-07-03/04 means "any time on 2020-07-03 or 2020-07-04"

I realize it may be difficult to fully support the complete time interval specs, but I think the first two in that list (truncation) would be sufficient for most use-cases.

Contributor guide