backing up
[vsorcdistro/.git] / ryu / build / lib.linux-armv7l-2.7 / ryu / services / protocols / bgp / operator / commands / show / __init__.py
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.command import STATUS_ERROR
5 from ryu.services.protocols.bgp.operator.commands.show import count
6 from ryu.services.protocols.bgp.operator.commands.show import importmap
7 from ryu.services.protocols.bgp.operator.commands.show import memory
8 from ryu.services.protocols.bgp.operator.commands.show import neighbor
9 from ryu.services.protocols.bgp.operator.commands.show import rib
10 from ryu.services.protocols.bgp.operator.commands.show import vrf
11
12
13 class ShowCmd(Command):
14     help_msg = 'shows runtime state information'
15     command = 'show'
16
17     def __init__(self, *args, **kwargs):
18         super(ShowCmd, self).__init__(*args, **kwargs)
19         self.subcommands = {
20             'count': self.Count,
21             'logging': self.Logging,
22             'rib': self.Rib,
23             'vrf': self.Vrf,
24             'memory': self.Memory,
25             'neighbor': self.Neighbor,
26             'importmap': self.Importmap
27         }
28
29     def action(self, params):
30         return CommandsResponse(STATUS_ERROR, 'Command incomplete')
31
32     class Count(count.Count):
33         pass
34
35     class Rib(rib.Rib):
36         pass
37
38     class Vrf(vrf.Vrf):
39         pass
40
41     class Importmap(importmap.Importmap):
42         pass
43
44     class Memory(memory.Memory):
45         pass
46
47     class Neighbor(neighbor.Neighbor):
48         pass
49
50     class Logging(Command):
51         command = 'logging'
52         help_msg = 'shows if logging is on/off and current logging level.'
53
54         def action(self, params):
55             if self.api.check_logging():
56                 ret = {'logging': self.api.check_logging(),
57                        'level': self.api.check_logging_level()}
58             else:
59                 ret = {'logging': self.api.check_logging(),
60                        'level': None}
61             return CommandsResponse(STATUS_OK, ret)