andrewmlim commented on a change in pull request #184: NIFIREG-268 Update user guide with upload/download bundle info URL: https://github.com/apache/nifi-registry/pull/184#discussion_r282131496
########## File path: nifi-registry-core/nifi-registry-docs/src/main/asciidoc/user-guide.adoc ########## @@ -363,3 +365,58 @@ image::remove_user_from_group.png["Remove User From Group"] === Other Group Level Actions Editing group names, deleting groups, adding policies to/deleting policies from groups and granting special privileges to groups follow similar procedures described earlier for corresponding user level actions. + +== Manage Bundles + +Bundles can be managed through the REST API. + +=== Upload Bundle + +A bundle can be uploaded to a bucket by making a `POST` request to the following REST end-point: + + /nifi-registry-api/buckets/<bucketId>/bundles/<bundleType> + +Replacing `bucketId` with the id of the bucket where the bundle is being uploaded to, and `bundleType` with the type of bundle being uploaded. Currently the only supported bundle type is a NiFi Archive (NAR) which can be specified as `nifi-nar`. + +The `Content-Type` of the request is expected to be `multipart/form-data`. An example of using `curl` to upload `my-processors-1.0.0.nar` would be the following: + + curl -v -F file=@/path/to/my-processors-1.0.0.nar http://localhost:18080/nifi-registry-api/buckets/de8e08c9-592d-4e10-affe-b3752698f1d9/bundles/nifi-nar + +NOTE: In order to upload a NAR to NiFi Registry, it must contain the file 'META-INF/docs/extension-manifest.xml' which is produced by the NAR Maven plugin, starting with version 1.3.0. + +=== Download Bundle + +There are two ways to download a bundle. + +==== Bundle Coordinates + +A bundle can be downloaded by using the combination of the bucket name and bundle coordinates, where bundle coordinates are the group, artifact, and version of the bundle. + +To download a bundle by it's coordinates, a `GET` request can be made to the following end-point: + + /nifi-registry-api/extension-repository/{bucketName}/{groupId}/{artifactId}/{version}/content + +The `Content-Type` of the response is `application/octet-stream`. + +An example of using `curl` to download `my-processors-1.0.0.nar` from the `Test` bucket would be the following: + + curl http://localhost:18080/nifi-registry-api/extension-repository/Test/com.test/my-processors/1.0.0/content > my-processors-1.0.0.nar + + +==== Bundle Id + +A bundle can be downloaded by using the combination of it's unique id and version. The unique id is an id assigned to the bundle when the first version of the bundle is uploaded to NiFi Registry. This id is returned in the response of a successful upload. + +To download a bundle by it's id and version, a `GET` request can be made to the following end-point: Review comment: Change "it's" to "its". ---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services
