Refs #447
authorpapagian <papagian@gmail.com>
Thu, 5 May 2011 15:51:04 +0000 (18:51 +0300)
committerpapagian <papagian@gmail.com>
Thu, 5 May 2011 15:51:04 +0000 (18:51 +0300)
pithos/backends/basebackend.py [new file with mode: 0644]

diff --git a/pithos/backends/basebackend.py b/pithos/backends/basebackend.py
new file mode 100644 (file)
index 0000000..640437d
--- /dev/null
@@ -0,0 +1,89 @@
+class BaseBackEnd:\r
+    def get_account_meta(self, account):\r
+        """\r
+        returns a dictionary with the account metadata\r
+        """\r
+        return {}\r
+\r
+    def update_account_meta(self, account, meta):\r
+        """\r
+        updates the metadata associated with the account\r
+        """\r
+        return\r
+    \r
+    def create_container(self, account, name):\r
+        """\r
+        creates a new container with the given name\r
+        if it doesn't exist under the basepath\r
+        """\r
+        return\r
+    \r
+    def delete_container(self, account, name):\r
+        """\r
+        deletes the container with the given name\r
+        if it exists under the basepath and is empty\r
+        """\r
+        return\r
+    \r
+    def get_container_meta(self, account, name):\r
+        """\r
+        returns a dictionary with the container metadata\r
+        """\r
+        return {}\r
+    \r
+    def update_container_meta(self, account, name, meta):\r
+        """\r
+        updates the metadata associated with the container\r
+        """\r
+        return\r
+    \r
+    def list_containers(self, account, marker = None, limit = 10000):\r
+        """\r
+        returns a list of at most limit (default = 10000) containers \r
+        starting from the next item after the optional marker\r
+        """\r
+        return []\r
+    \r
+    def list_objects(self, account, container, prefix = '', delimiter = None, marker = None, limit = 10000):\r
+        """\r
+        returns a list of objects existing under a container\r
+        """\r
+        return []\r
+    \r
+    def get_object_meta(self, account, container, name, keys = None):\r
+        """\r
+        returns a dictionary with the object metadata\r
+        """\r
+        return {}\r
+    \r
+    def update_object_meta(self, account, container, name, meta):\r
+        """\r
+        updates the metadata associated with the object\r
+        """\r
+        return\r
+    \r
+    def get_object(self, account, container, name, offset = 0, length = -1):\r
+        """\r
+        returns the object data\r
+        """\r
+        return\r
+\r
+    def update_object(self, account, container, name, data, offset = 0):\r
+        """\r
+        creates/updates an object with the specified data\r
+        """\r
+        return\r
+    \r
+    def copy_object(self, account, src_container, src_name, dest_container, dest_name):\r
+        """\r
+        copies an object\r
+        """\r
+        return\r
+    \r
+    def delete_object(self, account, container, name):\r
+        """\r
+        deletes an object\r
+        """\r
+        return\r
+\r
+\r