Closed aaravm closed 3 weeks ago
This pull request adds a Command Line Interface (CLI) for Task Execution Service (TES) operations. The implementation is inspired by the nanopub-rs project and uses the Clap library for command-line argument parsing. The CLI supports various TES operations including creating tasks, listing tasks, getting task details, checking task status, and canceling tasks. The code is structured to handle different subcommands and their respective arguments, making API calls to a TES server (specifically Funnel) to perform the requested operations.
Files | Changes |
---|---|
cli/src/main.rs |
Implemented a main function that sets up the CLI structure using Clap, defining subcommands for various TES operations |
cli/src/main.rs |
Added a 'create' subcommand to create new tasks, supporting both JSON input and file-based task definitions |
cli/src/main.rs |
Implemented a 'list' subcommand to retrieve and display a list of tasks with customizable parameters |
cli/src/main.rs |
Added 'get' and 'status' subcommands to retrieve task details and status respectively |
cli/src/main.rs |
Implemented a 'cancel' subcommand to cancel running tasks |
cli/src/main.rs |
Integrated with the ga4gh_sdk crate to interact with the TES API, including configuration setup and API calls |
cli/src/main.rs |
Added error handling and result printing for each subcommand execution |
@pavelnikonorov, I have addressed all of your concerns. Please let me know if you think any other changes should be made.
@aaravm: Can you please merge #37 (after updating the PR description) and then update this PR so that it only contains the changes relative to the updated main
? I will give it a closer review then.
For now: Please make sure all modules have docstrings for the module, class, function level etc., as well as comprehensive doctests. Same thing as for the other PRs... And +1 on Pavel's & Sourcery's comments.
Hi @uniqueg @pavelnikonorov, I have changed the list CLI, to take input in the form of
ga4gh-cli tes list --name_prefix <NAME_PREFIX> --state <STATE> --tag_key <TAG_KEY> --tag_value <TAG_VALUE> --page_size <PAGE_SIZE> --page_token <PAGE_TOKEN> --view <VIEW>
instead of dictionary, as suggested by @pavelnikonorov . Please look into this PR and merge it
all suggestions addressed, merging as discussed with @uniqueg
This PR contains code for the CLI and Instructions on how to use them. It is inspired from https://github.com/vemonet/nanopub-rs/blob/main/cli/src/main.rs
Summary by Sourcery
Add a new CLI tool for TES task management with commands for creating, listing, retrieving, checking the status of, and canceling tasks, along with usage documentation.
New Features:
Documentation: