@ReadOperation public Map<String, List<Map<String, Object>>> invoke() { // Map of filters by type final Map<String, List<Map<String, Object>>> filterMap = new TreeMap<>(); for (ZuulFilter filter : this.filterRegistry.getAllFilters()) { // Ensure that we have a list to store filters of each type if (!filterMap.containsKey(filter.filterType())) { filterMap.put(filter.filterType(), new ArrayList<>()); } final Map<String, Object> filterInfo = new LinkedHashMap<>(); filterInfo.put("class", filter.getClass().getName()); filterInfo.put("order", filter.filterOrder()); filterInfo.put("disabled", filter.isFilterDisabled()); filterInfo.put("static", filter.isStaticFilter()); filterMap.get(filter.filterType()).add(filterInfo); } return filterMap; }
@ReadOperation public ConsulData invoke() { ConsulData data = new ConsulData(); // data.setKeyValues(kvClient.getKeyValueRecurse()); Response<Map<String, Service>> agentServices = consul.getAgentServices(); data.setAgentServices(agentServices.getValue()); Response<Map<String, List<String>>> catalogServices = consul .getCatalogServices(QueryParams.DEFAULT); for (String serviceId : catalogServices.getValue().keySet()) { Response<List<CatalogService>> response = consul.getCatalogService(serviceId, QueryParams.DEFAULT); data.getCatalogServices().put(serviceId, response.getValue()); } Response<List<Node>> catalogNodes = consul.getCatalogNodes(QueryParams.DEFAULT); data.setCatalogNodes(catalogNodes.getValue()); return data; }
@Autowired EndpointCommand(ApplicationContext appCtx) { appCtx.getBeansWithAnnotation(Endpoint.class).entrySet().stream().forEachOrdered(entry -> { log.info("{} : {}", entry.getKey(), entry.getValue().getClass().getName()); for (Method m : entry.getValue().getClass().getDeclaredMethods()) { if (m.isAnnotationPresent(ReadOperation.class) || m.isAnnotationPresent(WriteOperation.class)) { log.info("\tOp: {}", m.getName()); for (Parameter p : m.getParameters()) { log.info("\t\tParameter {}, {}", p.getName(), p.getType().getName()); } } } }); }
@ReadOperation public ResponseEntity getStatus() { if (this.registration == null) { return ResponseEntity.status(HttpStatus.NOT_FOUND).body("no registration found"); } return ResponseEntity.ok().body(this.serviceRegistry.getStatus(this.registration)); }
@ReadOperation public Map<String, String> invoke() { Map<String, String> map = new LinkedHashMap<>(); for (Route route : this.routes.getRoutes()) { map.put(route.getFullPath(), route.getLocation()); } return map; }
/** * Expose Zuul {@link Route} information with details. */ @ReadOperation public Object invokeRouteDetails(@Selector String format) { if (FORMAT_DETAILS.equalsIgnoreCase(format)) { return invokeRouteDetails(); } else { return invoke(); } }
@ReadOperation public Map<String, Object> invoke() { Map<String, Object> map = new LinkedHashMap<>(); AbstractConfiguration config = ConfigurationManager.getConfigInstance(); if (config instanceof ConcurrentCompositeConfiguration) { ConcurrentCompositeConfiguration composite = (ConcurrentCompositeConfiguration) config; for (Configuration item : composite.getConfigurations()) { append(map, item); } } else { append(map, config); } return map; }