1 # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
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
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 from ryu.base import app_manager
17 from ryu.topology import event
20 def get_switch(app, dpid=None):
21 rep = app.send_request(event.EventSwitchRequest(dpid))
25 def get_all_switch(app):
26 return get_switch(app)
29 def get_link(app, dpid=None):
30 rep = app.send_request(event.EventLinkRequest(dpid))
34 def get_all_link(app):
38 def get_host(app, dpid=None):
39 rep = app.send_request(event.EventHostRequest(dpid))
43 def get_all_host(app):
47 app_manager.require_app('ryu.topology.switches', api_style=True)