Skip to content

Commit 532d767

Browse files
committed
change from/to epg/network in rules
1 parent 1b5c36a commit 532d767

5 files changed

+96
-43
lines changed

client/contivModel.js

+27-9
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,12 @@ var PolicyModalView = React.createClass({
389389

390390
<Input type='text' label='Tenant Name' ref='tenantName' defaultValue={obj.tenantName} placeholder='Tenant Name' />
391391

392+
<Input type='text' label='To Endpoint Group' ref='toEndpointGroup' defaultValue={obj.toEndpointGroup} placeholder='To Endpoint Group' />
393+
394+
<Input type='text' label='IP Address' ref='toIpAddress' defaultValue={obj.toIpAddress} placeholder='IP Address' />
395+
396+
<Input type='text' label='To Network' ref='toNetwork' defaultValue={obj.toNetwork} placeholder='To Network' />
397+
392398
</div>
393399
<div className='modal-footer'>
394400
<Button onClick={this.props.onRequestHide}>Close</Button>
@@ -415,10 +421,12 @@ var RuleSummaryView = React.createClass({
415421

416422
<td>{ rule.direction }</td>
417423

418-
<td>{ rule.endpointGroup }</td>
424+
<td>{ rule.fromEndpointGroup }</td>
425+
426+
<td>{ rule.fromIpAddress }</td>
427+
428+
<td>{ rule.fromNetwork }</td>
419429

420-
<td>{ rule.ipAddress }</td>
421-
422430
<td>{ rule.policyName }</td>
423431

424432
<td>{ rule.port }</td>
@@ -430,6 +438,12 @@ var RuleSummaryView = React.createClass({
430438
<td>{ rule.ruleId }</td>
431439

432440
<td>{ rule.tenantName }</td>
441+
442+
<td>{ rule.toEndpointGroup }</td>
443+
444+
<td>{ rule.toIpAddress }</td>
445+
446+
<td>{ rule.toNetwork }</td>
433447

434448
</tr>
435449
</ModalTrigger>
@@ -445,14 +459,18 @@ var RuleSummaryView = React.createClass({
445459

446460
<th> Action </th>
447461
<th> Direction </th>
448-
<th> Group </th>
449-
<th> IP Address </th>
462+
<th> From Endpoint Group </th>
463+
<th> IP Address </th>
464+
<th> From Network </th>
450465
<th> Policy Name </th>
451466
<th> Port No </th>
452467
<th> Priority </th>
453468
<th> Protocol </th>
454469
<th> Rule Id </th>
455-
<th> Tenant Name </th>
470+
<th> Tenant Name </th>
471+
<th> To Endpoint Group </th>
472+
<th> IP Address </th>
473+
<th> To Network </th>
456474
</tr>
457475
</thead>
458476
<tbody>
@@ -476,11 +494,11 @@ var RuleModalView = React.createClass({
476494

477495
<Input type='text' label='Direction' ref='direction' defaultValue={obj.direction} placeholder='Direction' />
478496

479-
<Input type='text' label='Group' ref='endpointGroup' defaultValue={obj.endpointGroup} placeholder='Group' />
497+
<Input type='text' label='From Endpoint Group' ref='fromEndpointGroup' defaultValue={obj.fromEndpointGroup} placeholder='From Endpoint Group' />
480498

481-
<Input type='text' label='IP Address' ref='ipAddress' defaultValue={obj.ipAddress} placeholder='IP Address' />
499+
<Input type='text' label='IP Address' ref='fromIpAddress' defaultValue={obj.fromIpAddress} placeholder='IP Address' />
482500

483-
<Input type='text' label='Network Name' ref='network' defaultValue={obj.network} placeholder='Network Name' />
501+
<Input type='text' label='From Network' ref='fromNetwork' defaultValue={obj.fromNetwork} placeholder='From Network' />
484502

485503
<Input type='text' label='Policy Name' ref='policyName' defaultValue={obj.policyName} placeholder='Policy Name' />
486504

client/contivModelClient.go

+14-11
Original file line numberDiff line numberDiff line change
@@ -234,17 +234,20 @@ type Rule struct {
234234
// every object has a key
235235
Key string `json:"key,omitempty"`
236236

237-
Action string `json:"action,omitempty"` // Action
238-
Direction string `json:"direction,omitempty"` // Direction
239-
EndpointGroup string `json:"endpointGroup,omitempty"` // Group
240-
IpAddress string `json:"ipAddress,omitempty"` // IP Address
241-
Network string `json:"network,omitempty"` // Network Name
242-
PolicyName string `json:"policyName,omitempty"` // Policy Name
243-
Port int `json:"port,omitempty"` // Port No
244-
Priority int `json:"priority,omitempty"` // Priority
245-
Protocol string `json:"protocol,omitempty"` // Protocol
246-
RuleID string `json:"ruleId,omitempty"` // Rule Id
247-
TenantName string `json:"tenantName,omitempty"` // Tenant Name
237+
Action string `json:"action,omitempty"` // Action
238+
Direction string `json:"direction,omitempty"` // Direction
239+
FromEndpointGroup string `json:"fromEndpointGroup,omitempty"` // From Endpoint Group
240+
FromIpAddress string `json:"fromIpAddress,omitempty"` // IP Address
241+
FromNetwork string `json:"fromNetwork,omitempty"` // From Network
242+
PolicyName string `json:"policyName,omitempty"` // Policy Name
243+
Port int `json:"port,omitempty"` // Port No
244+
Priority int `json:"priority,omitempty"` // Priority
245+
Protocol string `json:"protocol,omitempty"` // Protocol
246+
RuleID string `json:"ruleId,omitempty"` // Rule Id
247+
TenantName string `json:"tenantName,omitempty"` // Tenant Name
248+
ToEndpointGroup string `json:"toEndpointGroup,omitempty"` // To Endpoint Group
249+
ToIpAddress string `json:"toIpAddress,omitempty"` // IP Address
250+
ToNetwork string `json:"toNetwork,omitempty"` // To Network
248251

249252
// add link-sets and links
250253
LinkSets RuleLinkSets `json:"link-sets,omitempty"`

client/contivModelClient.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -281,15 +281,18 @@ def createRule(self, obj):
281281
jdata = json.dumps({
282282
"action": obj.action,
283283
"direction": obj.direction,
284-
"endpointGroup": obj.endpointGroup,
285-
"ipAddress": obj.ipAddress,
286-
"network": obj.network,
284+
"fromEndpointGroup": obj.fromEndpointGroup,
285+
"fromIpAddress": obj.fromIpAddress,
286+
"fromNetwork": obj.fromNetwork,
287287
"policyName": obj.policyName,
288288
"port": obj.port,
289289
"priority": obj.priority,
290290
"protocol": obj.protocol,
291291
"ruleId": obj.ruleId,
292292
"tenantName": obj.tenantName,
293+
"toEndpointGroup": obj.toEndpointGroup,
294+
"toIpAddress": obj.toIpAddress,
295+
"toNetwork": obj.toNetwork,
293296
})
294297

295298
# Post the data

contivModel.go

+26-15
Original file line numberDiff line numberDiff line change
@@ -131,17 +131,20 @@ type Rule struct {
131131
// every object has a key
132132
Key string `json:"key,omitempty"`
133133

134-
Action string `json:"action,omitempty"` // Action
135-
Direction string `json:"direction,omitempty"` // Direction
136-
EndpointGroup string `json:"endpointGroup,omitempty"` // Group
137-
IpAddress string `json:"ipAddress,omitempty"` // IP Address
138-
Network string `json:"network,omitempty"` // Network Name
139-
PolicyName string `json:"policyName,omitempty"` // Policy Name
140-
Port int `json:"port,omitempty"` // Port No
141-
Priority int `json:"priority,omitempty"` // Priority
142-
Protocol string `json:"protocol,omitempty"` // Protocol
143-
RuleID string `json:"ruleId,omitempty"` // Rule Id
144-
TenantName string `json:"tenantName,omitempty"` // Tenant Name
134+
Action string `json:"action,omitempty"` // Action
135+
Direction string `json:"direction,omitempty"` // Direction
136+
FromEndpointGroup string `json:"fromEndpointGroup,omitempty"` // From Endpoint Group
137+
FromIpAddress string `json:"fromIpAddress,omitempty"` // IP Address
138+
FromNetwork string `json:"fromNetwork,omitempty"` // From Network
139+
PolicyName string `json:"policyName,omitempty"` // Policy Name
140+
Port int `json:"port,omitempty"` // Port No
141+
Priority int `json:"priority,omitempty"` // Priority
142+
Protocol string `json:"protocol,omitempty"` // Protocol
143+
RuleID string `json:"ruleId,omitempty"` // Rule Id
144+
TenantName string `json:"tenantName,omitempty"` // Tenant Name
145+
ToEndpointGroup string `json:"toEndpointGroup,omitempty"` // To Endpoint Group
146+
ToIpAddress string `json:"toIpAddress,omitempty"` // IP Address
147+
ToNetwork string `json:"toNetwork,omitempty"` // To Network
145148

146149
// add link-sets and links
147150
LinkSets RuleLinkSets `json:"link-sets,omitempty"`
@@ -1839,6 +1842,14 @@ func ValidateNetwork(obj *Network) error {
18391842
return errors.New("tenantName string too long")
18401843
}
18411844

1845+
if len(obj.ToEndpointGroup) > 64 {
1846+
return errors.New("toEndpointGroup string too long")
1847+
}
1848+
1849+
if len(obj.ToNetwork) > 64 {
1850+
return errors.New("toNetwork string too long")
1851+
}
1852+
18421853
return nil
18431854
}
18441855

@@ -2317,12 +2328,12 @@ func ValidateRule(obj *Rule) error {
23172328
return errors.New("direction string invalid format")
23182329
}
23192330

2320-
if len(obj.EndpointGroup) > 64 {
2321-
return errors.New("endpointGroup string too long")
2331+
if len(obj.FromEndpointGroup) > 64 {
2332+
return errors.New("fromEndpointGroup string too long")
23222333
}
23232334

2324-
if len(obj.Network) > 64 {
2325-
return errors.New("network string too long")
2335+
if len(obj.FromNetwork) > 64 {
2336+
return errors.New("fromNetwork string too long")
23262337
}
23272338

23282339
if len(obj.PolicyName) > 64 {

rule.json

+23-5
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,36 @@
3939
"title": "Priority",
4040
"showSummary": true
4141
},
42-
"endpointGroup": {
42+
"fromEndpointGroup": {
4343
"type": "string",
4444
"length": 64,
45-
"title": "Group",
45+
"title": "From Endpoint Group",
4646
"showSummary": true
4747
},
48-
"network": {
48+
"toEndpointGroup": {
4949
"type": "string",
5050
"length": 64,
51-
"title": "Network Name"
51+
"title": "To Endpoint Group",
52+
"showSummary": true
53+
},
54+
"fromNetwork": {
55+
"type": "string",
56+
"length": 64,
57+
"title": "From Network",
58+
"showSummary": true
59+
},
60+
"toNetwork": {
61+
"type": "string",
62+
"length": 64,
63+
"title": "To Network",
64+
"showSummary": true
65+
},
66+
"fromIpAddress": {
67+
"type": "string",
68+
"title": "IP Address",
69+
"showSummary": true
5270
},
53-
"ipAddress": {
71+
"toIpAddress": {
5472
"type": "string",
5573
"title": "IP Address",
5674
"showSummary": true

0 commit comments

Comments
 (0)