Open calebhailey opened 5 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
It might be good to have the output optional via a flag. When applying over a larger group of resources stdout can add a bit of overhead to the speed that might not be necessary unless you are debugging or running in a CI job for example.
Updated the "possible solution" section of the issue description with the following notes:
Update resource PUT APIs to support 202 Accepted
and 304 Not Modified
NOTE: the PUT APIs (e.g. CheckConfig PUT) already provide HTTP response code
201 Created
, so adding202 Accepted
and304 Not Modified
would allow us to differentiate between created (201) vs updated (202) vs not updated (304).
Add tabular output support to sensuctl create
Add tabular output support to sensuctl prune
Add a --verbose
flag to optionally output filenames? For example:
$ sensuctl create -f check_http.yaml
processing file "/path/to/check_http.yaml"...
asset "nagios-plugins" created
check "http-service-health" created
filter "team-a" unchanged
This could help further troubleshoot sensuctl error messages if the file processing message was printed before attempting to read the file.
NOTE: separate this into two issues: API updates (list item 1), and Sensuctl updates (list items 2-4).
Updates:
--continue
or --skip-errors
flag to attempt to continue processing resources (e.g. in a file with 10 resources, if the second resource has an error, could we try to process the third resource, etc)? --quiet
(or similar) flag for suppressing this output --summary
flag for printing out a summary of changes (e.g. "created 100 resources, updated 100 resources, 100 resource unchanged) --quiet
and --summary
be the same thing?
Expected Behavior
sensuctl
should generate output to indicate what action has been taken on a resource (if any). This output should be consistent across allsensuctl
subcommands (e.g.sensuctl create -f foo.yaml
andsensuctl check create foo --interactive
).NOTE: this feature is inspired by the Kubernetes
kubectl
CLI output (for reference).Examples:
...or...
The output should follow a consistent syntax of
<resource> "<resource_name>" <action>
where valid actions are (subject to further specification): "created", "modified", "deleted", or "unchanged".This output should be especially helpful when processing a resource definition which describes multiple resources via
sensuctl create -f
, in the event that an invalid resource definition is encountered, the CLI output will help inform the user which action(s) have been taken.For example, a file named
foo.yaml
includes definitions for an asset resource, a check resource, and a handler resource, all named "foo" (in that order). The asset and handler definitions are valid, but the check definition is invalid. Assensuctl
reads the file and processes the resource definitions sequentially, it would inform the user that the first resource (the asset) was created before encountering an error on the second resource (the check) and exiting without attempting to process the handler definition:Current Behavior
Inconsistent output from
sensuctl
across the various subcommands.Possible Solution
Update resource PUT APIs to support
202 Accepted
and304 Not Modified
Add tabular output support to
sensuctl create
Add tabular output support to
sensuctl prune
Add a
--verbose
flag to optionally output filenames? For example:This could help further troubleshoot sensuctl error messages if the file processing message was printed before attempting to read the file.
Steps to Reproduce (for bugs)
n/a
Context
It can be difficult to know what actions sensuctl is taking, especially when using
sensuctl create -f
with a file containing multiple resource definitions.Your Environment
Sensu Go 5.0.0+