# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
-# @author: Somik Behera, Nicira Networks, Inc.
\ No newline at end of file
+# @author: Somik Behera, Nicira Networks, Inc.
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
-# @author: Somik Behera, Nicira Networks, Inc.
\ No newline at end of file
+# @author: Somik Behera, Nicira Networks, Inc.
"""
Manager is responsible for parsing a config file and instantiating the correct
set of plugins that concretely implement quantum_plugin_base class
-"""
\ No newline at end of file
+"""
from abc import ABCMeta, abstractmethod
+
class QuantumPluginBase(object):
__metaclass__ = ABCMeta
"""
Returns a dictionary containing all
<network_uuid, network_name> for
- the specified tenant.
+ the specified tenant.
"""
pass
-
+
@abstractmethod
def create_network(self, tenant_id, net_name):
"""
a symbolic name.
"""
pass
-
+
@abstractmethod
def delete_network(self, tenant_id, net_id):
"""
spec
"""
pass
-
+
@abstractmethod
def rename_network(self, tenant_id, net_id, new_name):
"""
Virtual Network.
"""
pass
-
+
@abstractmethod
def get_all_ports(self, tenant_id, net_id):
"""
specified Virtual Network.
"""
pass
-
+
@abstractmethod
def create_port(self, tenant_id, net_id):
"""
Creates a port on the specified Virtual Network.
"""
pass
-
+
@abstractmethod
def delete_port(self, tenant_id, net_id, port_id):
"""
is deleted.
"""
pass
-
+
@abstractmethod
def get_port_details(self, tenant_id, net_id, port_id):
"""
that is attached to this particular port.
"""
pass
-
+
@abstractmethod
def plug_interface(self, tenant_id, net_id, port_id, remote_interface_id):
"""
specified Virtual Network.
"""
pass
-
+
@abstractmethod
def unplug_interface(self, tenant_id, net_id, port_id):
"""
specified Virtual Network.
"""
pass
-
+
@abstractmethod
def get_interface_details(self, tenant_id, net_id, port_id):
"""
particular port.
"""
pass
-
+
@abstractmethod
def get_all_attached_interfaces(self, tenant_id, net_id):
"""
Retrieves all remote interfaces that are attached to
a particular Virtual Network.
"""
- pass
\ No newline at end of file
+ pass
import json
import routes
+from common import wsgi
from webob import Response
-from common import wsgi
class NetworkController(wsgi.Controller):
-
- def version(self,request):
+
+ def version(self, request):
return "Quantum version 0.1"
-class API(wsgi.Router):
- def __init__(self, options):
+
+class API(wsgi.Router):
+ def __init__(self, options):
self.options = options
- mapper = routes.Mapper()
+ mapper = routes.Mapper()
network_controller = NetworkController()
- mapper.resource("net_controller", "/network", controller=network_controller)
+ mapper.resource("net_controller", "/network",
+ controller=network_controller)
mapper.connect("/", controller=network_controller, action="version")
super(API, self).__init__(mapper)
-
-def app_factory(global_conf, **local_conf):
- conf = global_conf.copy()
+
+
+def app_factory(global_conf, **local_conf):
+ conf = global_conf.copy()
conf.update(local_conf)
return API(conf)