Skip to content

Commit

Permalink
adding Burst field to netprofile (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
reshmagiliyal authored and shaleman committed Aug 10, 2016
1 parent 185e865 commit 92c679a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client/contivModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ var NetprofileSummaryView = React.createClass({
<ModalTrigger modal={<NetprofileModalView netprofile={ netprofile }/>}>
<tr key={ netprofile.key } className="info">


</tr>
</ModalTrigger>
);
Expand All @@ -388,7 +388,7 @@ var NetprofileSummaryView = React.createClass({
<thead>
<tr>


</tr>
</thead>
<tbody>
Expand All @@ -412,6 +412,8 @@ var NetprofileModalView = React.createClass({

<Input type='text' label='Allocated bandwidth' ref='bandwidth' defaultValue={obj.bandwidth} placeholder='Allocated bandwidth' />

<Input type='text' label='burst size' ref='burst' defaultValue={obj.burst} placeholder='burst size' />

<Input type='text' label='Network profile name' ref='profileName' defaultValue={obj.profileName} placeholder='Network profile name' />

<Input type='text' label='Tenant name' ref='tenantName' defaultValue={obj.tenantName} placeholder='Tenant name' />
Expand Down
1 change: 1 addition & 0 deletions client/contivModelClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ type Netprofile struct {

DSCP int `json:"DSCP,omitempty"` // DSCP
Bandwidth string `json:"bandwidth,omitempty"` // Allocated bandwidth
Burst int `json:"burst,omitempty"` // burst size
ProfileName string `json:"profileName,omitempty"` // Network profile name
TenantName string `json:"tenantName,omitempty"` // Tenant name

Expand Down
1 change: 1 addition & 0 deletions client/contivModelClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ def createNetprofile(self, obj):
jdata = json.dumps({
"DSCP": obj.DSCP,
"bandwidth": obj.bandwidth,
"burst": obj.burst,
"profileName": obj.profileName,
"tenantName": obj.tenantName,
})
Expand Down
5 changes: 5 additions & 0 deletions contivModel.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ type Netprofile struct {

DSCP int `json:"DSCP,omitempty"` // DSCP
Bandwidth string `json:"bandwidth,omitempty"` // Allocated bandwidth
Burst int `json:"burst,omitempty"` // burst size
ProfileName string `json:"profileName,omitempty"` // Network profile name
TenantName string `json:"tenantName,omitempty"` // Tenant name

Expand Down Expand Up @@ -2620,6 +2621,10 @@ func ValidateNetprofile(obj *Netprofile) error {
return errors.New("bandwidth string invalid format")
}

if obj.Burst > 10486 {
return errors.New("burst Value Out of bound")
}

if len(obj.ProfileName) > 64 {
return errors.New("profileName string too long")
}
Expand Down
7 changes: 7 additions & 0 deletions netProfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@
"title": "DSCP",
"description": "DSCP value",
"ShowSummary": true
},
"burst": {
"type": "int",
"title": "burst size",
"max": 10486,
"description": "burst size",
"ShowSummary": true
}
},
"link-sets": {
Expand Down

0 comments on commit 92c679a

Please sign in to comment.