@GET
@Path("/current-state")
@ApiOperation(value = "Fetch policy states in batch", notes="Returns a map of policy ID to whether it is active")
public Map<String, Boolean> batchConfigRead(
@ApiParam(value = "Application ID or name", required = true)
@PathParam("application") String application,
@ApiParam(value = "Entity ID or name", required = true)
@PathParam("entity") String entityToken) {
EntityLocal entity = brooklyn().getEntity(application, entityToken);
Map<String, Boolean> result = Maps.newLinkedHashMap();
for (Policy p: entity.getPolicies()) {
result.put(p.getId(), !p.isSuspended());
}
return result;
}