private Stack parseStack(Resource clusterResource) throws InvalidTopologyTemplateException {
    String[] stackTokens = String.valueOf(clusterResource.getPropertyValue(
        ClusterResourceProvider.CLUSTER_VERSION_PROPERTY_ID)).split("-");

    try {
      return new Stack(stackTokens[0], stackTokens[1], controller);
    } catch (AmbariException e) {
      throw new InvalidTopologyTemplateException(String.format(
          "The specified stack doesn't exist: name=%s version=%s", stackTokens[0], stackTokens[1]));
    }
  }
Request to export a blueprint from an existing cluster.
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExportBlueprintRequest.java