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

Examples of com.vmware.bdd.plugin.ambari.api.model.bootstrap.ApiBootstrap


public class FakeBootstrapResource implements BootstrapResource {

   @Override
   public Response createBootstrap(String bootstrap) {
      ApiBootstrap apiBootstrap = ApiUtils.jsonToObject(ApiBootstrap.class, bootstrap);
      if (apiBootstrap.getHosts().size() == 2) {
         return BuildResponse.buildResponse("clusters/simple_hosts_bootstrap.json");
      } else {
         return BuildResponse.buildResponse("clusters/simple_bootstrap.json");
      }
   }
View Full Code Here


            clusterDef.getCurrentReport().setProgress(
                  ProgressSplit.BOOTSTRAP_HOSTS.getProgress());
         }
         reportStatus(clusterDef.getCurrentReport(), reportQueue);

         ApiBootstrap apiBootstrapRequest =
               apiManager.createBootstrap(clusterDef.toApiBootStrap(addedHosts));

         HostBootstrapPoller poller =
               new HostBootstrapPoller(apiManager, apiBootstrapRequest,
                     clusterDef.getCurrentReport(), reportQueue,
                     ProgressSplit.CREATE_BLUEPRINT.getProgress());
         poller.waitForComplete();
         logger.debug("Bootstrap request id: " + apiBootstrapRequest.getRequestId());

         boolean success = false;
         boolean allHostsBootstrapped = true;
         ApiBootstrapStatus apiBootstrapStatus =
               apiManager.getBootstrapStatus(apiBootstrapRequest.getRequestId());
         BootstrapStatus bootstrapStatus =
               BootstrapStatus.valueOf(apiBootstrapStatus.getStatus());
         logger.debug("Bootstrap status " + bootstrapStatus);
         if (!bootstrapStatus.isFailedState()) {
            success = true;
View Full Code Here

         throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
      }
      String bootstrapJson = handleAmbariResponse(response);
      logger.debug("Response of bootstrap creation from ambari server:");
      logger.debug(bootstrapJson);
      ApiBootstrap apiBootstrap =
            ApiUtils.jsonToObject(ApiBootstrap.class, bootstrapJson);
      return apiBootstrap;
   }
View Full Code Here

   public ApiBootstrap toApiBootStrap() {
      return toApiBootStrap(null);
   }

   public ApiBootstrap toApiBootStrap(List<String> hostNames) {
      ApiBootstrap apiBootstrap = new ApiBootstrap();
      apiBootstrap.setVerbose(verbose);
      List<String> hosts = new ArrayList<String>();
      for (AmNodeDef node : getNodes()) {
         if (hostNames == null) {
            hosts.add(node.getFqdn());
         } else if (hostNames.contains(node.getName())) {
            hosts.add(node.getFqdn());
         }
      }
      apiBootstrap.setHosts(hosts);
      apiBootstrap.setSshKey(sshKey);
      apiBootstrap.setUser(user);
      return apiBootstrap;
   }
View Full Code Here

TOP

Related Classes of com.vmware.bdd.plugin.ambari.api.model.bootstrap.ApiBootstrap

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.