mtien-apache commented on a change in pull request #319: URL: https://github.com/apache/nifi-registry/pull/319#discussion_r631404406
########## File path: nifi-registry-core/nifi-registry-web-ui/src/main/webapp/services/nf-registry.api.js ########## @@ -75,6 +75,137 @@ NfRegistryApi.prototype = { ); }, + /** + * Retrieves the specified versioned flow snapshot for an existing droplet the registry has stored. + * + * @param {string} dropletUri The uri of the droplet to request. + * @param {number} versionNumber The version of the flow to request. + * @returns {*} + */ + exportDropletVersionedSnapshot: function (dropletUri, versionNumber) { + var self = this; + var url = '../nifi-registry-api/' + dropletUri + '/versions/' + versionNumber + '/export'; + var options = { + headers: headers, + observe: 'response' + }; + + return this.http.get(url, options).pipe( + map(function (response) { + // export the VersionedFlowSnapshot by creating a hidden anchor element + var stringSnapshot = encodeURIComponent(JSON.stringify(response.body, null, 2)); Review comment: @exceptionfactory Good catch! I can return a `responseType: 'text'` and omit calling `JSON.stringify()`. The file content will not be in pretty print format but that seems ok to me. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org