org.springframework.boot.actuate.env.EnvironmentEndpoint Java Examples

The following examples show how to use org.springframework.boot.actuate.env.EnvironmentEndpoint. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ActuatorEnvironmentDimension.java    From sofa-dashboard-client with Apache License 2.0 5 votes vote down vote up
@Override
public EnvironmentDescriptor currentValue() {
    EnvironmentEndpoint.EnvironmentDescriptor result = endpoint.environment(null);
    //
    // Consider of dependency design, we do not use an actuator model directly.
    // We choose to define a serializable model in core module,
    // which can also be used by other extension modules(storage, for example)
    //
    String jsonString = JsonUtils.toJsonString(result);
    return JsonUtils.parseObject(jsonString, EnvironmentDescriptor.class);
}
 
Example #2
Source File: ActuatorCommand.java    From ssh-shell-spring-boot with Apache License 2.0 5 votes vote down vote up
public ActuatorCommand(ApplicationContext applicationContext, Environment environment,
                       SshShellProperties properties, SshShellHelper helper,
                       @Lazy AuditEventsEndpoint audit, @Lazy BeansEndpoint beans,
                       @Lazy ConditionsReportEndpoint conditions,
                       @Lazy ConfigurationPropertiesReportEndpoint configprops, @Lazy EnvironmentEndpoint env,
                       @Lazy HealthEndpoint health,
                       @Lazy HttpTraceEndpoint httptrace, @Lazy InfoEndpoint info, @Lazy LoggersEndpoint loggers,
                       @Lazy MetricsEndpoint metrics,
                       @Lazy MappingsEndpoint mappings, @Lazy ScheduledTasksEndpoint scheduledtasks,
                       @Lazy ShutdownEndpoint shutdown,
                       @Lazy ThreadDumpEndpoint threaddump) {
    this.applicationContext = applicationContext;
    this.environment = environment;
    this.properties = properties;
    this.helper = helper;
    this.audit = audit;
    this.beans = beans;
    this.conditions = conditions;
    this.configprops = configprops;
    this.env = env;
    this.health = health;
    this.httptrace = httptrace;
    this.info = info;
    this.loggers = loggers;
    this.metrics = metrics;
    this.mappings = mappings;
    this.scheduledtasks = scheduledtasks;
    this.shutdown = shutdown;
    this.threaddump = threaddump;
}
 
Example #3
Source File: ActuatorCommand.java    From ssh-shell-spring-boot with Apache License 2.0 5 votes vote down vote up
/**
 * Environment method
 *
 * @param pattern pattern to filter with
 * @return env
 */
@ShellMethod(key = "env", value = "Display env endpoint.")
@ShellMethodAvailability("envAvailability")
public EnvironmentEndpoint.EnvironmentDescriptor env(
        @ShellOption(value = {"-p", "--pattern"}, defaultValue = ShellOption.NULL, help = "Pattern " +
                "to filter on") String pattern) {
    return env.environment(pattern);
}
 
Example #4
Source File: EnvironmentManagerIntegrationTests.java    From spring-cloud-commons with Apache License 2.0 5 votes vote down vote up
@Test
public void environmentBeansConfiguredCorrectly() {
	Map<String, EnvironmentEndpoint> envbeans = this.context
			.getBeansOfType(EnvironmentEndpoint.class);
	then(envbeans).hasSize(1).containsKey("writableEnvironmentEndpoint");
	then(envbeans.get("writableEnvironmentEndpoint"))
			.isInstanceOf(WritableEnvironmentEndpoint.class);

	Map<String, EnvironmentEndpointWebExtension> extbeans = this.context
			.getBeansOfType(EnvironmentEndpointWebExtension.class);
	then(extbeans).hasSize(1).containsKey("writableEnvironmentEndpointWebExtension");
	then(extbeans.get("writableEnvironmentEndpointWebExtension"))
			.isInstanceOf(WritableEnvironmentEndpointWebExtension.class);
}
 
Example #5
Source File: AppDimensionConfiguration.java    From sofa-dashboard-client with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public ActuatorEnvironmentDimension createEnvironmentDimension(EnvironmentEndpoint endpoint) {
    return new ActuatorEnvironmentDimension(endpoint);
}
 
Example #6
Source File: ActuatorEnvironmentDimension.java    From sofa-dashboard-client with Apache License 2.0 4 votes vote down vote up
public ActuatorEnvironmentDimension(EnvironmentEndpoint endpoint) {
    this.endpoint = endpoint;
}
 
Example #7
Source File: DimensionTestContext.java    From sofa-dashboard-client with Apache License 2.0 4 votes vote down vote up
@Bean
public ActuatorEnvironmentDimension createEnvironmentDimension(EnvironmentEndpoint endpoint) {
    return new ActuatorEnvironmentDimension(endpoint);
}
 
Example #8
Source File: ActuatorCommand.java    From ssh-shell-spring-boot with Apache License 2.0 4 votes vote down vote up
/**
 * @return whether `env` command is available
 */
public Availability envAvailability() {
    return availability("env", EnvironmentEndpoint.class);
}
 
Example #9
Source File: EnvironmentCommand.java    From sshd-shell-spring-boot with Apache License 2.0 4 votes vote down vote up
EnvironmentCommand(@Value("${sshd.system.command.roles.environment}") String[] systemRoles,
        EnvironmentEndpoint envEndpoint) {
    super(systemRoles);
    this.envEndpoint = envEndpoint;
}