You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sn...@apache.org on 2015/08/17 20:14:40 UTC
[2/5] incubator-usergrid git commit: Fixes and improvements to
Usergrid Swagger file and HTML generation. Specifically: - Add
cross-references for 1) which API paths reference each definition and 2)
which models reference each model. - Add descriptions f
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2707dbf4/docs/rest-endpoints/api-docs.md
----------------------------------------------------------------------
diff --git a/docs/rest-endpoints/api-docs.md b/docs/rest-endpoints/api-docs.md
index 51f1909..a21be09 100644
--- a/docs/rest-endpoints/api-docs.md
+++ b/docs/rest-endpoints/api-docs.md
@@ -4,15 +4,16 @@ Methods are organized by tag. Follow the methods are the [Model Definitions](#mo
<h2>Table of Contents</h2>
-* [Access-Tokens](#access-tokens)
-* [Activities](#activities)
-* [Admin-Users](#admin-users)
-* [App-Users](#app-users)
-* [Entities-Collections](#entities-collections)
-* [Events](#events)
-* [Groups](#groups)
-* [Organizations-Applications](#organizations-applications)
-* [Permissions-Roles](#permissions-roles)
+* [Access-Tokens](#Access-Tokens)
+* [Activities](#Activities)
+* [Admin-Users](#Admin-Users)
+* [App-Users](#App-Users)
+* [Entities-Collections](#Entities-Collections)
+* [Events](#Events)
+* [Groups](#Groups)
+* [Notifications](#Notifications)
+* [Organizations-Applications](#Organizations-Applications)
+* [Permissions-Roles](#Permissions-Roles)
<br>
<br>
@@ -30,7 +31,7 @@ Login with Admin-User or Organization credentials.
<h3>Parameters</h3>
-* __login-credentials__ ([LoginCredentials](#logincredentials))
+* __login-credentials__ ([LoginCredentials](#LoginCredentials))
Login credentials either username/password or id/secret. (Specified in body).
<h3>Responses</h3>
@@ -38,12 +39,12 @@ Login credentials either username/password or id/secret. (Specified in body).
__200__
* Description: Object containing access_token.
-* Schema: [AccessTokenReponse](#accesstokenreponse)
+* Schema: [AccessTokenResponse](#AccessTokenResponse)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-POST-heading">POST /{orgId}/{appId}/token</h2>
@@ -52,20 +53,20 @@ Login with App-User or Application credentials.
<h3>Parameters</h3>
-* __login-credentials__ ([LoginCredentials](#logincredentials))
+* __login-credentials__ ([LoginCredentials](#LoginCredentials))
Login credentials either username/password or id/secret. (Specified in body).
<h3>Responses</h3>
__200__
-* Description: An array of new created Admin user's info.
-* Schema: [AccessTokenReponse](#accesstokenreponse)
+* Description: Object containing access_token.
+* Schema: [AccessTokenResponse](#AccessTokenResponse)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
### Activities
@@ -89,12 +90,12 @@ One of the group's identification which includes name or uuid. (Specified in
__200__
* Description: An array of group's activity.
-* Schema: [ActivityFeed](#activityfeed)
+* Schema: [ActivityFeed](#ActivityFeed)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-POST-heading">POST /{orgId}/{appId}/users/{userId}/activities</h2>
@@ -109,7 +110,7 @@ One of the organization's identification which includes name or uuid. (Speci
One of the application's identification which includes name or uuid. (Specified in path).
* __userId-3__ (string)
One of the user's identification which includes username or UUID. (Specified in path).
-* __CreateActivity__ ([CreateActivity](#createactivity))
+* __CreateActivity__ ([CreateActivity](#CreateActivity))
One or more sets of activity properties. (Specified in body).
<h3>Responses</h3>
@@ -117,12 +118,12 @@ One or more sets of activity properties. (Specified in body).
__200__
* Description: An array of user's activity.
-* Schema: [ActivityFeed](#activityfeed)
+* Schema: [ActivityFeed](#ActivityFeed)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-GET-heading">GET /{orgId}/{appId}/users/{userId}/feed</h2>
@@ -143,12 +144,12 @@ One of the user's identification which includes username or UUID. (Specified
__200__
* Description: An array of user's activity feed.
-* Schema: [ActivityFeed](#activityfeed)
+* Schema: [ActivityFeed](#ActivityFeed)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
### Admin-Users
@@ -168,12 +169,12 @@ One of the organization's identification which includes name or uuid. (Speci
__200__
* Description: An array of retrieved Admin user's info.
-* Schema: [User](#user)
+* Schema: [User](#User)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-DELETE-heading">DELETE /management/orgs/{orgId}/users/{userId}</h2>
@@ -192,12 +193,12 @@ One of the user's identification which includes username, email address or U
__200__
* Description: An array of deleted Admin user's info.
-* Schema: [User](#user)
+* Schema: [User](#User)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-POST-heading">POST /management/users</h2>
@@ -206,20 +207,20 @@ Create a whole new admin user.
<h3>Parameters</h3>
-* __adminuserproperty__ ([CreateAdminUser](#createadminuser))
-One or more sets of user properties of which username is mandatory and must be unique. (Specified in body).
+* __CreateAdminUser__ ([CreateAdminUser](#CreateAdminUser))
+User entity with fields required for User creation. (Specified in body).
<h3>Responses</h3>
__200__
-* Description: An array of new created Admin user's info.
-* Schema: [User](#user)
+* Description: An API Response with a entities array containing the newly created Admin User.
+* Schema: [User](#User)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-GET-heading">GET /management/users/resetpw</h2>
@@ -234,12 +235,12 @@ Initiate the reset of an admin user's password.
__200__
* Description: An array of complete messages.
-* Schema: [Action](#action)
+* Schema: [Action](#Action)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-POST-heading">POST /management/users/resetpw</h2>
@@ -248,7 +249,7 @@ Complete the password reset through getting the newpassword and the old one for
<h3>Parameters</h3>
-* __ResetPWMsg__ ([ResetPWMsg](#resetpwmsg))
+* __ResetPWMsg__ ([ResetPWMsg](#ResetPWMsg))
Parameters and value for the Captcha challenge, the admin user's response to the Captcha challenge, and the admin user's email address. (Specified in body).
<h3>Responses</h3>
@@ -256,12 +257,12 @@ Parameters and value for the Captcha challenge, the admin user's response to
__200__
* Description: An array of complete messages.
-* Schema: [Action](#action)
+* Schema: [](#)
__default__
-* Description: Unexpected error.
-* Schema: [Error](#error)
+* Description:
+* Schema: [Error](#Error)
<h2 class="usergrid-GET-heading">GET /management/users/{userId}</h2>
@@ -277,13 +278,13 @@ One of the user's identification which includes username, real name, email a
__200__
-* Description: An array of user's details
-* Schema: [User](#user)
+* Description: An API Response with a entities array containing the Admin User.
+* Schema: [User](#User)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-PUT-heading">PUT /management/users/{userId}</h2>
@@ -299,13 +300,13 @@ One of the user's identification which includes username, real name, email a
__200__
-* Description: An array of user's details.
-* Schema: [User](#user)
+* Description: An API Response with a entities array containing the updated Admin User
+* Schema: [User](#User)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-GET-heading">GET /management/users/{userId}/activate</h2>
@@ -326,12 +327,12 @@ Query statement of whether send confimation email or not. (Specified in query).
__200__
* Description: An array of complete messages.
-* Schema: [Action](#action)
+* Schema: [Action](#Action)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-PUT-heading">PUT /management/users/{userId}/password</h2>
@@ -342,7 +343,7 @@ Update an admin user's password through getting the newpassword and the old
* __userId__ (string)
One of the user's identification which includes username, real name, email address or UUID. (Specified in path).
-* __ResetPW__ ([ResetPW](#resetpw))
+* __ResetPW__ ([ResetPW](#ResetPW))
The user's old and new password. (Specified in body).
<h3>Responses</h3>
@@ -350,12 +351,12 @@ The user's old and new password. (Specified in body).
__200__
* Description: An array of complete messages.
-* Schema: [Action](#action)
+* Schema: [Action](#Action)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-GET-heading">GET /management/users/{userId}/reactivate</h2>
@@ -372,12 +373,12 @@ One of the user's identification which includes username, real name, email a
__200__
* Description: An array of complete messages.
-* Schema: [Action](#action)
+* Schema: [Action](#Action)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
### App-Users
@@ -401,12 +402,12 @@ The query statement of the User. (Specified in query).
__200__
* Description: An array of retrieved user's info.
-* Schema: [User](#user)
+* Schema: [User](#User)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-POST-heading">POST /{orgId}/{appId}/users</h2>
@@ -419,7 +420,7 @@ Create a user in the users collection through providing all the identifications.
One of the organization's identification which includes name or uuid. (Specified in path).
* __appId__ (string)
One of the application's identification which includes name or uuid. (Specified in path).
-* __CreateUser__ ([CreateUser](#createuser))
+* __CreateUser__ ([CreateUser](#CreateUser))
The properties of the user. (Specified in body).
<h3>Responses</h3>
@@ -427,12 +428,12 @@ The properties of the user. (Specified in body).
__200__
* Description: An array of created user's info.
-* Schema: [User](#user)
+* Schema: [User](#User)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-GET-heading">GET /{orgId}/{appId}/users/{userId}</h2>
@@ -453,12 +454,12 @@ One of the user's identification which includes username, email address or U
__200__
* Description: An array of retrieved user's info.
-* Schema: [User](#user)
+* Schema: [User](#User)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-PUT-heading">PUT /{orgId}/{appId}/users/{userId}</h2>
@@ -479,12 +480,12 @@ One of the user's identification which includes username or UUID. (Specified
__200__
* Description: An array of updated user's info.
-* Schema: [User](#user)
+* Schema: [User](#User)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-DELETE-heading">DELETE /{orgId}/{appId}/users/{userId}</h2>
@@ -505,12 +506,12 @@ One of the user's identification which includes username or UUID. (Specified
__200__
* Description: An array of deleted user's info.
-* Schema: [User](#user)
+* Schema: [User](#User)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-POST-heading">POST /{orgId}/{appId}/users/{user}/password</h2>
@@ -525,7 +526,7 @@ One of the organization's identification which includes name or uuid. (Speci
One of the application's identification which includes name or uuid. (Specified in path).
* __username__ (string)
The username of the user. (Specified in path).
-* __ResetPW__ ([ResetPW](#resetpw))
+* __ResetPW__ ([ResetPW](#ResetPW))
The user's old and new password. (Specified in body).
<h3>Responses</h3>
@@ -533,12 +534,12 @@ The user's old and new password. (Specified in body).
__200__
* Description: An array of complete messages.
-* Schema: [Action](#action)
+* Schema: [Action](#Action)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
### Entities-Collections
@@ -566,12 +567,12 @@ The query statement of the user. (Specified in query).
__200__
* Description: An array of user's collections info.
-* Schema: [Entity](#entity)
+* Schema: [Entity](#Entity)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-GET-heading">GET /{orgId}/{appId}/{collectionId}</h2>
@@ -594,12 +595,12 @@ Any values specified in the query statement should be enclosed in single-quotes.
__200__
* Description: An array of retrieved collection's info.
-* Schema: [Entity](#entity)
+* Schema: [Entity](#Entity)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-PUT-heading">PUT /{orgId}/{appId}/{collectionId}</h2>
@@ -622,12 +623,12 @@ Any values specified in the query statement should be enclosed in single-quotes.
__200__
* Description: An array of updated collection's info.
-* Schema: [Entity](#entity)
+* Schema: [Entity](#Entity)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-POST-heading">POST /{orgId}/{appId}/{collectionId}/{entityId1}/{relation}/{entityId2}</h2>
@@ -654,12 +655,12 @@ The Id of the 2nd entity. (Specified in path).
__200__
* Description: An array of added entity's info.
-* Schema: [Entity](#entity)
+* Schema: [Entity](#Entity)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-DELETE-heading">DELETE /{orgId}/{appId}/{collectionId}/{entityId1}/{relation}/{entityId2}</h2>
@@ -686,12 +687,12 @@ The Id of the 2nd entity. (Specified in path).
__200__
* Description: An array of deleted entity's info.
-* Schema: [Entity](#entity)
+* Schema: [Entity](#Entity)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-GET-heading">GET /{orgId}/{appId}/{collectionId}/{entityId}</h2>
@@ -714,12 +715,12 @@ One of the entity's identification which includes name or uuid. (Specified i
__200__
* Description: An array of retrieved entity's info.
-* Schema: [Entity](#entity)
+* Schema: [Entity](#Entity)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-PUT-heading">PUT /{orgId}/{appId}/{collectionId}/{entityId}</h2>
@@ -736,7 +737,7 @@ One of the application's identification which includes name or uuid. (Specif
One of the collection's identification which includes name or uuid. (Specified in path).
* __entityId__ (string)
One of the entity's identification which includes name or uuid. (Specified in path).
-* __entityproperty__ ([CreateEntities](#createentities))
+* __entityproperty__ ([CreateEntities](#CreateEntities))
The properties of the entity. (Specified in body).
<h3>Responses</h3>
@@ -744,12 +745,12 @@ The properties of the entity. (Specified in body).
__200__
* Description: An array of updated entity's info.
-* Schema: [Entity](#entity)
+* Schema: [Entity](#Entity)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-DELETE-heading">DELETE /{orgId}/{appId}/{collectionId}/{entityId}</h2>
@@ -772,17 +773,17 @@ One of the entity's identification which includes name or uuid. (Specified i
__200__
* Description: An array of deleted entity's info.
-* Schema: [Entity](#entity)
+* Schema: [Entity](#Entity)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-POST-heading">POST /{orgId}/{appId}/{entitytype}</h2>
-When a new entity is created, Usergrid will automatically create a corresponding collection if one does not already exist. The collection will automatically be named with the plural form of the entity type.
+When a new entity is created, Usergrid will automatically create a corresponding collection if one does not already exist. The collection will automatically be named with the plural form of the entity type.
<h3>Parameters</h3>
@@ -792,7 +793,7 @@ One of the organization's identification which includes name or uuid. (Speci
One of the application's identification which includes name or uuid. (Specified in path).
* __entitytype__ (string)
The entity type to create. (Specified in path).
-* __entityproperty__ ([CreateEntities](#createentities))
+* __entityproperty__ ([CreateEntities](#CreateEntities))
The properties of the entity. (Specified in body).
<h3>Responses</h3>
@@ -800,12 +801,12 @@ The properties of the entity. (Specified in body).
__200__
* Description: An array of created custom entity's info.
-* Schema: [Entity](#entity)
+* Schema: [Entity](#Entity)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
### Events
@@ -821,7 +822,7 @@ Create an event through providing both Id of organization and application.
One of the organization's identification which includes name or uuid. (Specified in path).
* __appId__ (string)
One of the application's identification which includes name or uuid. (Specified in path).
-* __CreateEvent__ ([CreateEvent](#createevent))
+* __CreateEvent__ ([CreateEvent](#CreateEvent))
The required property of the event. (Specified in body).
<h3>Responses</h3>
@@ -829,12 +830,12 @@ The required property of the event. (Specified in body).
__200__
* Description: An array of created event's info.
-* Schema: [Event](#event)
+* Schema: [Event](#Event)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
### Groups
@@ -850,7 +851,7 @@ Create a new group through providing both Id of organization and application.
One of the organization's identification which includes name or uuid. (Specified in path).
* __appId__ (string)
One of the application's identification which includes name or uuid. (Specified in path).
-* __groupproperty__ ([CreateGroup](#creategroup))
+* __groupproperty__ ([CreateGroup](#CreateGroup))
The property of the created group. (Specified in body).
<h3>Responses</h3>
@@ -858,12 +859,12 @@ The property of the created group. (Specified in body).
__200__
* Description: An array of created group's info.
-* Schema: [Group](#group)
+* Schema: [Group](#Group)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-POST-heading">POST /{orgId}/{appId}/groups/{groupId}/activities</h2>
@@ -878,20 +879,20 @@ One of the organization's identification which includes name or uuid. (Speci
One of the application's identification which includes name or uuid. (Specified in path).
* __groupId__ (string)
One of the group's identification which includes name or uuid. (Specified in path).
-* __CreateActivity__ ([CreateActivity](#createactivity))
+* __CreateActivity__ ([CreateActivity](#CreateActivity))
One or more sets of activity properties. (Specified in body).
<h3>Responses</h3>
__200__
-* Description: An array of user's activity.
-* Schema: [ActivityFeed](#activityfeed)
+* Description:
+* Schema: [ActivityFeed](#ActivityFeed)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-POST-heading">POST /{orgId}/{appId}/groups/{groupId}/users/{userId}</h2>
@@ -914,12 +915,12 @@ One of the user's identification which includes username or UUID. (Specified
__200__
* Description: An array of added user's info.
-* Schema: [User](#user)
+* Schema: [User](#User)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-DELETE-heading">DELETE /{orgId}/{appId}/groups/{groupId}/users/{userId}</h2>
@@ -942,12 +943,12 @@ One of the user's identification which includes username or UUID. (Specified
__200__
* Description: An array of deleted user's info.
-* Schema: [User](#user)
+* Schema: [User](#User)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-GET-heading">GET /{org_Id}/{app_Id}/groups/{groupId}</h2>
@@ -968,12 +969,12 @@ One of the group's identification which includes name or uuid. (Specified in
__200__
* Description: An array of retrieved group's info.
-* Schema: [Group](#group)
+* Schema: [Group](#Group)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-PUT-heading">PUT /{org_Id}/{app_Id}/groups/{groupId}</h2>
@@ -994,12 +995,359 @@ One of the group's identification which includes name or uuid. (Specified in
__200__
* Description: An array of updated group's info.
-* Schema: [Group](#group)
+* Schema: [Group](#Group)
+
+__default__
+
+* Description: Unexpected error.
+* Schema: [Error](#Error)
+
+
+### Notifications
+
+
+<h2 class="usergrid-POST-heading">POST /{orgId}/{applicationId}/devices</h2>
+
+Create notifications for user through targeting by location and providing all the identifications.
+
+<h3>Parameters</h3>
+
+* __orgId__ (string)
+One of the organization's identification which includes name or uuid. (Specified in path).
+* __applicationId__ (string)
+One of the application's identification which includes name or uuid (same as appId). (Specified in path).
+* __notification__ ([CreateNotifications](#CreateNotifications))
+These parameters are used when forming the notification portion of the request. (Specified in body).
+* __queryStatement__ (string)
+The query statement of the location of the user. (Specified in query).
+
+<h3>Responses</h3>
+
+__200__
+
+* Description: An array of created notification's info.
+* Schema: [Notification](#Notification)
+
+__default__
+
+* Description: Unexpected error.
+* Schema: [Error](#Error)
+
+
+<h2 class="usergrid-POST-heading">POST /{orgId}/{applicationId}/devices/*/notifications</h2>
+
+Create notifications for all devices. This request will target all device entities.
+
+<h3>Parameters</h3>
+
+* __orgId__ (string)
+One of the organization's identification which includes name or uuid. (Specified in path).
+* __applicationId__ (string)
+One of the application's identification which includes name or uuid (same as appId). (Specified in path).
+* __notification__ ([CreateNotifications](#CreateNotifications))
+These parameters are used when forming the notification portion of the request. (Specified in body).
+
+<h3>Responses</h3>
+
+__200__
+
+* Description: An array of created notification's info.
+* Schema: [Notification](#Notification)
+
+__default__
+
+* Description: Unexpected error.
+* Schema: [Error](#Error)
+
+
+<h2 class="usergrid-POST-heading">POST /{orgId}/{applicationId}/devices/{deviceId}/notifications</h2>
+
+Create notifications for a single device. This request will target a specific device entity.
+
+<h3>Parameters</h3>
+
+* __orgId__ (string)
+One of the organization's identification which includes name or uuid. (Specified in path).
+* __applicationId__ (string)
+One of the application's identification which includes name or uuid (same as appId). (Specified in path).
+* __deviceId__ (string)
+One of the device's identification which includes name or uuid. (Specified in path).
+* __notification__ ([CreateNotifications](#CreateNotifications))
+These parameters are used when forming the notification portion of the request. (Specified in body).
+
+<h3>Responses</h3>
+
+__200__
+
+* Description: An array of created notification's info.
+* Schema: [Notification](#Notification)
+
+__default__
+
+* Description: Unexpected error.
+* Schema: [Error](#Error)
+
+
+<h2 class="usergrid-POST-heading">POST /{orgId}/{applicationId}/groups/{path}/notifications</h2>
+
+Create notifications for a group. This request will target all users associated with a specific group entity.
+
+<h3>Parameters</h3>
+
+* __orgId__ (string)
+One of the organization's identification which includes name or uuid. (Specified in path).
+* __appId__ (string)
+One of the application's identification which includes name or uuid. (Specified in path).
+* __path__ (string)
+The path of the group. (Specified in path).
+* __notification__ ([CreateNotifications](#CreateNotifications))
+These parameters are used when forming the notification portion of the request. (Specified in body).
+
+<h3>Responses</h3>
+
+__200__
+
+* Description: An array of created notification's info.
+* Schema: [Notification](#Notification)
+
+__default__
+
+* Description: Unexpected error.
+* Schema: [Error](#Error)
+
+
+<h2 class="usergrid-GET-heading">GET /{orgId}/{applicationId}/notifications</h2>
+
+Retrieve one or more notifications through providing all the identifications.
+
+<h3>Parameters</h3>
+
+* __orgId__ (string)
+One of the organization's identification which includes name or uuid. (Specified in path).
+* __applicationId__ (string)
+One of the application's identification which includes name or uuid (same as appId). (Specified in path).
+
+<h3>Responses</h3>
+
+__200__
+
+* Description: An array of retrieved notification's info.
+* Schema: [Notification](#Notification)
+
+__default__
+
+* Description: Unexpected error.
+* Schema: [Error](#Error)
+
+
+<h2 class="usergrid-PUT-heading">PUT /{orgId}/{applicationId}/notifications/{notificationId}</h2>
+
+Update a Notification in order to cancel the notifcation or set a new expiration time.
+
+<h3>Parameters</h3>
+
+* __orgId__ (string)
+One of the organization's identification which includes name or uuid. (Specified in path).
+* __applicationId__ (string)
+One of the application's identification which includes name or uuid (same as appId). (Specified in path).
+* __notificationId__ (string)
+One of the notification's identification which includes name or uuid. (Specified in path).
+* __notificationUpdate__ ([NotificationUpdate](#NotificationUpdate))
+Object with Notification fields to be updated. (Specified in body).
+
+<h3>Responses</h3>
+
+__200__
+
+* Description: An API Response object containing an entity of type Notification.
+* Schema: [Notification](#Notification)
+
+__default__
+
+* Description: Unexpected error.
+* Schema: [Error](#Error)
+
+
+<h2 class="usergrid-DELETE-heading">DELETE /{orgId}/{applicationId}/notifications/{notificationId}</h2>
+
+Delete an unsent Notification from the system.
+
+<h3>Parameters</h3>
+
+* __orgId__ (string)
+One of the organization's identification which includes name or uuid. (Specified in path).
+* __applicationId__ (string)
+One of the application's identification which includes name or uuid (same as appId). (Specified in path).
+* __notificationId__ (string)
+One of the notification's identification which includes name or uuid. (Specified in path).
+
+<h3>Responses</h3>
+
+__200__
+
+* Description: API Response containing Notification entity that was deleted.
+* Schema: [Notification](#Notification)
+
+__default__
+
+* Description: Unexpected error.
+* Schema: [Error](#Error)
+
+
+<h2 class="usergrid-GET-heading">GET /{orgId}/{applicationId}/receipts</h2>
+
+Retrieve one or more receipts through providing all the identifications.
+
+<h3>Parameters</h3>
+
+* __orgId__ (string)
+One of the organization's identification which includes name or uuid. (Specified in path).
+* __applicationId__ (string)
+One of the application's identification which includes name or uuid (same as appId). (Specified in path).
+
+<h3>Responses</h3>
+
+__200__
+
+* Description: An array of retrieved receipt's info.
+* Schema: [Receipt](#Receipt)
+
+__default__
+
+* Description: Unexpected error.
+* Schema: [Error](#Error)
+
+
+<h2 class="usergrid-POST-heading">POST /{orgId}/{applicationId}/users/{userId}/notifications</h2>
+
+Create notifications for a user. This request will target a specific user entity.
+
+<h3>Parameters</h3>
+
+* __orgId__ (string)
+One of the organization's identification which includes name or uuid. (Specified in path).
+* __applicationId__ (string)
+One of the application's identification which includes name or uuid (same as appId). (Specified in path).
+* __userId-3__ (string)
+One of the user's identification which includes username or UUID. (Specified in path).
+* __notification__ ([CreateNotifications](#CreateNotifications))
+These parameters are used when forming the notification portion of the request. (Specified in body).
+
+<h3>Responses</h3>
+
+__200__
+
+* Description: An array of created notification's info.
+* Schema: [Notification](#Notification)
+
+__default__
+
+* Description: Unexpected error.
+* Schema: [Error](#Error)
+
+
+<h2 class="usergrid-GET-heading">GET /{orgId}/{applicationId}/{deviceId}/*/receipts</h2>
+
+Retrieve receipts associated with one or more devices through providing all the identifications.
+
+<h3>Parameters</h3>
+
+* __orgId__ (string)
+One of the organization's identification which includes name or uuid. (Specified in path).
+* __applicationId__ (string)
+One of the application's identification which includes name or uuid (same as appId). (Specified in path).
+* __deviceId__ (string)
+One of the device's identification which includes name or uuid. (Specified in path).
+
+<h3>Responses</h3>
+
+__200__
+
+* Description: An array of retrieved receipt's info.
+* Schema: [Receipt](#Receipt)
+
+__default__
+
+* Description: Unexpected error.
+* Schema: [Error](#Error)
+
+
+<h2 class="usergrid-GET-heading">GET /{orgId}/{applicationId}/{notificationId}/*/queue</h2>
+
+Retrieve the list of devices associated with one or more notifications before the notifications are sent through providing all the identifications.
+
+<h3>Parameters</h3>
+
+* __orgId__ (string)
+One of the organization's identification which includes name or uuid. (Specified in path).
+* __applicationId__ (string)
+One of the application's identification which includes name or uuid (same as appId). (Specified in path).
+* __notificationId__ (string)
+One of the notification's identification which includes name or uuid. (Specified in path).
+
+<h3>Responses</h3>
+
+__200__
+
+* Description: An array of retrieved device's info.
+* Schema: [Device](#Device)
+
+__default__
+
+* Description: Unexpected error.
+* Schema: [Error](#Error)
+
+
+<h2 class="usergrid-GET-heading">GET /{orgId}/{applicationId}/{notificationId}/*/receipts</h2>
+
+Retrieve receipts for one or more notifications through providing all the identifications.
+
+<h3>Parameters</h3>
+
+* __orgId__ (string)
+One of the organization's identification which includes name or uuid. (Specified in path).
+* __applicationId__ (string)
+One of the application's identification which includes name or uuid (same as appId). (Specified in path).
+* __notificationId__ (string)
+One of the notification's identification which includes name or uuid. (Specified in path).
+
+<h3>Responses</h3>
+
+__200__
+
+* Description: An array of retrieved receipt's info.
+* Schema: [Receipt](#Receipt)
+
+__default__
+
+* Description: Unexpected error.
+* Schema: [Error](#Error)
+
+
+<h2 class="usergrid-GET-heading">GET /{orgId}/{applicationId}/{receiptId}/*/notifications</h2>
+
+Retrieve notifications associated with one or more receipts through providing all the identifications.
+
+<h3>Parameters</h3>
+
+* __orgId__ (string)
+One of the organization's identification which includes name or uuid. (Specified in path).
+* __applicationId__ (string)
+One of the application's identification which includes name or uuid (same as appId). (Specified in path).
+* __receiptId__ (string)
+One of the receipt's identification which includes name or uuid. (Specified in path).
+
+<h3>Responses</h3>
+
+__200__
+
+* Description: An array of retrieved notification's info.
+* Schema: [Notification](#Notification)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
### Organizations-Applications
@@ -1011,7 +1359,7 @@ Create an organization through a form post.
<h3>Parameters</h3>
-* __CreateOrg__ ([CreateOrg](#createorg))
+* __CreateOrg__ ([CreateOrg](#CreateOrg))
A set of organization properties supplied through a form. (Specified in body).
<h3>Responses</h3>
@@ -1019,12 +1367,12 @@ A set of organization properties supplied through a form. (Specified in body).
__200__
* Description: An array of created Organization.
-* Schema: [Organization](#organization)
+* Schema: [Organization](#Organization)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-GET-heading">GET /management/orgs/{orgId}</h2>
@@ -1041,12 +1389,12 @@ One of the organization's identification which includes name or uuid. (Speci
__200__
* Description: An array of created Organization.
-* Schema: [Organization](#organization)
+* Schema: [Organization](#Organization)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-GET-heading">GET /management/orgs/{orgId}/activate</h2>
@@ -1067,12 +1415,12 @@ Send confirmation email or not. (Specified in query).
__200__
* Description: An array of complete messages.
-* Schema: [Action](#action)
+* Schema: [Action](#Action)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-GET-heading">GET /management/orgs/{orgId}/apps</h2>
@@ -1089,12 +1437,36 @@ One of the organization's identification which includes name or uuid. (Speci
__200__
* Description: An array of retrieved application data.
-* Schema: [AppData](#appdata)
+* Schema: [AppData](#AppData)
+
+__default__
+
+* Description: Unexpected error.
+* Schema: [Error](#Error)
+
+
+<h2 class="usergrid-DELETE-heading">DELETE /management/orgs/{orgId}/apps/{appId}</h2>
+
+Remove an application from an organization through providing both Id of application and organization.
+
+<h3>Parameters</h3>
+
+* __orgId__ (string)
+One of the organization's identification which includes name or uuid. (Specified in path).
+* __appId__ (string)
+One of the application's identification which includes name or uuid. (Specified in path).
+
+<h3>Responses</h3>
+
+__200__
+
+* Description: An array of deleted application info.
+* Schema: [AppData](#AppData)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-GET-heading">GET /management/orgs/{orgId}/apps/{appId}/credentials</h2>
@@ -1113,12 +1485,12 @@ One of the application's identification which includes name or uuid. (Specif
__200__
* Description: An array of retrieved credentials info.
-* Schema: [Credential](#credential)
+* Schema: [Credential](#Credential)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-POST-heading">POST /management/orgs/{orgId}/apps/{appId}/credentials</h2>
@@ -1137,12 +1509,12 @@ One of the application's identification which includes name or uuid. (Specif
__200__
* Description: An array of generated credentials info.
-* Schema: [Credential](#credential)
+* Schema: [Credential](#Credential)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-GET-heading">GET /management/orgs/{orgId}/credentials</h2>
@@ -1159,12 +1531,12 @@ One of the organization's identification which includes name or uuid. (Speci
__200__
* Description: An array of Credential
-* Schema: [Credential](#credential)
+* Schema: [Credential](#Credential)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-POST-heading">POST /management/orgs/{orgId}/credentials</h2>
@@ -1181,12 +1553,12 @@ One of the organization's identification which includes name or uuid. (Speci
__200__
* Description: An array of Credential
-* Schema: [Credential](#credential)
+* Schema: [Credential](#Credential)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-GET-heading">GET /management/orgs/{orgId}/feed</h2>
@@ -1203,12 +1575,12 @@ One of the organization's identification which includes name or uuid. (Speci
__200__
* Description: An array of the organization's ActivityFeed.
-* Schema: [ActivityFeed](#activityfeed)
+* Schema: [ActivityFeed](#ActivityFeed)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-GET-heading">GET /management/orgs/{orgId}/reactivate</h2>
@@ -1225,12 +1597,12 @@ One of the organization's identification which includes name or uuid. (Speci
__200__
* Description: An array of complete messages.
-* Schema: [Action](#action)
+* Schema: [Action](#Action)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-GET-heading">GET /management/users/{userId}/feed</h2>
@@ -1247,12 +1619,12 @@ One of the user's identification which includes username, real name, email a
__200__
* Description: An array of user's activity
-* Schema: [ActivityFeed](#activityfeed)
+* Schema: [ActivityFeed](#ActivityFeed)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
### Permissions-Roles
@@ -1274,12 +1646,12 @@ One of the application's identification which includes name or uuid. (Specif
__200__
* Description: An array of retrieved role's info.
-* Schema: [Role](#role)
+* Schema: [Role](#Role)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-POST-heading">POST /{orgId}/{appId}/roles</h2>
@@ -1292,7 +1664,7 @@ Create a new role through providing all the identifications.
One of the organization's identification which includes name or uuid. (Specified in path).
* __appId__ (string)
One of the application's identification which includes name or uuid. (Specified in path).
-* __roleproperty__ ([AddRole](#addrole))
+* __roleproperty__ ([AddRole](#AddRole))
The required properties of the role. (Specified in body).
<h3>Responses</h3>
@@ -1300,17 +1672,17 @@ The required properties of the role. (Specified in body).
__200__
* Description: An array of created role's info.
-* Schema: [Role](#role)
+* Schema: [Role](#Role)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-DELETE-heading">DELETE /{orgId}/{appId}/roles/{roleId}/permissions</h2>
-Remove permissions from a role.
+Remove permissions from a role.
<h3>Parameters</h3>
@@ -1320,20 +1692,20 @@ One of the organization's identification which includes name or uuid. (Speci
One of the application's identification which includes name or uuid. (Specified in path).
* __roleId__ (string)
One of the role's identification which includes name or uuid. (Specified in path).
-* __grant_url_pattern__ (string)
-The query statement of the url pattern. (Specified in query).
+* __Permissions__ ([Permissions](#Permissions))
+The query statement of the url pattern. (Specified in body).
<h3>Responses</h3>
__200__
-* Description: An array of deleted permission's info.
-* Schema: [Permission](#permission)
+* Description: Permissions object with array of the deleated Usergrid Permission strings.
+* Schema: [Permissions](#Permissions)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-GET-heading">GET /{orgId}/{appId}/roles/{roleId}/users</h2>
@@ -1353,13 +1725,13 @@ One of the role's identification which includes name or uuid. (Specified in
__200__
-* Description: An array of retrieved user's info.
-* Schema: [User](#user)
+* Description: An API Response with a entities array of Users.
+* Schema: [User](#User)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-POST-heading">POST /{orgId}/{appId}/roles/{roleId}/users/{userId}</h2>
@@ -1382,12 +1754,12 @@ One of the user's identification which includes username or UUID. (Specified
__200__
* Description: An array of added user's info.
-* Schema: [User](#user)
+* Schema: [User](#User)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-DELETE-heading">DELETE /{orgId}/{appId}/roles/{roleId}/users/{userId}</h2>
@@ -1410,12 +1782,12 @@ One of the user's identification which includes username or UUID. (Specified
__200__
* Description: An array of deleted user's info.
-* Schema: [User](#user)
+* Schema: [User](#User)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
<h2 class="usergrid-DELETE-heading">DELETE /{orgId}/{appId}/roles/{rolename}</h2>
@@ -1436,22 +1808,76 @@ The name of the role. (Specified in path).
__200__
* Description: An array of deleted role's info.
-* Schema: [Role](#role)
+* Schema: [Role](#Role)
__default__
* Description: Unexpected error.
-* Schema: [Error](#error)
+* Schema: [Error](#Error)
-## Models
-Properties for Usergrid default entities.
+<h2 class="usergrid-GET-heading">GET /{orgId}/{applicationId}/roles/{roleId}/permissions</h2>
-### AccessTokenResponse
+Retrieve permissions for a Role.
-__Properties__
+<h3>Parameters</h3>
-<table width="80%" class="usergrid-table">
+* __orgId__ (string)
+One of the organization's identification which includes name or uuid. (Specified in path).
+* __appId__ (string)
+One of the application's identification which includes name or uuid. (Specified in path).
+* __roleId__ (string)
+One of the role's identification which includes name or uuid. (Specified in path).
+
+<h3>Responses</h3>
+
+__200__
+
+* Description: Permissions object with array of Usergrid Permission strings.
+* Schema: [Permissions](#Permissions)
+
+__default__
+
+* Description: Unexpected error.
+* Schema: [Error](#Error)
+
+
+<h2 class="usergrid-POST-heading">POST /{orgId}/{applicationId}/roles/{roleId}/permissions</h2>
+
+Add permissions to a role through providing all the identifications.
+
+<h3>Parameters</h3>
+
+* __orgId__ (string)
+One of the organization's identification which includes name or uuid. (Specified in path).
+* __appId__ (string)
+One of the application's identification which includes name or uuid. (Specified in path).
+* __roleId__ (string)
+One of the role's identification which includes name or uuid. (Specified in path).
+* __Permissions__ ([Permissions](#Permissions))
+Permissions object with array of Usergrid Permission strings to be added. (Specified in body).
+
+<h3>Responses</h3>
+
+__200__
+
+* Description: Permissions object with array of Usergrid Permission strings.
+* Schema: [Permission](#Permission)
+
+__default__
+
+* Description: Unexpected error.
+* Schema: [Error](#Error)
+
+
+## Models
+This section lists the properties for the Usergrid Default Entities:
+
+### AccessTokenResponse
+
+__Properties__
+
+<table width="80%" class="usergrid-table">
<tr>
<th>Name</th>
<th>Type</th>
@@ -1502,6 +1928,18 @@ __Properties__
<td>false</td>
</tr>
<tr>
+ <td>timestamp</td>
+ <td>number</td>
+ <td>The timestamp of the requested action.</td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>duration</td>
+ <td>number</td>
+ <td>The duration of the requested action.</td>
+ <td>false</td>
+ </tr>
+ <tr>
<td>token</td>
<td>string</td>
<td>The token required for getting an AdminUser.</td>
@@ -1557,75 +1995,19 @@ __Properties__
<td>false</td>
</tr>
<tr>
- <td>completeMsg</td>
- <td>ref</td>
- <td></td>
- <td>false</td>
- </tr>
-</table>
-
-### Actor
-
-__Properties__
-
-<table width="80%" class="usergrid-table">
- <tr>
- <th>Name</th>
- <th>Type</th>
- <th>Description</th>
- <th>Required</th>
- </tr>
- <tr>
- <td>displayname</td>
- <td>string</td>
- <td>The display of the name of the actor.</td>
- <td>false</td>
- </tr>
- <tr>
- <td>objecttype</td>
- <td>string</td>
- <td>The type of the actor.</td>
- <td>false</td>
- </tr>
- <tr>
- <td>objectuuId</td>
- <td>string</td>
- <td>The UUID of the actor.</td>
+ <td>published</td>
+ <td>number</td>
+ <td>UTC timestamp of the feed publish time.</td>
<td>false</td>
</tr>
<tr>
- <td>entitytype</td>
- <td>string</td>
- <td>The entitytype of the actor.</td>
+ <td>completeMsg</td>
+ <td>ref</td>
+ <td></td>
<td>false</td>
</tr>
</table>
-### AddPermission
-
-__Properties__
-
-<table width="80%" class="usergrid-table">
- <tr>
- <th>Name</th>
- <th>Type</th>
- <th>Description</th>
- <th>Required</th>
- </tr>
- <tr>
- <td>operation</td>
- <td>string</td>
- <td>A comma-delimited set of HTTP methods (GET, PUT, POST, DELETE) that are allowed for the specified resource path.</td>
- <td>true</td>
- </tr>
- <tr>
- <td>resource_path</td>
- <td>string</td>
- <td>The path to the resources to be accessed.</td>
- <td>true</td>
- </tr>
-</table>
-
### AddRole
__Properties__
@@ -1651,31 +2033,6 @@ __Properties__
</tr>
</table>
-### AdminUserUpdate
-
-__Properties__
-
-<table width="80%" class="usergrid-table">
- <tr>
- <th>Name</th>
- <th>Type</th>
- <th>Description</th>
- <th>Required</th>
- </tr>
- <tr>
- <td>city</td>
- <td>string</td>
- <td></td>
- <td>false</td>
- </tr>
- <tr>
- <td>state</td>
- <td>string</td>
- <td></td>
- <td>false</td>
- </tr>
-</table>
-
### AppData
__Properties__
@@ -1713,62 +2070,6 @@ __Properties__
</tr>
</table>
-### CancelMSG
-
-__Properties__
-
-<table width="80%" class="usergrid-table">
- <tr>
- <th>Name</th>
- <th>Type</th>
- <th>Description</th>
- <th>Required</th>
- </tr>
- <tr>
- <td>canceled</td>
- <td>boolean</td>
- <td></td>
- <td>true</td>
- </tr>
-</table>
-
-### Collections
-
-__Properties__
-
-<table width="80%" class="usergrid-table">
- <tr>
- <th>Name</th>
- <th>Type</th>
- <th>Description</th>
- <th>Required</th>
- </tr>
- <tr>
- <td>activities</td>
- <td>string</td>
- <td></td>
- <td>false</td>
- </tr>
- <tr>
- <td>feed</td>
- <td>string</td>
- <td></td>
- <td>false</td>
- </tr>
- <tr>
- <td>roles</td>
- <td>string</td>
- <td></td>
- <td>false</td>
- </tr>
- <tr>
- <td>users</td>
- <td>string</td>
- <td></td>
- <td>false</td>
- </tr>
-</table>
-
### CreateActivity
__Properties__
@@ -1855,31 +2156,6 @@ __Properties__
</tr>
</table>
-### CreateApp
-
-__Properties__
-
-<table width="80%" class="usergrid-table">
- <tr>
- <th>Name</th>
- <th>Type</th>
- <th>Description</th>
- <th>Required</th>
- </tr>
- <tr>
- <td>token</td>
- <td>string</td>
- <td>The OAuth2 access token.</td>
- <td>true</td>
- </tr>
- <tr>
- <td>name</td>
- <td>string</td>
- <td>The name of the application.</td>
- <td>true</td>
- </tr>
-</table>
-
### CreateEntities
__Properties__
@@ -1893,31 +2169,6 @@ __Properties__
</tr>
</table>
-### CreateEntity
-
-__Properties__
-
-<table width="80%" class="usergrid-table">
- <tr>
- <th>Name</th>
- <th>Type</th>
- <th>Description</th>
- <th>Required</th>
- </tr>
- <tr>
- <td>property</td>
- <td>string</td>
- <td>The property of the entity.</td>
- <td>false</td>
- </tr>
- <tr>
- <td>value</td>
- <td>string</td>
- <td>The relevant value of the property.</td>
- <td>false</td>
- </tr>
-</table>
-
### CreateEvent
__Properties__
@@ -1962,31 +2213,6 @@ __Properties__
</tr>
</table>
-### CreateNotification
-
-__Properties__
-
-<table width="80%" class="usergrid-table">
- <tr>
- <th>Name</th>
- <th>Type</th>
- <th>Description</th>
- <th>Required</th>
- </tr>
- <tr>
- <td>notifier</td>
- <td>ref</td>
- <td></td>
- <td>true</td>
- </tr>
- <tr>
- <td>message</td>
- <td>string</td>
- <td>The push notitfication message that will be delivered to the user.</td>
- <td>true</td>
- </tr>
-</table>
-
### CreateNotifications
__Properties__
@@ -2123,10 +2349,22 @@ __Properties__
<td>false</td>
</tr>
<tr>
- <td>metadata</td>
- <td>ref</td>
- <td></td>
- <td>false</td>
+ <td>created</td>
+ <td>number</td>
+ <td>UTC timestamp in milliseconds of when the entity was created.</td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>modified</td>
+ <td>number</td>
+ <td>UTC timestamp in milliseconds of when the entity was last modified.</td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>metadata</td>
+ <td>ref</td>
+ <td></td>
+ <td>false</td>
</tr>
<tr>
<td>completeMsg</td>
@@ -2160,9 +2398,15 @@ __Properties__
<td>false</td>
</tr>
<tr>
- <td>actorproperty</td>
+ <td>created</td>
+ <td>number</td>
+ <td>UTC timestamp of entity creation time.</td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>modified</td>
<td>ref</td>
- <td></td>
+ <td>UTC timestamp of entity modified time.</td>
<td>false</td>
</tr>
<tr>
@@ -2332,37 +2576,6 @@ __Properties__
</tr>
</table>
-### ImageModel
-
-__Properties__
-
-<table width="80%" class="usergrid-table">
- <tr>
- <th>Name</th>
- <th>Type</th>
- <th>Description</th>
- <th>Required</th>
- </tr>
- <tr>
- <td>url</td>
- <td>string</td>
- <td></td>
- <td>false</td>
- </tr>
- <tr>
- <td>wIdth</td>
- <td>integer</td>
- <td></td>
- <td>false</td>
- </tr>
- <tr>
- <td>email</td>
- <td>string</td>
- <td></td>
- <td>false</td>
- </tr>
-</table>
-
### LoginCredentials
__Properties__
@@ -2406,7 +2619,7 @@ __Properties__
</tr>
</table>
-### Metadata
+### Notification
__Properties__
@@ -2418,52 +2631,27 @@ __Properties__
<th>Required</th>
</tr>
<tr>
- <td>cursor</td>
+ <td>uuid</td>
<td>string</td>
- <td>The cursor of the metadata.</td>
+ <td>Unique entity Id.</td>
<td>false</td>
</tr>
<tr>
- <td>path</td>
+ <td>type</td>
<td>string</td>
- <td>The path of the metadata.</td>
- <td>false</td>
- </tr>
- <tr>
- <td>sets</td>
- <td>ref</td>
- <td></td>
- <td>false</td>
- </tr>
- <tr>
- <td>collections</td>
- <td>ref</td>
- <td></td>
+ <td>Type of entity.</td>
<td>false</td>
</tr>
-</table>
-
-### Notification
-
-__Properties__
-
-<table width="80%" class="usergrid-table">
<tr>
- <th>Name</th>
- <th>Type</th>
- <th>Description</th>
- <th>Required</th>
- </tr>
- <tr>
- <td>uuid</td>
- <td>string</td>
- <td>Unique entity Id.</td>
+ <td>created</td>
+ <td>number</td>
+ <td>UTC timestamp in milliseconds of when the entity was created.</td>
<td>false</td>
</tr>
<tr>
- <td>type</td>
- <td>string</td>
- <td>Type of entity.</td>
+ <td>modified</td>
+ <td>number</td>
+ <td>UTC timestamp in milliseconds of when the entity was last modified.</td>
<td>false</td>
</tr>
<tr>
@@ -2481,7 +2669,7 @@ __Properties__
<tr>
<td>scheduled</td>
<td>boolean</td>
- <td>whether the notification is currently scheduled for delivery.</td>
+ <td>Whether the notification is currently scheduled for delivery.</td>
<td>false</td>
</tr>
<tr>
@@ -2504,7 +2692,7 @@ __Properties__
</tr>
</table>
-### Notifier
+### NotificationUpdate
__Properties__
@@ -2516,76 +2704,21 @@ __Properties__
<th>Required</th>
</tr>
<tr>
- <td>uuid</td>
- <td>string</td>
- <td>Unique entity Id.</td>
- <td>false</td>
- </tr>
- <tr>
- <td>type</td>
- <td>string</td>
- <td>Type of entity.</td>
- <td>false</td>
- </tr>
- <tr>
- <td>name</td>
- <td>string</td>
- <td>Notifier display name.</td>
- <td>false</td>
- </tr>
- <tr>
- <td>provider</td>
- <td>string</td>
- <td>Push notification provider 'apple' or 'google'.</td>
- <td>true</td>
- </tr>
- <tr>
- <td>environment</td>
- <td>string</td>
- <td>The environment that corresponds to your app 'development' or 'production'.</td>
- <td>true</td>
- </tr>
- <tr>
- <td>metadata</td>
- <td>ref</td>
- <td></td>
- <td>false</td>
- </tr>
-</table>
-
-### Object
-
-__Properties__
-
-<table width="80%" class="usergrid-table">
- <tr>
- <th>Name</th>
- <th>Type</th>
- <th>Description</th>
- <th>Required</th>
- </tr>
- <tr>
- <td>displayname</td>
- <td>string</td>
- <td>The display of the name of the object.</td>
- <td>false</td>
- </tr>
- <tr>
- <td>objecttype</td>
- <td>string</td>
- <td>The type of the object.</td>
+ <td>canceled</td>
+ <td>boolean</td>
+ <td>Setting this field to true will cancel a Notification, if it has not yet been sent.</td>
<td>false</td>
</tr>
<tr>
- <td>objectuuId</td>
- <td>string</td>
- <td>The UUID of the object.</td>
+ <td>deliver</td>
+ <td>number</td>
+ <td>Specifies the UNIX timestamp time at which the Notification should be sent.</td>
<td>false</td>
</tr>
<tr>
- <td>entitytype</td>
- <td>string</td>
- <td>The entitytype of the object.</td>
+ <td>expired</td>
+ <td>number</td>
+ <td>Specifies the UNIX timestamp time at which this Notification has expired.</td>
<td>false</td>
</tr>
</table>
@@ -2687,7 +2820,7 @@ __Properties__
</tr>
</table>
-### Permission
+### Permissions
__Properties__
@@ -2699,46 +2832,28 @@ __Properties__
<th>Required</th>
</tr>
<tr>
- <td>applicationName</td>
- <td>string</td>
- <td>The name of the application of the permission.</td>
- <td>false</td>
- </tr>
- <tr>
- <td>entity</td>
- <td>ref</td>
- <td></td>
- <td>false</td>
- </tr>
- <tr>
- <td>url</td>
+ <td>application</td>
<td>string</td>
- <td>The url of the permission.</td>
+ <td>The UUID of the associated application.</td>
<td>false</td>
</tr>
<tr>
- <td>applicationId</td>
- <td>string</td>
- <td>The UUID of the application.</td>
- <td>false</td>
- </tr>
- <tr>
- <td>parameters</td>
+ <td>applicationName</td>
<td>string</td>
- <td>The parameters of the permission.</td>
+ <td>The name of the associated application.</td>
<td>false</td>
</tr>
<tr>
<td>organization</td>
<td>string</td>
- <td>The organization of the permission.</td>
+ <td>The name of the associated organization.</td>
<td>false</td>
</tr>
<tr>
- <td>permissiondata</td>
- <td>ref</td>
- <td></td>
- <td>false</td>
+ <td>data</td>
+ <td>array</td>
+ <td>Array of strings each being a Usergrid Permission String.</td>
+ <td>true</td>
</tr>
</table>
@@ -2766,6 +2881,18 @@ __Properties__
<td>false</td>
</tr>
<tr>
+ <td>created</td>
+ <td>number</td>
+ <td>UTC timestamp in milliseconds of when the entity was created.</td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>modified</td>
+ <td>number</td>
+ <td>UTC timestamp in milliseconds of when the entity was last modified.</td>
+ <td>false</td>
+ </tr>
+ <tr>
<td>payloads</td>
<td>string</td>
<td>The push notifications to be delivered.</td>
@@ -2877,6 +3004,12 @@ __Properties__
<td>false</td>
</tr>
<tr>
+ <td>count</td>
+ <td>number</td>
+ <td>The numebr of the roles.</td>
+ <td>false</td>
+ </tr>
+ <tr>
<td>entity</td>
<td>ref</td>
<td></td>
@@ -2920,7 +3053,7 @@ __Properties__
</tr>
</table>
-### ScheduleNotification
+### User
__Properties__
@@ -2932,33 +3065,101 @@ __Properties__
<th>Required</th>
</tr>
<tr>
- <td>timestamp</td>
+ <td>applicationId</td>
<td>string</td>
- <td>UTC timestamp in milliseconds of when schedule notifications.</td>
- <td>true</td>
+ <td>The application Id of a user.</td>
+ <td>false</td>
</tr>
-</table>
-
-### SetExpiration
-
-__Properties__
-
-<table width="80%" class="usergrid-table">
<tr>
- <th>Name</th>
- <th>Type</th>
- <th>Description</th>
- <th>Required</th>
+ <td>username</td>
+ <td>string</td>
+ <td>The username of a user.</td>
+ <td>false</td>
</tr>
<tr>
- <td>timestamp</td>
+ <td>name</td>
<td>string</td>
- <td>UTC timestamp in milliseconds of when set expirations.</td>
- <td>true</td>
+ <td>The name of a user.</td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>email</td>
+ <td>string</td>
+ <td>The email of a user.</td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>activated</td>
+ <td>boolean</td>
+ <td>Indicate whether the account is activated or not.</td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>disabled</td>
+ <td>boolean</td>
+ <td>Indicate whether the account is disabled or not.</td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>uuid</td>
+ <td>string</td>
+ <td>The UUID of a user.</td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>adminUser</td>
+ <td>boolean</td>
+ <td>Indicate whether the use is a adminUser or not.</td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>displayEmail</td>
+ <td>string</td>
+ <td>The display of the email of a user.</td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>htmldisplayEmail</td>
+ <td>string</td>
+ <td>The HTML display of the email of a user.</td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>organization</td>
+ <td>string</td>
+ <td>The organization of the user.</td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>picture</td>
+ <td>string</td>
+ <td>The uri of the user's picture.</td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>uri</td>
+ <td>string</td>
+ <td>The uri of the user.</td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>path</td>
+ <td>string</td>
+ <td>The path of the user.</td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>completeMsg</td>
+ <td>ref</td>
+ <td></td>
+ <td>false</td>
</tr>
</table>
-### Sets
+## Sub-Types
+This section lists the properties for sub-types used in Usergrid Default Entities.
+
+### Collections
__Properties__
@@ -2970,20 +3171,32 @@ __Properties__
<th>Required</th>
</tr>
<tr>
- <td>rolenames</td>
+ <td>activities</td>
<td>string</td>
<td></td>
<td>false</td>
</tr>
<tr>
- <td>permissions</td>
+ <td>feed</td>
+ <td>string</td>
+ <td></td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>roles</td>
+ <td>string</td>
+ <td></td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>users</td>
<td>string</td>
<td></td>
<td>false</td>
</tr>
</table>
-### User
+### ImageModel
__Properties__
@@ -2995,92 +3208,131 @@ __Properties__
<th>Required</th>
</tr>
<tr>
- <td>applicationId</td>
- <td>string</td>
- <td>The application Id of a user.</td>
+ <td>duration</td>
+ <td>number</td>
+ <td></td>
<td>false</td>
</tr>
<tr>
- <td>username</td>
- <td>string</td>
- <td>The username of a user.</td>
+ <td>height</td>
+ <td>number</td>
+ <td></td>
<td>false</td>
</tr>
<tr>
- <td>name</td>
+ <td>url</td>
<td>string</td>
- <td>The name of a user.</td>
+ <td></td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>wIdth</td>
+ <td>integer</td>
+ <td></td>
<td>false</td>
</tr>
<tr>
<td>email</td>
<td>string</td>
- <td>The email of a user.</td>
+ <td></td>
<td>false</td>
</tr>
+</table>
+
+### Metadata
+
+__Properties__
+
+<table width="80%" class="usergrid-table">
<tr>
- <td>activated</td>
- <td>boolean</td>
- <td>Indicate whether the account is activated or not.</td>
- <td>false</td>
+ <th>Name</th>
+ <th>Type</th>
+ <th>Description</th>
+ <th>Required</th>
</tr>
<tr>
- <td>disabled</td>
- <td>boolean</td>
- <td>Indicate whether the account is disabled or not.</td>
+ <td>cursor</td>
+ <td>string</td>
+ <td>The cursor of the metadata.</td>
<td>false</td>
</tr>
<tr>
- <td>uuid</td>
+ <td>path</td>
<td>string</td>
- <td>The UUID of a user.</td>
+ <td>The path of the metadata.</td>
<td>false</td>
</tr>
<tr>
- <td>adminUser</td>
- <td>boolean</td>
- <td>Indicate whether the use is a adminUser or not.</td>
+ <td>sets</td>
+ <td>ref</td>
+ <td></td>
<td>false</td>
</tr>
<tr>
- <td>displayEmail</td>
- <td>string</td>
- <td>The display of the email of a user.</td>
+ <td>collections</td>
+ <td>ref</td>
+ <td></td>
<td>false</td>
</tr>
+</table>
+
+### Object
+
+__Properties__
+
+<table width="80%" class="usergrid-table">
<tr>
- <td>htmldisplayEmail</td>
+ <th>Name</th>
+ <th>Type</th>
+ <th>Description</th>
+ <th>Required</th>
+ </tr>
+ <tr>
+ <td>displayname</td>
<td>string</td>
- <td>The HTML display of the email of a user.</td>
+ <td>The display of the name of the object.</td>
<td>false</td>
</tr>
<tr>
- <td>organization</td>
+ <td>objecttype</td>
<td>string</td>
- <td>The organization of the user.</td>
+ <td>The type of the object.</td>
<td>false</td>
</tr>
<tr>
- <td>picture</td>
+ <td>objectuuId</td>
<td>string</td>
- <td>The uri of the user's picture.</td>
+ <td>The UUID of the object.</td>
<td>false</td>
</tr>
<tr>
- <td>uri</td>
+ <td>entitytype</td>
<td>string</td>
- <td>The uri of the user.</td>
+ <td>The entitytype of the object.</td>
<td>false</td>
</tr>
+</table>
+
+### Sets
+
+__Properties__
+
+<table width="80%" class="usergrid-table">
<tr>
- <td>path</td>
+ <th>Name</th>
+ <th>Type</th>
+ <th>Description</th>
+ <th>Required</th>
+ </tr>
+ <tr>
+ <td>rolenames</td>
<td>string</td>
- <td>The path of the user.</td>
+ <td></td>
<td>false</td>
</tr>
<tr>
- <td>completeMsg</td>
- <td>ref</td>
+ <td>permissions</td>
+ <td>string</td>
<td></td>
<td>false</td>
</tr>
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2707dbf4/docs/src/main/groovy/usergrid/ApiDocGenerator.groovy
----------------------------------------------------------------------
diff --git a/docs/src/main/groovy/usergrid/ApiDocGenerator.groovy b/docs/src/main/groovy/usergrid/ApiDocGenerator.groovy
index efc99e9..6946f99 100644
--- a/docs/src/main/groovy/usergrid/ApiDocGenerator.groovy
+++ b/docs/src/main/groovy/usergrid/ApiDocGenerator.groovy
@@ -5,22 +5,31 @@
// Depdency management with Grape:
// http://docs.groovy-lang.org/latest/html/documentation/grape.html
-package usergrid;
+package usergrid
@Grab(group = 'io.swagger', module = 'swagger-parser', version = '1.0.8')
@Grab(group = 'io.swagger', module = 'swagger-compat-spec-parser', version = '1.0.8')
@Grab(group = 'com.github.spullara.mustache.java', module = 'compiler', version = '0.8.18-SNAPSHOT')
+@Grab(group = 'org.slf4j', module = 'slf4j-simple', version = '1.7.12')
-import io.swagger.parser.*;
-import io.swagger.models.*;
-import com.github.mustachejava.*
-import org.apache.commons.lang3.RandomStringUtils;
+import com.github.mustachejava.DefaultMustacheFactory
+import io.swagger.models.Model
+import io.swagger.models.Operation
+import io.swagger.models.parameters.BodyParameter
+import io.swagger.models.parameters.RefParameter
+import io.swagger.models.properties.RefProperty
+import io.swagger.parser.*
+import org.apache.commons.lang3.RandomStringUtils
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
/**
* Generates Usergrid API docs from Swagger in Markdown format.
*/
public class ApiDocGenerator {
+
+ static Logger logger = LoggerFactory.getLogger(ApiDocGenerator.class);
def parser = new SwaggerParser();
def swagger = parser.read("src/main/resources/usergrid-swagger.yaml");
@@ -39,8 +48,14 @@ public class ApiDocGenerator {
def allTags = [];
def allModels = [];
-
-
+ def urlOpsBySchema = [:];
+ def modelsBySchema = [:];
+
+ def tagsToUrlOps = new TreeMap();
+
+ def definitions = new TreeMap();
+ def subTypes = new TreeMap();
+
public ApiDocGenerator() {
writer = new OutputStreamWriter(new FileOutputStream("rest-endpoints/api-docs.md"));
operationTemplate = mf.compile(
@@ -61,59 +76,66 @@ public class ApiDocGenerator {
}
def generate() {
-
- // build up scope and generate via Mustache template
-
- // organize methods by tag
- def tagsToUrlOps = new TreeMap();
+
+ // build various hashmaps and lists to help organize and cross-reference content
swagger.getPaths().each { pathEntry ->
def url = pathEntry.key;
def path = pathEntry.value;
if (path.get != null) {
- addOperation(tagsToUrlOps, "GET", url, path.get);
+ addOperation("GET", url, path.get);
}
if (path.post != null) {
- addOperation(tagsToUrlOps, "POST", url, path.post);
+ addOperation("POST", url, path.post);
}
if (path.put != null) {
- addOperation(tagsToUrlOps, "PUT", url, path.put);
+ addOperation("PUT", url, path.put);
}
if (path.delete != null) {
- addOperation(tagsToUrlOps, "DELETE", url, path.delete);
+ addOperation("DELETE", url, path.delete);
}
};
-
tagsToUrlOps.each { entry -> allTags.add(entry.key) };
- def definitions = new TreeMap();
swagger.getDefinitions().each { entry ->
- definitions.put( entry.key, entry.value );
+ addModel( entry.key, entry.value );
};
definitions.each { entry -> allModels.add(entry.key); };
-
- // generate
+
+ // generate the doc
generateFileStart();
+
generateMethodsSectionTitle();
+
tagsToUrlOps.each { entry ->
def tag = entry.key;
def urlOps = entry.value;
generateMethodsTitle(tag);
urlOps.each { urlOp -> formatOperation( urlOp ); };
};
-
+
generateModelsTitle();
+
definitions.each { entry ->
def name = entry.key;
def model = entry.value;
formatModel( name, model );
};
+
+ generateSubTypesTitle();
+
+ subTypes.each { entry ->
+ def name = entry.key;
+ def model = entry.value;
+ formatModel( name, model );
+ };
+
generateFileEnd();
}
- def addOperation( Map tagsToUrlOps, String method, String url, Operation operation ) {
+ def addOperation( String method, String url, Operation operation ) {
// assume each operation has one tag
def tag = operation.tags[0];
@@ -123,12 +145,64 @@ public class ApiDocGenerator {
urlOps = [];
tagsToUrlOps[tag] = urlOps;
}
-
+
def urlOp = new HashMap();
urlOp.url = url;
urlOp.method = method;
urlOp.operation = operation;
+ urlOp.opId = RandomStringUtils.randomAlphanumeric(10);
urlOps.add(urlOp);
+
+ operation.getResponses().each { responseEntry ->
+
+ if (responseEntry.value.schema != null) {
+
+ if (responseEntry.key.equals("200")) {
+ def list = urlOpsBySchema[responseEntry.value.schema.ref];
+ if (list == null) {
+ list = new HashSet();
+ urlOpsBySchema[responseEntry.value.schema.ref] = list;
+ }
+ list.add(urlOp);
+ }
+ }
+ };
+
+ operation.getParameters().each { param ->
+
+ if ( param instanceof BodyParameter && param.schema != null ) {
+ def list = urlOpsBySchema[param.schema.ref];
+ if (list == null) {
+ list = new HashSet();
+ urlOpsBySchema[param.schema.ref] = list;
+ }
+ list.add(urlOp);
+ }
+ };
+
+ }
+
+ def addModel(name, model) {
+
+ if (urlOpsBySchema[name] != null || name.equals("Error")) {
+ definitions.put(name, model);
+ } else if (modelsBySchema[name] != null ) {
+ subTypes.put(name, model);
+ } else {
+ logger.error("${name} omitted because it is not referenced by any API path or definition.");
+ }
+
+ model.properties.each { propertyEntity ->
+
+ if (propertyEntity.value instanceof RefProperty ) {
+ def list = modelsBySchema[ propertyEntity.value.ref ];
+ if ( list == null ) {
+ list = [];
+ modelsBySchema[ propertyEntity.value.ref ] = list;
+ }
+ list.add(name);
+ }
+ };
}
def formatOperation( urlOp ) {
@@ -150,7 +224,17 @@ public class ApiDocGenerator {
// if parameter has a schema, assume that it is a reference
if ( responseEntry.value.schema != null) {
response.schema = responseEntry.value.schema.ref;
- response.schemaAnchor = responseEntry.value.schema.ref.toLowerCase();
+ response.schemaAnchor = responseEntry.value.schema.ref;
+
+ // keep track of paths that use each schema definition
+ if ( response.status.equals("200") ) {
+ def list = urlOpsBySchema[response.schema];
+ if ( list == null ) {
+ list = [];
+ urlOpsBySchema[response.schema] = list;
+ }
+ list.add(urlOp);
+ }
}
responses.add(response);
}
@@ -164,10 +248,25 @@ public class ApiDocGenerator {
param.in = parameter.in;
// assume that body parameters have a schema that is a reference
- if (parameter.in == "body" && parameter.schema != null) {
+ if (parameter.in == "body") {
+
+ if ( parameter.schema == null ) {
+ def a = 5;
+ }
param.schemaRef = parameter.schema.ref;
- param.schemaAnchor = parameter.schema.ref.toLowerCase();
- } else { // if (parameter.in == "path") {
+ param.schemaAnchor = parameter.schema.ref;
+
+ // keep track of paths that use each schema definition
+ def list = urlOpsBySchema[parameter.schema.ref];
+ if ( list == null ) {
+ list = [];
+ urlOpsBySchema[parameter.schema.ref] = list;
+ }
+ list.add(urlOp);
+
+ } else if ( parameter instanceof RefParameter ) {
+ param.type = "booger";
+ } else {
param.type = parameter.type;
}
params.add(param);
@@ -181,14 +280,21 @@ public class ApiDocGenerator {
scope.tags = op.getTags();
scope.responses = responses;
scope.parameters = params;
- scope.opid = RandomStringUtils.randomAlphanumeric(10);
-
+ scope.opId = urlOp.opId;
+
operationTemplate.execute(writer, scope);
writer.flush();
}
def formatModel(String name, Model model) {
+ def scope = [:];
+ scope.referrers = urlOpsBySchema[name];
+ scope.modelRefs = modelsBySchema[name];
+ scope.hasReferrers = scope.referrers != null && !scope.referrers.isEmpty();
+ scope.hasParamRefs = scope.paramRefs != null && !scope.paramRefs.isEmpty();
+ scope.hasModelRefs = scope.modelRefs != null && !scope.modelRefs.isEmpty();
+
// put properties in array form, mustache doesn't play nice with associative arrays
def props = [];
model.getProperties().each { property ->
@@ -201,12 +307,15 @@ public class ApiDocGenerator {
prop.readOnly = property.value.readOnly;
prop.required = property.value.required;
prop.position = property.value.position;
+ if ( property.value instanceof RefProperty ) {
+ prop.ref = property.value.ref;
+ }
props.add(prop);
};
- def scope = [:];
scope.name = name;
+ scope.description = model.description;
scope.properties = props;
- scope.modelid = RandomStringUtils.randomAlphanumeric(10);
+
modelTemplate.execute(writer, scope);
writer.flush();
}
@@ -217,7 +326,7 @@ public class ApiDocGenerator {
allTags.each{ tag ->
def atag = [:];
atag.name = tag;
- atag.link = tag.toLowerCase();
+ atag.link = tag;
tags.add(atag);
};
scope.tags = tags;
@@ -239,7 +348,12 @@ public class ApiDocGenerator {
def generateModelsTitle() {
writer.println "\n## Models";
- writer.println "Properties for Usergrid default entities.";
+ writer.println "This section lists the properties for the Usergrid Default Entities:";
+ }
+
+ def generateSubTypesTitle() {
+ writer.println "\n## Sub-Types";
+ writer.println "This section lists the properties for sub-types used in Usergrid Default Entities.";
}
def generateFileEnd() {
@@ -289,9 +403,15 @@ class HtmlApiDocGenerator extends ApiDocGenerator {
def generateModelsTitle() {
writer.println "<a name='models'></a>";
writer.println "<br><h1>Default Entity Models</h1>" +
- "<p>This section lists the properties for the following Usergrid Default Entities:</p>";
+ "<p>This section lists the properties for the following Usergrid Default Entities.</p>";
}
+ def generateSubTypesTitle() {
+ writer.println "<a name='subtypes'></a>";
+ writer.println "<br><h1>Sub-types Referenced By Models</h1>" +
+ "<p>This section lists the properties for sub-types used in Usergrid Default Entities.</p>";
+ }
+
def generateFileEnd() {
def scope = [:];
fileEndTemplate.execute(writer, scope);
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2707dbf4/docs/src/main/resources/html/file-end.mustache
----------------------------------------------------------------------
diff --git a/docs/src/main/resources/html/file-end.mustache b/docs/src/main/resources/html/file-end.mustache
index 28d75b5..77b0b67 100644
--- a/docs/src/main/resources/html/file-end.mustache
+++ b/docs/src/main/resources/html/file-end.mustache
@@ -8,6 +8,23 @@
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
+
+<script>
+if ("onhashchange" in window) {
+ window.onhashchange = function () {
+ var hash = window.location.hash;
+ if ( hash.substring(0,1) != "/") {
+ hash = hash.substring(1, hash.length);
+
+ $("#collapse-" + hash).removeClass("collapse");
+ $("a[href=#collapse-" + hash + "]").removeClass("collapsed");
+
+ $("#" + hash).removeClass("collapse");
+ $("a[href=#" + hash + "]").removeClass("collapsed");
+ }
+ }
+}
+</script>
</body>
</html>
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2707dbf4/docs/src/main/resources/html/file-start.mustache
----------------------------------------------------------------------
diff --git a/docs/src/main/resources/html/file-start.mustache b/docs/src/main/resources/html/file-start.mustache
index 642bf42..9951f3c 100644
--- a/docs/src/main/resources/html/file-start.mustache
+++ b/docs/src/main/resources/html/file-start.mustache
@@ -10,6 +10,39 @@
<link rel="stylesheet" href="api-docs.css">
+ <style type="text/css">
+ .panel-default > .panel-heading.GET{
+ background-color: rgba(54, 180, 255, 0.42);
+ background-image: none;
+ }
+ .panel-default > .panel-heading.POST {
+ background-color: rgba(0, 128, 0, 0.38);
+ background-image: none;
+ }
+ .panel-default > .panel-heading.PUT{
+ background-color: rgba(255, 165, 0, 0.41);
+ background-image: none;
+ }
+ .panel-default > .panel-heading.DELETE {
+ background-color: rgba(255, 0, 0, 0.29);
+ background-image: none;
+ }
+
+ .panel-heading a.collapse-button:after {
+ font-family:'Glyphicons Halflings';
+ content:"\e114";
+ float: right;
+ color: grey;
+ }
+ .panel-heading a.collapse-button.collapsed:after {
+ content:"\e080";
+ }
+
+ table td {
+ font-size: small;
+ }
+ </style>
+
</head>
<body>
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2707dbf4/docs/src/main/resources/html/model.mustache
----------------------------------------------------------------------
diff --git a/docs/src/main/resources/html/model.mustache b/docs/src/main/resources/html/model.mustache
index 8672641..fa21399 100644
--- a/docs/src/main/resources/html/model.mustache
+++ b/docs/src/main/resources/html/model.mustache
@@ -1,4 +1,5 @@
+
<div>
<a name="{{name}}"/>
</div>
@@ -7,14 +8,16 @@
<div class="panel-heading">
<h2 class="panel-title model-heading">{{name}}
- <a data-toggle="collapse" data-target="#collapse-{{modelid}}"
- href="#collapse-{{modelid}}" class="collapsed collapse-button"> </a>
+ <a data-toggle="collapse" data-target="#collapse-{{name}}"
+ href="#collapse-{{name}}" class="collapsed collapse-button"> </a>
</h2>
</div>
- <div id="collapse-{{modelid}}" class="panel-body collapse">
+ <div id="collapse-{{name}}" class="panel-body collapse">
+
+ <p>{{description}}</p>
- <h3>Properties</h3>
+ <p><b>Properties</b></p>
<table width="80%" class="table table-striped">
<tr>
@@ -26,13 +29,39 @@
{{#properties}}
<tr>
<td>{{name}}</td>
- <td>{{type}}</td>
+ <td>
+ {{#ref}}<a href="#{{ref}}">{{ref}}</a>{{/ref}}
+ {{^ref}}{{type}}{{/ref}}
+ </td>
<td>{{description}}</td>
<td>{{required}}</td>
</tr>
{{/properties}}
</table>
+ {{#hasReferrers}}
+ <p><b>Referring API Paths</b></p>
+ <table width="80%" class="table table-striped">
+ {{#referrers}}
+ <tr>
+ <td><p><a href="#op-{{opId}}">{{url}}</a></p></td>
+ </tr>
+ {{/referrers}}
+ </table>
+ {{/hasReferrers}}
+
+ {{#hasModelRefs}}
+ <p><b>Referring Definitions</b></p>
+ <table width="80%" class="table table-striped">
+ {{#modelRefs}}
+ <tr>
+ <td><p><a href="#{{.}}">{{.}}</a></p></td>
+ </tr>
+ {{/modelRefs}}
+ </table>
+ {{/hasModelRefs}}
+
</div>
</div>
+
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2707dbf4/docs/src/main/resources/html/operation.mustache
----------------------------------------------------------------------
diff --git a/docs/src/main/resources/html/operation.mustache b/docs/src/main/resources/html/operation.mustache
index 6e15b1f..27b7ab5 100644
--- a/docs/src/main/resources/html/operation.mustache
+++ b/docs/src/main/resources/html/operation.mustache
@@ -1,14 +1,16 @@
+<a name="op-{{opId}}"/>
+
<div class="panel panel-default">
<div class="panel-heading {{method}}">
<h2 class="panel-title {{method}}-heading">{{method}} {{url}}
- <a data-toggle="collapse" data-target="#collapse-{{opid}}"
- href="#collapse-{{opid}}" class="collapsed collapse-button"> </a>
+ <a data-toggle="collapse" data-target="#op-{{opId}}"
+ href="#op-{{opId}}" class="collapsed collapse-button"> </a>
</h2>
</div>
- <div id="collapse-{{opid}}" class="panel-body collapse">
+ <div id="op-{{opId}}" class="panel-body collapse">
<p>{{description}}</p>
@@ -17,8 +19,7 @@
<ul>
{{#parameters}}
<li>
- <b>{{name}}</b> ({{#type}}{{type}}{{/type}}{{#schemaRef}}
- <a href="#{{schemaAnchor}}">{{schemaRef}}</a>{{/schemaRef}}) <br>
+ <b>{{name}}</b> ({{#type}}{{type}}{{/type}}{{#schemaRef}}<a href="#{{schemaAnchor}}">{{schemaRef}}</a>{{/schemaRef}})<br>
{{description}} (Specified in {{in}}).
</li>
{{/parameters}}