[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[GitHub] brooklyn-server pull request #967: add an /applications/details endpoint whi...
Github user geomacy commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/967#discussion_r192711341
--- Diff: rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ApplicationResource.java ---
@@ -194,16 +218,42 @@ private EntityDetail fromEntity(Entity entity) {
Entity entity = mgmt().getEntityManager().getEntity(entityId.trim());
while (entity != null && entity.getParent() != null) {
if (Entitlements.isEntitled(mgmt().getEntitlementManager(), Entitlements.SEE_ENTITY, entity)) {
- entitySummaries.add(addSensors(fromEntity(entity), entity, extraSensors));
+ entitySummaries.add(addSensorsByName((EntityDetail)fromEntity(entity, false, -1, null, null), entity, extraSensors));
}
entity = entity.getParent();
}
}
}
return entitySummaries;
}
+
+ @Override
+ public List<EntitySummary> details(String entityIds, boolean includeAllApps, String extraSensorsGlobsS, String extraConfigGlobsS, int depth) {
+ List<String> extraSensorGlobs = JavaStringEscapes.unwrapOptionallyQuotedJavaStringList(extraSensorsGlobsS);
+
+ Map<String, EntitySummary> entitySummaries = MutableMap.of();
+ if (includeAllApps) {
+ for (Entity application : mgmt().getApplications()) {
+ entitySummaries.put(application.getId(), fromEntity(application, true, depth, extraSensorGlobs, extraSensorGlobs));
--- End diff --
`fromEntity(application, true, depth, extraSensorGlobs, extraSensorGlobs))` needs to be
`... extraSensorGlobs, extraConfigGlobs))`.
at the moment when you request sensors you get results including empty `config` object, but when you request config you don't get either sensors or config.
---