http://git-wip-us.apache.org/repos/asf/usergrid/blob/73186077/content/docs/assets-and-files/file-storage-configuration.html ---------------------------------------------------------------------- diff --git a/content/docs/assets-and-files/file-storage-configuration.html b/content/docs/assets-and-files/file-storage-configuration.html new file mode 100644 index 0000000..877164b --- /dev/null +++ b/content/docs/assets-and-files/file-storage-configuration.html @@ -0,0 +1,335 @@ + + + + + + + + + + + File storage configuration — Apache Usergrid 1.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +
+
+
+ +
+
+
+
+ +
+

File storage configuration

+

Usergrid can store your assets either on your hard drive or in the +Amazon S3 cloud.

+
+

Local storage configuration

+

By default assets are stored in the temporary folder /tmp/usergrid This +can be changed by editing this file +/stack/rest/src/main/resources/usergrid-rest-context.xml and replacing +{usergrid.temp.files} by the wanted destination

+
<bean id="binaryStore" class="org.apache.usergrid.services.assets.data.LocalFileBinaryStore">
+  <property name="reposLocation" value="${usergrid.temp.files}"/>
+</bean>
+
+
+
+
+

AwS S3 configuration

+

To use your AWS S3 storage you need to change the binaryStore classpath +and add several constructor arguments in +/stack/rest/src/main/resources/usergrid-rest-context.xml

+

Some examples :

+
<bean id="binaryStore" class="org.apache.usergrid.services.assets.data.AwsSdkS3BinaryStore">
+  <constructor-arg name="accessId" value="x" />
+  <constructor-arg name="secretKey" value="xx" />
+  <constructor-arg name="bucketName" value="x" />
+  <constructor-arg name="regionName" value="eu-central-1" />
+</bean>
+
+
+

the regionName field is not mandatory, this code is also valid

+
<bean id="binaryStore" class="org.apache.usergrid.services.assets.data.AwsSdkS3BinaryStore">
+  <constructor-arg name="accessId" value="x" />
+  <constructor-arg name="secretKey" value="xx" />
+  <constructor-arg name="bucketName" value="x" />
+</bean>
+
+
+

The filesize is limited to 50GB but you need to keep in mind that the +file has to be stored on the hard drive before being sended to Amazon.

+
+
+ + +
+
+ + +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/usergrid/blob/73186077/content/docs/assets-and-files/folders.html ---------------------------------------------------------------------- diff --git a/content/docs/assets-and-files/folders.html b/content/docs/assets-and-files/folders.html new file mode 100644 index 0000000..616413c --- /dev/null +++ b/content/docs/assets-and-files/folders.html @@ -0,0 +1,404 @@ + + + + + + + + + + + Folders — Apache Usergrid 1.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +
+
+
+ +
+
+
+
+ +
+

Folders

+
+

Linking a folder to an asset

+

In order to access the asset for the image in the folder, you need to +link the folder to the asset. You can do that by issuing a POST request +in the following format:

+
POST /{org-uuid}/{app-uuid}/folders/{folder-uuid}/assets/{assets_id}
+
+
+

where {folder-uuid} is the UUID of the folder, and {assets-uuid} +is the UUID of the assets entity.

+

Here’s how you could link the folder and the asset you created for the +my-image.jpg image:

+
POST https://api.usergrid.com/my-org/my-app/folders/6640a601-2ac6-11e2-92c3-02e81ae640dc/assets/9501cda1-2d21-11e2-b4c6-02e81ac5a17b
+
+
+

In the response, you should see the assets entity for the image added to +the folder:

+
{
+  "action": "post",
+  "application": "3400ba10-cd0c-11e1-bcf7-12313d1c4491",
+  "params": {},
+  "path": "/folders/6640a601-2ac6-11e2-92c3-02e81ae640dc/assets",
+  "uri": "https://api.usergrid.com/my-org/my-app/folders/6640a601-2ac6-11e2-92c3-02e81ae640dc/assets",
+  "entities": [
+    {
+      "uuid": "9501cda1-2d21-11e2-b4c6-02e81ac5a17b",
+      "type": "asset",
+      "name": "my-image.jpg",
+      "created": 1352763303163,
+      "modified": 1352763303163,
+      "metadata": {
+        "path": "/folders/6640a601-2ac6-11e2-92c3-02e81ae640dc/assets/9501cda1-2d21-11e2-b4c6-02e81ac5a17b"
+      },
+      "owner": "5c0c1789-d503-11e1-b36a-12313b01d5c1",
+      "path": "/myassets/asset1"
+    }
+  ],
+  "timestamp": 1352830448045,
+  "duration": 54,
+  "organization": "my-org”,
+  "applicationName": "my-app"
+}
+
+
+
+
+

Retrieve list of folder assets

+

You can also request a list of the linked contents of the folder like +this:

+
GET https://api.usergrid.com/my-org/my-app/folders/6640a601-2ac6-11e2-92c3-02e81ae640dc/assets
+
+
+

The response should look something like this:

+
{
+  "action": "get",
+  "application": "3400ba10-cd0c-11e1-bcf7-12313d1c4491",
+  "params": {
+    "_": [
+      "1352830364891"
+    ]
+  },
+  "path": "/folders/6640a601-2ac6-11e2-92c3-02e81ae640dc/assets",
+  "uri": "https://api.usergrid.com/my-org/my-app/folders/6640a601-2ac6-11e2-92c3-02e81ae640dc/assets",
+  "entities": [
+    {
+      "uuid": "7bf47435-2ac8-11e2-b4c6-02e81ac5a17b",
+      "type": "asset",
+      "name": "my-image.jpg",
+      "created": 1352505133598,
+      "modified": 1352507245108,
+      "checksum": "8e0cd3866ee20746c99e9a9825f38ad8",
+      "content-length": 11853,
+      "content-type": "image/jpeg",
+      "etag": "\"8e0cd3866ee20746c99e9a9825f38ad8\"",
+      "metadata": {
+        "connecting": {
+          "assets": "/folders/6640a601-2ac6-11e2-92c3-02e81ae640dc/assets/7bf47435-2ac8-11e2-b4c6-02e81ac5a17b/connecting/assets"
+        },
+        "connection": "assets",
+        "path": "/folders/6640a601-2ac6-11e2-92c3-02e81ae640dc/assets/7bf47435-2ac8-11e2-b4c6-02e81ac5a17b"
+      },
+      "owner": "5c0c1789-d503-11e1-b36a-12313b01d5c1",
+      "path": "my-image"
+    }
+  ],
+  "timestamp": 1352830363797,
+  "duration": 57,
+  "organization": "my-org",
+  "applicationName": "my-app"
+}
+
+
+
+
+ + +
+
+ + +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/usergrid/blob/73186077/content/docs/assets-and-files/legacy-asset-support.html ---------------------------------------------------------------------- diff --git a/content/docs/assets-and-files/legacy-asset-support.html b/content/docs/assets-and-files/legacy-asset-support.html new file mode 100644 index 0000000..7085315 --- /dev/null +++ b/content/docs/assets-and-files/legacy-asset-support.html @@ -0,0 +1,293 @@ + + + + + + + + + + + <no title> — Apache Usergrid 1.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +
+
+
+ +
+
+
+
+ + + +
+
+ + +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/usergrid/blob/73186077/content/docs/assets-and-files/retrieving-assets.html ---------------------------------------------------------------------- diff --git a/content/docs/assets-and-files/retrieving-assets.html b/content/docs/assets-and-files/retrieving-assets.html new file mode 100644 index 0000000..2cb0706 --- /dev/null +++ b/content/docs/assets-and-files/retrieving-assets.html @@ -0,0 +1,372 @@ + + + + + + + + + + + Retrieving assets — Apache Usergrid 1.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +
+
+
+ +
+
+
+
+ +
+

Retrieving assets

+
+

Retrieving asset data

+

To retrieve the asset from an entity, send a GET request with the +Accept header set to the content type of the asset. The content type +can be retrieved from the file-metadata.content-type property of the +entity the asset is attached to.

+
+

Request syntax

+
curl -X GET -H 'Accept: <content_type>' 'https://api.usergrid.com/<org>/<app>/<collection>/<entity>
+
+
+

Parameters

+ ++++ + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
content_typeThe content type of the attached asset. For example, text/plain, image/jpeg.
org OrganizationUUID or organization name
app ApplicationUUID or application name
collectionName or UUID of the collection of the entity the asset is attached to.
entityName or UUID of the entity the asset is attached to.
+
+
+

Example request

+

The following request will retrieve the data for a jpeg file attached to +an entity named ‘cloud’ in the ‘pictures’ collection:

+
curl -X GET -H 'Accept: image/jpeg' 'https://api.usergrid.com/your-org/your-app/pictures/cloud
+
+
+
+
+
+

Retrieving an asset entity

+

To retrieve the entity that an asset is attached to, perform a GET +request as you normally would to retrieve an entity. For more +information, see Retrieving Data +Entities.

+
+
+ + +
+
+ + +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file