Commit 99e6503a authored by Christian Dupuis's avatar Christian Dupuis

Some polish to the endpoint command

parent 99d6af6c
......@@ -20,7 +20,12 @@ class endpoint {
@Usage("Invoke provided actuator endpoint")
@Command
def invoke(InvocationContext context, @Usage("The object name pattern") @Required @Argument String name) {
def invoke(InvocationContext context, @Usage("The name of the Endpoint to invoke") @Required @Argument String name) {
// Don't require passed argument to end with 'Endpoint'
if (!name.endsWith("Endpoint")) {
name = name + "Endpoint"
}
context.attributes['spring.beanfactory'].getBeansOfType(Endpoint.class).each { n, endpoint ->
if (n.equals(name) && endpoint.isEnabled()) {
......@@ -30,7 +35,7 @@ class endpoint {
out.println mbean.getData()
}
else {
out.println mbean.invoke()
out.println mbean.endpoint.invoke()
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment