~corey.bryant/ubuntu/vivid/neutron-lbaas/dh-python2

« back to all changes in this revision

Viewing changes to neutron_lbaas/services/loadbalancer/agent/agent_device_driver.py

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2015-01-14 11:31:23 UTC
  • Revision ID: package-import@ubuntu.com-20150114113123-t0ymuw5vm45jn8gu
Tags: upstream-2015.1~b1
ImportĀ upstreamĀ versionĀ 2015.1~b1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2013 OpenStack Foundation.  All rights reserved
 
2
#
 
3
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
 
4
#    not use this file except in compliance with the License. You may obtain
 
5
#    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, WITHOUT
 
11
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 
12
#    License for the specific language governing permissions and limitations
 
13
#    under the License.
 
14
 
 
15
import abc
 
16
 
 
17
import six
 
18
 
 
19
 
 
20
@six.add_metaclass(abc.ABCMeta)
 
21
class AgentDeviceDriver(object):
 
22
    """Abstract device driver that defines the API required by LBaaS agent."""
 
23
 
 
24
    @abc.abstractmethod
 
25
    def get_name(cls):
 
26
        """Returns unique name across all LBaaS device drivers."""
 
27
        pass
 
28
 
 
29
    @abc.abstractmethod
 
30
    def deploy_instance(self, logical_config):
 
31
        """Fully deploys a loadbalancer instance from a given config."""
 
32
        pass
 
33
 
 
34
    @abc.abstractmethod
 
35
    def undeploy_instance(self, pool_id):
 
36
        """Fully undeploys the loadbalancer instance."""
 
37
        pass
 
38
 
 
39
    @abc.abstractmethod
 
40
    def get_stats(self, pool_id):
 
41
        pass
 
42
 
 
43
    def remove_orphans(self, known_pool_ids):
 
44
        # Not all drivers will support this
 
45
        raise NotImplementedError()
 
46
 
 
47
    @abc.abstractmethod
 
48
    def create_vip(self, vip):
 
49
        pass
 
50
 
 
51
    @abc.abstractmethod
 
52
    def update_vip(self, old_vip, vip):
 
53
        pass
 
54
 
 
55
    @abc.abstractmethod
 
56
    def delete_vip(self, vip):
 
57
        pass
 
58
 
 
59
    @abc.abstractmethod
 
60
    def create_pool(self, pool):
 
61
        pass
 
62
 
 
63
    @abc.abstractmethod
 
64
    def update_pool(self, old_pool, pool):
 
65
        pass
 
66
 
 
67
    @abc.abstractmethod
 
68
    def delete_pool(self, pool):
 
69
        pass
 
70
 
 
71
    @abc.abstractmethod
 
72
    def create_member(self, member):
 
73
        pass
 
74
 
 
75
    @abc.abstractmethod
 
76
    def update_member(self, old_member, member):
 
77
        pass
 
78
 
 
79
    @abc.abstractmethod
 
80
    def delete_member(self, member):
 
81
        pass
 
82
 
 
83
    @abc.abstractmethod
 
84
    def create_pool_health_monitor(self, health_monitor, pool_id):
 
85
        pass
 
86
 
 
87
    @abc.abstractmethod
 
88
    def update_pool_health_monitor(self,
 
89
                                   old_health_monitor,
 
90
                                   health_monitor,
 
91
                                   pool_id):
 
92
        pass
 
93
 
 
94
    @abc.abstractmethod
 
95
    def delete_pool_health_monitor(self, health_monitor, pool_id):
 
96
        pass