@@ -167,6 +167,8 @@ public class ShellProperties {
|
||||
+ "configured method '%s'. Please check your classpath.",
|
||||
finalAuth, this.auth));
|
||||
}
|
||||
// Make sure we keep track of final authentication method
|
||||
this.auth = finalAuth;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -467,13 +467,8 @@ download and install http://www.putty.org/[PuTTY].
|
||||
:: Spring Boot :: (v{spring-boot-version}) on myhost
|
||||
----
|
||||
|
||||
Type `help` for a list of commands. Spring boot provides `metrics`, `beans` and
|
||||
`autoconfig` commands. You can also use the `jmx` command to query endpoint data:
|
||||
|
||||
[indent=0]
|
||||
----
|
||||
jmx find -p org.springframework.boot:type=Endpoint,name=healthEndpoint | jmx get Data
|
||||
----
|
||||
Type `help` for a list of commands. Spring boot provides `metrics`, `beans`, `autoconfig`
|
||||
and `endpoint` commands.
|
||||
|
||||
|
||||
|
||||
@@ -502,10 +497,10 @@ for details). By default Spring Boot will search for commands in the following l
|
||||
* `classpath*:/commands/**`
|
||||
* `classpath*:/crash/commands/**`
|
||||
|
||||
TIP: You can change the search path by settings a `shell.commandpathpatterns` property.
|
||||
TIP: You can change the search path by settings a `shell.commandPathPatterns` property.
|
||||
|
||||
Here is a simple ``hello world'' command that could be loaded from
|
||||
`src/main/resources/commands/Hello.groovy`
|
||||
`src/main/resources/commands/hello.groovy`
|
||||
|
||||
[source,groovy,indent=0]
|
||||
----
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package commands
|
||||
|
||||
import org.springframework.boot.actuate.endpoint.Endpoint;
|
||||
|
||||
@Usage("Invoke actuator endpoints")
|
||||
class endpoint {
|
||||
|
||||
@Usage("List all available and enabled actuator endpoints")
|
||||
@Command
|
||||
def list(InvocationContext context) {
|
||||
|
||||
context.attributes['spring.beanfactory'].getBeansOfType(Endpoint.class).each { name, endpoint ->
|
||||
if (endpoint.isEnabled()) {
|
||||
out.println name
|
||||
}
|
||||
}
|
||||
""
|
||||
}
|
||||
|
||||
@Usage("Invoke provided actuator endpoint")
|
||||
@Command
|
||||
def invoke(InvocationContext context, @Usage("The object name pattern") @Required @Argument String name) {
|
||||
|
||||
context.attributes['spring.beanfactory'].getBeansOfType(Endpoint.class).each { n, endpoint ->
|
||||
if (n.equals(name) && endpoint.isEnabled()) {
|
||||
out.println endpoint.invoke()
|
||||
}
|
||||
}
|
||||
""
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user