def add_neighbor(self, **kwargs):
"""
Registers a new neighbor to the speaker.
Usage:
======= ========================
Method URI
======= ========================
POST /vtep/neighbors
======= ========================
Request parameters:
========== ================================================
Attribute Description
========== ================================================
address IP address of neighbor. (e.g. "172.17.0.2")
remote_as AS number of neighbor. (e.g. 65000)
========== ================================================
Example::
$ curl -X POST -d '{
"address": "172.17.0.2",
"remote_as": 65000
}' http://localhost:8080/vtep/neighbors |
python -m json.tool
::
{
"172.17.0.2": {
"EvpnNeighbor": {
"address": "172.17.0.2",
"remote_as": 65000,
"state": "down"
}
}
}
"""
try:
body = self.vtep_app.add_neighbor(**kwargs)
except BGPSpeakerNotFound as e:
return e.to_response(status=400)
return Response(content_type='application/json',
body=json.dumps(body))
评论列表
文章目录