Skip to content

Commit

Permalink
Add max routes per VRF
Browse files Browse the repository at this point in the history
  • Loading branch information
sojindal committed Nov 9, 2020
1 parent 37a7c61 commit 8087846
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions go-server-server/go/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,7 @@ func ConfigVrouterVrfIdGet(w http.ResponseWriter, r *http.Request) {
VnetName: vars["vnet_name"],
Attr: VnetModel{
Vnid: vnid,
Ipv4MaxRoutes: 0,
},
}

Expand Down Expand Up @@ -933,6 +934,7 @@ func ConfigVrouterVrfIdPost(w http.ResponseWriter, r *http.Request) {
pt.Set(vnet_id_str, map[string]string{
"vxlan_tunnel": "default_vxlan_tunnel",
"vni": strconv.Itoa(attr.Vnid),
"ipv4_max_routes": "",
"guid": vars["vnet_name"],
}, "SET", "")

Expand Down
3 changes: 3 additions & 0 deletions go-server-server/go/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ type TunnelDecapReturnModel struct {

type VnetModel struct {
Vnid int `json:"vnid"`
Ipv4MaxRoutes int `json:"ipv4_max_routes,omitempty"`
}

type VnetReturnModel struct {
Expand Down Expand Up @@ -309,6 +310,7 @@ func (m *TunnelDecapModel) UnmarshalJSON(data []byte) (err error) {
func (m *VnetModel) UnmarshalJSON(data []byte) (err error) {
required := struct {
Vnid *int `json:"vnid"`
Ipv4MaxRoutes *int `json:"ipv4_max_routes,omitempty"`
}{}

err = json.Unmarshal(data, &required)
Expand All @@ -328,6 +330,7 @@ func (m *VnetModel) UnmarshalJSON(data []byte) (err error) {
}

m.Vnid = *required.Vnid
m.Ipv4MaxRoutes = 0

return
}
Expand Down
5 changes: 5 additions & 0 deletions sonic_api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1337,11 +1337,16 @@ definitions:
type: object
required:
- vnid
- max_routes
properties:
vnid:
type: integer
format: int32
description: vnid
max_routes:
type: integer
format: int32
description: maximum routes per vrf
VlanEntry:
type: object
properties:
Expand Down

0 comments on commit 8087846

Please sign in to comment.