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

Create XYZ commands must return an id/name only #20

Closed
aperepel opened this issue Feb 3, 2018 · 3 comments
Closed

Create XYZ commands must return an id/name only #20

aperepel opened this issue Feb 3, 2018 · 3 comments

Comments

@aperepel
Copy link

aperepel commented Feb 3, 2018

The use case is automation/scripting. We don't need Successfully created XYZ with ID: blah in the output.

Consider either printing a single line with the ID or printing a json structure with any required additional info. Just printing an ID makes sense for the create operation (a la RESTful service), and also makes it easier to copy/paste in the interactive shell vs selecting it within verbose output.

Could add some --json arg to convert every output into machine-parseable ones. Yes, very much like SVN did at the time :)

@bbende
Copy link
Owner

bbende commented Feb 4, 2018

I think it makes sense to just print the ids for the create operations.

On the registry side the returned entities have a concept of self link, would it make sense to return that? An example would be:

nifi-reg create-bucket ...
buckets/{bucketId}

nifi-reg create-flow ...
buckets/{bucketId}/flows/{flowId}

nifi-reg import-flow-version ...
buckets/{bucketId}/flows/{flowId}/versions/{versionNumber}

Or does it make more sense to just stick with a single value?

nifi-reg create-bucket ...
{bucketId}

nifi-reg create-flow ...
{flowId}

nifi-reg import-flow-version ...
{versionNumber}

bbende added a commit that referenced this issue Feb 4, 2018
…asy use in automation or copying/pasting
@aperepel
Copy link
Author

aperepel commented Feb 5, 2018 via email

@bbende
Copy link
Owner

bbende commented Feb 5, 2018

Sounds good, the commit I pushed has the single value approach, closing this.

@bbende bbende closed this as completed Feb 5, 2018
bbende added a commit that referenced this issue Feb 9, 2018
- Setting up command framework
- Check point for get-flow-version command
- Working get-flow-version
- Working commands for ListBuckets and CreateBucket
- Adding more commands
- Adding support for properties files and secure connections with certificates
- Adding JLine to make a shell
- Cleaning up JLine integration
- Adding support for executing single commands, renaming to CLI
- Adding command groups to organize commands based on target area
- Refactoring how command options are setup
- Refactoring how NiFiRegistryClient is created to make it easier to test and to support proxied entities
- Implementing custom completer
- Working NiFI commands for listing, adding, and updating Registry Clients
- Refactoring to create an overall CLI context to pass around with a session, and adding session commands
- Making use of session properties file for NiFi and NiFiReg commands
- Working import-pg command for NiFi
- Adding current user commands and session clear
- Reorganizing packages, refactoring to separate API
- Adding persistent session
- Adding commands for pg-start, pg-stop, and pg-get-vars, and a basic README
- Fixes #17 - Only print session info when interactive
- Fixes #20 - Making all create commands return a single id value for easy use in automation or copying/pasting
- Fixes #19 - Removing name from the options of pg-import since it should use the name from registry
- Fixes #16 - Making flow version optional when exporting, if not specified then the latest will be exported
- Fixes #18 - Removing flow version arg from import-flow-version, automatically determining next one-up version
- Fixes #21 - Removing bucket id from export/import and automatically determining it
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

No branches or pull requests

2 participants