Hi, Stan
manager.main() takes module names but not class names,
so simple replacement with the class name "ExampleSwitch13" will not work.
However, if you have the instance of "ExampleSwitch13" class,
you can get the name of module in which the class was defined.
For example, you can run ryu.app.example_switch_13 as follows:
manager.main(args=['--verbose', '--ofp-tcp-listen-port', '6666',
ExampleSwitch13().__module__])
Thanks,
Fujimoto
On 2017年05月19日 08:50, Stan Wong wrote:
> Hi Fujimoto,
>
> Thank for replying!
>
> Can the rye.app.example_switch_13 replace by Example_Switch_13 class?
>
> Best regards,
>
> Stan
>> On 12 May 2017, at 03:22, Fujimoto Satoshi <[email protected]>
>> wrote:
>>
>> Hi, Stan
>>
>> You can run a Ryu application by calling main() in ryu/cmd/manager.py.
>> It receives the arguments list including the application name by 'args'
>> argument.
>>
>> So, the following code can run a Ryu application:
>> manager.main(args=['--verbose', '--ofp-tcp-listen-port', '6666',
>> 'ryu.app.example_switch_13'])
>>
>> It is equal to executing the following command in command line:
>> ryu-manager --verbose --ofp-tcp-listen-port 6666
>> ryu.app.example_switch_13
>>
>> Thanks,
>> Fujimoto
>>
>> On 2017年05月11日 21:35, Stan Wong wrote:
>>> Dear All,
>>>
>>> I am new to Ryu and would like to execute Ryu purely in python.
>>>
>>> Does any example available or where I should look at it?
>>>
>>> Best regards,
>>>
>>> Stan
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>> _______________________________________________
>>> Ryu-devel mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel