private void createBlueprint(Collection<ExportedHostGroup> exportedHostGroups, Stack stack) {
    String bpName = "exported-blueprint";

    Collection<HostGroup> hostGroups = new ArrayList<>();
    for (ExportedHostGroup exportedHostGroup : exportedHostGroups) {

      // create Component using component name
      List<Component> componentList = new ArrayList<>();
      for (String component : exportedHostGroup.getComponents()) {
        componentList.add(new Component(component));
      }

      hostGroups.add(new HostGroupImpl(exportedHostGroup.getName(), bpName, stack, componentList,
          exportedHostGroup.getConfiguration(), String.valueOf(exportedHostGroup.getCardinality())));
    }
    blueprint = new BlueprintImpl(bpName, hostGroups, stack, configuration, null);
  }
Request to export a blueprint from an existing cluster.
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExportBlueprintRequest.java