From 353fe3357e1c6f36a615a204f2f2f2d8c926dc72 Mon Sep 17 00:00:00 2001
From: Jacky Hu
Date: Wed, 15 Nov 2017 20:23:03 +0800
Subject: [PATCH] Able to edit connection limit of listener
Change-Id: Id3c3ca1c7983ba63f7c37f3c8017457f7521b7b7
Story: 1713858
Task: 5367
---
octavia_dashboard/api/rest/lbaasv2.py | 4 +++-
.../locale/id/LC_MESSAGES/djangojs.po | 21 +++++++++++++++++++
.../workflow/listener/listener.controller.js | 3 +++
.../workflow/listener/listener.help.html | 5 +++++
.../lbaasv2/workflow/listener/listener.html | 21 +++++++++++++++++++
.../project/lbaasv2/workflow/model.service.js | 4 +++-
.../lbaasv2/workflow/model.service.spec.js | 19 ++++++++++++++++-
7 files changed, 74 insertions(+), 3 deletions(-)
diff --git a/octavia_dashboard/api/rest/lbaasv2.py b/octavia_dashboard/api/rest/lbaasv2.py
index 797edfe9..1547686e 100644
--- a/octavia_dashboard/api/rest/lbaasv2.py
+++ b/octavia_dashboard/api/rest/lbaasv2.py
@@ -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)
@@ -328,7 +329,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)
diff --git a/octavia_dashboard/locale/id/LC_MESSAGES/djangojs.po b/octavia_dashboard/locale/id/LC_MESSAGES/djangojs.po
index f1ae38e2..18627a55 100644
--- a/octavia_dashboard/locale/id/LC_MESSAGES/djangojs.po
+++ b/octavia_dashboard/locale/id/LC_MESSAGES/djangojs.po
@@ -18,6 +18,15 @@ msgstr ""
msgid "%(ip)s..."
msgstr "%(ip)s..."
+msgid ""
+"Connection Limit:\n"
+" The maximum number of connections permitted for this listener.\n"
+" Default value is -1 which represents infinite connections."
+msgstr ""
+"Connection Limit:\n"
+" The maximum number of connections permitted for this listener.\n"
+" Default value is -1 which represents infinite connections."
+
msgid ""
"Expected status codes:\n"
" The expected HTTP status codes to get from a successful health check. Must "
@@ -627,6 +636,13 @@ msgstr "Berat anggota kolam telah diperbarui."
msgid "Port"
msgstr "Port"
+msgid ""
+"Connection Limit\n"
+" "
+msgstr ""
+"Connection Limit\n"
+" "
+
msgid ""
"Port\n"
" "
@@ -736,6 +752,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."
diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/listener/listener.controller.js b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/listener/listener.controller.js
index 7a53c6d5..f8b98169 100644
--- a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/listener/listener.controller.js
+++ b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/listener/listener.controller.js
@@ -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.'
+ );
////////////
diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/listener/listener.help.html b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/listener/listener.help.html
index dce57984..c35258cf 100644
--- a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/listener/listener.help.html
+++ b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/listener/listener.help.html
@@ -13,3 +13,8 @@
Port:
The port on which the front end listens. Must be an integer from 1 to 65535.
+
+ Connection Limit:
+ The maximum number of connections permitted for this listener.
+ Default value is -1 which represents infinite connections.
+