This is a sample application for integrating with Predix Blobstore. This is built on Spring (Spring Boot, Spring MVC, Spring Data) technology and uses a JCloud Blobstore client (S3 APIs) to connect to the store. The sample app has a simple web interface, that lets you do the following:
- Add a new object (single object or multipart upload available)
- List all objects in the store
- Download an object
- Delete an object
The sample app uses Predix Blobstore to store objects and their metadata.
Note: We recommend jclouds-blobstore version 2.0.0. Other versions are not necessarily supported.
-
Login to Predix.
-
Create an instance of the predix-blobstore service, for example:
cf create-service predix-blobstore <plan> <my_blobstore_instance>. -
Clone the sample project.
git clone http://github.com/PredixDev/blobstore-samples.git -
Change to the object-store sub directory.
cd blobstore-samples/blobstore-jclouds-sample -
Run
mvn clean package -
In the manifest.yml file, enter the name of your blobstore app, update the BROKER_SERVICE_NAME value with your Blobstore instance name, and add your Blobstore instance to the services section.
- name: blobstore-jclouds-sample memory: 512M instances: 1 path: target/blobstore-jclouds-sample-1.0.0-SNAPSHOT.jar timeout: 180 buildpack: java_buildpack env: BROKER_SERVICE_NAME: <my-blobstore-instance> services: - <my-blobstore-instance>
-
From the project's home directory, push the application:
cf push -
View the environment variables for your application:
cf env <application_name> -
Copy and paste the URL that is returned in your environment variables for your application into a browser window.
-
Click Upload to upload your file. You can upload both single object and multipart objects.
NOTE: If you upload an object with the same file name as an existing object, the existing object is replaced by the new object.