1
from ryu.services.protocols.bgp.operator.command import Command
2
from ryu.services.protocols.bgp.operator.command import CommandsResponse
3
from ryu.services.protocols.bgp.operator.command import STATUS_OK
4
from ryu.services.protocols.bgp.operator.commands.responses import \
9
help_msg = ('reset bgp connections, no afi/safi is '
10
'treated as - all supported address-families')
11
param_help_msg = '<peer_ip> [<afi> <safi>]'
14
def __init__(self, *args, **kwargs):
15
super(BGPCmd, self).__init__(*args, **kwargs)
17
self.subcommands = {'all': self.All}
19
def action(self, params):
21
return WrongParamResp()
22
peer = afi = safi = None
30
self.api.route_refresh(peer, afi, safi)
31
return CommandsResponse(STATUS_OK, '')
34
help_msg = 'reset all connections'
35
param_help_msg = '[<afi=> <safi=>]'
38
def action(self, params):
39
peer = afi = safi = None
46
self.api.route_refresh(peer, afi, safi)
47
return CommandsResponse(STATUS_OK, '')
50
class ClearCmd(Command):
51
help_msg = 'allows to reset BGP connections'
54
subcommands = {'bgp': BGPCmd}