Skip to content
This repository
Browse code

updated doc to reflect v0.2 changes

  • Loading branch information...
commit 65bfcbee0cb050a1a0e6a9cf0f9647e3e7ad4609 1 parent e673745
Jared Wilkening authored March 22, 2012

Showing 2 changed files with 73 additions and 15 deletions. Show diff stats Hide diff stats

  1. 85  README.md
  2. 3  Roadmap.txt
85  README.md
Source Rendered
@@ -24,25 +24,22 @@ To build:
24 24
 
25 25
 Unix/Macintosh 
26 26
 
27  
-To install go weekly.2012-01-20 ([weekly.golang.org/doc/install/source](http://weekly.golang.org/doc/install/source)):
  27
+To install go weekly.2012-03-13 ([weekly.golang.org/doc/install/source](http://weekly.golang.org/doc/install/source)):
28 28
     
29 29
     hg clone -u release https://code.google.com/p/go
30 30
     hg pull
31  
-    hg update weekly.2012-01-20
  31
+    hg update weekly.2012-03-13
32 32
     cd go/src
33 33
     ./all.bash
34 34
     <add ../bin to $PATH>
35 35
 
36 36
 To build Shock:
37 37
 
38  
-    git clone <this repo>
39  
-    cd Shock
40  
-    export GOPATH=`pwd`
41  
-    go install shock/shock-server
  38
+    go get github.com/MG-RAST/Shock/shock-server
42 39
   
43 40
 To run (additional requires mongodb=>2.0.3):
44 41
   
45  
-    ./bin/shock-server -port=<port to listen on> -data=<data directory to store on disk files> -mongo=<hostname(s) of mongodb>
  42
+    shock-server -port=<port to listen on> -data=<data directory to store on disk files> -mongo=<hostname(s) of mongodb> -secretkey=<secret key>
46 43
 
47 44
 Command-line client:
48 45
 -------------------
@@ -160,12 +157,13 @@ All responses from Shock currently are in the following encoding.
160 157
 ### Create node:
161 158
 POST /node (multipart/form-data encoded)
162 159
 
  160
+ - optionally takes user/password via Basic Auth. If set only that user with have access to the node
163 161
  - to set attributes include file field named "attributes" containing a json file of attributes
164 162
  - to set file include file field named "file" containing any file
165 163
 
166 164
 ##### example
167 165
 	
168  
-	curl -X POST [ -F "attributes=@<path_to_json>" -F "file=@<path_to_data_file>" ] http://<shock_host>[:<port>]/node
  166
+	curl -X POST [ --user user:password ] [ -F "attributes=@<path_to_json>" -F "file=@<path_to_data_file>" ] http://<shock_host>[:<port>]/node
169 167
 	
170 168
 ##### returns
171 169
 
@@ -176,10 +174,10 @@ POST /node (multipart/form-data encoded)
176 174
         "S": <http status of request>
177 175
     } 
178 176
 
179  
-<br/>
180 177
 ### List nodes:
181 178
 GET /node
182 179
 
  180
+ - optionally takes user/password via Basic Auth. Grants access to non-public data
183 181
  - by adding ?skip=N you get the nodes starting at N+1 
184 182
  - by adding ?limit=N you get a maximum of N nodes returned 
185 183
 
@@ -200,7 +198,7 @@ Multiple attributes can be selected in a single query and are treated as AND ope
200 198
 
201 199
 ##### example
202 200
 	
203  
-	curl -X GET http://<shock_host>[:<port>]/node/[?skip=<skip>&limit=<count>][&query&<tag>=<value>]
  201
+	curl -X GET [ --user user:password ] http://<shock_host>[:<port>]/node/[?skip=<skip>&limit=<count>][&query&<tag>=<value>]
204 202
 		
205 203
 ##### returns
206 204
 
@@ -211,21 +209,80 @@ Multiple attributes can be selected in a single query and are treated as AND ope
211 209
         "S": <http status of request>
212 210
     }
213 211
 
214  
-<br/>	
215 212
 ### Get node:
216 213
 GET /node/:nodeid
217  
-	
  214
+
  215
+ - optionally takes user/password via Basic Auth
218 216
  - ?download - complete file download
  217
+ - ?download&index=size&part=1\[&part=2...\]\[chunksize=inbytes\] - download portion of the file via the size virtual index. Chunksize defaults to 1MB (1048576 bytes).
  218
+
  219
+##### example	
  220
+
  221
+	curl -X GET [ --user user:password ] http://<shock_host>[:<port>]/node/:nodeid
  222
+
  223
+##### returns
  224
+
  225
+    {
  226
+        "C":"",
  227
+        "D": {<node>},
  228
+        "E": <error message or null>, 
  229
+        "S": <http status of request>
  230
+    }
  231
+
  232
+### Create user:
  233
+POST /user
  234
+
  235
+Requires Basic Auth encoded username:password. To create an admin user include :secret_key specified at server start.
219 236
 	
220 237
 ##### example	
221 238
 
222  
-	curl -X GET http://<shock_host>[:<port>]/node/:nodeid
  239
+    # regular user 
  240
+    curl -X POST --user joeuser:1234 http://<shock_host>[:<port>]/user
  241
+    
  242
+    # admin user
  243
+    curl -X POST --user joeuser:1234:supersupersecret http://<shock_host>[:<port>]/user
223 244
 	
224 245
 ##### returns
225 246
 
226 247
     {
227 248
         "C":"",
228  
-        "D": {<node>},
  249
+        "D": {<user>},
  250
+        "E": <error message or null>, 
  251
+        "S": <http status of request>
  252
+    }
  253
+
  254
+### Get user:
  255
+GET /user/:uuid
  256
+
  257
+Requires Basic Auth encoded username:password. Regular user are able to see their own information while Admin user are able to access all. 
  258
+
  259
+##### example	
  260
+
  261
+    curl -X GET --user joeuser:1234 http://<shock_host>[:<port>]/user/:uuid
  262
+
  263
+##### returns
  264
+
  265
+    {
  266
+        "C":"",
  267
+        "D": {<user>},
  268
+        "E": <error message or null>, 
  269
+        "S": <http status of request>
  270
+    }
  271
+
  272
+### List users:
  273
+GET /user
  274
+
  275
+Requires Basic Auth encoded username:password. Restricted to Admin users.
  276
+
  277
+##### example	
  278
+
  279
+    curl -X GET --user joeadmin:12345 http://<shock_host>[:<port>]/user
  280
+
  281
+##### returns
  282
+
  283
+    {
  284
+        "C":"",
  285
+        "D": {[<user>,...]},
229 286
         "E": <error message or null>, 
230 287
         "S": <http status of request>
231 288
     }
3  Roadmap.txt
... ...
@@ -1,7 +1,7 @@
1 1
 Release 0.2 (3/22/12)
2 2
  - Client command (github.com/MG-RAST/ShockClient): Done
3 3
  - basic auth: Done
4  
- - indices
  4
+ - indices (size vitual indexes): Done
5 5
  - node ACLs: Done
6 6
  - basic user management: Done
7 7
  
@@ -15,6 +15,7 @@ Release 0.3 (4/1/12)
15 15
 Release 0.4 (4/25/12)
16 16
 
17 17
 Unfiled:
  18
+ - generic indices
18 19
  - testing
19 20
  - OAuth
20 21
  - client command (go version)

0 notes on commit 65bfcbe

Please sign in to comment.
Something went wrong with that request. Please try again.