summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-08-19 09:35:32 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-08-24 14:23:44 +0900
commit1a9008b73ec1f9af6212d113a40253c22227e770 (patch)
tree88a278fe6ea9f66470e49d3205f2740a1a7e581a
parent0d405de657c1bd7837c9a248c177f2240b98e462 (diff)
bgp: add neighbor_state_get method
Can be used to get the state of peer(s). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/services/protocols/bgp/bgpspeaker.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/ryu/services/protocols/bgp/bgpspeaker.py b/ryu/services/protocols/bgp/bgpspeaker.py
index 8998d7ee..5fe381f0 100644
--- a/ryu/services/protocols/bgp/bgpspeaker.py
+++ b/ryu/services/protocols/bgp/bgpspeaker.py
@@ -376,6 +376,21 @@ class BGPSpeaker(object):
neighbors.CHANGES: attribute_param}
call(func_name, **param)
+ def neighbor_state_get(self, address=None, format='json'):
+ """ This method returns the state of peer(s) in a json
+ format.
+
+ ``address`` specifies the address of a peer. If not given, the
+ state of all the peers return.
+
+ """
+ show = {}
+ show['params'] = ['neighbor', 'summary']
+ if address:
+ show['params'].append(address)
+ show['format'] = format
+ return call('operator.show', **show)
+
def prefix_add(self, prefix, next_hop=None, route_dist=None):
""" This method adds a new prefix to be advertized.