private boolean isHostGroupRequest(Request request) {
    boolean isHostGroupRequest = false;
    Set<Map<String, Object>> properties = request.getProperties();
    if (properties != null && ! properties.isEmpty()) {
      //todo: for now, either all or none of the hosts need to specify a hg.  Unable to mix.
      String hgName = (String) properties.iterator().next().get(HOST_GROUP_PROPERTY_ID);
      isHostGroupRequest = hgName != null && ! hgName.isEmpty();
    }
    return isHostGroupRequest;
  }
Determine if a request is a high level "add hosts" call or a simple lower level request
to add a host resources.

@param request  current request
@return true if this is a high level "add hosts" request;
        false if it is a simple create host resources request
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java