|
|
|
@ -1,6 +1,7 @@ |
|
|
|
package commands |
|
|
|
package commands |
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.boot.actuate.endpoint.Endpoint; |
|
|
|
import org.springframework.boot.actuate.endpoint.Endpoint |
|
|
|
|
|
|
|
import org.springframework.boot.actuate.endpoint.jmx.* |
|
|
|
|
|
|
|
|
|
|
|
@Usage("Invoke actuator endpoints") |
|
|
|
@Usage("Invoke actuator endpoints") |
|
|
|
class endpoint { |
|
|
|
class endpoint { |
|
|
|
@ -23,7 +24,15 @@ class endpoint { |
|
|
|
|
|
|
|
|
|
|
|
context.attributes['spring.beanfactory'].getBeansOfType(Endpoint.class).each { n, endpoint -> |
|
|
|
context.attributes['spring.beanfactory'].getBeansOfType(Endpoint.class).each { n, endpoint -> |
|
|
|
if (n.equals(name) && endpoint.isEnabled()) { |
|
|
|
if (n.equals(name) && endpoint.isEnabled()) { |
|
|
|
out.println endpoint.invoke() |
|
|
|
|
|
|
|
|
|
|
|
EndpointMBean mbean = context.attributes['spring.beanfactory'].getBean(EndpointMBeanExporter.class).getEndpointMBean(name, endpoint) |
|
|
|
|
|
|
|
if (mbean instanceof DataEndpointMBean) { |
|
|
|
|
|
|
|
out.println mbean.getData() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
out.println mbean.invoke() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
"" |
|
|
|
"" |
|
|
|
|