Package com.vmware.bdd.software.mgmt.plugin.intf

Examples of com.vmware.bdd.software.mgmt.plugin.intf.SoftwareManager


      appManagerName = CommonUtil.decode(appManagerName);
      if (CommonUtil.isBlank(appManagerName)
            || !CommonUtil.validateResourceName(appManagerName)) {
         throw BddException.INVALID_PARAMETER("appmanager name", appManagerName);
      }
      SoftwareManager softMgr =
            softwareManagerCollector.getSoftwareManager(appManagerName);
      List<HadoopStack> stacks = null;
      try {
         stacks = softMgr.getSupportedStacks();
      } catch (Exception e) {
         // call SoftwareManagerCollector.loadSoftwareManager() to detect connection issue
         logger.error("Failed to get supported stacks from appmaanger "
               + appManagerName, e);
         SoftwareManager softwareManager =
               softwareManagerCollector.getSoftwareManager(appManagerName);
         // if succeed, call getSupportedStacks() again
         try {
            logger.info("Call getSupportedStacks() again.");
            stacks = softwareManager.getSupportedStacks();
         } catch (Exception ex) {
            logger.error("Failed to get supported stacks from appmanager "
                  + appManagerName + " again.", ex);
            throw SoftwareManagerCollectorException.CONNECT_FAILURE(
                  appManagerName, ExceptionUtils.getRootCauseMessage(ex));
View Full Code Here


      appManagerName = CommonUtil.decode(appManagerName);
      if (CommonUtil.isBlank(appManagerName)
            || !CommonUtil.validateResourceName(appManagerName)) {
         throw BddException.INVALID_PARAMETER("appmanager name", appManagerName);
      }
      SoftwareManager softMgr =
            softwareManagerCollector.getSoftwareManager(appManagerName);
      List<HadoopStack> stacks = softMgr.getSupportedStacks();
      HadoopStack hadoopStack = null;
      for (HadoopStack stack : stacks) {
         if (distroName.equals(stack.getDistro())) {
            hadoopStack = stack;
            break;
View Full Code Here

      if (CommonUtil.isBlank(appManagerName)
            || !CommonUtil.validateResourceName(appManagerName)) {
         throw BddException.INVALID_PARAMETER("appmanager name", appManagerName);
      }

      SoftwareManager softMgr =
            softwareManagerCollector.getSoftwareManager(appManagerName);
      List<HadoopStack> stacks = softMgr.getSupportedStacks();
      HadoopStack hadoopStack = null;
      for (HadoopStack stack : stacks) {
         if (distroName.equals(stack.getDistro())) {
            hadoopStack = stack;
            break;
         }
      }
      if (hadoopStack == null) {
         throw BddException.NOT_FOUND("distro", distroName);
      } else {
         return softMgr.getSupportedConfigs(hadoopStack);
      }
   }
View Full Code Here

      appManagerName = CommonUtil.decode(appManagerName);
      if (CommonUtil.isBlank(appManagerName)
            || !CommonUtil.validateResourceName(appManagerName)) {
         throw BddException.INVALID_PARAMETER("appmanager name", appManagerName);
      }
      SoftwareManager softMgr = softwareManagerCollector.getSoftwareManager(appManagerName);
      HadoopStack stack = softMgr.getDefaultStack();
      if (stack == null) {
         return null;
      } else {
         return new DistroRead(stack);
      }
View Full Code Here

      appManagerName = CommonUtil.decode(appManagerName);
      if (CommonUtil.isBlank(appManagerName)
            || !CommonUtil.validateResourceName(appManagerName)) {
         throw BddException.INVALID_PARAMETER("appmanager name", appManagerName);
      }
      SoftwareManager softMgr = softwareManagerCollector.getSoftwareManager(appManagerName);
      HadoopStack stack = clusterMgr.filterDistroFromAppManager(softMgr, distroName);
      if (stack == null) {
         return null;
      } else {
         return new DistroRead(stack);
View Full Code Here

    */
   @RequestMapping(value = "/distros", method = RequestMethod.GET, produces = "application/json")
   @ResponseBody
   public List<DistroRead> getDistros() {
      //TODO handle appmanager case
      SoftwareManager softMgr =
            softwareManagerCollector.getSoftwareManager(Constants.IRONFAN);
      List<HadoopStack> stacks = softMgr.getSupportedStacks();
      List<DistroRead> distros = new ArrayList<DistroRead>(stacks.size());
      for (HadoopStack stack : stacks) {
         distros.add(new DistroRead(stack));
      }
      return distros;
View Full Code Here

            || !CommonUtil.validateDistroName(distroName)) {
         throw BddException.INVALID_PARAMETER("distro name", distroName);
      }

      //TODO handle appmanager case
      SoftwareManager softMgr =
            softwareManagerCollector.getSoftwareManager(Constants.IRONFAN);
      List<HadoopStack> stacks = softMgr.getSupportedStacks();
      for (HadoopStack stack : stacks) {
         if (distroName.equalsIgnoreCase(stack.getDistro())) {
            return new DistroRead(stack);
         }
      }
View Full Code Here

   }

   @RequestMapping(value = "/cluster/{clusterName}/validate", method = RequestMethod.POST, produces = "application/json")
   @ResponseBody
   public ValidateResult validateBlueprint(@RequestBody ClusterCreate createSpec) {
      SoftwareManager softwareManager =
            clusterMgr.getClusterConfigMgr().getSoftwareManager(
                  createSpec.getAppManager());
      ClusterBlueprint blueprint = createSpec.toBlueprint();
      ValidateResult result = new ValidateResult();
      boolean validated = false;
      try {
         validated = softwareManager.validateBlueprint(blueprint);
      } catch (ValidationException ve) {
         result.setFailedMsgList(ve.getFailedMsgList());
         result.setWarningMsgList(ve.getWarningMsgList());
      }
      result.setValidated(validated);
View Full Code Here

      ClusterRead read = clusterEntityMgr.toClusterRead(clusterName, true);

      Map<String, Object> attrs = new HashMap<String, Object>();

      if (Constants.IRONFAN.equalsIgnoreCase(clusterConfig.getAppManager())) {
         SoftwareManager softwareManager = clusterConfigMgr.getSoftwareManager(clusterConfig.getAppManager());
         IronfanStack stack = (IronfanStack)filterDistroFromAppManager(softwareManager, clusterConfig.getDistro());
         CommonClusterExpandPolicy.expandDistro(clusterConfig, stack);
        
         attrs.put("cloud_provider", cloudProvider);
         attrs.put("cluster_definition", clusterConfig);        
View Full Code Here

      }
      return clusters;
   }

   public Long createCluster(ClusterCreate createSpec) throws Exception {
      SoftwareManager softMgr = softwareManagerCollector.getSoftwareManager(createSpec.getAppManager());
      // @ Todo if specify hadoop stack, we can get hadoop stack by stack name. Otherwise, we will get a default hadoop stack.
      HadoopStack stack = clusterConfigMgr.filterDistroFromAppManager(softMgr, createSpec.getDistro());

      // if the distro is not specified by the REST Client, add it.
      if(CommonUtil.isBlank(createSpec.getDistro())) {
         createSpec.setDistro(stack.getDistro());
      }
      createSpec.setDistroVendor(stack.getVendor());
      createSpec.setDistroVersion(stack.getFullVersion());

      // create auto rps if vc cluster/rp is specified
      createAutoRps(createSpec);
      ClusterCreate clusterSpec =
            ClusterSpecFactory.getCustomizedSpec(createSpec, softMgr.getType());
      createSpec.verifyClusterNameLength();
      clusterSpec.validateNodeGroupNames();
      //Check the cpu, memory max configuration according vm hardware version
      if (clusterSpec != null && clusterSpec.getNodeGroups() != null) {
         for (NodeGroupCreate ng : clusterSpec.getNodeGroups()) {
View Full Code Here

TOP

Related Classes of com.vmware.bdd.software.mgmt.plugin.intf.SoftwareManager

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.