From 8f0f665b9ee4e2cd21e9e0d5d7cfc69b1d19b86f Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Mon, 05 May 2014 12:46:02 -0400 Subject: [PATCH] Merged #23 "Enhance the plugin infrastructure to allow deeper plugin integration" --- src/site/rpc.mkd | 47 +++++++++++++++++++++++++---------------------- 1 files changed, 25 insertions(+), 22 deletions(-) diff --git a/src/site/rpc.mkd b/src/site/rpc.mkd index 35528bf..b86fd9a 100644 --- a/src/site/rpc.mkd +++ b/src/site/rpc.mkd @@ -21,15 +21,6 @@ **NOTE:** Gitblit Manager stores your login credentials **INSECURELY** in homedir/.gitblit/config. -### Eclipse/EGit "Import from Gitblit" Feature (Planning) - -One obvious goal of a Gitblit RPC mechanism would be to have an Eclipse/EGit Feature that allows authentication and enumeration of Gitblit repositories from the Eclipse *Import...* menu. Batch cloning would be supported and delegated to EGit. - -This particular project should not be difficult as the only external dependency for `com.gitblit.utils.RpcUtils` is [google-gson](http://google-gson.googlecode.com) which is already a dependency of the EGit/GitHub Mylyn feature. - -One proposal from the EGit team is to define a common JSON RPC method for enumeration of repositories which can be implemented by Git hosts. The EGit team would then implement the UI and the client-side enumeration code. This idea was raised as part of this [feature request for EGit](https://bugs.eclipse.org/bugs/show_bug.cgi?id=361251). - -Currently this project is in the planning stage. ## RSS Query Interface @@ -58,6 +49,7 @@ ## JSON Remote Procedure Call (RPC) Interface ### RPC Protocol Versions + <table class="table"> <tbody> <tr><th>Release</th><th>Protocol Version</th></tr> @@ -66,6 +58,8 @@ <tr><td>Gitblit v0.9.0 - v1.0.0</td><td>3</td></tr> <tr><td>Gitblit v1.1.0</td><td>4</td></tr> <tr><td>Gitblit v1.2.0+</td><td>5</td></tr> +<tr><td>Gitblit v1.3.1+</td><td>6</td></tr> +<tr><td>Gitblit v1.4.0+</td><td>7</td></tr> </tbody> </table> @@ -77,6 +71,7 @@ Use *SET_REPOSITORY_TEAM_PERMISSIONS* instead. ### RPC Request and Response Types + <table class="table"> <tr><th colspan='2'>url parameters</th><th rowspan='2'>required<br/>user<br/>permission</th><th rowspan='2'>protocol<br/>version</th><th colspan='2'>json</th></tr> <tr><th>req=</th><th>name=</th><th>post body</th><th>response body</th></tr> @@ -85,18 +80,19 @@ <tr><td>LIST_REPOSITORIES</td><td>-</td><td>-</td><td>1</td><td>-</td><td>Map<String, RepositoryModel></td></tr> <tr><td>LIST_BRANCHES</td><td>-</td><td>-</td><td>1</td><td>-</td><td>Map<String, List<String>></td></tr> <tr><td>LIST_SETTINGS</td><td>-</td><td><em>-</em></td><td>1</td><td>-</td><td>ServerSettings (basic keys)</td></tr> +<tr><td>GET_USER</td><td>user name</td><td>-</td><td>6</td><td>-</td><td>UserModel</td></tr> <tr><td colspan='6'><em>web.enableRpcManagement=true</em></td></tr> <tr><td>CREATE_REPOSITORY</td><td>repository name</td><td><em>admin</em></td><td>1</td><td>RepositoryModel</td><td>-</td></tr> <tr><td>EDIT_REPOSITORY</td><td>repository name</td><td><em>admin</em></td><td>1</td><td>RepositoryModel</td><td>-</td></tr> -<tr><td>DELETE_REPOSITORY</td><td>repository name</td><td><em>admin</em></td><td>1</td><td>-</td><td>-</td></tr> +<tr><td>DELETE_REPOSITORY</td><td>repository name</td><td><em>admin</em></td><td>1</td><td>RepositoryModel</td><td>-</td></tr> <tr><td>LIST_USERS</td><td>-</td><td><em>admin</em></td><td>1</td><td>-</td><td>List<UserModel></td></tr> <tr><td>CREATE_USER</td><td>user name</td><td><em>admin</em></td><td>1</td><td>UserModel</td><td>-</td></tr> <tr><td>EDIT_USER</td><td>user name</td><td><em>admin</em></td><td>1</td><td>UserModel</td><td>-</td></tr> -<tr><td>DELETE_USER</td><td>user name</td><td><em>admin</em></td><td>1</td><td>-</td><td>-</td></tr> +<tr><td>DELETE_USER</td><td>user name</td><td><em>admin</em></td><td>1</td><td>UserModel</td><td>-</td></tr> <tr><td>LIST_TEAMS</td><td>-</td><td><em>admin</em></td><td>2</td><td>-</td><td>List<TeamModel></td></tr> <tr><td>CREATE_TEAM</td><td>team name</td><td><em>admin</em></td><td>2</td><td>TeamModel</td><td>-</td></tr> <tr><td>EDIT_TEAM</td><td>team name</td><td><em>admin</em></td><td>2</td><td>TeamModel</td><td>-</td></tr> -<tr><td>DELETE_TEAM</td><td>team name</td><td><em>admin</em></td><td>2</td><td>-</td><td>-</td></tr> +<tr><td>DELETE_TEAM</td><td>team name</td><td><em>admin</em></td><td>2</td><td>TeamModel</td><td>-</td></tr> <tr><td>LIST_REPOSITORY_MEMBERS</td><td>repository name</td><td><em>admin</em></td><td>1</td><td>-</td><td>List<String></td></tr> <tr><td><s>SET_REPOSITORY_MEMBERS</s></td><td><s>repository name</s></td><td><em><s>admin</s></em></td><td><s>1</s></td><td><s>List<String></s></td><td>-</td></tr> <tr><td>LIST_REPOSITORY_MEMBER_PERMISSIONS</td><td>repository name</td><td><em>admin</em></td><td>5</td><td>-</td><td>List<String></td></tr> @@ -107,6 +103,7 @@ <tr><td>SET_REPOSITORY_TEAM_PERMISSIONS</td><td>repository name</td><td><em>admin</em></td><td>5</td><td>List<String></td><td>-</td></tr> <tr><td>LIST_SETTINGS</td><td>-</td><td><em>admin</em></td><td>1</td><td>-</td><td>ServerSettings (management keys)</td></tr> <tr><td>CLEAR_REPOSITORY_CACHE</td><td>-</td><td><em>-</em></td><td>4</td><td>-</td><td>-</td></tr> +<tr><td>REINDEX_TICKETS</td><td>repository name</td><td><em>-</em></td><td>7</td><td>-</td><td>-</td></tr> <tr><td colspan='6'><em>web.enableRpcAdministration=true</em></td></tr> <tr><td>LIST_FEDERATION_REGISTRATIONS</td><td>-</td><td><em>admin</em></td><td>1</td><td>-</td><td>List<FederationModel></td></tr> <tr><td>LIST_FEDERATION_RESULTS</td><td>-</td><td><em>admin</em></td><td>1</td><td>-</td><td>List<FederationModel></td></tr> @@ -118,6 +115,7 @@ </table> ### RPC/HTTP Response Codes + <table class="table"> <tr><th>code</th><th>name</th><th>description</th></tr> <tr><td>200</td><td>success</td><td>Gitblit processed the request successfully</td></tr> @@ -132,7 +130,8 @@ **url**: https://localhost/rpc?req=LIST_REPOSITORIES **response body**: Map<String, RepositoryModel> where the map key is the clone url of the repository -<pre> + +```json { "https://localhost/git/libraries/xmlapache.git": { "name": "libraries/xmlapache.git", @@ -175,7 +174,7 @@ "size": "4.8 MB" } } -</pre> +``` ### Example: EDIT_REPOSITORY (rename) @@ -183,7 +182,8 @@ **url**: https://localhost/rpc?req=EDIT_REPOSITORY&name=libraries/xmlapache.git **post body**: RepositoryModel -<pre> + +```json { "name": "libraries/xmlapache-renamed.git", "description": "apache xmlrpc client and server", @@ -205,12 +205,13 @@ "skipSummaryMetrics": false, "size": "102 KB" } -</pre> +``` ### Example: LIST_USERS **url**: https://localhost/rpc?req=LIST_USERS **response body**: List<UserModel> -<pre> + +```json [ { "username": "admin", @@ -230,12 +231,13 @@ ] } ] -</pre> +``` ### Example: LIST_SETTINGS **url**: https://localhost/rpc?req=LIST_SETTINGS **response body**: ServerSettings -<pre> + +```json { "settings": { "web.siteName": { @@ -260,12 +262,13 @@ } } } -</pre> +``` ### Example: LIST_STATUS **url**: https://localhost/rpc?req=LIST_STATUS **response body**: ServerStatus -<pre> + +```json { "bootDate": "2011-10-22T12:13:00Z", "version": "0.7.0-SNAPSHOT", @@ -292,4 +295,4 @@ "heapSize": 1899560960, "servletContainer": "jetty/7.4.3.v20110701" } -</pre> \ No newline at end of file +``` -- Gitblit v1.9.1