blob: 34e2d01d70b0a813d5554018c5530611c0e7f671 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
#! /usr/bin/env python
from abc import abstractmethod
class BlobTable:
@abstractmethod
def __init__(self):
pass
# client
# server
@abstractmethod
def get_blob_list(self, container=None):
# return a dict {blobname:rev}
# if container is not None , only return blobs in that container
pass
# client
# server
@abstractmethod
def get_blob_info(self, blobname, attr=None):
# if the blobname doesn't exist, return None
if attr is None:
# return blob info
pass
else:
# return specific attribute
pass
# server
@abstractmethod
def create_container(self, container):
pass
# server
@abstractmethod
def del_container(self, container):
pass
# server
@abstractmethod
def get_container_list(self):
# return a set of container
pass
# client
# server
@abstractmethod
def update_blob(self, blobname, info):
pass
# client
# server
@abstractmethod
def del_blob(self, blobname):
pass
"""
info:
rev (int)
container (str)
metadata (str)
size (???)
commit_time (???)
"""
|