Add VNI to VM network API list

Saves some processing on API clients.
This commit is contained in:
Joshua Boniface 2020-12-01 04:44:33 -05:00
parent 593810e53e
commit 0f8e5c6536
2 changed files with 5 additions and 0 deletions

View File

@ -1046,6 +1046,9 @@ class API_VM_Root(Resource):
source:
type: string
description: The parent network bridge on the node
vni:
type: integer
description: The VNI (PVC network) of the network bridge
model:
type: string
description: The virtual network device model

View File

@ -27,6 +27,7 @@ import shlex
import subprocess
import kazoo.client
from json import loads
from re import match as re_match
from distutils.util import strtobool
@ -359,6 +360,7 @@ def getDomainNetworks(parsed_xml, stats_data):
net_wr_drops = net_stats.get('wr_drops', 0)
net_obj = {
'type': net_type,
'vni': re_match(r'[vm]*br([0-9a-z]+)', net_bridge).group(1),
'mac': net_mac,
'source': net_bridge,
'model': net_model,