Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tasks): add ability to find tasks by name #14694

Merged
merged 1 commit into from
Aug 16, 2019
Merged

Conversation

AlirieGray
Copy link
Contributor

@AlirieGray AlirieGray commented Aug 16, 2019

Closes #12170

Adds ability to find tasks with a name specified in the query parameters. An exact matched is used, to be consistent with the way filtering by name works with other resources such as buckets.

For example, a request to http://localhost:9999/api/v2/tasks?name=mytask will return the task(s) with the name mytask

  • CHANGELOG.md updated with a link to the PR (not the Issue)
  • Rebased/mergeable
  • Tests pass
  • http/swagger.yml updated (if modified Go structs or API)

@AlirieGray AlirieGray requested review from a team as code owners August 16, 2019 18:58
@AlirieGray AlirieGray requested a review from a team August 16, 2019 18:59
@ghost ghost requested review from lyondhill and removed request for a team August 16, 2019 18:59
kv/task.go Outdated
return ts, len(ts), err
}

func filterByName(ts []*influxdb.Task, name string) []*influxdb.Task {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add tasks to name. Just so it's clear is not generic

Copy link
Contributor

@chnn chnn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

swagger looks good to me

Copy link
Contributor

@kelwang kelwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, quick question do we want the name to be unique or doesn't matter?

@AlirieGray
Copy link
Contributor Author

@kelwang No they are not necessarily unique. If there are multiple tasks with the same name, it will just return an array with those tasks

@AlirieGray AlirieGray merged commit 7da6055 into master Aug 16, 2019
@AlirieGray AlirieGray deleted the tasks/find-by-name branch August 16, 2019 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tasks: should be able to find task by name
4 participants