Revision 83dd59c5 pithos/backends/base.py
b/pithos/backends/base.py | ||
---|---|---|
44 | 44 |
'block_size': Suggested is 4MB |
45 | 45 |
""" |
46 | 46 |
|
47 |
def delete_account(self, account): |
|
47 |
def delete_account(self, user, account):
|
|
48 | 48 |
"""Delete the account with the given name. |
49 |
|
|
49 |
|
|
50 | 50 |
Raises: |
51 | 51 |
IndexError: Account is not empty |
52 | 52 |
""" |
53 | 53 |
return |
54 | 54 |
|
55 |
def get_account_meta(self, account, until=None): |
|
55 |
def get_account_meta(self, user, account, until=None):
|
|
56 | 56 |
"""Return a dictionary with the account metadata. |
57 | 57 |
|
58 | 58 |
The keys returned are all user-defined, except: |
... | ... | |
64 | 64 |
""" |
65 | 65 |
return {} |
66 | 66 |
|
67 |
def update_account_meta(self, account, meta, replace=False): |
|
67 |
def update_account_meta(self, user, account, meta, replace=False):
|
|
68 | 68 |
"""Update the metadata associated with the account. |
69 | 69 |
|
70 | 70 |
Parameters: |
... | ... | |
73 | 73 |
""" |
74 | 74 |
return |
75 | 75 |
|
76 |
def list_containers(self, account, marker=None, limit=10000, until=None): |
|
76 |
def list_containers(self, user, account, marker=None, limit=10000, until=None):
|
|
77 | 77 |
"""Return a list of container (name, version_id) tuples existing under an account. |
78 | 78 |
|
79 | 79 |
Parameters: |
... | ... | |
82 | 82 |
""" |
83 | 83 |
return [] |
84 | 84 |
|
85 |
def put_container(self, account, container): |
|
85 |
def put_container(self, user, account, container):
|
|
86 | 86 |
"""Create a new container with the given name. |
87 |
|
|
87 |
|
|
88 | 88 |
Raises: |
89 | 89 |
NameError: Container already exists |
90 | 90 |
""" |
91 | 91 |
return |
92 | 92 |
|
93 |
def delete_container(self, account, container): |
|
93 |
def delete_container(self, user, account, container):
|
|
94 | 94 |
"""Delete the container with the given name. |
95 |
|
|
95 |
|
|
96 | 96 |
Raises: |
97 | 97 |
NameError: Container does not exist |
98 | 98 |
IndexError: Container is not empty |
99 | 99 |
""" |
100 | 100 |
return |
101 | 101 |
|
102 |
def get_container_meta(self, account, container, until=None): |
|
102 |
def get_container_meta(self, user, account, container, until=None):
|
|
103 | 103 |
"""Return a dictionary with the container metadata. |
104 |
|
|
104 |
|
|
105 | 105 |
The keys returned are all user-defined, except: |
106 | 106 |
'name': The container name |
107 | 107 |
'count': The number of objects |
... | ... | |
114 | 114 |
""" |
115 | 115 |
return {} |
116 | 116 |
|
117 |
def update_container_meta(self, account, container, meta, replace=False): |
|
117 |
def update_container_meta(self, user, account, container, meta, replace=False):
|
|
118 | 118 |
"""Update the metadata associated with the container. |
119 | 119 |
|
120 | 120 |
Parameters: |
... | ... | |
126 | 126 |
""" |
127 | 127 |
return |
128 | 128 |
|
129 |
def list_objects(self, account, container, prefix='', delimiter=None, marker=None, limit=10000, virtual=True, keys=[], until=None): |
|
129 |
def list_objects(self, user, account, container, prefix='', delimiter=None, marker=None, limit=10000, virtual=True, keys=[], until=None):
|
|
130 | 130 |
"""Return a list of object (name, version_id) tuples existing under a container. |
131 | 131 |
|
132 | 132 |
Parameters: |
... | ... | |
146 | 146 |
""" |
147 | 147 |
return [] |
148 | 148 |
|
149 |
def list_object_meta(self, account, container, until=None): |
|
149 |
def list_object_meta(self, user, account, container, until=None):
|
|
150 | 150 |
"""Return a list with all the container's object meta keys. |
151 | 151 |
|
152 | 152 |
Raises: |
... | ... | |
154 | 154 |
""" |
155 | 155 |
return [] |
156 | 156 |
|
157 |
def get_object_meta(self, account, container, name, version=None): |
|
157 |
def get_object_meta(self, user, account, container, name, version=None):
|
|
158 | 158 |
"""Return a dictionary with the object metadata. |
159 | 159 |
|
160 | 160 |
The keys returned are all user-defined, except: |
... | ... | |
170 | 170 |
""" |
171 | 171 |
return {} |
172 | 172 |
|
173 |
def update_object_meta(self, account, container, name, meta, replace=False): |
|
173 |
def update_object_meta(self, user, account, container, name, meta, replace=False):
|
|
174 | 174 |
"""Update the metadata associated with the object. |
175 | 175 |
|
176 | 176 |
Parameters: |
... | ... | |
182 | 182 |
""" |
183 | 183 |
return |
184 | 184 |
|
185 |
def get_object_hashmap(self, account, container, name, version=None): |
|
185 |
def get_object_hashmap(self, user, account, container, name, version=None):
|
|
186 | 186 |
"""Return the object's size and a list with partial hashes. |
187 | 187 |
|
188 | 188 |
Raises: |
... | ... | |
191 | 191 |
""" |
192 | 192 |
return 0, [] |
193 | 193 |
|
194 |
def update_object_hashmap(self, account, container, name, size, hashmap):
|
|
194 |
def update_object_hashmap(self, user, account, container, name, size, hashmap, meta={}, replace_meta=False):
|
|
195 | 195 |
"""Create/update an object with the specified size and partial hashes. |
196 | 196 |
|
197 | 197 |
Raises: |
... | ... | |
199 | 199 |
""" |
200 | 200 |
return |
201 | 201 |
|
202 |
def copy_object(self, account, src_container, src_name, dest_container, dest_name, dest_meta={}, replace_meta=False, src_version=None): |
|
202 |
def copy_object(self, user, account, src_container, src_name, dest_container, dest_name, dest_meta={}, replace_meta=False, src_version=None):
|
|
203 | 203 |
"""Copy an object's data and metadata. |
204 | 204 |
|
205 | 205 |
Parameters: |
... | ... | |
213 | 213 |
""" |
214 | 214 |
return |
215 | 215 |
|
216 |
def move_object(self, account, src_container, src_name, dest_container, dest_name, dest_meta={}, replace_meta=False, src_version=None): |
|
216 |
def move_object(self, user, account, src_container, src_name, dest_container, dest_name, dest_meta={}, replace_meta=False, src_version=None):
|
|
217 | 217 |
"""Move an object's data and metadata. |
218 | 218 |
|
219 | 219 |
Parameters: |
... | ... | |
227 | 227 |
""" |
228 | 228 |
return |
229 | 229 |
|
230 |
def delete_object(self, account, container, name): |
|
230 |
def delete_object(self, user, account, container, name):
|
|
231 | 231 |
"""Delete an object. |
232 | 232 |
|
233 | 233 |
Raises: |
... | ... | |
235 | 235 |
""" |
236 | 236 |
return |
237 | 237 |
|
238 |
def list_versions(self, account, container, name): |
|
239 |
"""Return a list of version (version_id, version_modified) tuples for an object."""
|
|
238 |
def list_versions(self, user, account, container, name):
|
|
239 |
"""Return a list of all (version, version_timestamp) tuples for an object."""
|
|
240 | 240 |
return [] |
241 | 241 |
|
242 | 242 |
def get_block(self, hash): |
Also available in: Unified diff