4 In Pithos, an object can be published, shared with all or restricted to be
5 accessible by only some users or groups.
10 Get publishing information for objects `info.txt` and `file2upload.txt`
12 .. code-block:: console
14 $ kamaki file info info.txt
15 cache-control: no-cache, no-store, must-revalidate, max-age=0
16 content-language: en-us
17 content-type: plan-text/unicode
18 date: Tue, 18 Jun 2013 12:54:14 GMT
19 etag: d41d8cd98f00b204e9800998ecf8427e
20 expires: Tue, 18 Jun 2013 12:54:14 GMT
21 last-modified: Mon, 17 Jun 2013 13:09:44 GMT
22 server: gunicorn/0.14.5
23 vary: X-Auth-Token,Accept-Language,Accept-Encoding
24 x-object-hash: e3b0c44298fc1c14....ca495991b7852b855
25 x-object-modified-by: s0m3-u53r-1d
26 x-object-public: https://example.com/pithos/public/14lhJnAhVU7
27 x-object-uuid: 0493f1d9-9410-4f4b-a81f-fe42f9cefa70
28 x-object-version: 1085
29 x-object-version-timestamp: Mon, 17 Jun 2013 13:09:44 GMT
30 $ kamaki file info file2upload.txt
31 cache-control: no-cache, no-store, must-revalidate, max-age=0
32 content-language: en-us
33 content-type: plan-text/unicode
34 date: Tue, 18 Jun 2013 12:54:14 GMT
35 etag: c41d8cd98f00b304e9800998ecf8427g
36 expires: Tue, 18 Jun 2013 12:54:14 GMT
37 last-modified: Mon, 17 Jun 2013 13:09:44 GMT
38 server: gunicorn/0.14.5
39 vary: X-Auth-Token,Accept-Language,Accept-Encoding
40 x-object-hash: f3b0c44298fc1c149af...a495991b7852b857
41 x-object-modified-by: s0m3-u53r-1d
42 x-object-uuid: 0493f1d9-9410-4f4b-a81f-fe42f9cefa70
43 x-object-version: 1085
44 x-object-version-timestamp: Mon, 17 Jun 2013 13:09:44 GMT
46 .. note:: The first object contains an "x-object-public" field, therefore is
47 published. Alternatively, use the "--sharing" argument
49 .. code-block:: console
51 $ kamaki file info info.txt --sharing
52 public url: https://example.com/pithos/public/14lhJnAhVU7
54 Unpublish info.txt, publish file2upload.txt
56 .. code-block:: console
58 $ kamaki file modify /pithos/info.txt --unpublish
59 $ kamaki file modify /pithos/file2upload.txt --publish
60 https://example.com/pithos/public/43gdL2df02ld3
65 Get current permissions. If none set, the object inherits permissions from the
66 container and account (in that order).
68 .. code-block:: console
70 $ kamaki file info info.txt --sharing
71 public url: https://example.com/pithos/public/14lhJnAhVU7
72 $ kamaki file info file2upload.txt --sharing
73 read: local_user_group, write: s0m3-u53r-1d
74 public url: https://example.com/pithos/public/43gdL2df02ld3
76 Let user with id `4n07h3r-u53r-1d` to have read access to `info.txt` and write
77 access to `file2upload.txt`, and current user to have the opposite access
79 .. code-block:: console
81 $ kamaki file modify info.txt --read-permission=4n07h3r-u53r-1d --write-permission=s0m3-u53r-1d
82 $ kamaki file modify file2upload.txt --write-permission=4n07h3r-u53r-1d --read-permission=s0m3-u53r-1d
84 Share (read permission) `info.txt` with all
86 .. code-block:: console
88 $ kamaki file modify info.txt --read-permission=*
93 List users who share objects with current user
95 .. code-block:: console
98 5h4r1ng-u53r-1d (somesharinguser@example.com)
99 4n07h3r-5h4r1ng-u53r-1d (anothersharinguser@example.com)
101 List containers of `5h4r1ng-u53r-1d` and then list `images` container
103 .. code-block:: console
105 $ kamaki container list -A 5h4r1ng-u53r-1d
109 $ kamaki file list -A 5h4r1ng-u53r-1d /images
111 some-other-image.diskdump
113 Copy the shared image `some-image.diskdump` to current pithos container
115 .. code-block:: console
117 $ kamaki file copy -A 5h4r1ng-u53r-1d /images/some-image.diskdump /pithos
121 $ kamaki file copy pithos://5h4r1ng-u53r-1d/images/some-image.diskdump /pithos