litmus_paper
litmus_paper copied to clipboard
command line is awkward
force down application
force down application -d
That doesn't make sense. Think about a better api
I'm glad I saw this, I was just about to force up
to undo a force down
I agree, the CLI is awkward. I'm not sure what a better one really looks like though... we'd be open to suggestions (and PRs). Maybe something like litmusctl --service foo --health bar
and just get rid of the (-d|force|health|up|down)
options?
If we did that, I think we'd want to rework the HTTP API, though.
I think the best proposal I have seen was in the last comment of #16: force down
and unforce down
.
I had a thought yesterday:
litmusctl --service foo --health 0 --reason bar
We could deprecate the force (health|up|down) [-d]
system and remove it in a future release. It'd definitely simplify the interaction model - all up/down/health really does is force a specific return value...
That's not entirely true though - force up
!= force health 100
. I think you raise a valid point but I'm not 100% sure it actually ends up producing a less confusing UI.
Another option might be:
litmustctl add force-down -s foo -r bar
litmustctl rm force-down -s foo
I am not a huge fan of unforce, as it is an awkward English word
How about this
litmusctl force-up --service foo --reason bar
litmusctl force-down --service foo --reason bar
litmusctl monitor --service foo # removes any existing forces
@pitluga I like monitor, though I would prefer to keep the short options, but that is mainly a preference for less typing.
What about litmusctl reset
?
I think the problem with commands that remove all existing forces is that there are cases where we we need more granularity, like removing a force down but not a force health.
Having a hard time coming up with an elegant interface that retains full functionality, but going off of @ssgelm suggestion something like this might work:
litmusctl force-down -s foo -r bar
litmusctl force-up -s foo -r bar
litmusctl force-health -s foo -r bar
litmusctl reset force-down -s foo
litmusctl reset force-up -s foo
litmusctl reset force-health -s foo
The confusing thing about litmusctl
to me was always that ability to layer forces. If you only can have one force in place for a service, you should be able to cover all cases.
litmus-ctl force-down -s foo # forces the service down with health <actual>
litmus-ctl force-heath 10 -s foo # makes the service up with health 10
litmus-ctl force-heath 0 -s foo # makes the service down with health 0
litmus-ctl reset -s foo # makes the service's up|down status respect <actual> health
litmus-ctl force-up -s foo # forces service up with health <acutal>
By removing the side-effects of needing to know the current status of the service, you make the commands more predictable.