Skip to content

Commit 69ff0b9

Browse files
committed
move vlan/vxlan range to global
1 parent 3b56d98 commit 69ff0b9

7 files changed

+108
-156
lines changed

client/contivModel.js

+10-18
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ var GlobalSummaryView = React.createClass({
145145
<td>{ global.name }</td>
146146

147147
<td>{ global.network-infra-type }</td>
148-
148+
149149
</tr>
150150
</ModalTrigger>
151151
);
@@ -159,7 +159,7 @@ var GlobalSummaryView = React.createClass({
159159

160160

161161
<th> name of this block </th>
162-
<th> Network infrastructure type </th>
162+
<th> Network infrastructure type </th>
163163
</tr>
164164
</thead>
165165
<tbody>
@@ -183,6 +183,10 @@ var GlobalModalView = React.createClass({
183183

184184
<Input type='text' label='Network infrastructure type' ref='network-infra-type' defaultValue={obj.network-infra-type} placeholder='Network infrastructure type' />
185185

186+
<Input type='text' label='Allowed vlan range' ref='vlans' defaultValue={obj.vlans} placeholder='Allowed vlan range' />
187+
188+
<Input type='text' label='Allwed vxlan range' ref='vxlans' defaultValue={obj.vxlans} placeholder='Allwed vxlan range' />
189+
186190
</div>
187191
<div className='modal-footer'>
188192
<Button onClick={this.props.onRequestHide}>Close</Button>
@@ -208,7 +212,7 @@ var NetworkSummaryView = React.createClass({
208212
<td>{ network.encap }</td>
209213

210214
<td>{ network.gateway }</td>
211-
215+
212216
<td>{ network.networkName }</td>
213217

214218
<td>{ network.pktTag }</td>
@@ -228,7 +232,7 @@ var NetworkSummaryView = React.createClass({
228232

229233

230234
<th> Encapsulation </th>
231-
<th> Gateway </th>
235+
<th> Gateway </th>
232236
<th> Network name </th>
233237
<th> Vlan/Vxlan Tag </th>
234238
<th> Subnet </th>
@@ -255,10 +259,6 @@ var NetworkModalView = React.createClass({
255259

256260
<Input type='text' label='Gateway' ref='gateway' defaultValue={obj.gateway} placeholder='Gateway' />
257261

258-
<Input type='text' label='Private network' ref='isPrivate' defaultValue={obj.isPrivate} placeholder='Private network' />
259-
260-
<Input type='text' label='Public network' ref='isPublic' defaultValue={obj.isPublic} placeholder='Public network' />
261-
262262
<Input type='text' label='Network name' ref='networkName' defaultValue={obj.networkName} placeholder='Network name' />
263263

264264
<Input type='text' label='Vlan/Vxlan Tag' ref='pktTag' defaultValue={obj.pktTag} placeholder='Vlan/Vxlan Tag' />
@@ -596,7 +596,7 @@ var TenantSummaryView = React.createClass({
596596
<ModalTrigger modal={<TenantModalView tenant={ tenant }/>}>
597597
<tr key={ tenant.key } className="info">
598598

599-
599+
600600
</tr>
601601
</ModalTrigger>
602602
);
@@ -608,7 +608,7 @@ var TenantSummaryView = React.createClass({
608608
<thead>
609609
<tr>
610610

611-
611+
612612
</tr>
613613
</thead>
614614
<tbody>
@@ -630,16 +630,8 @@ var TenantModalView = React.createClass({
630630

631631
<Input type='text' label='Network name' ref='defaultNetwork' defaultValue={obj.defaultNetwork} placeholder='Network name' />
632632

633-
<Input type='text' label='' ref='subnetLen' defaultValue={obj.subnetLen} placeholder='' />
634-
635-
<Input type='text' label='' ref='subnetPool' defaultValue={obj.subnetPool} placeholder='' />
636-
637633
<Input type='text' label='Tenant Name' ref='tenantName' defaultValue={obj.tenantName} placeholder='Tenant Name' />
638634

639-
<Input type='text' label='' ref='vlans' defaultValue={obj.vlans} placeholder='' />
640-
641-
<Input type='text' label='' ref='vxlans' defaultValue={obj.vxlans} placeholder='' />
642-
643635
</div>
644636
<div className='modal-footer'>
645637
<Button onClick={this.props.onRequestHide}>Close</Button>

client/contivModelClient.go

+38-42
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ type App struct {
122122
// every object has a key
123123
Key string `json:"key,omitempty"`
124124

125-
AppName string `json:"appName,omitempty"` // Application Name
126-
TenantName string `json:"tenantName,omitempty"` // Tenant Name
125+
AppName string `json:"appName,omitempty"` //
126+
TenantName string `json:"tenantName,omitempty"` //
127127

128128
// add link-sets and links
129129
LinkSets AppLinkSets `json:"link-sets,omitempty"`
@@ -142,11 +142,11 @@ type EndpointGroup struct {
142142
// every object has a key
143143
Key string `json:"key,omitempty"`
144144

145-
EndpointGroupID int `json:"endpointGroupId,omitempty"` //
146-
GroupName string `json:"groupName,omitempty"` // Endpoint group Name
147-
NetworkName string `json:"networkName,omitempty"` //
145+
EndpointGroupID int `json:"endpointGroupId,omitempty"` // Group Identifier
146+
GroupName string `json:"groupName,omitempty"` // Group name
147+
NetworkName string `json:"networkName,omitempty"` // Network
148148
Policies []string `json:"policies,omitempty"`
149-
TenantName string `json:"tenantName,omitempty"` // Tenant Name
149+
TenantName string `json:"tenantName,omitempty"` // Tenant
150150

151151
// add link-sets and links
152152
LinkSets EndpointGroupLinkSets `json:"link-sets,omitempty"`
@@ -167,23 +167,23 @@ type Global struct {
167167
// every object has a key
168168
Key string `json:"key,omitempty"`
169169

170-
Name string `json:"name,omitempty"` //
171-
NetworkInfraType string `json:"network-infra-type,omitempty"` //
170+
Name string `json:"name,omitempty"` // name of this block
171+
NetworkInfraType string `json:"network-infra-type,omitempty"` // Network infrastructure type
172+
Vlans string `json:"vlans,omitempty"` // Allowed vlan range
173+
Vxlans string `json:"vxlans,omitempty"` // Allwed vxlan range
172174

173175
}
174176

175177
type Network struct {
176178
// every object has a key
177179
Key string `json:"key,omitempty"`
178180

179-
Encap string `json:"encap,omitempty"` //
180-
Gateway string `json:"gateway,omitempty"` //
181-
IsPrivate bool `json:"isPrivate,omitempty"` //
182-
IsPublic bool `json:"isPublic,omitempty"` //
183-
NetworkName string `json:"networkName,omitempty"` //
184-
PktTag int `json:"pktTag,omitempty"` //
185-
Subnet string `json:"subnet,omitempty"` //
186-
TenantName string `json:"tenantName,omitempty"` //
181+
Encap string `json:"encap,omitempty"` // Encapsulation
182+
Gateway string `json:"gateway,omitempty"` // Gateway
183+
NetworkName string `json:"networkName,omitempty"` // Network name
184+
PktTag int `json:"pktTag,omitempty"` // Vlan/Vxlan Tag
185+
Subnet string `json:"subnet,omitempty"` // Subnet
186+
TenantName string `json:"tenantName,omitempty"` // Tenant Name
187187

188188
// add link-sets and links
189189
LinkSets NetworkLinkSets `json:"link-sets,omitempty"`
@@ -224,17 +224,17 @@ type Rule struct {
224224
// every object has a key
225225
Key string `json:"key,omitempty"`
226226

227-
Action string `json:"action,omitempty"` //
228-
Direction string `json:"direction,omitempty"` //
229-
EndpointGroup string `json:"endpointGroup,omitempty"` //
230-
IpAddress string `json:"ipAddress,omitempty"` //
231-
Network string `json:"network,omitempty"` //
232-
PolicyName string `json:"policyName,omitempty"` //
233-
Port int `json:"port,omitempty"` //
234-
Priority int `json:"priority,omitempty"` //
235-
Protocol string `json:"protocol,omitempty"` //
236-
RuleID string `json:"ruleId,omitempty"` //
237-
TenantName string `json:"tenantName,omitempty"` //
227+
Action string `json:"action,omitempty"` // Action
228+
Direction string `json:"direction,omitempty"` // Direction
229+
EndpointGroup string `json:"endpointGroup,omitempty"` // Group
230+
IpAddress string `json:"ipAddress,omitempty"` // IP Address
231+
Network string `json:"network,omitempty"` // Network Name
232+
PolicyName string `json:"policyName,omitempty"` // Policy Name
233+
Port int `json:"port,omitempty"` // Port No
234+
Priority int `json:"priority,omitempty"` // Priority
235+
Protocol string `json:"protocol,omitempty"` // Protocol
236+
RuleID string `json:"ruleId,omitempty"` // Rule Id
237+
TenantName string `json:"tenantName,omitempty"` // Tenant Name
238238

239239
// add link-sets and links
240240
LinkSets RuleLinkSets `json:"link-sets,omitempty"`
@@ -248,7 +248,7 @@ type Service struct {
248248
// every object has a key
249249
Key string `json:"key,omitempty"`
250250

251-
AppName string `json:"appName,omitempty"` // Application Name
251+
AppName string `json:"appName,omitempty"` //
252252
Command string `json:"command,omitempty"` //
253253
Cpu string `json:"cpu,omitempty"` //
254254
EndpointGroups []string `json:"endpointGroups,omitempty"`
@@ -257,8 +257,8 @@ type Service struct {
257257
Memory string `json:"memory,omitempty"` //
258258
Networks []string `json:"networks,omitempty"`
259259
Scale int `json:"scale,omitempty"` //
260-
ServiceName string `json:"serviceName,omitempty"` // Service Name
261-
TenantName string `json:"tenantName,omitempty"` // Tenant Name
260+
ServiceName string `json:"serviceName,omitempty"` //
261+
TenantName string `json:"tenantName,omitempty"` //
262262
VolumeProfile string `json:"volumeProfile,omitempty"` //
263263

264264
// add link-sets and links
@@ -282,9 +282,9 @@ type ServiceInstance struct {
282282
Key string `json:"key,omitempty"`
283283

284284
AppName string `json:"appName,omitempty"` //
285-
InstanceID string `json:"instanceId,omitempty"` // Service instance id
285+
InstanceID string `json:"instanceId,omitempty"` //
286286
ServiceName string `json:"serviceName,omitempty"` //
287-
TenantName string `json:"tenantName,omitempty"` // Tenant Name
287+
TenantName string `json:"tenantName,omitempty"` //
288288
Volumes []string `json:"volumes,omitempty"`
289289

290290
// add link-sets and links
@@ -304,12 +304,8 @@ type Tenant struct {
304304
// every object has a key
305305
Key string `json:"key,omitempty"`
306306

307-
DefaultNetwork string `json:"defaultNetwork,omitempty"` //
308-
SubnetLen int `json:"subnetLen,omitempty"` //
309-
SubnetPool string `json:"subnetPool,omitempty"` //
310-
TenantName string `json:"tenantName,omitempty"` //
311-
Vlans string `json:"vlans,omitempty"` //
312-
Vxlans string `json:"vxlans,omitempty"` //
307+
DefaultNetwork string `json:"defaultNetwork,omitempty"` // Network name
308+
TenantName string `json:"tenantName,omitempty"` // Tenant Name
313309

314310
// add link-sets and links
315311
LinkSets TenantLinkSets `json:"link-sets,omitempty"`
@@ -332,8 +328,8 @@ type Volume struct {
332328
MountPoint string `json:"mountPoint,omitempty"` //
333329
PoolName string `json:"poolName,omitempty"` //
334330
Size string `json:"size,omitempty"` //
335-
TenantName string `json:"tenantName,omitempty"` // Tenant Name
336-
VolumeName string `json:"volumeName,omitempty"` // Volume Name
331+
TenantName string `json:"tenantName,omitempty"` //
332+
VolumeName string `json:"volumeName,omitempty"` //
337333

338334
// add link-sets and links
339335
LinkSets VolumeLinkSets `json:"link-sets,omitempty"`
@@ -356,8 +352,8 @@ type VolumeProfile struct {
356352
MountPoint string `json:"mountPoint,omitempty"` //
357353
PoolName string `json:"poolName,omitempty"` //
358354
Size string `json:"size,omitempty"` //
359-
TenantName string `json:"tenantName,omitempty"` // Tenant Name
360-
VolumeProfileName string `json:"volumeProfileName,omitempty"` // Volume profile Name
355+
TenantName string `json:"tenantName,omitempty"` //
356+
VolumeProfileName string `json:"volumeProfileName,omitempty"` //
361357

362358
// add link-sets and links
363359
LinkSets VolumeProfileLinkSets `json:"link-sets,omitempty"`

client/contivModelClient.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ def createGlobal(self, obj):
146146
jdata = json.dumps({
147147
"name": obj.name,
148148
"network-infra-type": obj.network-infra-type,
149+
"vlans": obj.vlans,
150+
"vxlans": obj.vxlans,
149151
})
150152

151153
# Post the data
@@ -178,8 +180,6 @@ def createNetwork(self, obj):
178180
jdata = json.dumps({
179181
"encap": obj.encap,
180182
"gateway": obj.gateway,
181-
"isPrivate": obj.isPrivate,
182-
"isPublic": obj.isPublic,
183183
"networkName": obj.networkName,
184184
"pktTag": obj.pktTag,
185185
"subnet": obj.subnet,
@@ -365,11 +365,7 @@ def createTenant(self, obj):
365365

366366
jdata = json.dumps({
367367
"defaultNetwork": obj.defaultNetwork,
368-
"subnetLen": obj.subnetLen,
369-
"subnetPool": obj.subnetPool,
370368
"tenantName": obj.tenantName,
371-
"vlans": obj.vlans,
372-
"vxlans": obj.vxlans,
373369
})
374370

375371
# Post the data

0 commit comments

Comments
 (0)