Initial commit
[ta/config-manager.git] / cmframework / src / cmframework / apis / cmbackend.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 from cmframework.apis import cmerror
15
16
17 class CMBackend(object):
18     # pylint: disable=no-self-use, unused-argument
19     def get_property(self, prop_name):
20         """get the value of some property
21
22            Arguments:
23
24            prop_name: The name of the property
25
26            Raise:
27
28            CMError is raised in-case of failure
29         """
30         raise cmerror.CMError('No implemented')
31
32     # pylint: disable=no-self-use, unused-argument
33     def get_properties(self, prop_filter):
34         """get the properties matching some filter
35
36            Arguments:
37
38            prop_filter: A string containing the re used to match the required
39                         properties.
40
41             Raise:
42
43             CMError is raised in-case of failure
44         """
45         raise cmerror.CMError('Not implemented')
46
47     # pylint: disable=no-self-use, unused-argument
48     def set_property(self, prop_name, prop_value):
49         """set/update a value to some property
50
51            Arguments:
52
53            prop_name: The name of the property to be set/updated.
54
55            prop_value: The value of the property
56
57            Raise:
58
59            CMError is raised in-case of failure
60         """
61         raise cmerror.CMError('Not implemented')
62
63     # pylint: disable=no-self-use, unused-argument
64     def set_properties(self, properties):
65         """set/update a group of properties
66
67            Arguments:
68
69            props: A dictionary containing the changed properties.
70
71            Raise:
72
73            CMError is raised in-case of a failure.
74         """
75         raise cmerror.CMError('Not implemented')
76
77     # pylint: disable=no-self-use, unused-argument
78     def delete_property(self, prop_name):
79         """delete a property
80
81            This is the API used to delete a configuration property.
82
83            Arguments:
84
85            prop_name: The name of the property to be deleted.
86
87            Raise:
88
89            CMError is raised in-case of a failure.
90         """
91         raise cmerror.CMError('Not implemented')
92
93     # pylint: disable=no-self-use, unused-argument
94     def delete_properties(self, arg):
95         """delete a group of properties
96
97            Arguments:
98
99            arg: This can be either a string representing the re used when
100                 matching the properties to be deleted, or it can be a list of
101                 properties names to be deleted.
102
103             Rise:
104
105             CMError is raised in-case of a failure.
106         """
107         raise cmerror.CMError('Not implemented')
108
109 if __name__ == '__main__':
110     pass