From c25a1d65ed2c94b65741d81862a7612ae12bdf76 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Tue, 01 Nov 2011 18:19:44 -0400
Subject: [PATCH] Branch renderer. String change. Config section name changes.

---
 docs/02_rpc.mkd |   88 ++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 84 insertions(+), 4 deletions(-)

diff --git a/docs/02_rpc.mkd b/docs/02_rpc.mkd
index fbc5e44..bf2cf24 100644
--- a/docs/02_rpc.mkd
+++ b/docs/02_rpc.mkd
@@ -14,9 +14,12 @@
 ### RPC Requests
 
 <table>
-<tr><th colspan='2'>url parameters</th><th rowspan='2'>required<br/>permission</th><th colspan='2'>json</th></tr>
+<tr><th colspan='2'>url parameters</th><th rowspan='2'>required<br/>user<br/>permission</th><th colspan='2'>json</th></tr>
 <tr><th>req=</th><th>name=</th><th>post body</th><th>response body</th></tr>
+<tr><td colspan='5'><em>web.enableRpcServlet=true</em></td></tr>
 <tr><td>LIST_REPOSITORIES</td><td>-</td><td>-</td><td>-</td><td>Map&lt;String, RepositoryModel&gt;</td></tr>
+<tr><td>LIST_BRANCHES</td><td>-</td><td>-</td><td>-</td><td>Map&lt;String, List&lt;String&gt;&gt;</td></tr>
+<tr><td colspan='5'><em>web.enableRpcManagement=true</em></td></tr>
 <tr><td>CREATE_REPOSITORY</td><td>repository name</td><td><em>admin</em></td><td>RepositoryModel</td><td>-</td></tr>
 <tr><td>EDIT_REPOSITORY</td><td>repository name</td><td><em>admin</em></td><td>RepositoryModel</td><td>-</td></tr>
 <tr><td>DELETE_REPOSITORY</td><td>repository name</td><td><em>admin</em></td><td>-</td><td>-</td></tr>
@@ -26,14 +29,18 @@
 <tr><td>DELETE_USER</td><td>user name</td><td><em>admin</em></td><td>-</td><td>-</td></tr>
 <tr><td>LIST_REPOSITORY_MEMBERS</td><td>repository name</td><td><em>admin</em></td><td>-</td><td>List&lt;String&gt;</td></tr>
 <tr><td>SET_REPOSITORY_MEMBERS</td><td>repository name</td><td><em>admin</em></td><td>List&lt;String&gt;</td><td>-</td></tr>
+<tr><td>LIST_SETTINGS</td><td>-</td><td><em>admin</em></td><td>-</td><td>ServerSettings (management keys)</td></tr>
+<tr><td colspan='5'><em>web.enableRpcAdministration=true</em></td></tr>
 <tr><td>LIST_FEDERATION_REGISTRATIONS</td><td>-</td><td><em>admin</em></td><td>-</td><td>List&lt;FederationModel&gt;</td></tr>
 <tr><td>LIST_FEDERATION_RESULTS</td><td>-</td><td><em>admin</em></td><td>-</td><td>List&lt;FederationModel&gt;</td></tr>
 <tr><td>LIST_FEDERATION_PROPOSALS</td><td>-</td><td><em>admin</em></td><td>-</td><td>List&lt;FederationProposal&gt;</td></tr>
 <tr><td>LIST_FEDERATION_SETS</td><td>-</td><td><em>admin</em></td><td>-</td><td>List&lt;FederationSet&gt;</td></tr>
-<tr><td>LIST_SETTINGS</td><td>-</td><td><em>admin</em></td><td>-</td><td>Properties</td></tr>
+<tr><td>LIST_SETTINGS</td><td>-</td><td><em>admin</em></td><td>-</td><td>ServerSettings (all keys)</td></tr>
+<tr><td>EDIT_SETTINGS</td><td>-</td><td><em>admin</em></td><td>Map&lt;String, String&gt;</td><td>-</td></tr>
+<tr><td>LIST_STATUS</td><td>-</td><td><em>admin</em></td><td>-</td><td>ServerStatus (see example below)</td></tr>
 </table>
 
-### RPC Response Codes
+### RPC/HTTP Response Codes
 <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>
@@ -47,13 +54,18 @@
 ### Gitblit Manager
 
 [Gitblit Manager](http://code.google.com/p/gitblit/downloads/detail?name=%MANAGER%) is an example Java/Swing application that allows remote administration of a Gitblit server.  
-This application exercises most methods from the utility class `com.gitblit.utils.RpcUtils`.
+This application exercises many, but not all, methods from the utility class `com.gitblit.utils.RpcUtils`.
+
+**NOTE:**  
+Gitblit Manager stores your login credentials **INSECURELY** in homedir/.gitblit/config.
 
 ### EGit "Import from Gitblit" Feature (Planning)
 
 One obvious goal of a Gitblit RPC mechanism would be to have an EGit Feature that allows authentication and enumeration of Gitblit repositories from the Eclipse *Import...* menu.  Cloning (hopefully batch) would be 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.
 
@@ -80,6 +92,8 @@
       "libraries"
     ],
     "isFederated": false,
+    "skipSizeCalculation": false,
+    "skipSummaryMetrics": false,
     "size": "102 KB"
   },
   "https://localhost/git/libraries/smack.git": {
@@ -97,6 +111,8 @@
     "federationStrategy": "FEDERATE_THIS",
     "federationSets": [],
     "isFederated": false,
+    "skipSizeCalculation": false,
+    "skipSummaryMetrics": false,
     "size": "4.8 MB"
   }
 }
@@ -126,6 +142,8 @@
       "libraries"
     ],
     "isFederated": false,
+    "skipSizeCalculation": false,
+    "skipSummaryMetrics": false,
     "size": "102 KB"
 }
 </pre>
@@ -153,4 +171,66 @@
     ]
   }
 ]
+</pre>
+
+### Example: LIST_SETTINGS
+**url**: https://localhost/rpc?req=LIST_SETTINGS  
+**response body**: ServerSettings
+<pre>
+{
+  "settings": {
+      "web.siteName": {
+        "name": "web.siteName",
+        "currentValue": "",
+        "defaultValue": "",
+        "description": "Gitblit Web Settings\nIf blank Gitblit is displayed.",
+        "since": "0.5.0",
+        "caseSensitive": false,
+        "restartRequired": false,
+        "spaceDelimited": false
+      },
+      "web.summaryCommitCount": {
+        "name": "web.summaryCommitCount",
+        "currentValue": "16",
+        "defaultValue": "16",
+        "description": "The number of commits to display on the summary page\nValue must exceed 0 else default of 16 is used",
+        "since": "0.5.0",
+        "caseSensitive": false,
+        "restartRequired": false,
+        "spaceDelimited": false
+      }
+  }
+}
+</pre>
+
+### Example: LIST_STATUS
+**url**: https://localhost/rpc?req=LIST_STATUS  
+**response body**: ServerStatus
+<pre>
+{
+  "bootDate": "2011-10-22T12:13:00Z",
+  "version": "0.7.0-SNAPSHOT",
+  "releaseDate": "PENDING",
+  "isGO": true,
+  "systemProperties": {
+    "file.encoding": "Cp1252",
+    "java.home": "C:\\Program Files\\Java\\jdk1.6.0_26\\jre",
+    "java.io.tmpdir": "C:\\Users\\JAMESM~1\\AppData\\Local\\Temp\\",
+    "java.runtime.name": "Java(TM) SE Runtime Environment",
+    "java.runtime.version": "1.6.0_26-b03",
+    "java.vendor": "Sun Microsystems Inc.",
+    "java.version": "1.6.0_26",
+    "java.vm.info": "mixed mode",
+    "java.vm.name": "Java HotSpot(TM) 64-Bit Server VM",
+    "java.vm.vendor": "Sun Microsystems Inc.",
+    "java.vm.version": "20.1-b02",
+    "os.arch": "amd64",
+    "os.name": "Windows 7",
+    "os.version": "6.1"
+  },
+  "heapAllocated": 128057344,
+  "heapFree": 120399168,
+  "heapSize": 1899560960,
+  "servletContainer": "jetty/7.4.3.v20110701"
+}
 </pre>
\ No newline at end of file

--
Gitblit v1.9.1