diff --git a/neutron_taas_dashboard/api/taas.py b/neutron_taas_dashboard/api/taas.py index 720c8c8..39b99fb 100644 --- a/neutron_taas_dashboard/api/taas.py +++ b/neutron_taas_dashboard/api/taas.py @@ -117,14 +117,16 @@ def show_tap_flow(request, tap_flow_id): return TapFlow(tap_flow.get('tap_flow')) -def create_tap_flow(request, direction, tap_service_id, port_id, **params): +def create_tap_flow(request, direction, tap_service_id, port_id, + vlan_filter, **params): req_data = {} req_data['tap_flow'] = { 'name': params['name'], 'description': params['description'], 'source_port': port_id, 'direction': direction, - 'tap_service_id': tap_service_id + 'tap_service_id': tap_service_id, + 'vlan_filter': vlan_filter } res = neutronclient(request).post("/taas/tap_flows", req_data) diff --git a/neutron_taas_dashboard/dashboards/project/tapservices/tapflows/workflows.py b/neutron_taas_dashboard/dashboards/project/tapservices/tapflows/workflows.py index 953ccbd..7c4b316 100644 --- a/neutron_taas_dashboard/dashboards/project/tapservices/tapflows/workflows.py +++ b/neutron_taas_dashboard/dashboards/project/tapservices/tapflows/workflows.py @@ -41,6 +41,11 @@ class CreateTapFlowInfoAction(workflows.Action): help_text=_("Whether to mirror the traffic" " leaving or ariving" " at the source port.")) + vlan_filter = forms.CharField(max_length=255, + label=_("VLAN Filter"), + required=False, + help_text=_("Comma separated list of" + "VLAN Ids to be mirrored.")) class Meta(object): name = _("Information") @@ -50,7 +55,7 @@ class CreateTapFlowInfoAction(workflows.Action): class CreateTapFlowInfo(workflows.Step): action_class = CreateTapFlowInfoAction - contributes = ("tap_flow_name", "description", "direction") + contributes = ("tap_flow_name", "description", "direction", "vlan_filter") depends_on = ("tap_service_id",) @@ -115,10 +120,12 @@ class CreateTapFlow(ts_workflows.CreateTapService): direction = data['direction'] tap_service_id = self.context.get('tap_service_id') port_id = data['port'] + vlan_filter = data['vlan_filter'] tap_flow = api.taas.create_tap_flow(request, direction, tap_service_id, port_id, + vlan_filter, **params) self.context['tap_flow_id'] = tap_flow.id return True diff --git a/neutron_taas_dashboard/dashboards/project/tapservices/templates/tapservices/tapflows/_detail_overview.html b/neutron_taas_dashboard/dashboards/project/tapservices/templates/tapservices/tapflows/_detail_overview.html index 10a5a80..3325e45 100644 --- a/neutron_taas_dashboard/dashboards/project/tapservices/templates/tapservices/tapflows/_detail_overview.html +++ b/neutron_taas_dashboard/dashboards/project/tapservices/templates/tapservices/tapflows/_detail_overview.html @@ -12,6 +12,8 @@
{{ tap_flow.tap_service_id|default:_("-") }}
{% trans "Port ID" %}
{{ tap_flow.source_port|default:_("-") }}
+
{% trans "VLAN Filter" %}
+
{{ tap_flow.vlan_filter|default:_("None") }}
{% trans "Project ID" %}
{{ tap_flow.tenant_id|default:_("-") }}