You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2015/08/20 22:49:23 UTC
[03/14] allura git commit: [#6797] initial RAML, written by Heith
http://git-wip-us.apache.org/repos/asf/allura/blob/26375dad/Allura/docs/api-rest/schemas/tickets.json
----------------------------------------------------------------------
diff --git a/Allura/docs/api-rest/schemas/tickets.json b/Allura/docs/api-rest/schemas/tickets.json
new file mode 100755
index 0000000..6a68c2c
--- /dev/null
+++ b/Allura/docs/api-rest/schemas/tickets.json
@@ -0,0 +1,163 @@
+ {
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "id": "/",
+ "type": "object",
+ "properties": {
+ "tickets": {
+ "id": "tickets",
+ "type": "array",
+ "items": {
+ "id": "99",
+ "type": "object",
+ "properties": {
+ "summary": {
+ "id": "summary",
+ "type": "string"
+ },
+ "ticket_num": {
+ "id": "ticket_num",
+ "type": "integer"
+ }
+ }
+ }
+ },
+ "count": {
+ "id": "count",
+ "type": "integer"
+ },
+ "milestones": {
+ "id": "milestones",
+ "type": "array",
+ "items": {
+ "id": "7",
+ "type": "object",
+ "properties": {
+ "due_date": {
+ "id": "due_date",
+ "type": "string"
+ },
+ "complete": {
+ "id": "complete",
+ "type": "boolean"
+ },
+ "closed": {
+ "id": "closed",
+ "type": "integer"
+ },
+ "default": {
+ "id": "default",
+ "type": ""
+ },
+ "description": {
+ "id": "description",
+ "type": "string"
+ },
+ "total": {
+ "id": "total",
+ "type": "integer"
+ },
+ "name": {
+ "id": "name",
+ "type": "string"
+ }
+ }
+ }
+ },
+ "tracker_config": {
+ "id": "tracker_config",
+ "type": "object",
+ "properties": {
+ "_id": {
+ "id": "_id",
+ "type": "string"
+ },
+ "options": {
+ "id": "options",
+ "type": "object",
+ "properties": {
+ "ordinal": {
+ "id": "ordinal",
+ "type": "integer"
+ },
+ "TicketHelpNew": {
+ "id": "TicketHelpNew",
+ "type": "string"
+ },
+ "mount_point": {
+ "id": "mount_point",
+ "type": "string"
+ },
+ "TicketMonitoringType": {
+ "id": "TicketMonitoringType",
+ "type": "string"
+ },
+ "EnableVoting": {
+ "id": "EnableVoting",
+ "type": "boolean"
+ },
+ "TicketHelpSearch": {
+ "id": "TicketHelpSearch",
+ "type": "string"
+ },
+ "TicketMonitoringEmail": {
+ "id": "TicketMonitoringEmail",
+ "type": "string"
+ },
+ "import_id": {
+ "id": "import_id",
+ "type": "object",
+ "properties": {
+ "source": {
+ "id": "source",
+ "type": "string"
+ },
+ "app_config_id": {
+ "id": "app_config_id",
+ "type": "string"
+ }
+ }
+ },
+ "mount_label": {
+ "id": "mount_label",
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "limit": {
+ "id": "limit",
+ "type": "integer"
+ },
+ "saved_bins": {
+ "id": "saved_bins",
+ "type": "array",
+ "items": {
+ "id": "4",
+ "type": "object",
+ "properties": {
+ "sort": {
+ "id": "sort",
+ "type": "string"
+ },
+ "_id": {
+ "id": "_id",
+ "type": "string"
+ },
+ "terms": {
+ "id": "terms",
+ "type": "string"
+ },
+ "summary": {
+ "id": "summary",
+ "type": "string"
+ }
+ }
+ }
+ },
+ "page": {
+ "id": "page",
+ "type": "integer"
+ }
+ }
+ }
http://git-wip-us.apache.org/repos/asf/allura/blob/26375dad/Allura/docs/api-rest/schemas/user.json
----------------------------------------------------------------------
diff --git a/Allura/docs/api-rest/schemas/user.json b/Allura/docs/api-rest/schemas/user.json
new file mode 100755
index 0000000..77d0591
--- /dev/null
+++ b/Allura/docs/api-rest/schemas/user.json
@@ -0,0 +1,196 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "id": "/",
+ "title": "User.",
+ "description": "A user's first and last name.",
+ "type": "object",
+ "properties": {
+ "status": {
+ "id": "status",
+ "type": "string"
+ },
+ "preferred_support_tool": {
+ "id": "preferred_support_tool",
+ "type": "string"
+ },
+ "profile_api_url": {
+ "id": "profile_api_url",
+ "type": "string"
+ },
+ "preferred_support_url": {
+ "id": "preferred_support_url",
+ "type": "string"
+ },
+ "labels": {
+ "id": "labels",
+ "type": "array",
+ "items": {}
+ },
+ "private": {
+ "id": "private",
+ "type": "boolean"
+ },
+ "creation_date": {
+ "id": "creation_date",
+ "type": "string"
+ },
+ "socialnetworks": {
+ "id": "socialnetworks",
+ "type": "array",
+ "items": {
+ "id": "1",
+ "type": "object",
+ "properties": {
+ "accounturl": {
+ "id": "accounturl",
+ "type": "string"
+ },
+ "socialnetwork": {
+ "id": "socialnetwork",
+ "type": "string"
+ }
+ }
+ }
+ },
+ "tools": {
+ "id": "tools",
+ "type": "array",
+ "items": {
+ "id": "5",
+ "type": "object",
+ "properties": {
+ "mount_point": {
+ "id": "mount_point",
+ "type": "string"
+ },
+ "name": {
+ "id": "name",
+ "type": "string"
+ },
+ "label": {
+ "id": "label",
+ "type": "string"
+ }
+ }
+ }
+ },
+ "categories": {
+ "id": "categories",
+ "type": "object",
+ "properties": {
+ "developmentstatus": {
+ "id": "developmentstatus",
+ "type": "array",
+ "items": {}
+ },
+ "environment": {
+ "id": "environment",
+ "type": "array",
+ "items": {}
+ },
+ "language": {
+ "id": "language",
+ "type": "array",
+ "items": {}
+ },
+ "license": {
+ "id": "license",
+ "type": "array",
+ "items": {}
+ },
+ "database": {
+ "id": "database",
+ "type": "array",
+ "items": {}
+ },
+ "topic": {
+ "id": "topic",
+ "type": "array",
+ "items": {}
+ },
+ "audience": {
+ "id": "audience",
+ "type": "array",
+ "items": {}
+ },
+ "translation": {
+ "id": "translation",
+ "type": "array",
+ "items": {}
+ },
+ "os": {
+ "id": "os",
+ "type": "array",
+ "items": {}
+ }
+ }
+ },
+ "_id": {
+ "id": "_id",
+ "type": "string"
+ },
+ "name": {
+ "id": "name",
+ "type": "string"
+ },
+ "url": {
+ "id": "url",
+ "type": "string"
+ },
+ "icon_url": {
+ "id": "icon_url",
+ "type": "null"
+ },
+ "video_url": {
+ "id": "video_url",
+ "type": "string"
+ },
+ "screenshots": {
+ "id": "screenshots",
+ "type": "array",
+ "items": {}
+ },
+ "summary": {
+ "id": "summary",
+ "type": "string"
+ },
+ "short_description": {
+ "id": "short_description",
+ "type": "null"
+ },
+ "moved_to_url": {
+ "id": "moved_to_url",
+ "type": "string"
+ },
+ "shortname": {
+ "id": "shortname",
+ "type": "string"
+ },
+ "developers": {
+ "id": "developers",
+ "type": "array",
+ "items": {
+ "id": "0",
+ "type": "object",
+ "properties": {
+ "url": {
+ "id": "url",
+ "type": "string"
+ },
+ "username": {
+ "id": "username",
+ "type": "string"
+ },
+ "name": {
+ "id": "name",
+ "type": "string"
+ }
+ }
+ }
+ },
+ "external_homepage": {
+ "id": "external_homepage",
+ "type": "string"
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/allura/blob/26375dad/Allura/docs/api-rest/schemas/userProfile.json
----------------------------------------------------------------------
diff --git a/Allura/docs/api-rest/schemas/userProfile.json b/Allura/docs/api-rest/schemas/userProfile.json
new file mode 100755
index 0000000..a2fde7b
--- /dev/null
+++ b/Allura/docs/api-rest/schemas/userProfile.json
@@ -0,0 +1,266 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "id": "/",
+ "type": "object",
+ "title": "User Profile.",
+ "name": "/",
+ "properties": {
+ "username": {
+ "id": "username",
+ "type": "string",
+ "name": "username"
+ },
+ "name": {
+ "id": "name",
+ "type": "string",
+ "title": "Full Name.",
+ "description": "A user's first and last name.",
+ "name": "name"
+ },
+ "localization": {
+ "id": "localization",
+ "type": "object",
+ "description": "General Location.",
+ "name": "localization",
+ "properties": {
+ "city": {
+ "id": "city",
+ "type": "string",
+ "name": "city"
+ },
+ "country": {
+ "id": "country",
+ "type": "string",
+ "name": "country"
+ }
+ }
+ },
+ "skills": {
+ "id": "skills",
+ "type": "array",
+ "title": "Skills.",
+ "description": "A list of skills and associated skill levels.",
+ "name": "skills",
+ "items": {
+ "id": "0",
+ "type": "object",
+ "title": "0 schema.",
+ "name": "0",
+ "properties": {
+ "comment": {
+ "id": "comment",
+ "type": "string",
+ "title": "Comment.",
+ "description": "Additional comments about a given skill.",
+ "name": "comment"
+ },
+ "skill": {
+ "id": "skill",
+ "type": "object",
+ "title": "Skill schema.",
+ "name": "skill",
+ "properties": {
+ "fullpath": {
+ "id": "fullpath",
+ "type": "string",
+ "title": "Full Path.",
+ "description": "Category hierarchy.",
+ "name": "fullpath"
+ },
+ "fullname": {
+ "id": "fullname",
+ "type": "string",
+ "title": "Fullname schema.",
+ "description": "Name of category.",
+ "name": "fullname"
+ },
+ "shortname": {
+ "id": "shortname",
+ "type": "string",
+ "title": "Shortname.",
+ "description": "Short form of category.",
+ "name": "shortname"
+ },
+ "id": {
+ "id": "id",
+ "type": "integer",
+ "title": "Id.",
+ "description": "Unique identifier",
+ "name": "id"
+ }
+ }
+ },
+ "level": {
+ "id": "level",
+ "type": "string",
+ "enum": ["low", "medium", "high"],
+ "title": "Skill Level.",
+ "description": "low, medium or high",
+ "name": "level"
+ }
+ }
+ }
+ },
+ "webpages": {
+ "id": "webpages",
+ "type": "array",
+ "title": "Webpages schema.",
+ "description": "A list of URL strings associated with a user.",
+ "name": "webpages",
+ "items": {}
+ },
+ "joined": {
+ "id": "joined",
+ "type": "string",
+ "title": "Joined schema.",
+ "description": "The date a user signed up.",
+ "name": "joined"
+ },
+ "socialnetworks": {
+ "id": "socialnetworks",
+ "type": "array",
+ "title": "Social Networks.",
+ "description": "A list of social networks URLs.",
+ "name": "socialnetworks",
+ "items": {
+ "type": "object",
+ "properties": {
+ "accounturl": {
+ "id": "accounturl",
+ "type": "string",
+ "title": "Account Url.",
+ "description": "URL to the associated user account on the social network site.",
+ "name": "accounturl"
+ },
+ "socialnetwork": {
+ "id": "socialnetwork",
+ "type": "string",
+ "title": "Socialnetwork schema.",
+ "description": "Name of the social networking site.",
+ "name": "socialnetwork"
+ }
+ }
+ }
+ },
+ "telnumbers": {
+ "id": "telnumbers",
+ "type": "array",
+ "title": "Telnumbers schema.",
+ "description": "A list of phone numbers as strings.",
+ "name": "telnumbers",
+ "items": {}
+ },
+ "sex": {
+ "id": "sex",
+ "type": "string",
+ "name": "sex"
+ },
+ "availability": {
+ "id": "availability",
+ "type": "array",
+ "title": "Availability.",
+ "description": "Indicates the availability of a user.",
+ "name": "availability",
+ "items": {
+ "type": "object",
+ "description": "An explanation about the puropose of this instance described by this schema.",
+ "properties": {
+ "start_time": {
+ "id": "start_time",
+ "type": "object",
+ "title": "Start Time.",
+ "description": "The start of a user's availability.",
+ "name": "start_time",
+ "properties": {
+ "h": {
+ "id": "h",
+ "type": "integer",
+ "title": "Hour.",
+ "name": "h"
+ },
+ "m": {
+ "id": "m",
+ "type": "integer",
+ "title": "Minute.",
+ "name": "m"
+ }
+ }
+ },
+ "week_day": {
+ "id": "week_day",
+ "type": "string",
+ "title": "Week Day.",
+ "description": "Day of week.",
+ "name": "week_day"
+ },
+ "end_time": {
+ "id": "end_time",
+ "type": "object",
+ "title": "End Time.",
+ "description": "The end of a user's availability.",
+ "name": "end_time",
+ "properties": {
+ "h": {
+ "id": "h",
+ "type": "integer",
+ "title": "Hour.",
+ "name": "h"
+ },
+ "m": {
+ "id": "m",
+ "type": "integer",
+ "title": "Minute.",
+ "name": "m"
+ }
+ }
+ }
+ }
+ }
+ },
+ "projects": {
+ "id": "projects",
+ "type": "array",
+ "title": "Projects.",
+ "description": "A list of projects accociated with a user.",
+ "name": "projects",
+ "items": {
+ "type": "object",
+ "description": "Apache Allura project.",
+ "properties": {
+ "url": {
+ "id": "url",
+ "type": "string",
+ "title": "Project Url.",
+ "name": "url"
+ },
+ "last_updated": {
+ "id": "last_updated",
+ "type": "string",
+ "title": "Last Updated.",
+ "description": "string formatted timestamp.",
+ "name": "last_updated"
+ },
+ "name": {
+ "id": "name",
+ "type": "string",
+ "title": "Name.",
+ "name": "name"
+ },
+ "summary": {
+ "id": "summary",
+ "type": "string",
+ "title": "Project Summary.",
+ "name": "summary"
+ }
+ }
+ }
+ },
+ "skypeaccount": {
+ "id": "skypeaccount",
+ "type": ["null", "string"],
+ "title": "Skype Account.",
+ "description": "Skype account username.",
+ "name": "skypeaccount"
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/allura/blob/26375dad/Allura/docs/api-rest/schemas/webhook.json
----------------------------------------------------------------------
diff --git a/Allura/docs/api-rest/schemas/webhook.json b/Allura/docs/api-rest/schemas/webhook.json
new file mode 100755
index 0000000..a855903
--- /dev/null
+++ b/Allura/docs/api-rest/schemas/webhook.json
@@ -0,0 +1,34 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "id": "http://jsonschema.net",
+ "type": "object",
+ "properties": {
+ "hook_url": {
+ "id": "http://jsonschema.net/hook_url",
+ "type": "string"
+ },
+ "mod_date": {
+ "id": "http://jsonschema.net/mod_date",
+ "type": "string"
+ },
+ "url": {
+ "id": "http://jsonschema.net/url",
+ "type": "string"
+ },
+ "_id": {
+ "id": "http://jsonschema.net/_id",
+ "type": "string"
+ },
+ "type": {
+ "id": "http://jsonschema.net/type",
+ "type": "string"
+ }
+ },
+ "required": [
+ "hook_url",
+ "mod_date",
+ "url",
+ "_id",
+ "type"
+ ]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/allura/blob/26375dad/Allura/docs/api-rest/schemas/webhooks.json
----------------------------------------------------------------------
diff --git a/Allura/docs/api-rest/schemas/webhooks.json b/Allura/docs/api-rest/schemas/webhooks.json
new file mode 100755
index 0000000..4c10e81
--- /dev/null
+++ b/Allura/docs/api-rest/schemas/webhooks.json
@@ -0,0 +1,57 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "id": "/",
+ "type": "object",
+ "properties": {
+ "webhooks": {
+ "id": "webhooks",
+ "type": "array",
+ "items": {
+ "id": "1",
+ "type": "object",
+ "properties": {
+ "url": {
+ "id": "url",
+ "type": "string"
+ },
+ "mod_date": {
+ "id": "mod_date",
+ "type": "string"
+ },
+ "_id": {
+ "id": "_id",
+ "type": "string"
+ },
+ "type": {
+ "id": "type",
+ "type": "string"
+ },
+ "hook_url": {
+ "id": "hook_url",
+ "type": "string"
+ }
+ }
+ }
+ },
+ "limits": {
+ "id": "limits",
+ "type": "object",
+ "properties": {
+ "repo-push": {
+ "id": "repo-push",
+ "type": "object",
+ "properties": {
+ "max": {
+ "id": "max",
+ "type": "integer"
+ },
+ "used": {
+ "id": "used",
+ "type": "integer"
+ }
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/allura/blob/26375dad/Allura/docs/api-rest/schemas/wiki.json
----------------------------------------------------------------------
diff --git a/Allura/docs/api-rest/schemas/wiki.json b/Allura/docs/api-rest/schemas/wiki.json
new file mode 100755
index 0000000..7859527
--- /dev/null
+++ b/Allura/docs/api-rest/schemas/wiki.json
@@ -0,0 +1,16 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema",
+ "type": "object",
+ "id": "#",
+ "properties": {
+ "pages": {
+ "items": {
+ "type": "string",
+ "id": "0"
+ },
+ "type": "array",
+ "id": "pages"
+ }
+ }
+}
+
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/allura/blob/26375dad/Allura/docs/api-rest/securitySchemes.yaml
----------------------------------------------------------------------
diff --git a/Allura/docs/api-rest/securitySchemes.yaml b/Allura/docs/api-rest/securitySchemes.yaml
new file mode 100755
index 0000000..a7927cc
--- /dev/null
+++ b/Allura/docs/api-rest/securitySchemes.yaml
@@ -0,0 +1,8 @@
+- oauth_1_0:
+ description: |
+ Apache Allura supports OAuth 1.0 for authenticating API requests.
+ type: OAuth 1.0
+ settings:
+ requestTokenUri: https://forge-allura.apache.org/rest/oauth/request_token
+ authorizationUri: https://forge-allura.apache.org/rest/oauth/authorize
+ tokenCredentialsUri: https://forge-allura.apache.org/rest/oauth/access_token
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/allura/blob/26375dad/Allura/docs/api-rest/traits.yaml
----------------------------------------------------------------------
diff --git a/Allura/docs/api-rest/traits.yaml b/Allura/docs/api-rest/traits.yaml
new file mode 100755
index 0000000..d483810
--- /dev/null
+++ b/Allura/docs/api-rest/traits.yaml
@@ -0,0 +1,80 @@
+- searchable:
+ queryParameters:
+ query:
+ description: |
+ JSON array [{"field1","value1","operator1"},{"field2","value2","operator2"},...,{"fieldN","valueN","operatorN"}] <<description>>
+ example: |
+ <<example>>
+- orderable:
+ queryParameters:
+ orderBy:
+ description: |
+ Order by field: <<fieldsList>>
+ type: string
+ required: false
+ order:
+ description: Order
+ enum: [desc, asc]
+ default: desc
+ required: false
+- pageable:
+ queryParameters:
+ page:
+ description: Skip over a number of elements by specifying an offset value for the query
+ type: integer
+ required: false
+ example: 2
+ default: 0
+ limit:
+ description: Limit the number of elements on the response
+ type: integer
+ required: false
+ example: 5
+ default: 10
+- paged:
+ queryParameters:
+ numPages:
+ description: The number of pages to return
+- secured:
+ displayName: secured
+ headers:
+ Authorization:
+ description: The auth token for this request
+ responses:
+ 401:
+ description: Unauthorized
+- rateLimited:
+ queryParameters:
+ numPages:
+ description: The number of pages to return, not to exceed <<maxPages>>
+- permissionTestable:
+ description: |
+ **Endpoints**
+ Permissions can be checked at three levels:
+ 1. **Neighborhood:** `/rest/p/has_access`
+ 2. **Project:** `/rest/p/project_name/has_access`
+ 3. **Tool:** `/rest/p/project_name/mount_point/has_access`
+
+ ---
+
+ It is only available to users that have 'admin' permission for corresponding neighborhood/project/tool. It requires user and perm parameters and will return JSON dict with result key, which contains boolean value, indicating if given user has perm permission to the neighborhood/project/tool.
+
+ E.g.:
+ **GET** `/rest/p/test/wiki/has_access?user=admin1&perm=create`
+ *returns* { result: true }
+ **GET** `/rest/p/test/wiki/has_access?user=user01&perm=create`
+ *returns* { result: false }
+
+ queryParameters:
+ user:
+ type: string
+ example: heiths
+ required: true
+ description: The username to check
+ perm:
+ displayName: Permission
+ required: true
+ type: string
+ example: create
+ default: read
+ enum: ["read", "admin", "create", "update"]
\ No newline at end of file