def get_speakers(self, **kwargs):
"""
Gets the info of BGPSpeaker instance.
Usage:
======= ================
Method URI
======= ================
GET /vtep/speakers
======= ================
Example::
$ curl -X GET http://localhost:8080/vtep/speakers |
python -m json.tool
::
{
"172.17.0.1": {
"EvpnSpeaker": {
"as_number": 65000,
"dpid": 1,
"neighbors": {
"172.17.0.2": {
"EvpnNeighbor": {
"address": "172.17.0.2",
"remote_as": 65000,
"state": "up"
}
}
},
"router_id": "172.17.0.1"
}
}
}
"""
try:
body = self.vtep_app.get_speaker()
except BGPSpeakerNotFound as e:
return e.to_response(status=404)
return Response(content_type='application/json',
body=json.dumps(body))
评论列表
文章目录