Revision 6848eae1

b/docs/pithos-api-guide.rst
116 116

  
117 117
Client software using Pithos, should forward to the ``/feedback`` URI. The Pithos service, depending on its configuration will delegate the request to the appropriate identity management URI.
118 118

  
119
========================= =========  ==================
120
Uri                       Method     Description
121
========================= =========  ==================
122
``/feedback``             POST       Send feedback
123
========================= =========  ==================
119
============================ =========  ==================
120
Uri                          Method     Description
121
============================ =========  ==================
122
``/pithos/astakos/feedback`` POST       Send feedback
123
============================ =========  ==================
124 124

  
125 125
|
126 126

  
......
156 156

  
157 157
Client software using Pithos, should forward to the ``/user_catalogs`` URI to get uuid to displayname translations and vice versa. The Pithos service, depending on its configuration will delegate the request to the appropriate identity management URI.
158 158

  
159
================================ =========  ==================
160
Uri                              Method     Description
161
================================ =========  ==================
162
``/user_catalogs``               POST       Get 2 catalogs containing uuid to displayname mapping and the opposite
163
================================ =========  ==================
159
================================= =========  ==================
160
Uri                               Method     Description
161
================================= =========  ==================
162
``/pithos/astakos/user_catalogs`` POST       Get 2 catalogs containing uuid to displayname mapping and the opposite
163
================================= =========  ==================
164 164

  
165 165
|
166 166

  
......
272 272

  
273 273
::
274 274

  
275
  [{"name": "user", "last_modified": "2011-12-02T08:10:41.565891+00:00"}, ...]
275
  [{"name": "user-uuid", "last_modified": "2011-12-02T08:10:41.565891+00:00"}, ...]
276 276

  
277 277
Example ``format=xml`` reply:
278 278

  
......
281 281
  <?xml version="1.0" encoding="UTF-8"?>
282 282
  <accounts>
283 283
    <account>
284
      <name>user</name>
284
      <name>user-uuid</name>
285 285
      <last_modified>2011-12-02T08:10:41.565891+00:00</last_modified>
286 286
    </account>
287 287
    <account>...</account>
......
405 405
::
406 406

  
407 407
  <?xml version="1.0" encoding="UTF-8"?>
408
  <account name="user">
408
  <account name="user-uuid">
409 409
    <container>
410 410
      <name>pithos</name>
411 411
      <bytes>62452</bytes>
......
583 583
x_object_modified_by        The user that committed the object's version
584 584
x_object_sharing            Object permissions (optional)
585 585
x_object_allowed_to         Allowed actions on object (optional)
586
x_object_public             Object's publicly accessible URI (optional)
586
x_object_public             Object's publicly accessible URI (optional - present if public is requested and the token holder is the object owner)
587 587
==========================  ======================================
588 588

  
589 589
Sharing metadata and last modification timestamp will only be returned if there is no ``until`` parameter defined.
......
606 606
    "x_object_uuid": "8ed9af1b-c948-4bb6-82b0-48344f5c822c",
607 607
    "x_object_version": 98,
608 608
    "x_object_version_timestamp": "1322813441.565891",
609
    "x_object_modified_by": "user"}, ...]
609
    "x_object_modified_by": "user-uuid"}, ...]
610 610

  
611 611
Example ``format=xml`` reply:
612 612

  
......
624 624
      <x_object_uuid>8ed9af1b-c948-4bb6-82b0-48344f5c822c</x_object_uuid>
625 625
      <x_object_version>98</x_object_version>
626 626
      <x_object_version_timestamp>1322813441.565891</x_object_version_timestamp>
627
      <x_object_modified_by>chazapis</x_object_modified_by>
627
      <x_object_modified_by>user-uuid</x_object_modified_by>
628 628
    </object>
629 629
    <object>...</object>
630 630
  </container>
......
1087 1087

  
1088 1088
The ``POST`` method can also be used for creating an object via a standard HTML form. If the request ``Content-Type`` is ``multipart/form-data``, none of the above headers will be processed. The form should have an ``X-Object-Data`` field, as in the following example. The token is passed as a request parameter. ::
1089 1089

  
1090
  <form method="post" action="https://pithos.dev.grnet.gr/v1/user/folder/EXAMPLE.txt?X-Auth-Token=0000" enctype="multipart/form-data">
1090
  <form method="post" action="https://storage.example.synnefo.org/pithos/object-store/v1.0/user-uuid/folder/EXAMPLE.txt?X-Auth-Token=0000" enctype="multipart/form-data">
1091 1091
    <input type="file" name="X-Object-Data">
1092 1092
    <input type="submit">
1093 1093
  </form>
......
1214 1214

  
1215 1215
    curl -X HEAD -D - \
1216 1216
         -H "X-Auth-Token: 0000" \
1217
         https://pithos.dev.grnet.gr/v1/user
1217
         https://storage.example.synnefo.org/pithos/object-store/v1.0/user-uuid
1218 1218

  
1219 1219
* List available containers ::
1220 1220

  
1221 1221
    curl -X GET -D - \
1222 1222
         -H "X-Auth-Token: 0000" \
1223
         https://pithos.dev.grnet.gr/v1/user
1223
         https://storage.example.synnefo.org/pithos/object-store/v1.0/user-uuid
1224 1224

  
1225 1225
* Get container information ::
1226 1226

  
1227 1227
    curl -X HEAD -D - \
1228 1228
         -H "X-Auth-Token: 0000" \
1229
         https://pithos.dev.grnet.gr/v1/user/pithos
1229
         https://storage.example.synnefo.org/pithos/object-store/v1.0/user-uuid/pithos
1230 1230

  
1231 1231
* Add a new container ::
1232 1232

  
1233 1233
    curl -X PUT -D - \
1234 1234
         -H "X-Auth-Token: 0000" \
1235
         https://pithos.dev.grnet.gr/v1/user/test
1235
         https://storage.example.synnefo.org/pithos/object-store/v1.0/user-uuid/test
1236 1236

  
1237 1237
* Delete a container ::
1238 1238

  
1239 1239
    curl -X DELETE -D - \
1240 1240
         -H "X-Auth-Token: 0000" \
1241
         https://pithos.dev.grnet.gr/v1/user/test
1241
         https://storage.example.synnefo.org/pithos/object-store/v1.0/user-uuid/test
1242 1242

  
1243 1243
* List objects in a container ::
1244 1244

  
1245 1245
    curl -X GET -D - \
1246 1246
         -H "X-Auth-Token: 0000" \
1247
         https://pithos.dev.grnet.gr/v1/user/pithos
1247
         https://storage.example.synnefo.org/pithos/object-store/v1.0/user-uuid/pithos
1248 1248

  
1249 1249
* List objects in a container (extended reply) ::
1250 1250

  
1251 1251
    curl -X GET -D - \
1252 1252
         -H "X-Auth-Token: 0000" \
1253
         https://pithos.dev.grnet.gr/v1/user/pithos?format=json
1253
         https://storage.example.synnefo.org/pithos/object-store/v1.0/user-uuid/pithos?format=json
1254 1254

  
1255 1255
  It is recommended that extended replies are cached and subsequent requests utilize the ``If-Modified-Since`` header.
1256 1256

  
......
1262 1262

  
1263 1263
    curl -X GET -D - \
1264 1264
         -H "X-Auth-Token: 0000" \
1265
         https://pithos.dev.grnet.gr/v1/user/pithos?meta=favorites
1265
         https://storage.example.synnefo.org/pithos/object-store/v1.0/user-uuid/pithos?meta=favorites
1266 1266

  
1267 1267
* Retrieve an object ::
1268 1268

  
1269 1269
    curl -X GET -D - \
1270 1270
         -H "X-Auth-Token: 0000" \
1271
         https://pithos.dev.grnet.gr/v1/user/pithos/README.txt
1271
         https://storage.example.synnefo.org/pithos/object-store/v1.0/user-uuid/pithos/README.txt
1272 1272

  
1273 1273
* Retrieve an object (specific ranges of data) ::
1274 1274

  
1275 1275
    curl -X GET -D - \
1276 1276
         -H "X-Auth-Token: 0000" \
1277 1277
         -H "Range: bytes=0-9" \
1278
         https://pithos.dev.grnet.gr/v1/user/pithos/README.txt
1278
         https://storage.example.synnefo.org/pithos/object-store/v1.0/user-uuid/pithos/README.txt
1279 1279

  
1280 1280
  This will return the first 10 bytes. To get the first 10, bytes 30-39 and the last 100 use ``Range: bytes=0-9,30-39,-100``.
1281 1281

  
......
1284 1284
    curl -X PUT -D - \
1285 1285
         -H "X-Auth-Token: 0000" \
1286 1286
         -H "Content-Type: application/directory" \
1287
         https://pithos.dev.grnet.gr/v1/user/pithos/folder
1287
         https://storage.example.synnefo.org/pithos/object-store/v1.0/user-uuid/pithos/folder
1288 1288

  
1289 1289
* Add a new object ::
1290 1290

  
......
1292 1292
         -H "X-Auth-Token: 0000" \
1293 1293
         -H "Content-Type: text/plain" \
1294 1294
         -T EXAMPLE.txt
1295
         https://pithos.dev.grnet.gr/v1/user/pithos/folder/EXAMPLE.txt
1295
         https://storage.example.synnefo.org/pithos/object-store/v1.0/user-uuid/pithos/folder/EXAMPLE.txt
1296 1296

  
1297 1297
* Update an object ::
1298 1298

  
......
1302 1302
         -H "Content-Type: application/octet-stream" \
1303 1303
         -H "Content-Range: bytes 10-19/*" \
1304 1304
         -d "0123456789" \
1305
         https://pithos.dev.grnet.gr/v1/user/folder/EXAMPLE.txt
1305
         https://storage.example.synnefo.org/pithos/object-store/v1.0/user-uuid/folder/EXAMPLE.txt
1306 1306

  
1307 1307
  This will update bytes 10-19 with the data specified.
1308 1308

  
......
1314 1314
         -H "Content-Type: application/octet-stream" \
1315 1315
         -H "Content-Range: bytes */*" \
1316 1316
         -d "0123456789" \
1317
         https://pithos.dev.grnet.gr/v1/user/folder/EXAMPLE.txt
1317
         https://storage.example.synnefo.org/pithos/object-store/v1.0/user-uuid/folder/EXAMPLE.txt
1318 1318

  
1319 1319
* Update an object (truncate) ::
1320 1320

  
......
1323 1323
         -H "X-Source-Object: /folder/EXAMPLE.txt" \
1324 1324
         -H "Content-Range: bytes 0-0/*" \
1325 1325
         -H "X-Object-Bytes: 0" \
1326
         https://pithos.dev.grnet.gr/v1/user/folder/EXAMPLE.txt
1326
         https://storage.example.synnefo.org/pithos/object-store/v1.0/user-uuid/folder/EXAMPLE.txt
1327 1327

  
1328 1328
  This will truncate the object to 0 bytes.
1329 1329

  
......
1333 1333
         -H "X-Auth-Token: 0000" \
1334 1334
         -H "X-Object-Meta-First: first_meta_value" \
1335 1335
         -H "X-Object-Meta-Second: second_meta_value" \
1336
         https://pithos.dev.grnet.gr/v1/user/folder/EXAMPLE.txt
1336
         https://storage.example.synnefo.org/pithos/object-store/v1.0/user-uuid/folder/EXAMPLE.txt
1337 1337

  
1338 1338
* Delete object metadata ::
1339 1339

  
1340 1340
    curl -X POST -D - \
1341 1341
         -H "X-Auth-Token: 0000" \
1342 1342
         -H "X-Object-Meta-First: first_meta_value" \
1343
         https://pithos.dev.grnet.gr/v1/user/folder/EXAMPLE.txt
1343
         https://storage.example.synnefo.org/pithos/object-store/v1.0/user-uuid/folder/EXAMPLE.txt
1344 1344

  
1345 1345
  Metadata can only be "set". To delete ``X-Object-Meta-Second``, reset all metadata.
1346 1346

  
......
1348 1348

  
1349 1349
    curl -X DELETE -D - \
1350 1350
         -H "X-Auth-Token: 0000" \
1351
         https://pithos.dev.grnet.gr/v1/user/folder/EXAMPLE.txt
1351
         https://storage.example.synnefo.org/pithos/object-store/v1.0/user-uuid/folder/EXAMPLE.txt

Also available in: Unified diff