go-rundeck
go-rundeck copied to clipboard
c.ListProjectExecutions statusFilter not filtering?
I'm trying to get all the failed jobs from a certain time period. I'm able to filter based on begin and end, but I haven't had any luck with statusFilter. As a simplified example:
project := "prod"
c, _ := rundeck.NewClientFromEnv()
r, _ := c.ListProjectExecutions(project, map[string]string{"statusFilter": "failed"})
log.Printf("Found %d matching jobs", r.Paging.Total)
2018/03/30 21:20:18 Found 71867 matching jobs
Whereas when I search with rundeck-cli:
$ rd executions query -s failed -p prod
# Paged results 0 - 20 (of 2760 by 20).
...
I'm not sure where the 71867 comes from, but I did write a loop that pages through and outputs the results and it includes status="succeeded".
I confirmed that I'm able to curl the api with expected results:
$ curl ${RUNDECK_URL}/api/14/project/prod/executions?authtoken=${RUNDECK_TOKEN} -d statusFilter="failed"
<executions count='20' total='2762' offset='0' max='20'>
...
Rundeck 2.10.4-1 go version go1.10 darwin/amd64