@ReadOperation public WebEndpointResponse<Health> healthForComponentInstance( SecurityContext securityContext, @Selector String component, @Selector String instance) { Supplier<Health> health = () -> this.delegate .healthForComponentInstance(component, instance); return this.responseMapper.mapDetails(health, securityContext); }
@SshdShellCommand(value = "componentInstance", description = "Health for component instance") public String healthForComponentInstance(String arg) { if (StringUtils.isEmpty(arg)) { return "Usage: health componentInstance {\"component\":\"<component>\",\"instance\":\"<instance>\"}"; } return CommandUtils.process(log, () -> { ComponentInstance ci = JsonUtils.stringToObject(arg, ComponentInstance.class); return JsonUtils.asJson(healthEndpoint.healthForComponentInstance(ci.component, ci.instance)); }); }