~ubuntu-branches/ubuntu/vivid/neutron/vivid-updates

« back to all changes in this revision

Viewing changes to neutron/plugins/nec/ofc_driver_base.py

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2015-03-30 11:17:19 UTC
  • mfrom: (1.1.21)
  • Revision ID: package-import@ubuntu.com-20150330111719-h0gx7233p4jkkgfh
Tags: 1:2015.1~b3-0ubuntu1
* New upstream milestone release:
  - d/control: Align version requirements with upstream.
  - d/control: Add new dependency on oslo-log.
  - d/p/*: Rebase.
  - d/control,d/neutron-plugin-hyperv*: Dropped, decomposed into
    separate project upstream.
  - d/control,d/neutron-plugin-openflow*: Dropped, decomposed into
    separate project upstream.
  - d/neutron-common.install: Add neutron-rootwrap-daemon and 
    neutron-keepalived-state-change binaries.
  - d/rules: Ignore neutron-hyperv-agent when installing; only for Windows.
  - d/neutron-plugin-cisco.install: Drop neutron-cisco-cfg-agent as
    decomposed into separate project upstream.
  - d/neutron-plugin-vmware.install: Drop neutron-check-nsx-config and
    neutron-nsx-manage as decomposed into separate project upstream.
  - d/control: Add dependency on python-neutron-fwaas to neutron-l3-agent.
* d/pydist-overrides: Add overrides for oslo packages.
* d/control: Fixup type in package description (LP: #1263539).
* d/p/fixup-driver-test-execution.patch: Cherry pick fix from upstream VCS
  to support unit test exection in out-of-tree vendor drivers.
* d/neutron-common.postinst: Allow general access to /etc/neutron but limit
  access to root/neutron to /etc/neutron/neutron.conf to support execution
  of unit tests in decomposed vendor drivers.
* d/control: Add dependency on python-neutron-fwaas to neutron-l3-agent
  package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2012 NEC Corporation.  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
 
import six
17
 
 
18
 
 
19
 
@six.add_metaclass(abc.ABCMeta)
20
 
class OFCDriverBase(object):
21
 
    """OpenFlow Controller (OFC) Driver Specification.
22
 
 
23
 
    OFCDriverBase defines the minimum set of methods required by this plugin.
24
 
    It would be better that other methods like update_* are implemented.
25
 
    """
26
 
 
27
 
    @abc.abstractmethod
28
 
    def create_tenant(self, description, tenant_id=None):
29
 
        """Create a new tenant at OpenFlow Controller.
30
 
 
31
 
        :param description: A description of this tenant.
32
 
        :param tenant_id: A hint of OFC tenant ID.
33
 
                          A driver could use this id as a OFC id or ignore it.
34
 
        :returns: ID of the tenant created at OpenFlow Controller.
35
 
        :raises: neutron.plugin.nec.common.exceptions.OFCException
36
 
        """
37
 
        pass
38
 
 
39
 
    @abc.abstractmethod
40
 
    def delete_tenant(self, ofc_tenant_id):
41
 
        """Delete a tenant at OpenFlow Controller.
42
 
 
43
 
        :raises: neutron.plugin.nec.common.exceptions.OFCException
44
 
        """
45
 
        pass
46
 
 
47
 
    @abc.abstractmethod
48
 
    def create_network(self, ofc_tenant_id, description, network_id=None):
49
 
        """Create a new network on specified OFC tenant at OpenFlow Controller.
50
 
 
51
 
        :param ofc_tenant_id: a OFC tenant ID in which a new network belongs.
52
 
        :param description: A description of this network.
53
 
        :param network_id: A hint of an ID of OFC network.
54
 
        :returns: ID of the network created at OpenFlow Controller.
55
 
            ID returned must be unique in the OpenFlow Controller.
56
 
            If a network is identified in conjunction with other information
57
 
            such as a tenant ID, such information should be included in the ID.
58
 
        :raises: neutron.plugin.nec.common.exceptions.OFCException
59
 
        """
60
 
        pass
61
 
 
62
 
    @abc.abstractmethod
63
 
    def delete_network(self, ofc_network_id):
64
 
        """Delete a netwrok at OpenFlow Controller.
65
 
 
66
 
        :raises: neutron.plugin.nec.common.exceptions.OFCException
67
 
        """
68
 
        pass
69
 
 
70
 
    @abc.abstractmethod
71
 
    def create_port(self, ofc_network_id, portinfo,
72
 
                    port_id=None, filters=None):
73
 
        """Create a new port on specified network at OFC.
74
 
 
75
 
        :param ofc_network_id: a OFC tenant ID in which a new port belongs.
76
 
        :param portinfo: An OpenFlow information of this port.
77
 
                    {'datapath_id': Switch ID that a port connected.
78
 
                     'port_no': Port Number that a port connected on a Swtich.
79
 
                     'vlan_id': VLAN ID that a port tagging.
80
 
                     'mac': Mac address.
81
 
                    }
82
 
        :param port_id: A hint of an ID of OFC port.
83
 
            ID returned must be unique in the OpenFlow Controller.
84
 
 
85
 
            If a port is identified in combination with a network or
86
 
            a tenant, such information should be included in the ID.
87
 
        :param filters: A list of packet filter associated with the port.
88
 
            Each element is a tuple (neutron ID, OFC ID)
89
 
 
90
 
        :returns: ID of the port created at OpenFlow Controller.
91
 
        :raises: neutron.plugin.nec.common.exceptions.OFCException
92
 
        """
93
 
        pass
94
 
 
95
 
    @abc.abstractmethod
96
 
    def delete_port(self, ofc_port_id):
97
 
        """Delete a port at OpenFlow Controller.
98
 
 
99
 
        :raises: neutron.plugin.nec.common.exceptions.OFCException
100
 
        """
101
 
        pass