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
7 # http://www.apache.org/licenses/LICENSE-2.0
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
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
24 prop_name: The name of the property
28 CMError is raised in-case of failure
30 raise cmerror.CMError('No implemented')
32 # pylint: disable=no-self-use, unused-argument
33 def get_properties(self, prop_filter):
34 """get the properties matching some filter
38 prop_filter: A string containing the re used to match the required
43 CMError is raised in-case of failure
45 raise cmerror.CMError('Not implemented')
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
53 prop_name: The name of the property to be set/updated.
55 prop_value: The value of the property
59 CMError is raised in-case of failure
61 raise cmerror.CMError('Not implemented')
63 # pylint: disable=no-self-use, unused-argument
64 def set_properties(self, properties):
65 """set/update a group of properties
69 props: A dictionary containing the changed properties.
73 CMError is raised in-case of a failure.
75 raise cmerror.CMError('Not implemented')
77 # pylint: disable=no-self-use, unused-argument
78 def delete_property(self, prop_name):
81 This is the API used to delete a configuration property.
85 prop_name: The name of the property to be deleted.
89 CMError is raised in-case of a failure.
91 raise cmerror.CMError('Not implemented')
93 # pylint: disable=no-self-use, unused-argument
94 def delete_properties(self, arg):
95 """delete a group of properties
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.
105 CMError is raised in-case of a failure.
107 raise cmerror.CMError('Not implemented')
109 if __name__ == '__main__':