From e98966c795e86da5cfa0f4c26276241b4e398133 Mon Sep 17 00:00:00 2001 From: Jacky Hu Date: Sat, 14 Apr 2018 19:17:44 +0800 Subject: [PATCH] Add timeout options for listener This is a follow up of octavia-api change made in: Id4667201c1bfaa06f7af9060c936ba00c2f314f9 Change-Id: I2ae995e4f8a828128481b02e956444c8208fc41b Depends-On: https://review.openstack.org/#/c/561401/ Story: 1457556 Task: 12488 --- octavia_dashboard/api/rest/lbaasv2.py | 8 +++ .../lbaasv2/listeners/details/detail.html | 5 +- .../lbaasv2/listeners/details/drawer.html | 4 +- .../lbaasv2/listeners/listeners.module.js | 4 ++ .../workflow/listener/listener.controller.js | 1 + .../workflow/listener/listener.help.html | 25 ++++++++ .../lbaasv2/workflow/listener/listener.html | 60 +++++++++++++++++++ .../project/lbaasv2/workflow/model.service.js | 10 +++- .../lbaasv2/workflow/model.service.spec.js | 2 +- .../add-timeout-options-8988fc477fa46d31.yaml | 4 ++ 10 files changed, 119 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/add-timeout-options-8988fc477fa46d31.yaml diff --git a/octavia_dashboard/api/rest/lbaasv2.py b/octavia_dashboard/api/rest/lbaasv2.py index 6200ac2b..2251317f 100644 --- a/octavia_dashboard/api/rest/lbaasv2.py +++ b/octavia_dashboard/api/rest/lbaasv2.py @@ -171,6 +171,10 @@ def create_listener(request, **kwargs): sni_container_refs=None, admin_state_up=data['listener'].get('admin_state_up'), insert_headers=data['listener'].get('insert_headers'), + timeout_client_data=data['listener'].get('timeout_client_data'), + timeout_member_connect=data['listener'].get('timeout_member_connect'), + timeout_member_data=data['listener'].get('timeout_member_data'), + timeout_tcp_inspect=data['listener'].get('timeout_tcp_inspect'), ) if data.get('pool'): @@ -396,6 +400,10 @@ def update_listener(request, **kwargs): admin_state_up=data['listener'].get('admin_state_up'), default_pool_id=default_pool_id, insert_headers=data['listener'].get('insert_headers'), + timeout_client_data=data['listener'].get('timeout_client_data'), + timeout_member_connect=data['listener'].get('timeout_member_connect'), + timeout_member_data=data['listener'].get('timeout_member_data'), + timeout_tcp_inspect=data['listener'].get('timeout_tcp_inspect'), ) if data.get('pool'): diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/listeners/details/detail.html b/octavia_dashboard/static/dashboard/project/lbaasv2/listeners/details/detail.html index 1c09cc59..9346712d 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/listeners/details/detail.html +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/listeners/details/detail.html @@ -51,7 +51,10 @@ item="ctrl.listener" property-groups="[[ 'id', 'name', 'description', 'project_id', 'created_at', 'updated_at', - 'connection_limit', 'insert_headers', 'default_pool_id']]"> + 'connection_limit', 'insert_headers', 'default_pool_id', + 'timeout_client_data', 'timeout_member_connect', + 'timeout_member_data', 'timeout_tcp_inspect' + ]]"> diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/listeners/details/drawer.html b/octavia_dashboard/static/dashboard/project/lbaasv2/listeners/details/drawer.html index faf42c80..c72d1ae4 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/listeners/details/drawer.html +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/listeners/details/drawer.html @@ -5,5 +5,7 @@ ['name', 'id', 'project_id'], ['created_at', 'updated_at', 'description'], ['protocol', 'protocol_port', 'connection_limit'], - ['insert_headers', 'default_pool_id']]"> + ['insert_headers', 'default_pool_id', 'timeout_client_data'], + ['timeout_member_connect', 'timeout_member_data', 'timeout_tcp_inspect'] + ]"> diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/listeners/listeners.module.js b/octavia_dashboard/static/dashboard/project/lbaasv2/listeners/listeners.module.js index 6ff8fd77..d080a7b1 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/listeners/listeners.module.js +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/listeners/listeners.module.js @@ -177,6 +177,10 @@ loadBalancerService.nullFilter ] }, + timeout_client_data: gettext('Client Data Timeout'), + timeout_member_connect: gettext('Member Connect Timeout'), + timeout_member_data: gettext('Member Data Timeout'), + timeout_tcp_inspect: gettext('TCP Inspect Timeout'), load_balancers: gettext('Load Balancers') }; } 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 70716c54..902cf7f1 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 @@ -52,6 +52,7 @@ ctrl.connectionLimitError = gettext( 'The connection limit must be a number greater than or equal to -1.' ); + ctrl.timeoutError = gettext('The timeout must be a number between 0 and 31536000000.'); //////////// 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 e28699b2..e05dc38f 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 @@ -37,3 +37,28 @@ only "X-Forwarded-For" and "X-Forwarded-Port" are supported.

+

+ Client Data Timeout: + + Frontend client inactivity timeout in milliseconds. Default: 50000. + +

+

+ TCP Inspect Timeout: + + Time, in milliseconds, to wait for additional TCP packets for content + inspection. Default: 0. + +

+

+ Member Connect Timeout: + + Backend member connection timeout in milliseconds. Default: 5000. + +

+

+ Member Data Timeout: + + Backend member inactivity timeout in milliseconds. Default: 50000. + +

diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/listener/listener.html b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/listener/listener.html index 31c8e317..7d1df369 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/listener/listener.html +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/listener/listener.html @@ -61,6 +61,66 @@ +
+ +
+
+ + + + {$ ::ctrl.timeoutError $} + +
+
+ +
+
+ + + + {$ ::ctrl.timeoutError $} + +
+
+ +
+ +
+ +
+
+ + + + {$ ::ctrl.timeoutError $} + +
+
+ +
+
+ + + + {$ ::ctrl.timeoutError $} + +
+
+ +
+
diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/model.service.js b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/model.service.js index 88177699..29ae275b 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/model.service.js +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/model.service.js @@ -153,7 +153,11 @@ admin_state_up: true, default_pool: null, default_pool_id: null, - insert_headers: {} + insert_headers: {}, + timeout_client_data: 50000, + timeout_member_connect: 5000, + timeout_member_data: 50000, + timeout_tcp_inspect: 0 }, l7policy: { id: null, @@ -744,6 +748,10 @@ spec.admin_state_up = listener.admin_state_up; spec.default_pool_id = listener.default_pool_id; spec.insert_headers = listener.insert_headers; + spec.timeout_client_data = listener.timeout_client_data; + spec.timeout_member_connect = listener.timeout_member_connect; + spec.timeout_member_data = listener.timeout_member_data; + spec.timeout_tcp_inspect = listener.timeout_tcp_inspect; } function setL7PolicySpec(l7policy) { diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/model.service.spec.js b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/model.service.spec.js index e9904bc2..f1b8a2f8 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/model.service.spec.js +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/model.service.spec.js @@ -1177,7 +1177,7 @@ it('has the right number of properties', function() { expect(Object.keys(model.spec).length).toBe(11); expect(Object.keys(model.spec.loadbalancer).length).toBe(5); - expect(Object.keys(model.spec.listener).length).toBe(10); + expect(Object.keys(model.spec.listener).length).toBe(14); expect(Object.keys(model.spec.l7policy).length).toBe(8); expect(Object.keys(model.spec.l7rule).length).toBe(7); expect(Object.keys(model.spec.pool).length).toBe(7); diff --git a/releasenotes/notes/add-timeout-options-8988fc477fa46d31.yaml b/releasenotes/notes/add-timeout-options-8988fc477fa46d31.yaml new file mode 100644 index 00000000..de933631 --- /dev/null +++ b/releasenotes/notes/add-timeout-options-8988fc477fa46d31.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Adds the ability to set the timeout options on listeners.