def add_network(self, **kwargs):
"""
Defines a new network.
Usage:
======= ===============
Method URI
======= ===============
POST /vtep/networks
======= ===============
Request parameters:
================ ========================================
Attribute Description
================ ========================================
vni Virtual Network Identifier. (e.g. 10)
================ ========================================
Example::
$ curl -X POST -d '{
"vni": 10
}' http://localhost:8080/vtep/networks | python -m json.tool
::
{
"10": {
"EvpnNetwork": {
"clients": {},
"ethernet_tag_id": 0,
"route_dist": "65000:10",
"vni": 10
}
}
}
"""
try:
body = self.vtep_app.add_network(**kwargs)
except BGPSpeakerNotFound as e:
return e.to_response(status=404)
return Response(content_type='application/json',
body=json.dumps(body))
评论列表
文章目录