diff --git a/client/contivModel.js b/client/contivModel.js index 0e3cd3028..2ea3b6d29 100644 --- a/client/contivModel.js +++ b/client/contivModel.js @@ -282,6 +282,8 @@ var NetworkSummaryView = React.createClass({ { network.networkName } + { network.nwType } + { network.pktTag } { network.subnet } @@ -301,6 +303,7 @@ var NetworkSummaryView = React.createClass({ Encapsulation Gateway Network name + Network Type Vlan/Vxlan Tag Subnet @@ -328,6 +331,8 @@ var NetworkModalView = React.createClass({ + + diff --git a/client/contivModelClient.go b/client/contivModelClient.go index b01afacd3..73cf0a3f9 100644 --- a/client/contivModelClient.go +++ b/client/contivModelClient.go @@ -225,6 +225,7 @@ type Network struct { Encap string `json:"encap,omitempty"` // Encapsulation Gateway string `json:"gateway,omitempty"` // Gateway NetworkName string `json:"networkName,omitempty"` // Network name + NwType string `json:"nwType,omitempty"` // Network Type PktTag int `json:"pktTag,omitempty"` // Vlan/Vxlan Tag Subnet string `json:"subnet,omitempty"` // Subnet TenantName string `json:"tenantName,omitempty"` // Tenant Name diff --git a/contivModel.go b/contivModel.go index 6bfc0255f..a0c81b6cf 100644 --- a/contivModel.go +++ b/contivModel.go @@ -94,6 +94,7 @@ type Network struct { Encap string `json:"encap,omitempty"` // Encapsulation Gateway string `json:"gateway,omitempty"` // Gateway NetworkName string `json:"networkName,omitempty"` // Network name + NwType string `json:"nwType,omitempty"` // Network Type PktTag int `json:"pktTag,omitempty"` // Vlan/Vxlan Tag Subnet string `json:"subnet,omitempty"` // Subnet TenantName string `json:"tenantName,omitempty"` // Tenant Name @@ -1873,6 +1874,11 @@ func ValidateNetwork(obj *Network) error { return errors.New("networkName string too long") } + nwTypeMatch := regexp.MustCompile("^(infra|data)$") + if nwTypeMatch.MatchString(obj.NwType) == false { + return errors.New("nwType string invalid format") + } + subnetMatch := regexp.MustCompile("^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})(\\-(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9]))?/(3[0-1]|2[0-9]|1[0-9]|[1-9])$") if subnetMatch.MatchString(obj.Subnet) == false { return errors.New("subnet string invalid format") diff --git a/network.json b/network.json index c76e3f837..c38afd90a 100644 --- a/network.json +++ b/network.json @@ -17,6 +17,12 @@ "title": "Tenant Name", "length": 64 }, + "nwType": { + "type": "string", + "format": "^(infra|data)$", + "title": "Network Type", + "showSummary": true + }, "encap": { "type": "string", "format": "^(vlan|vxlan)$",