Merge "Able to edit connection limit of listener"
This commit is contained in:
commit
136abdf789
@ -153,6 +153,7 @@ def create_listener(request, **kwargs):
|
||||
load_balancer_id=kwargs['loadbalancer_id'],
|
||||
name=data['listener'].get('name'),
|
||||
description=data['listener'].get('description'),
|
||||
connection_limit=data['listener'].get('connection_limit'),
|
||||
default_tls_container_ref=default_tls_ref,
|
||||
sni_container_refs=None)
|
||||
|
||||
@ -331,7 +332,8 @@ def update_listener(request, **kwargs):
|
||||
listener = conn.load_balancer.update_listener(
|
||||
listener=listener_id,
|
||||
name=data['listener'].get('name'),
|
||||
description=data['listener'].get('description'))
|
||||
description=data['listener'].get('description'),
|
||||
connection_limit=data['listener'].get('connection_limit'))
|
||||
|
||||
if data.get('pool'):
|
||||
args = (request, loadbalancer_id, update_pool)
|
||||
|
@ -18,6 +18,15 @@ msgstr ""
|
||||
msgid "%(ip)s..."
|
||||
msgstr "%(ip)s..."
|
||||
|
||||
msgid ""
|
||||
"<strong>Connection Limit:</strong>\n"
|
||||
" The maximum number of connections permitted for this listener.\n"
|
||||
" Default value is -1 which represents infinite connections."
|
||||
msgstr ""
|
||||
"<strong>Connection Limit:</strong>\n"
|
||||
" The maximum number of connections permitted for this listener.\n"
|
||||
" Default value is -1 which represents infinite connections."
|
||||
|
||||
msgid ""
|
||||
"<strong>Expected status codes:</strong>\n"
|
||||
" The expected HTTP status codes to get from a successful health check. Must "
|
||||
@ -665,6 +674,13 @@ msgstr "Pool member has been updated."
|
||||
msgid "Port"
|
||||
msgstr "Port"
|
||||
|
||||
msgid ""
|
||||
"Connection Limit\n"
|
||||
" <span class=\"hz-icon-required fa fa-asterisk\"></span>"
|
||||
msgstr ""
|
||||
"Connection Limit\n"
|
||||
" <span class=\"hz-icon-required fa fa-asterisk\"></span>"
|
||||
|
||||
msgid ""
|
||||
"Port\n"
|
||||
" <span class=\"hz-icon-required fa fa-asterisk\"></span>"
|
||||
@ -784,6 +800,11 @@ msgstr ""
|
||||
"yang tidak ditemukan di tabel \n"
|
||||
" Available Instance."
|
||||
|
||||
msgid ""
|
||||
"The connection limit must be a number greater than or equal to -1."
|
||||
msgstr ""
|
||||
"The connection limit must be a number greater than or equal to -1."
|
||||
|
||||
msgid "The IP address is not valid."
|
||||
msgstr "Alamat IP tidak valid."
|
||||
|
||||
|
@ -44,6 +44,9 @@
|
||||
ctrl.portNumberError = gettext('The port must be a number between 1 and 65535.');
|
||||
ctrl.portUniqueError = gettext(
|
||||
'The port must be unique among all listeners attached to this load balancer.');
|
||||
ctrl.connectionLimitError = gettext(
|
||||
'The connection limit must be a number greater than or equal to -1.'
|
||||
);
|
||||
|
||||
////////////
|
||||
|
||||
|
@ -13,3 +13,8 @@
|
||||
<strong>Port:</strong>
|
||||
The port on which the front end listens. Must be an integer from 1 to 65535.
|
||||
</p>
|
||||
<p translate>
|
||||
<strong>Connection Limit:</strong>
|
||||
The maximum number of connections permitted for this listener.
|
||||
Default value is -1 which represents infinite connections.
|
||||
</p>
|
||||
|
@ -60,4 +60,25 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-xs-12 col-sm-8 col-md-6">
|
||||
<div class="form-group required"
|
||||
ng-class="{ 'has-error': listenerDetailsForm.connection_limit.$invalid && listenerDetailsForm.connection_limit.$dirty }">
|
||||
<label translate class="control-label" for="connection_limit">
|
||||
Connection Limit
|
||||
<span class="hz-icon-required fa fa-asterisk"></span>
|
||||
</label>
|
||||
<input name="connection_limit" id="connection_limit" type="number" class="form-control"
|
||||
ng-model="model.spec.listener.connection_limit" ng-pattern="/^-?\d+$/" min="-1"
|
||||
ng-required="true">
|
||||
<span class="help-block" ng-show="(listenerDetailsForm.connection_limit.$error.number || listenerDetailsForm.connection_limit.$error.required) && listenerDetailsForm.connection_limit.$dirty">
|
||||
{$ ::ctrl.connectionLimitError $}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@ -146,7 +146,8 @@
|
||||
name: gettext('Listener 1'),
|
||||
description: null,
|
||||
protocol: null,
|
||||
port: null
|
||||
port: null,
|
||||
connection_limit: -1
|
||||
},
|
||||
pool: {
|
||||
id: null,
|
||||
@ -631,6 +632,7 @@
|
||||
spec.description = listener.description;
|
||||
spec.protocol = listener.protocol;
|
||||
spec.port = listener.protocol_port;
|
||||
spec.connection_limit = listener.connection_limit;
|
||||
}
|
||||
|
||||
function setPoolSpec(pool) {
|
||||
|
@ -31,6 +31,7 @@
|
||||
description: 'listener description',
|
||||
protocol: 'HTTP',
|
||||
protocol_port: 80,
|
||||
connection_limit: 999,
|
||||
loadbalancers: [ { id: '1234' } ],
|
||||
sni_container_refs: ['container2']
|
||||
},
|
||||
@ -550,6 +551,7 @@
|
||||
expect(model.spec.listener.description).toBeNull();
|
||||
expect(model.spec.listener.protocol).toBeNull();
|
||||
expect(model.spec.listener.port).toBeNull();
|
||||
expect(model.spec.listener.connection_limit).toBe(-1);
|
||||
});
|
||||
|
||||
it('should not initialize pool model spec properties', function() {
|
||||
@ -693,6 +695,7 @@
|
||||
expect(model.spec.listener.description).toBe('listener description');
|
||||
expect(model.spec.listener.protocol).toBe('HTTP');
|
||||
expect(model.spec.listener.port).toBe(80);
|
||||
expect(model.spec.listener.connection_limit).toBe(999);
|
||||
});
|
||||
|
||||
it('should initialize all pool properties', function() {
|
||||
@ -776,6 +779,7 @@
|
||||
expect(model.spec.listener.description).toBeNull();
|
||||
expect(model.spec.listener.protocol).toBeNull();
|
||||
expect(model.spec.listener.port).toBeNull();
|
||||
expect(model.spec.listener.connection_limit).toBe(-1);
|
||||
});
|
||||
|
||||
it('should initialize all pool properties', function() {
|
||||
@ -859,6 +863,7 @@
|
||||
expect(model.spec.listener.description).toBeNull();
|
||||
expect(model.spec.listener.protocol).toBeNull();
|
||||
expect(model.spec.listener.port).toBeNull();
|
||||
expect(model.spec.listener.connection_limit).toBe(-1);
|
||||
});
|
||||
|
||||
it('should initialize all pool properties', function() {
|
||||
@ -948,7 +953,7 @@
|
||||
it('has the right number of properties', function() {
|
||||
expect(Object.keys(model.spec).length).toBe(8);
|
||||
expect(Object.keys(model.spec.loadbalancer).length).toBe(4);
|
||||
expect(Object.keys(model.spec.listener).length).toBe(5);
|
||||
expect(Object.keys(model.spec.listener).length).toBe(6);
|
||||
expect(Object.keys(model.spec.pool).length).toBe(7);
|
||||
expect(Object.keys(model.spec.monitor).length).toBe(9);
|
||||
expect(model.spec.members).toEqual([]);
|
||||
@ -998,6 +1003,10 @@
|
||||
expect(model.spec.listener.port).toBeNull();
|
||||
});
|
||||
|
||||
it('sets listener connection limit to reasonable default', function() {
|
||||
expect(model.spec.listener.connection_limit).toBe(-1);
|
||||
});
|
||||
|
||||
it('sets pool id to null', function() {
|
||||
expect(model.spec.pool.id).toBeNull();
|
||||
});
|
||||
@ -1191,6 +1200,7 @@
|
||||
model.spec.loadbalancer.subnet = model.subnets[0];
|
||||
model.spec.listener.protocol = 'TCP';
|
||||
model.spec.listener.port = 80;
|
||||
model.spec.listener.connection_limit = 999;
|
||||
model.spec.pool.name = 'pool name';
|
||||
model.spec.pool.description = 'pool description';
|
||||
model.spec.pool.method = 'LEAST_CONNECTIONS';
|
||||
@ -1244,6 +1254,7 @@
|
||||
expect(finalSpec.listener.description).toBeUndefined();
|
||||
expect(finalSpec.listener.protocol).toBe('TCP');
|
||||
expect(finalSpec.listener.port).toBe(80);
|
||||
expect(finalSpec.listener.connection_limit).toBe(999);
|
||||
|
||||
expect(finalSpec.pool.name).toBe('pool name');
|
||||
expect(finalSpec.pool.description).toBe('pool description');
|
||||
@ -1286,6 +1297,7 @@
|
||||
model.spec.loadbalancer.subnet = model.subnets[0];
|
||||
model.spec.listener.protocol = 'TERMINATED_HTTPS';
|
||||
model.spec.listener.port = 443;
|
||||
model.spec.listener.connection_limit = 9999;
|
||||
model.spec.pool.method = 'LEAST_CONNECTIONS';
|
||||
model.spec.certificates = [{
|
||||
id: 'container1',
|
||||
@ -1303,6 +1315,7 @@
|
||||
expect(finalSpec.listener.description).toBeUndefined();
|
||||
expect(finalSpec.listener.protocol).toBe('TERMINATED_HTTPS');
|
||||
expect(finalSpec.listener.port).toBe(443);
|
||||
expect(finalSpec.listener.connection_limit).toBe(9999);
|
||||
expect(finalSpec.pool.protocol).toBe('HTTP');
|
||||
expect(finalSpec.certificates).toEqual(['container1']);
|
||||
});
|
||||
@ -1440,6 +1453,7 @@
|
||||
it('should set final spec properties', function() {
|
||||
model.spec.listener.protocol = 'TCP';
|
||||
model.spec.listener.port = 80;
|
||||
model.spec.listener.connection_limit = 999;
|
||||
model.spec.pool.name = 'pool name';
|
||||
model.spec.pool.description = 'pool description';
|
||||
model.spec.pool.method = 'LEAST_CONNECTIONS';
|
||||
@ -1487,6 +1501,7 @@
|
||||
expect(finalSpec.listener.description).toBeUndefined();
|
||||
expect(finalSpec.listener.protocol).toBe('TCP');
|
||||
expect(finalSpec.listener.port).toBe(80);
|
||||
expect(finalSpec.listener.connection_limit).toBe(999);
|
||||
|
||||
expect(finalSpec.pool.name).toBe('pool name');
|
||||
expect(finalSpec.pool.description).toBe('pool description');
|
||||
@ -1528,6 +1543,7 @@
|
||||
model.spec.loadbalancer.subnet = model.subnets[0];
|
||||
model.spec.listener.protocol = 'TERMINATED_HTTPS';
|
||||
model.spec.listener.port = 443;
|
||||
model.spec.listener.connection_limit = 999;
|
||||
model.spec.pool.method = 'LEAST_CONNECTIONS';
|
||||
model.spec.certificates = [{
|
||||
id: 'container1',
|
||||
@ -1541,6 +1557,7 @@
|
||||
expect(finalSpec.listener.description).toBeUndefined();
|
||||
expect(finalSpec.listener.protocol).toBe('TERMINATED_HTTPS');
|
||||
expect(finalSpec.listener.port).toBe(443);
|
||||
expect(finalSpec.listener.connection_limit).toBe(999);
|
||||
expect(finalSpec.pool.protocol).toBe('HTTP');
|
||||
expect(finalSpec.certificates).toEqual(['container1']);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user