protected ResourceInstance createHostResource(String clusterName, String hostName) {
    Map<Resource.Type,String> mapIds = new HashMap<>();
    mapIds.put(Resource.Type.Host, hostName);
    if (clusterName != null) {
      mapIds.put(Resource.Type.Cluster, clusterName);
    }

    return createResource(Resource.Type.Host, mapIds);
  }
Create a service resource instance.

@param clusterName  cluster
@param hostName     host name
@return a host resource instance
ambari-server/src/main/java/org/apache/ambari/server/api/services/HostService.java