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

Examples of com.vmware.bdd.plugin.ambari.api.model.blueprint.ApiBlueprint


      /*
      For cluster resume/resize, the blueprint is already exist, we need to check if this blueprint is created by BDE.
      So far, just check if all goup names and components exist in Ambari Cluster are included in given blueprint
       */
      String clusterName = clusterDef.getName();
      ApiBlueprint apiBlueprint = apiManager.getBlueprint(clusterName);

      Map<String, Set> GroupNamesWithComponents = new HashMap<String, Set>();
      for (AmNodeDef node : clusterDef.getNodes()) {
         Set<String> components = new HashSet<String>();
         GroupNamesWithComponents.put(node.getName(), components);
      }

      for (ApiHostGroup apiHostGroup : apiBlueprint.getApiHostGroups()) {
         String groupName = apiHostGroup.getName();
         if (!GroupNamesWithComponents.containsKey(groupName)) {
            throw AmException.BLUEPRINT_ALREADY_EXIST(clusterName);
         }
         Set<String> components = GroupNamesWithComponents.get(groupName);
View Full Code Here


         throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
      }
      String blueprintJson = handleAmbariResponse(response);
      logger.debug("Response of blueprint from ambari server:");
      logger.debug(blueprintJson);
      ApiBlueprint apiBlueprint =
            ApiUtils.jsonToObject(ApiBlueprint.class, blueprintJson);
      return apiBlueprint;
   }
View Full Code Here

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

      apiBootstrap.setUser(user);
      return apiBootstrap;
   }

   public ApiBlueprint toApiBlueprint() {
      ApiBlueprint apiBlueprint = new ApiBlueprint();

      apiBlueprint.setConfigurations(configurations);

      ApiBlueprintInfo apiBlueprintInfo = new ApiBlueprintInfo();
      apiBlueprintInfo.setStackName(amStack.getName());
      apiBlueprintInfo.setStackVersion(amStack.getVersion());
      apiBlueprint.setApiBlueprintInfo(apiBlueprintInfo);

      List<ApiHostGroup> apiHostGroups = new ArrayList<ApiHostGroup>();
      for (AmNodeDef node : nodes) {
         apiHostGroups.add(node.toApiHostGroupForBlueprint());
      }
      apiBlueprint.setApiHostGroups(apiHostGroups);
      return apiBlueprint;
   }
View Full Code Here

TOP

Related Classes of com.vmware.bdd.plugin.ambari.api.model.blueprint.ApiBlueprint

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.