Examples of ApiHostList


Examples of com.cloudera.api.model.ApiHostList

public class FakeHostsResource implements HostsResourceV2 {

   ApiHostList hosts;

   public FakeHostsResource() {
      hosts = new ApiHostList();
   }
View Full Code Here

Examples of com.cloudera.api.model.ApiHostList

   }

   @Override
   public ApiCommand hostInstallCommand(ApiHostInstallArguments apiHostInstallArguments) {
      System.out.println("calling " + this.getClass().getInterfaces()[0].getName() + "#" + Thread.currentThread().getStackTrace()[1].getMethodName());
      ApiHostList hosts = new ApiHostList();
      for (String ip : apiHostInstallArguments.getHostNames()) {
         ApiHost host = new ApiHost();
         host.setHostId(UUID.randomUUID().toString());
         host.setIpAddress(ip);
         host.setHostname(ip);
         hosts.add(host);
      }
      hostsResourceV2.createHosts(hosts);

      ApiCommand command = new ApiCommand();
      command.setName("installHosts");
View Full Code Here

Examples of com.cloudera.api.model.ApiHostList

   }

   @Test( groups = { "TestClouderaManagerImpl" }, dependsOnMethods = { "testCreateCluster" })
   public void testQueryClusterStatus() {
      blueprint.getHadoopStack().setDistro("CDH-5.0.1");
      ApiHostList hostList = rootResourceV6.getHostsResource().readHosts(DataView.SUMMARY);
      List<ApiHost> hosts = hostList.getHosts();
      hosts.get(0).setHealthSummary(ApiHealthSummary.BAD);
      hosts.get(1).setHealthSummary(ApiHealthSummary.CONCERNING);
      hosts.get(2).setHealthSummary(ApiHealthSummary.GOOD);
      hosts.get(3).setHealthSummary(ApiHealthSummary.NOT_AVAILABLE);
      List<ApiRoleRef> roleRefs = new ArrayList<>();
View Full Code Here

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

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

         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

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

      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

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

                     .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

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

                     .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

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

                     .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
Copyright © 2018 www.massapi.com. 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.