Package com.vmware.bdd.plugin.ambari.api.model.cluster

Examples of com.vmware.bdd.plugin.ambari.api.model.cluster.ApiHostList


      return services;
   }

   @Override
   public ApiHostList getHostsSummaryInfo(String clusterName) {
      ApiHostList apiHostList = new ApiHostList();
      List<ApiHost> apiHosts = new ArrayList<>();
      ApiHost host = new ApiHost();
      ApiHostInfo hostInfo = new ApiHostInfo();
      hostInfo.setHostName("test_host");
      host.setApiHostInfo(hostInfo);
      apiHosts.add(host);
      apiHostList.setApiHosts(apiHosts);
      return apiHostList;
   }
View Full Code Here


         return false;
      }

      // wait for all hosts registration
      int registeredHostsCount = 0;
      ApiHostList apiHostList = apiManager.getRegisteredHosts();
      for ( ApiBootstrapHostStatus apiBootstrapHostStatus : apiBootstrapStatus.getApiBootstrapHostStatus()) {
         for (ApiHost apiHost : apiHostList.getApiHosts()) {
            if (apiHost.getApiHostInfo().getHostName().equals(apiBootstrapHostStatus.getHostName())) {
               registeredHostsCount++;
            }
         }
      }
View Full Code Here

      return serviceList;
   }

   @Override
   public Map<String, ServiceStatus> getHostStatus(String clusterName) throws AmbariApiException {
      ApiHostList hostList = getHostsWithRoleState(clusterName);
      Map<String, ServiceStatus> result = new HashMap<String, ServiceStatus>();

      List<ApiHost> apiHosts = hostList.getApiHosts();
      if (apiHosts != null) {
         for (ApiHost apiHost : apiHosts) {
            String state = apiHost.getApiHostInfo().getState();
            if (ApiHostStatus.HEALTHY.name().equalsIgnoreCase(state)) {
               result.put(apiHost.getApiHostInfo().getHostName(),
View Full Code Here

                     .getHostsResource(clusterName).readHostsWithFilter(fields);
      } catch (Exception e) {
         throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
      }
      String hostsWithState = handleAmbariResponse(response);
      ApiHostList hostList =
            ApiUtils.jsonToObject(ApiHostList.class, hostsWithState);
      return hostList;
   }
View Full Code Here

                     .getHostsResource(clusterName).readHosts();
      } catch (Exception e) {
         throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
      }
      String hostList = handleAmbariResponse(response);
      ApiHostList apiHostList = ApiUtils.jsonToObject(ApiHostList.class, hostList);
      List<String> existingHosts = new ArrayList<>();
      if (apiHostList.getApiHosts() != null) {
         for (ApiHost apiHost : apiHostList.getApiHosts()) {
            if (hostNames.contains(apiHost.getApiHostInfo().getHostName())) {
               existingHosts.add(apiHost.getApiHostInfo().getHostName());
            }
         }
      }
View Full Code Here

                     .getHostsResource(clusterName).readHosts();
      } catch (Exception e) {
         throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
      }
      String hostList = handleAmbariResponse(response);
      ApiHostList apiHostList =
            ApiUtils.jsonToObject(ApiHostList.class, hostList);
      return apiHostList;
   }
View Full Code Here

TOP

Related Classes of com.vmware.bdd.plugin.ambari.api.model.cluster.ApiHostList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.