@Override
    public void process(Request request, TreeNode<Resource> resultNode, String href) {
      //todo: look at partial request fields to ensure that hosts should be returned
      if (request.getResource().getResourceDefinition().getType() == getType()) {
        // only add host if query host_resource was directly queried
        String nodeHref = resultNode.getStringProperty("href");
        resultNode.getObject().setProperty(PropertyHelper.getPropertyId("host", "href"),
            nodeHref.substring(0, nodeHref.indexOf("/host_components/")));
      }
    }
Host_Component resource processor which is responsible for generating a host section for host components.
This is called by the ResultPostProcessor during post processing of a result.
ambari-server/src/main/java/org/apache/ambari/server/api/resources/HostComponentResourceDefinition.java