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

Add support for filtering job lists by ID #21

Merged
merged 8 commits into from
Apr 8, 2022

Conversation

Mandrenkov
Copy link
Collaborator

Context:

The GET /jobs endpoint of the Xanadu Cloud 0.4.0 API now accepts repeated id query parameters to filter jobs by ID.

Description of the Change:

  • Added an ids parameter to the xcc job list command.
  • Added an ids parameter to the xcc.Job.list() function.
  • Improved the parsing of query parameter validation error responses. For example:
$ xcc job list --ids "Invalid UUID" # Before
ERROR: 0.
$ xcc job list --ids "Invalid UUID" # Now
ERROR: Not a valid UUID.

Benefits:

  • There is an efficient way to fetch multiple job overviews with known IDs (i.e., relative to an user-side loop).

Possible Drawbacks:
None.

Related GitHub Issues:
None.

Copy link
Contributor

@doctorperceptron doctorperceptron left a comment

Choose a reason for hiding this comment

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

Looks good to me and works as advertised.

Currently, when you request more than the limit number of jobs via the --ids flag you only receive limit jobs back. I would expect the limit to be overridden when specifying specific jobs to return, but that could just be me.

@Mandrenkov
Copy link
Collaborator Author

Thanks for the review, @doctorperceptron!

Currently, when you request more than the limit number of jobs via the --ids flag you only receive limit jobs back. I would expect the limit to be overridden when specifying specific jobs to return, but that could just be me.

Excellent point! Your suggestion has been implemented.

@Mandrenkov Mandrenkov merged commit 7c7ffb7 into main Apr 8, 2022
@Mandrenkov Mandrenkov deleted the sc-15555-list-jobs-with-ids branch April 8, 2022 20:22
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.

2 participants