Hi,

On 2015年04月22日 07:59, MD.Badruzzaman Shakib wrote:
> Hello everyone,
> 
> In my application I want to get all the dpid and datapath object that are 
> connected with the controller. I am not good in python that's why it seems 
> difficult to me to write the code. I tried something like the following but 
> it did not work-
> 
> from ryu.controller import dpset
> 
> .....
> .....
> @set_ev_cls(EventLinkAdd, MAIN_DISPATCHER)
>  def _link_add_handler(self, ev):
>          .........
>          .........
>         datapath_list = *dpset.DPSet()*
>         print "Datapath instances in a list:", *datapath_list.get_all()*
> 
> I thought *datapath_list.get_all()* will give me the list of the tuple of 
> (dpid, datapath). But it did not work. Can anyone please tell me what should 
> be the code to get the (dpid, datapath) list by using the get_all() method of 
> DPSet class?
> 

Please define 'dpset' in _CONTEXTS.
(Contexts are ordinary python objects shared among Ryu applications.)

And, I recommend that refer to the follwing application(simple_isolation.py) 
for writing your application.
The following points will be helpful.

 https://github.com/osrg/ryu/blob/master/ryu/app/simple_isolation.py#L28
 https://github.com/osrg/ryu/blob/master/ryu/app/simple_isolation.py#L44
 https://github.com/osrg/ryu/blob/master/ryu/app/simple_isolation.py#L50
 https://github.com/osrg/ryu/blob/master/ryu/app/simple_isolation.py#L318

thanks,

> Thanking you
> Sakib
> 
> 
> 
> ------------------------------------------------------------------------------
> BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
> Develop your own process in accordance with the BPMN 2 standard
> Learn Process modeling best practices with Bonita BPM through live exercises
> http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
> source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
> 
> 
> 
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
> 

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to