Revision 4067cdaf kamaki/clients/pithos_rest_api.py
b/kamaki/clients/pithos_rest_api.py | ||
---|---|---|
48 | 48 |
@param until (string): optional timestamp |
49 | 49 |
--- --- optional request headers --- |
50 | 50 |
@param if_modified_since (string): Retrieve if account has changed |
51 |
since provided timestamp
|
|
51 |
since provided timestamp |
|
52 | 52 |
@param if_unmodified_since (string): Retrieve if account has not |
53 |
change since provided timestamp
|
|
53 |
change since provided timestamp |
|
54 | 54 |
""" |
55 |
|
|
55 | 56 |
self.assert_account() |
56 | 57 |
path = path4url(self.account) |
57 | 58 |
|
... | ... | |
75 | 76 |
""" Full Pithos+ GET at account level |
76 | 77 |
--- request parameters --- |
77 | 78 |
@param limit (integer): The amount of results requested |
78 |
(server will use default value if None)
|
|
79 |
(server will use default value if None) |
|
79 | 80 |
@param marker (string): Return containers with name |
80 |
lexicographically after marker
|
|
81 |
lexicographically after marker |
|
81 | 82 |
@param format (string): reply format can be json or xml |
82 |
(default: json)
|
|
83 |
(default: json) |
|
83 | 84 |
@param shared (bool): If true, only shared containers will be |
84 |
included in results
|
|
85 |
included in results |
|
85 | 86 |
@param until (string): optional timestamp |
86 | 87 |
--- --- optional request headers --- |
87 | 88 |
@param if_modified_since (string): Retrieve if account has changed |
88 |
since provided timestamp
|
|
89 |
since provided timestamp |
|
89 | 90 |
@param if_unmodified_since (string): Retrieve if account has not |
90 |
changed since provided timestamp
|
|
91 |
changed since provided timestamp |
|
91 | 92 |
""" |
93 |
|
|
92 | 94 |
self.assert_account() |
93 | 95 |
|
94 | 96 |
self.set_param('format', format, iff=format is not None) |
... | ... | |
117 | 119 |
@param update (bool): if True, Do not replace metadata/groups |
118 | 120 |
--- request headers --- |
119 | 121 |
@groups (dict): Optional user defined groups in the form |
120 |
{ 'group1':['user1', 'user2', ...], |
|
121 |
'group2':['userA', 'userB', ...], ... |
|
122 |
} |
|
122 |
{ 'group1':['user1', 'user2', ...], |
|
123 |
'group2':['userA', 'userB', ...], } |
|
123 | 124 |
@metadata (dict): Optional user defined metadata in the form |
124 |
{ 'name1': 'value1', |
|
125 |
'name2': 'value2', ... |
|
126 |
} |
|
125 |
{ 'name1': 'value1', 'name2': 'value2', ... } |
|
127 | 126 |
@param quota(integer): If supported, sets the Account quota |
128 | 127 |
@param versioning(string): If supported, sets the Account versioning |
129 |
to 'auto' or some other supported versioning string
|
|
128 |
to 'auto' or some other supported versioning string |
|
130 | 129 |
""" |
130 |
|
|
131 | 131 |
self.assert_account() |
132 | 132 |
|
133 | 133 |
self.set_param('update', iff=update) |
... | ... | |
156 | 156 |
@param until (string): optional timestamp |
157 | 157 |
--- optional request headers --- |
158 | 158 |
@param if_modified_since (string): Retrieve if account has changed |
159 |
since provided timestamp
|
|
159 |
since provided timestamp |
|
160 | 160 |
@param if_unmodified_since (string): Retrieve if account has not |
161 |
changed since provided timestamp
|
|
161 |
changed since provided timestamp |
|
162 | 162 |
""" |
163 |
|
|
163 | 164 |
self.assert_container() |
164 | 165 |
|
165 | 166 |
self.set_param('until', until, iff=until is not None) |
... | ... | |
188 | 189 |
""" Full Pithos+ GET at container level |
189 | 190 |
--- request parameters --- |
190 | 191 |
@param limit (integer): The amount of results requested |
191 |
(server qill use default value if None)
|
|
192 |
(server qill use default value if None) |
|
192 | 193 |
@param marker (string): Return containers with name lexicographically |
193 |
after marker
|
|
194 |
after marker |
|
194 | 195 |
@param prefix (string): Return objects starting with prefix |
195 | 196 |
@param delimiter (string): Return objects up to the delimiter |
196 | 197 |
@param path (string): assume prefix = path and delimiter = / |
197 |
(overwrites prefix and delimiter)
|
|
198 |
(overwrites prefix and delimiter) |
|
198 | 199 |
@param format (string): reply format can be json or xml (default:json) |
199 | 200 |
@param meta (list): Return objects that satisfy the key queries in |
200 |
the specified comma separated list (use <key>, !<key> for
|
|
201 |
existence queries, <key><op><value> for value queries, where <op>
|
|
202 |
can be one of =, !=, <=, >=, <, >)
|
|
201 |
the specified comma separated list (use <key>, !<key> for |
|
202 |
existence queries, <key><op><value> for value queries, where <op> |
|
203 |
can be one of =, !=, <=, >=, <, >) |
|
203 | 204 |
@param shared (bool): If true, only shared containers will be included |
204 | 205 |
in results |
205 | 206 |
@param until (string): optional timestamp |
206 | 207 |
--- --- optional request headers --- |
207 | 208 |
@param if_modified_since (string): Retrieve if account has changed |
208 |
since provided timestamp
|
|
209 |
since provided timestamp |
|
209 | 210 |
@param if_unmodified_since (string): Retrieve if account has not |
210 |
changed since provided timestamp
|
|
211 |
changed since provided timestamp |
|
211 | 212 |
""" |
213 |
|
|
212 | 214 |
self.assert_container() |
213 | 215 |
|
214 | 216 |
self.set_param('format', format, iff=format is not None) |
... | ... | |
307 | 309 |
""" Full Pithos+ DELETE at container level |
308 | 310 |
--- request parameters --- |
309 | 311 |
@param until (timestamp string): if defined, container is purged up to |
310 |
that time
|
|
312 |
that time |
|
311 | 313 |
""" |
314 |
|
|
312 | 315 |
self.assert_container() |
313 | 316 |
|
314 | 317 |
self.set_param('until', until, iff=until is not None) |
... | ... | |
331 | 334 |
@param version (string): optional version identified |
332 | 335 |
--- request headers --- |
333 | 336 |
@param if_etag_match (string): if provided, return only results |
334 |
with etag matching with this
|
|
337 |
with etag matching with this |
|
335 | 338 |
@param if_etag_not_match (string): if provided, return only results |
336 |
with etag not matching with this
|
|
339 |
with etag not matching with this |
|
337 | 340 |
@param if_modified_since (string): Retrieve if account has changed |
338 |
since provided timestamp
|
|
341 |
since provided timestamp |
|
339 | 342 |
@param if_unmodified_since (string): Retrieve if account has not |
340 |
changed since provided timestamp
|
|
343 |
changed since provided timestamp |
|
341 | 344 |
""" |
345 |
|
|
342 | 346 |
self.assert_container() |
343 | 347 |
|
344 | 348 |
self.set_param('version', version, iff=version is not None) |
... | ... | |
373 | 377 |
@param data_range (string): Optional range of data to retrieve |
374 | 378 |
@param if_range (bool): |
375 | 379 |
@param if_etag_match (string): if provided, return only results |
376 |
with etag matching with this
|
|
380 |
with etag matching with this |
|
377 | 381 |
@param if_etag_not_match (string): if provided, return only results |
378 |
with etag not matching with this
|
|
382 |
with etag not matching with this |
|
379 | 383 |
@param if_modified_since (string): Retrieve if account has changed |
380 |
since provided timestamp
|
|
384 |
since provided timestamp |
|
381 | 385 |
@param if_unmodified_since (string): Retrieve if account has not |
382 |
changed since provided timestamp
|
|
386 |
changed since provided timestamp |
|
383 | 387 |
""" |
388 |
|
|
384 | 389 |
self.assert_container() |
385 | 390 |
|
386 | 391 |
self.set_param('format', format, iff=format is not None) |
... | ... | |
427 | 432 |
@param hashmap (bool): Optional hashmap provided instead of data |
428 | 433 |
--- request headers --- |
429 | 434 |
@param if_etag_match (string): if provided, return only results |
430 |
with etag matching with this
|
|
435 |
with etag matching with this |
|
431 | 436 |
@param if_etag_not_match (string): if provided, return only results |
432 |
with etag not matching with this
|
|
437 |
with etag not matching with this |
|
433 | 438 |
@param etag (string): The MD5 hash of the object (optional to check |
434 |
written data)
|
|
439 |
written data) |
|
435 | 440 |
@param content_length (integer): The size of the data written |
436 | 441 |
@param content_type (string): The MIME content type of the object |
437 | 442 |
@param transfer_encoding (string): Set to chunked to specify |
438 |
incremental uploading (if used, Content-Length is ignored)
|
|
443 |
incremental uploading (if used, Content-Length is ignored) |
|
439 | 444 |
@param copy_from (string): The source path in the form |
440 |
/<container>/<object>
|
|
445 |
/<container>/<object> |
|
441 | 446 |
@param move_from (string): The source path in the form |
442 |
/<container>/<object>
|
|
447 |
/<container>/<object> |
|
443 | 448 |
@param source_account (string): The source account to copy/move from |
444 | 449 |
@param source_version (string): The source version to copy from |
445 | 450 |
@param conent_encoding (string): The encoding of the object |
446 | 451 |
@param content_disposition (string): Presentation style of the object |
447 | 452 |
@param manifest (string): Object parts prefix in |
448 |
/<container>/<object> form
|
|
453 |
/<container>/<object> form |
|
449 | 454 |
@param permissions (dict): Object permissions in the form (all fields |
450 |
are optional) |
|
451 |
{ 'read':[user1, group1, user2, ...], |
|
452 |
'write':['user3, group2, group3, ...] |
|
453 |
} |
|
455 |
are optional) |
|
456 |
{ 'read':[user1, group1, user2, ...], |
|
457 |
'write':['user3, group2, group3, ...] } |
|
454 | 458 |
@param public (bool): If true, Object is publicly accessible, |
455 |
if false, not
|
|
459 |
if false, not |
|
456 | 460 |
@param metadata (dict): Optional user defined metadata in the form |
457 |
{'meta-key-1':'meta-value-1', 'meta-key-2':'meta-value-2', ...}
|
|
461 |
{'meta-key-1':'meta-value-1', 'meta-key-2':'meta-value-2', ...} |
|
458 | 462 |
""" |
463 |
|
|
459 | 464 |
self.assert_container() |
460 | 465 |
|
461 | 466 |
self.set_param('format', format, iff=format is not None) |
... | ... | |
516 | 521 |
@param format (string): json (default) or xml |
517 | 522 |
@param ignore_content_type (bool): Ignore the supplied Content-Type |
518 | 523 |
--- request headers --- |
519 |
@param if_etag_match (string): if provided, copy only results
|
|
520 |
with etag matching with this
|
|
524 |
@param if_etag_match (string): if provided, copy only results |
|
525 |
with etag matching with this |
|
521 | 526 |
@param if_etag_not_match (string): if provided, copy only results |
522 |
with etag not matching with this
|
|
527 |
with etag not matching with this |
|
523 | 528 |
@param destination (string): The destination path in the form |
524 |
/<container>/<object>
|
|
529 |
/<container>/<object> |
|
525 | 530 |
@param destination_account (string): The destination account to copy to |
526 | 531 |
@param content_type (string): The MIME content type of the object |
527 | 532 |
@param content_encoding (string): The encoding of the object |
528 | 533 |
@param content_disposition (string): Object resentation style |
529 | 534 |
@param source_version (string): The source version to copy from |
530 | 535 |
@param permissions (dict): Object permissions in the form |
531 |
(all fields are optional) |
|
532 |
{ 'read':[user1, group1, user2, ...], |
|
533 |
'write':['user3, group2, group3, ...] |
|
534 |
} |
|
535 |
permissions override source permissions, |
|
536 |
removing any old permissions |
|
536 |
(all fields are optional) |
|
537 |
{ 'read':[user1, group1, user2, ...], |
|
538 |
'write':['user3, group2, group3, ...] } |
|
539 |
@permissions override source permissions, removing any old permissions |
|
537 | 540 |
@param public (bool): If true, Object is publicly accessible |
538 | 541 |
@param metadata (dict): Optional user defined metadata in the form |
539 |
{'meta-key-1':'meta-value-1', 'meta-key-2':'meta-value-2', ...}
|
|
540 |
Metadata are appended to the source metadata. In case of same
|
|
541 |
keys, they replace the old metadata
|
|
542 |
{'meta-key-1':'meta-value-1', 'meta-key-2':'meta-value-2', ...} |
|
543 |
Metadata are appended to the source metadata. In case of same keys,
|
|
544 |
they replace the old metadata |
|
542 | 545 |
""" |
546 |
|
|
543 | 547 |
self.assert_container() |
544 | 548 |
|
545 | 549 |
self.set_param('format', format, iff=format is not None) |
... | ... | |
594 | 598 |
@param format (string): json (default) or xml |
595 | 599 |
@param ignore_content_type (bool): Ignore the supplied Content-Type |
596 | 600 |
--- request headers --- |
597 |
@param if_etag_match (string): if provided, return only results
|
|
598 |
with etag matching with this
|
|
601 |
@param if_etag_match (string): if provided, return only results |
|
602 |
with etag matching with this |
|
599 | 603 |
@param if_etag_not_match (string): if provided, return only results |
600 |
with etag not matching with this
|
|
604 |
with etag not matching with this |
|
601 | 605 |
@param destination (string): The destination path in the form |
602 |
/<container>/<object>
|
|
606 |
/<container>/<object> |
|
603 | 607 |
@param destination_account (string): The destination account to copy to |
604 | 608 |
@param content_type (string): The MIME content type of the object |
605 | 609 |
@param content_encoding (string): The encoding of the object |
606 | 610 |
@param content_disposition (string): Object presentation style |
607 | 611 |
@param source_version (string): The source version to copy from |
608 | 612 |
@param permissions (dict): Object permissions in the form |
609 |
(all fields are optional) |
|
610 |
{ 'read':[user1, group1, user2, ...], |
|
611 |
'write':['user3, group2, group3, ...] |
|
612 |
} |
|
613 |
(all fields are optional) |
|
614 |
{ 'read':[user1, group1, user2, ...], |
|
615 |
'write':['user3, group2, group3, ...] } |
|
613 | 616 |
@param public (bool): If true, Object is publicly accessible |
614 | 617 |
@param metadata (dict): Optional user defined metadata in the form |
615 |
{'meta-key-1':'meta-value-1', 'meta-key-2':'meta-value-2', ...}
|
|
618 |
{'meta-key-1':'meta-value-1', 'meta-key-2':'meta-value-2', ...} |
|
616 | 619 |
""" |
620 |
|
|
617 | 621 |
self.assert_container() |
618 | 622 |
|
619 | 623 |
self.set_param('format', format, iff=format is not None) |
... | ... | |
672 | 676 |
@param update (bool): Do not replace metadata |
673 | 677 |
--- request headers --- |
674 | 678 |
@param if_etag_match (string): if provided, return only results |
675 |
with etag matching with this
|
|
679 |
with etag matching with this |
|
676 | 680 |
@param if_etag_not_match (string): if provided, return only results |
677 |
with etag not matching with this
|
|
681 |
with etag not matching with this |
|
678 | 682 |
@param content_length (string): The size of the data written |
679 | 683 |
@param content_type (string): The MIME content type of the object |
680 | 684 |
@param content_range (string): The range of data supplied |
681 | 685 |
@param transfer_encoding (string): Set to chunked to specify |
682 |
incremental uploading (if used, Content-Length is ignored)
|
|
686 |
incremental uploading (if used, Content-Length is ignored) |
|
683 | 687 |
@param content_encoding (string): The encoding of the object |
684 | 688 |
@param content_disposition (string): Object presentation style |
685 | 689 |
@param source_object (string): Update with data from the object at |
686 |
path /<container>/<object>
|
|
690 |
path /<container>/<object> |
|
687 | 691 |
@param source_account (string): The source account to update from |
688 | 692 |
@param source_version (string): The source version to copy from |
689 | 693 |
@param object_bytes (integer): The updated objects final size |
690 | 694 |
@param manifest (string): Object parts prefix as /<container>/<object> |
691 | 695 |
@param permissions (dict): Object permissions in the form (all fields |
692 |
are optional) |
|
693 |
{ 'read':[user1, group1, user2, ...], |
|
694 |
'write':['user3, group2, group3, ...] |
|
695 |
} |
|
696 |
are optional) |
|
697 |
{ 'read':[user1, group1, user2, ...], |
|
698 |
'write':['user3, group2, group3, ...] } |
|
696 | 699 |
@param public (bool): If true, Object is publicly accessible |
697 | 700 |
@param metadata (dict): Optional user defined metadata in the form |
698 |
{'meta-key-1':'meta-value-1', 'meta-key-2':'meta-value-2', ...}
|
|
701 |
{'meta-key-1':'meta-value-1', 'meta-key-2':'meta-value-2', ...} |
|
699 | 702 |
""" |
703 |
|
|
700 | 704 |
self.assert_container() |
701 | 705 |
|
702 | 706 |
self.set_param('format', format, iff=format is not None) |
Also available in: Unified diff