Find file History
Latest commit cf0b653 Feb 10, 2017 @michaelarusso michaelarusso Fixes issue with organization credentials using the same cache key wh…
…en the credentials cache is enabled.
Permalink
..
Failed to load latest commit information.
build-tools Prepare for next iteration of Usergrid (2.2.0) Feb 25, 2016
config Enable Akka for all tests. Nov 20, 2016
core Make Locks keyspace creation more robust ( IF NOT EXISTS sometimes ha… Jan 25, 2017
corepersistence Set default to UniqueValue verification for UG clustering. Jan 23, 2017
java-sdk-old Merge branch 'master' into two-dot-o Jun 9, 2015
launcher Merge remote-tracking branch 'origin/master' into USERGRID-1200 Jan 19, 2016
mongo-emulator Don't cache Optionals or nulls in app id cache. Apr 8, 2016
query-validator Stop using hector for schema deletion in tests and move to the datast… Nov 20, 2016
rest Further test tuning. Nov 20, 2016
scripts De-dup management app as part of migration script and fix re-index so… Nov 3, 2015
services Fixes issue with organization credentials using the same cache key wh… Feb 10, 2017
test-utils Fix more netty dependency exclusions. Nov 21, 2016
tools Temporarily disabling tools tests as it's failing to exit properly ca… Jan 23, 2017
websocket Fix Astyanax locking to be re-entrant as Hector locks were and possib… Jan 14, 2016
.editorconfig added apache header to editor config Jan 12, 2015
.gitignore Rename deployment properties file back to usergrid-deployment.propert… Sep 21, 2014
Coverage.md Correct Jacoco profile command arg Nov 16, 2015
README.md Moving the Java SDK to https://github.com/apache/usergrid-java Sep 2, 2016
cloudbees.xml USERGRID-208 License headers for all XML files Aug 13, 2014
jacoco-pom.xml Fixes to new jacoco profile. Oct 26, 2015
pom.xml Revert "Temporarily disabling tools build from main pom as it's faili… Jan 23, 2017

README.md

Apache Usergrid

A highly-scalable data platform for mobile applications.

Requirements

Building

First, build the Java SDK as the stack uses this as a dependency for some modules:

mvn clean install -DskipTests=true

From the command line, go to the usergrid stack/ directory and type the following:

mvn clean install -DskipTests=true

If you want to run tests you will need to have Cassandra and ElasticSearch running on your computer and on the default ports. The following command will do the build and run all JUnit tests:

mvn clean install

Running

The build process will package the Usergrid Stack into one file stack/rest/target/ROOT.war

To run Usergrid Stack you will need to deploy it to Tomcat. You can find instructions for doing that in the Usergrid Deployment Guide.

Upgrading from Previous Versions

There is currently no upgrade path for a Usergrid 1 database to Usergrid 2.x.

Getting Started with the HTTP API

Start by creating an Organization. It’s the top-level structure in Usergrid: all Apps and Administrators must belong to an Organization. Here’s how you create one:

curl -X POST  \
     -d 'organization=myfirstorg&username=myadmin&name=Admin&email=admin@example.com&password=password' \
     http://localhost:8080/management/organizations

You can see that creating an Organization creates an Administrator in the process. Let’s authenticate as him:

curl 'http://localhost:8080/management/token?grant_type=password&username=myadmin&password=password'

This will return an access_token. We’ll use this to authenticate the next two calls. Next, let’s create an Application:

curl -H "Authorization: Bearer [the management token from above]" \
     -H "Content-Type: application/json" \
     -X POST -d '{ "name":"myapp" }' \
     http://localhost:8080/management/orgs/myfirstorg/apps

… And a User for the Application:

curl -H "Authorization: Bearer [the management token from above]" \
     -X POST "http://localhost:8080/myfirstorg/myapp/users" \
     -d '{ "username":"myuser", "password":"mypassword", "email":"user@example.com" }'

Let’s now generate an access token for this Application User:

curl 'http://localhost:8080/myfirstorg/myapp/token?grant_type=password&username=myuser&password=mypassword'

This will also send back an access_token, but limited in scope. Let’s use it to create a collection with some data in it:

curl -H "Authorization: Bearer [the user token]" \
     -X POST -d '[ { "cat":"fluffy" }, { "fish": { "gold":2, "oscar":1 } } ]' \
     http://localhost:8080/myfirstorg/myapp/pets

Contributing

We welcome all contributions, including via pull requests on GitHub! For more information see How to Contribute Code & Docs.

Licenses

Usergrid is licensed under the Apache License, Version 2.