Skip to content
This repository was archived by the owner on Nov 29, 2017. It is now read-only.

Commit bd2613f

Browse files
committed
service load balancer
1 parent 6c557ca commit bd2613f

5 files changed

+39
-22
lines changed

client/contivModel.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ var ServiceLBSummaryView = React.createClass({
681681
<ModalTrigger modal={<ServiceLBModalView ServiceLB={ ServiceLB }/>}>
682682
<tr key={ ServiceLB.key } className="info">
683683

684-
684+
685685
</tr>
686686
</ModalTrigger>
687687
);
@@ -693,7 +693,7 @@ var ServiceLBSummaryView = React.createClass({
693693
<thead>
694694
<tr>
695695

696-
696+
697697
</tr>
698698
</thead>
699699
<tbody>
@@ -713,11 +713,15 @@ var ServiceLBModalView = React.createClass({
713713
<div className='modal-body' style={ {margin: '5%',} }>
714714

715715

716+
<Input type='text' label='Service ip' ref='ipAddress' defaultValue={obj.ipAddress} placeholder='Service ip' />
717+
716718
<Input type='text' label='labels key value pair' ref='labels' defaultValue={obj.labels} placeholder='labels key value pair' />
717719

718-
<Input type='text' label='service name' ref='serviceName' defaultValue={obj.serviceName} placeholder='service name' />
720+
<Input type='text' label='Service subnet' ref='network' defaultValue={obj.network} placeholder='Service subnet' />
719721

720-
<Input type='text' label='Service subnet' ref='subnet' defaultValue={obj.subnet} placeholder='Service subnet' />
722+
<Input type='text' label='service provider port' ref='ports' defaultValue={obj.ports} placeholder='service provider port' />
723+
724+
<Input type='text' label='service name' ref='serviceName' defaultValue={obj.serviceName} placeholder='service name' />
721725

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

client/contivModelClient.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,12 @@ type ServiceLB struct {
348348
// every object has a key
349349
Key string `json:"key,omitempty"`
350350

351-
Labels string `json:"labels,omitempty"` // labels key value pair
352-
ServiceName string `json:"serviceName,omitempty"` // service name
353-
Subnet string `json:"subnet,omitempty"` // Service subnet
354-
TenantName string `json:"tenantName,omitempty"` // Tenant Name
351+
IpAddress string `json:"ipAddress,omitempty"` // Service ip
352+
Labels []string `json:"labels,omitempty"`
353+
Network string `json:"network,omitempty"` // Service subnet
354+
Ports []string `json:"ports,omitempty"`
355+
ServiceName string `json:"serviceName,omitempty"` // service name
356+
TenantName string `json:"tenantName,omitempty"` // Tenant Name
355357

356358
}
357359

client/contivModelClient.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,11 @@ def createServiceLB(self, obj):
404404
postUrl = self.baseUrl + '/api/ServiceLBs/' + obj.serviceName + ":" + obj.tenantName + '/'
405405

406406
jdata = json.dumps({
407+
"ipAddress": obj.ipAddress,
407408
"labels": obj.labels,
409+
"network": obj.network,
410+
"ports": obj.ports,
408411
"serviceName": obj.serviceName,
409-
"subnet": obj.subnet,
410412
"tenantName": obj.tenantName,
411413
})
412414

contivModel.go

+12-10
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,12 @@ type ServiceLB struct {
221221
// every object has a key
222222
Key string `json:"key,omitempty"`
223223

224-
Labels string `json:"labels,omitempty"` // labels key value pair
225-
ServiceName string `json:"serviceName,omitempty"` // service name
226-
Subnet string `json:"subnet,omitempty"` // Service subnet
227-
TenantName string `json:"tenantName,omitempty"` // Tenant Name
224+
IpAddress string `json:"ipAddress,omitempty"` // Service ip
225+
Labels []string `json:"labels,omitempty"`
226+
Network string `json:"network,omitempty"` // Service subnet
227+
Ports []string `json:"ports,omitempty"`
228+
ServiceName string `json:"serviceName,omitempty"` // service name
229+
TenantName string `json:"tenantName,omitempty"` // Tenant Name
228230

229231
}
230232

@@ -3121,16 +3123,16 @@ func ValidateServiceLB(obj *ServiceLB) error {
31213123

31223124
// Validate each field
31233125

3124-
if len(obj.Labels) > 512 {
3125-
return errors.New("labels string too long")
3126+
if len(obj.IpAddress) > 15 {
3127+
return errors.New("ipAddress string too long")
31263128
}
31273129

3128-
if len(obj.ServiceName) > 256 {
3129-
return errors.New("serviceName string too long")
3130+
if len(obj.Network) > 15 {
3131+
return errors.New("network string too long")
31303132
}
31313133

3132-
if len(obj.Subnet) > 15 {
3133-
return errors.New("subnet string too long")
3134+
if len(obj.ServiceName) > 256 {
3135+
return errors.New("serviceName string too long")
31343136
}
31353137

31363138
if len(obj.TenantName) > 64 {

services.json

+10-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"length": 64
1818
},
1919

20-
"subnet": {
20+
"network": {
2121
"type": "string",
2222
"title": "Service subnet",
2323
"length": 15
@@ -28,9 +28,16 @@
2828
"length": 15
2929
},
3030
"labels": {
31-
"type": "string",
31+
"type": "array",
3232
"title": "labels key value pair",
33-
"length": 512
33+
"length": 512,
34+
"items" :"string"
35+
},
36+
"ports":{
37+
"type":"array",
38+
"title":"service provider port",
39+
"length": 32,
40+
"items" : "string"
3441
}
3542
}
3643
}]

0 commit comments

Comments
 (0)