Initial commit
[ta/distributed-state-server.git] / src / dss / api / dss_plugin.py
1 # Copyright 2019 Nokia
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 #
15
16 from dss.api import dss_error
17
18 class DSSPlugin(object):
19     def __init__(self, config_file):
20         self.config_file = config_file
21
22
23     def get(self, domain, name):
24         """get the value associated with an attribute
25
26            Arguments:
27
28            domain: The domain name.
29
30            name: The attribute name.
31
32            Return:
33
34            The value 
35
36            Raise:
37
38            dss_error.Error can be raised in-case of an error.
39         """
40         raise dss_error.Error('Not implemented')
41
42     def set(self, domain, name, value):
43         """set an attribute to some value
44
45            Arguments:
46
47            domain: The domain name.
48
49            name: The attribute name.
50
51            value: The value.
52
53            Raise:
54
55            dss_error.Error can be raised in-case of an error.
56         """
57         raise dss_error.Error('Not implemented')
58
59     def get_domain(self, domain):
60         """Get all the attributes in a domain
61
62            Arguments:
63             
64            Return: A dictionary.
65
66            Raise:
67
68            dss_error.Error can raised in case of an error
69         """
70         raise dss_error.Error('Not implemented')
71
72     def get_domains(self):
73         """Get the domains list
74
75            Arguments:
76             
77            Return: A list containing domain names
78
79            Raise:
80
81            dss_error.Error can raised in case of an error
82         """
83         raise dss_error.Error('Not implemented')
84