-
Notifications
You must be signed in to change notification settings - Fork 73
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
Accept input via command chaining #45
Comments
This PR adds utility methods and logic to read stdin for details needed in commands, allowing each command ouput to be piped to the next command newrelic#45
@jthurman42 I intend to start tackling this issue, using the entity command as an MVP, but it would help if you could answer a question. This example code includes a secret request to add a feature for bulk edits. Currently in the cli, there's no way to specify multiple entities to act on at once. Should I aim here to add that functionality? |
@nicolasjhampton Good point, there is an assumption that the CLI would handle an array of input items and loop thought them based on the example. I believe my thought here was that the data passed through the pipe would be in JSON, so easy enough to detect an array to iterate on. I'd prefer to see that at least though of, otherwise we're pushing the work of splitting / running multiple items out to the user. |
This PR adds utility methods and logic to read stdin for details needed in commands, allowing each command ouput to be piped to the next command newrelic#45
@jthurman42 I've gotten all the way to getting bulk information from stdin to the actual newrelic client query, but there's literally not a method on the newrelic-client-go package that takes several guids and returns the tags for all of them. Like we agreed before, this is actually two legs of work. I think I'm complete on getting bulk data from stdin and making it accessible to each command to use. If I can get your signoff for this to be reviewed and merged separately, I'll do an inventory of what needs to change in newrelic-client-go to allow useful bulk actions and make a PR there to make further work here possible. |
This PR adds utility methods and logic to read stdin for details needed in commands, allowing each command ouput to be piped to the next command newrelic#45 refactor(release): WIP clean up logic in init function This commit refactors the init logic to be cleaner, handle more flags, and prepare for bulk actions feat(release): WIP collect values from multiple results and add tests This commit adds more testing and allows reading values from multiple results refactor(release): WIP create pipe module This commit pulls the pipe input logic out of the utils module and into a new pipe module. It also abstracts the PipeInput map from other modules. feat(release): make newrelic entity tags get cmd take stdin This commit is the last step I can take towards making the entity tags get command return bulk data based on stdin. Work has to be done on newrelic-client-go in order to support bulk guid queries https://github.com/newrelic/newrelic-client-go/blob/13ed6ee7fa172cce9218cf30e98eab6e1805541d/pkg/entities/tags.go#L124 fix(release): make Get and GetInput always return same values This commit checks for the existence of the pipeInput internal state, so even if GetInput is called more than once, nothing is overwritten and Get returns the same values. More testing and test refactors are also included.
This PR adds utility methods and logic to read stdin for details needed in commands, allowing each command ouput to be piped to the next command newrelic#45 refactor(release): WIP clean up logic in init function This commit refactors the init logic to be cleaner, handle more flags, and prepare for bulk actions feat(release): WIP collect values from multiple results and add tests This commit adds more testing and allows reading values from multiple results refactor(release): WIP create pipe module This commit pulls the pipe input logic out of the utils module and into a new pipe module. It also abstracts the PipeInput map from other modules. feat(release): make newrelic entity tags get cmd take stdin This commit is the last step I can take towards making the entity tags get command return bulk data based on stdin. Work has to be done on newrelic-client-go in order to support bulk guid queries https://github.com/newrelic/newrelic-client-go/blob/13ed6ee7fa172cce9218cf30e98eab6e1805541d/pkg/entities/tags.go#L124 fix(release): make Get and GetInput always return same values This commit checks for the existence of the pipeInput internal state, so even if GetInput is called more than once, nothing is overwritten and Get returns the same values. More testing and test refactors are also included. docs(release): add docs comments to pipe package
This PR adds utility methods and logic to read stdin for details needed in commands, allowing each command ouput to be piped to the next command newrelic#45 refactor(release): WIP clean up logic in init function This commit refactors the init logic to be cleaner, handle more flags, and prepare for bulk actions feat(release): WIP collect values from multiple results and add tests This commit adds more testing and allows reading values from multiple results refactor(release): WIP create pipe module This commit pulls the pipe input logic out of the utils module and into a new pipe module. It also abstracts the PipeInput map from other modules. feat(release): make newrelic entity tags get cmd take stdin This commit is the last step I can take towards making the entity tags get command return bulk data based on stdin. Work has to be done on newrelic-client-go in order to support bulk guid queries https://github.com/newrelic/newrelic-client-go/blob/13ed6ee7fa172cce9218cf30e98eab6e1805541d/pkg/entities/tags.go#L124 fix(release): make Get and GetInput always return same values This commit checks for the existence of the pipeInput internal state, so even if GetInput is called more than once, nothing is overwritten and Get returns the same values. More testing and test refactors are also included. docs(release): add docs comments to pipe package docs(release): fix spelling errors
…tag-cmd feat(release): Issue #45 add support for command chaining
cc @kidk |
Feature Description
Add the ability to chain newrelic commands together, example would be an entity search filtered to GUIDs, then piped back to newrelic to add tags to all of those entities.
The text was updated successfully, but these errors were encountered: