@Override
  public void execute(FunctionContext context) {

    ArrayList<String> vals = new ArrayList<>();

    Cache c = null;
    try {
      c = CacheFactory.getAnyInstance();
    } catch (CacheClosedException ex) {
      vals.add("NoCacheResult");
      context.getResultSender().lastResult(vals);
    }

    final Set<Region<?, ?>> regionSet = c.rootRegions();
    for (Region<?, ?> r : regionSet) {
      vals.add(r.getName());
    }

    context.getResultSender().lastResult(vals);
  }
The GetRegions class is an gemfire function that gives data about available regions.
<p>

@since GemFire 8.0
geode-assembly/geode-assembly-test/src/main/java/org/apache/geode/rest/internal/web/controllers/GetRegions.java