Merge "framework: Add reworked framework to repo"
[vswitchperf.git] / core / vnf_controller.py
1 # Copyright 2015 Intel Corporation.
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 """ VNF Controller interface
15 """
16
17 class IVnfController(object):
18     """Abstract class which defines a VNF controller
19
20     Used to set-up and control a VNF provider for a particular
21     deployment scenario.
22     """
23
24     def get_vnfs(self):
25         """Returns a list of vnfs controlled by this controller.
26         """
27         raise NotImplementedError(
28             "The VnfController does not implement",
29             "the \"get_vnfs\" function.")
30
31     #TODO: Decide on contextmanager or __enter/exit__ strategy <MH 2015-05-01>
32     def start(self):
33         """Boots all VNFs set-up by __init__.
34
35         This is a blocking function.
36         """
37         raise NotImplementedError(
38             "The VnfController does not implement",
39             "the \"start\" function.")
40
41     def stop(self):
42         """Stops all VNFs set-up by __init__.
43
44         This is a blocking function.
45         """
46         raise NotImplementedError(
47             "The VnfController does not implement",
48             "the \"stop\" function.")