This is an automated email from the ASF dual-hosted git repository.

smolnar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/knox.git


The following commit(s) were added to refs/heads/master by this push:
     new 919fcf3bf KNOX-3195: Add support for Flink Dashboard and Flink SQL 
gateway (#1090)
919fcf3bf is described below

commit 919fcf3bfef033dac7102f0dcb62c015b360abd0
Author: hanicz <[email protected]>
AuthorDate: Thu Sep 25 11:07:40 2025 +0200

    KNOX-3195: Add support for Flink Dashboard and Flink SQL gateway (#1090)
---
 ...va => FlinkDashboardServiceModelGenerator.java} |  17 ++++----
 .../cm/model/flink/FlinkServiceModelGenerator.java |  48 +--------------------
 ...a => FlinkSqlGatewayServiceModelGenerator.java} |  30 ++++++-------
 ...way.topology.discovery.cm.ServiceModelGenerator |   2 +
 ...> FlinkDashboardServiceModelGeneratorTest.java} |  20 ++++-----
 .../flink/FlinkServiceModelGeneratorTest.java      |  27 +-----------
 ... FlinkSqlGatewayServiceModelGeneratorTest.java} |  20 ++++-----
 .../services/flink-dashboard/1.11.1/rewrite.xml    |  37 ++++++++++++++++
 .../services/flink-dashboard/1.11.1/service.xml    |  39 +++++++++++++++++
 .../services/flink-sql-gateway/1.11.1/rewrite.xml  |  22 ++++++++++
 .../services/flink-sql-gateway/1.11.1/service.xml  |  29 +++++++++++++
 .../resources/services/flink/1.12.1/rewrite.xml    |  34 +++++++++++++++
 .../resources/services/flink/1.12.1/service.xml    |  37 ++++++++++++++++
 .../home/assets/service-logos/flink-dashboard.png  | Bin 0 -> 267874 bytes
 .../assets/service-logos/flink-sql-gateway.png     | Bin 0 -> 267874 bytes
 .../home/assets/service-logos/flink.png            | Bin 0 -> 267874 bytes
 16 files changed, 244 insertions(+), 118 deletions(-)

diff --git 
a/gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkServiceModelGenerator.java
 
b/gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkDashboardServiceModelGenerator.java
similarity index 94%
copy from 
gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkServiceModelGenerator.java
copy to 
gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkDashboardServiceModelGenerator.java
index 36df5deaf..a1d5036b1 100644
--- 
a/gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkServiceModelGenerator.java
+++ 
b/gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkDashboardServiceModelGenerator.java
@@ -17,21 +17,20 @@
  */
 package org.apache.knox.gateway.topology.discovery.cm.model.flink;
 
-import java.util.Locale;
-
-import org.apache.knox.gateway.topology.discovery.cm.ServiceModel;
-import org.apache.knox.gateway.topology.discovery.cm.ServiceModel.Type;
-import 
org.apache.knox.gateway.topology.discovery.cm.model.AbstractServiceModelGenerator;
-
 import com.cloudera.api.swagger.client.ApiException;
 import com.cloudera.api.swagger.model.ApiConfigList;
 import com.cloudera.api.swagger.model.ApiRole;
 import com.cloudera.api.swagger.model.ApiService;
 import com.cloudera.api.swagger.model.ApiServiceConfig;
+import org.apache.knox.gateway.topology.discovery.cm.ServiceModel;
+import org.apache.knox.gateway.topology.discovery.cm.ServiceModel.Type;
+import 
org.apache.knox.gateway.topology.discovery.cm.model.AbstractServiceModelGenerator;
+
+import java.util.Locale;
 
-public class FlinkServiceModelGenerator extends AbstractServiceModelGenerator {
+public class FlinkDashboardServiceModelGenerator extends 
AbstractServiceModelGenerator {
 
-  static final String SERVICE = "FLINK";
+  static final String SERVICE = "FLINK-DASHBOARD";
   static final String SERVICE_TYPE = "FLINK";
   static final String ROLE_TYPE = "FLINK_HISTORY_SERVER";
 
@@ -55,7 +54,7 @@ public class FlinkServiceModelGenerator extends 
AbstractServiceModelGenerator {
 
   @Override
   public Type getModelType() {
-    return ServiceModel.Type.UI;
+    return Type.UI;
   }
 
   @Override
diff --git 
a/gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkServiceModelGenerator.java
 
b/gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkServiceModelGenerator.java
index 36df5deaf..fc3e848d5 100644
--- 
a/gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkServiceModelGenerator.java
+++ 
b/gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkServiceModelGenerator.java
@@ -17,59 +17,13 @@
  */
 package org.apache.knox.gateway.topology.discovery.cm.model.flink;
 
-import java.util.Locale;
-
-import org.apache.knox.gateway.topology.discovery.cm.ServiceModel;
-import org.apache.knox.gateway.topology.discovery.cm.ServiceModel.Type;
-import 
org.apache.knox.gateway.topology.discovery.cm.model.AbstractServiceModelGenerator;
-
-import com.cloudera.api.swagger.client.ApiException;
-import com.cloudera.api.swagger.model.ApiConfigList;
-import com.cloudera.api.swagger.model.ApiRole;
-import com.cloudera.api.swagger.model.ApiService;
-import com.cloudera.api.swagger.model.ApiServiceConfig;
-
-public class FlinkServiceModelGenerator extends AbstractServiceModelGenerator {
 
+public class FlinkServiceModelGenerator extends 
FlinkDashboardServiceModelGenerator {
   static final String SERVICE = "FLINK";
-  static final String SERVICE_TYPE = "FLINK";
-  static final String ROLE_TYPE = "FLINK_HISTORY_SERVER";
-
-  static final String SSL_ENABLED = "ssl_enabled";
-  static final String WEB_PORT = "historyserver_web_port";
 
   @Override
   public String getService() {
     return SERVICE;
   }
 
-  @Override
-  public String getServiceType() {
-    return SERVICE_TYPE;
-  }
-
-  @Override
-  public String getRoleType() {
-    return ROLE_TYPE;
-  }
-
-  @Override
-  public Type getModelType() {
-    return ServiceModel.Type.UI;
-  }
-
-  @Override
-  public ServiceModel generateService(ApiService service, ApiServiceConfig 
serviceConfig, ApiRole role, ApiConfigList roleConfig, ApiServiceConfig 
coreSettingsConfig) throws ApiException {
-    final String hostname = role.getHostRef().getHostname();
-    final String port = getRoleConfigValue(roleConfig, WEB_PORT);
-    final boolean sslEnabled = 
Boolean.parseBoolean(getRoleConfigValue(roleConfig, SSL_ENABLED));
-    final String scheme = sslEnabled ? "https" : "http";
-
-    final ServiceModel model = 
createServiceModel(String.format(Locale.getDefault(), "%s://%s:%s", scheme, 
hostname, port));
-    model.addRoleProperty(getRoleType(), SSL_ENABLED, 
Boolean.toString(sslEnabled));
-    model.addRoleProperty(getRoleType(), WEB_PORT, port);
-
-    return model;
-  }
-
 }
diff --git 
a/gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkServiceModelGenerator.java
 
b/gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkSqlGatewayServiceModelGenerator.java
similarity index 79%
copy from 
gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkServiceModelGenerator.java
copy to 
gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkSqlGatewayServiceModelGenerator.java
index 36df5deaf..5f6b64296 100644
--- 
a/gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkServiceModelGenerator.java
+++ 
b/gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkSqlGatewayServiceModelGenerator.java
@@ -17,26 +17,25 @@
  */
 package org.apache.knox.gateway.topology.discovery.cm.model.flink;
 
-import java.util.Locale;
-
-import org.apache.knox.gateway.topology.discovery.cm.ServiceModel;
-import org.apache.knox.gateway.topology.discovery.cm.ServiceModel.Type;
-import 
org.apache.knox.gateway.topology.discovery.cm.model.AbstractServiceModelGenerator;
-
 import com.cloudera.api.swagger.client.ApiException;
 import com.cloudera.api.swagger.model.ApiConfigList;
 import com.cloudera.api.swagger.model.ApiRole;
 import com.cloudera.api.swagger.model.ApiService;
 import com.cloudera.api.swagger.model.ApiServiceConfig;
+import org.apache.knox.gateway.topology.discovery.cm.ServiceModel;
+import org.apache.knox.gateway.topology.discovery.cm.ServiceModel.Type;
+import 
org.apache.knox.gateway.topology.discovery.cm.model.AbstractServiceModelGenerator;
+
+import java.util.Locale;
 
-public class FlinkServiceModelGenerator extends AbstractServiceModelGenerator {
+public class FlinkSqlGatewayServiceModelGenerator extends 
AbstractServiceModelGenerator {
 
-  static final String SERVICE = "FLINK";
+  static final String SERVICE = "FLINK-SQL-GATEWAY";
   static final String SERVICE_TYPE = "FLINK";
-  static final String ROLE_TYPE = "FLINK_HISTORY_SERVER";
+  static final String ROLE_TYPE = "FLINK_SQL_GATEWAY";
 
   static final String SSL_ENABLED = "ssl_enabled";
-  static final String WEB_PORT = "historyserver_web_port";
+  static final String PORT = "sql_gateway_port";
 
   @Override
   public String getService() {
@@ -55,19 +54,18 @@ public class FlinkServiceModelGenerator extends 
AbstractServiceModelGenerator {
 
   @Override
   public Type getModelType() {
-    return ServiceModel.Type.UI;
+    return Type.API;
   }
 
   @Override
   public ServiceModel generateService(ApiService service, ApiServiceConfig 
serviceConfig, ApiRole role, ApiConfigList roleConfig, ApiServiceConfig 
coreSettingsConfig) throws ApiException {
     final String hostname = role.getHostRef().getHostname();
-    final String port = getRoleConfigValue(roleConfig, WEB_PORT);
-    final boolean sslEnabled = 
Boolean.parseBoolean(getRoleConfigValue(roleConfig, SSL_ENABLED));
-    final String scheme = sslEnabled ? "https" : "http";
+    final String port = getRoleConfigValue(roleConfig, PORT);
+    final String scheme = "http";
 
     final ServiceModel model = 
createServiceModel(String.format(Locale.getDefault(), "%s://%s:%s", scheme, 
hostname, port));
-    model.addRoleProperty(getRoleType(), SSL_ENABLED, 
Boolean.toString(sslEnabled));
-    model.addRoleProperty(getRoleType(), WEB_PORT, port);
+    model.addRoleProperty(getRoleType(), SSL_ENABLED, Boolean.toString(false));
+    model.addRoleProperty(getRoleType(), PORT, port);
 
     return model;
   }
diff --git 
a/gateway-discovery-cm/src/main/resources/META-INF/services/org.apache.knox.gateway.topology.discovery.cm.ServiceModelGenerator
 
b/gateway-discovery-cm/src/main/resources/META-INF/services/org.apache.knox.gateway.topology.discovery.cm.ServiceModelGenerator
index e1b0c6c94..1fef3b616 100644
--- 
a/gateway-discovery-cm/src/main/resources/META-INF/services/org.apache.knox.gateway.topology.discovery.cm.ServiceModelGenerator
+++ 
b/gateway-discovery-cm/src/main/resources/META-INF/services/org.apache.knox.gateway.topology.discovery.cm.ServiceModelGenerator
@@ -18,7 +18,9 @@
 
 
org.apache.knox.gateway.topology.discovery.cm.model.atlas.AtlasServiceModelGenerator
 
org.apache.knox.gateway.topology.discovery.cm.model.atlas.AtlasAPIServiceModelGenerator
+org.apache.knox.gateway.topology.discovery.cm.model.flink.FlinkDashboardServiceModelGenerator
 
org.apache.knox.gateway.topology.discovery.cm.model.flink.FlinkServiceModelGenerator
+org.apache.knox.gateway.topology.discovery.cm.model.flink.FlinkSqlGatewayServiceModelGenerator
 
org.apache.knox.gateway.topology.discovery.cm.model.hbase.HBaseUIServiceModelGenerator
 
org.apache.knox.gateway.topology.discovery.cm.model.hbase.WebHBaseServiceModelGenerator
 
org.apache.knox.gateway.topology.discovery.cm.model.hdfs.NameNodeServiceModelGenerator
diff --git 
a/gateway-discovery-cm/src/test/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkServiceModelGeneratorTest.java
 
b/gateway-discovery-cm/src/test/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkDashboardServiceModelGeneratorTest.java
similarity index 75%
copy from 
gateway-discovery-cm/src/test/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkServiceModelGeneratorTest.java
copy to 
gateway-discovery-cm/src/test/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkDashboardServiceModelGeneratorTest.java
index 7cccea973..5ff491bac 100644
--- 
a/gateway-discovery-cm/src/test/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkServiceModelGeneratorTest.java
+++ 
b/gateway-discovery-cm/src/test/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkDashboardServiceModelGeneratorTest.java
@@ -17,36 +17,36 @@
  */
 package org.apache.knox.gateway.topology.discovery.cm.model.flink;
 
+import 
org.apache.knox.gateway.topology.discovery.cm.model.AbstractServiceModelGeneratorTest;
+import org.junit.Test;
+
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
-import 
org.apache.knox.gateway.topology.discovery.cm.model.AbstractServiceModelGeneratorTest;
-import org.junit.Test;
-
-public class FlinkServiceModelGeneratorTest extends 
AbstractServiceModelGeneratorTest {
+public class FlinkDashboardServiceModelGeneratorTest extends 
AbstractServiceModelGeneratorTest {
   @Test
   public void testServiceModelMetadata() {
     final Map<String, String> serviceConfig = Collections.emptyMap();
     final Map<String, String> roleConfig = new HashMap<>();
-    roleConfig.put(FlinkServiceModelGenerator.SSL_ENABLED, "true");
-    roleConfig.put(FlinkServiceModelGenerator.WEB_PORT, "8082");
+    roleConfig.put(FlinkDashboardServiceModelGenerator.SSL_ENABLED, "true");
+    roleConfig.put(FlinkDashboardServiceModelGenerator.WEB_PORT, "8082");
 
     validateServiceModel(createServiceModel(serviceConfig, roleConfig), 
serviceConfig, roleConfig);
   }
 
   @Override
   protected String getServiceType() {
-    return FlinkServiceModelGenerator.SERVICE_TYPE;
+    return FlinkDashboardServiceModelGenerator.SERVICE_TYPE;
   }
 
   @Override
   protected String getRoleType() {
-    return FlinkServiceModelGenerator.ROLE_TYPE;
+    return FlinkDashboardServiceModelGenerator.ROLE_TYPE;
   }
 
   @Override
-  protected FlinkServiceModelGenerator newGenerator() {
-    return new FlinkServiceModelGenerator();
+  protected FlinkDashboardServiceModelGenerator newGenerator() {
+    return new FlinkDashboardServiceModelGenerator();
   }
 }
diff --git 
a/gateway-discovery-cm/src/test/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkServiceModelGeneratorTest.java
 
b/gateway-discovery-cm/src/test/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkServiceModelGeneratorTest.java
index 7cccea973..420742f75 100644
--- 
a/gateway-discovery-cm/src/test/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkServiceModelGeneratorTest.java
+++ 
b/gateway-discovery-cm/src/test/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkServiceModelGeneratorTest.java
@@ -17,36 +17,11 @@
  */
 package org.apache.knox.gateway.topology.discovery.cm.model.flink;
 
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import 
org.apache.knox.gateway.topology.discovery.cm.model.AbstractServiceModelGeneratorTest;
-import org.junit.Test;
-
-public class FlinkServiceModelGeneratorTest extends 
AbstractServiceModelGeneratorTest {
-  @Test
-  public void testServiceModelMetadata() {
-    final Map<String, String> serviceConfig = Collections.emptyMap();
-    final Map<String, String> roleConfig = new HashMap<>();
-    roleConfig.put(FlinkServiceModelGenerator.SSL_ENABLED, "true");
-    roleConfig.put(FlinkServiceModelGenerator.WEB_PORT, "8082");
-
-    validateServiceModel(createServiceModel(serviceConfig, roleConfig), 
serviceConfig, roleConfig);
-  }
+public class FlinkServiceModelGeneratorTest extends 
FlinkDashboardServiceModelGeneratorTest {
 
   @Override
   protected String getServiceType() {
     return FlinkServiceModelGenerator.SERVICE_TYPE;
   }
 
-  @Override
-  protected String getRoleType() {
-    return FlinkServiceModelGenerator.ROLE_TYPE;
-  }
-
-  @Override
-  protected FlinkServiceModelGenerator newGenerator() {
-    return new FlinkServiceModelGenerator();
-  }
 }
diff --git 
a/gateway-discovery-cm/src/test/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkServiceModelGeneratorTest.java
 
b/gateway-discovery-cm/src/test/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkSqlGatewayServiceModelGeneratorTest.java
similarity index 75%
copy from 
gateway-discovery-cm/src/test/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkServiceModelGeneratorTest.java
copy to 
gateway-discovery-cm/src/test/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkSqlGatewayServiceModelGeneratorTest.java
index 7cccea973..fe618b623 100644
--- 
a/gateway-discovery-cm/src/test/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkServiceModelGeneratorTest.java
+++ 
b/gateway-discovery-cm/src/test/java/org/apache/knox/gateway/topology/discovery/cm/model/flink/FlinkSqlGatewayServiceModelGeneratorTest.java
@@ -17,36 +17,36 @@
  */
 package org.apache.knox.gateway.topology.discovery.cm.model.flink;
 
+import 
org.apache.knox.gateway.topology.discovery.cm.model.AbstractServiceModelGeneratorTest;
+import org.junit.Test;
+
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
-import 
org.apache.knox.gateway.topology.discovery.cm.model.AbstractServiceModelGeneratorTest;
-import org.junit.Test;
-
-public class FlinkServiceModelGeneratorTest extends 
AbstractServiceModelGeneratorTest {
+public class FlinkSqlGatewayServiceModelGeneratorTest extends 
AbstractServiceModelGeneratorTest {
   @Test
   public void testServiceModelMetadata() {
     final Map<String, String> serviceConfig = Collections.emptyMap();
     final Map<String, String> roleConfig = new HashMap<>();
-    roleConfig.put(FlinkServiceModelGenerator.SSL_ENABLED, "true");
-    roleConfig.put(FlinkServiceModelGenerator.WEB_PORT, "8082");
+    roleConfig.put(FlinkSqlGatewayServiceModelGenerator.SSL_ENABLED, "false");
+    roleConfig.put(FlinkSqlGatewayServiceModelGenerator.PORT, "18083");
 
     validateServiceModel(createServiceModel(serviceConfig, roleConfig), 
serviceConfig, roleConfig);
   }
 
   @Override
   protected String getServiceType() {
-    return FlinkServiceModelGenerator.SERVICE_TYPE;
+    return FlinkSqlGatewayServiceModelGenerator.SERVICE_TYPE;
   }
 
   @Override
   protected String getRoleType() {
-    return FlinkServiceModelGenerator.ROLE_TYPE;
+    return FlinkSqlGatewayServiceModelGenerator.ROLE_TYPE;
   }
 
   @Override
-  protected FlinkServiceModelGenerator newGenerator() {
-    return new FlinkServiceModelGenerator();
+  protected FlinkSqlGatewayServiceModelGenerator newGenerator() {
+    return new FlinkSqlGatewayServiceModelGenerator();
   }
 }
diff --git 
a/gateway-service-definitions/src/main/resources/services/flink-dashboard/1.11.1/rewrite.xml
 
b/gateway-service-definitions/src/main/resources/services/flink-dashboard/1.11.1/rewrite.xml
new file mode 100644
index 000000000..1fadd1897
--- /dev/null
+++ 
b/gateway-service-definitions/src/main/resources/services/flink-dashboard/1.11.1/rewrite.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<rules>
+    <rule name="FLINK-DASHBOARD/flink-dashboard/inbound/root" 
pattern="*://*:*/**/flink/dashboard/">
+        <rewrite template="{$serviceUrl[FLINK-DASHBOARD]}/"/>
+    </rule>
+    <rule name="FLINK-DASHBOARD/flink-dashboard/inbound/path" 
pattern="*://*:*/**/flink/dashboard/{**}">
+        <rewrite template="{$serviceUrl[FLINK-DASHBOARD]}/{**}"/>
+    </rule>
+    <rule name="FLINK-DASHBOARD/flink-dashboard/inbound/query" 
pattern="*://*:*/**/flink/dashboard/{path=**}?{**}">
+        <rewrite template="{$serviceUrl[FLINK-DASHBOARD]}/{path=**}?{**}"/>
+    </rule>
+    <rule dir="OUT" name="FLINK-DASHBOARD/flink-dashboard/outbound/links">
+        <match pattern="*://*:*/proxy/{**}"/>
+        <rewrite template="{$frontend[url]}/yarnuiv2/proxy/{**}/"/>
+    </rule>
+    <filter name="FLINK-DASHBOARD/flink-dashboard/outbound/json">
+        <content type="*/json">
+            <apply path="$.jobs[*].cluster.url" 
rule="FLINK-DASHBOARD/flink-dashboard/outbound/links"/>
+        </content>
+    </filter>
+</rules>
diff --git 
a/gateway-service-definitions/src/main/resources/services/flink-dashboard/1.11.1/service.xml
 
b/gateway-service-definitions/src/main/resources/services/flink-dashboard/1.11.1/service.xml
new file mode 100644
index 000000000..7dbf9f176
--- /dev/null
+++ 
b/gateway-service-definitions/src/main/resources/services/flink-dashboard/1.11.1/service.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<service name="flink-dashboard" role="FLINK-DASHBOARD" version="1.11.1">
+    <metadata>
+        <context>/flink/dashboard/</context>
+        <description>The Flink Dashboard acts as a single UI for all the Flink 
jobs running on the YARN cluster.</description>
+        <shortDesc>Flink Dashboard</shortDesc>
+        <type>UI</type>
+    </metadata>
+    <dispatch 
classname="org.apache.knox.gateway.dispatch.ConfigurableDispatch" 
use-two-way-ssl="false">
+        <param>
+            <name>responseExcludeHeaders</name>
+            <value>CONTENT-LENGTH</value>
+        </param>
+    </dispatch>
+    <routes>
+        <route path="/flink/dashboard/"/>
+        <route path="/flink/dashboard/**"/>
+        <route path="/flink/dashboard/**?**"/>
+        <route path="/flink/dashboard/jobs/overview">
+            <rewrite apply="FLINK-DASHBOARD/flink-dashboard/outbound/json" 
to="response.body"/>
+        </route>
+    </routes>
+</service>
diff --git 
a/gateway-service-definitions/src/main/resources/services/flink-sql-gateway/1.11.1/rewrite.xml
 
b/gateway-service-definitions/src/main/resources/services/flink-sql-gateway/1.11.1/rewrite.xml
new file mode 100644
index 000000000..0a8f60e2e
--- /dev/null
+++ 
b/gateway-service-definitions/src/main/resources/services/flink-sql-gateway/1.11.1/rewrite.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<rules>
+    <rule dir="IN" name="FLINK-SQL-GATEWAY/flink-sql-gateway/inbound/path" 
pattern="*://*:*/**/flink/sql-gateway/{path=**}">
+        <rewrite template="{$serviceUrl[FLINK-SQL-GATEWAY]}/{path=**}"/>
+    </rule>
+</rules>
diff --git 
a/gateway-service-definitions/src/main/resources/services/flink-sql-gateway/1.11.1/service.xml
 
b/gateway-service-definitions/src/main/resources/services/flink-sql-gateway/1.11.1/service.xml
new file mode 100644
index 000000000..4226b670b
--- /dev/null
+++ 
b/gateway-service-definitions/src/main/resources/services/flink-sql-gateway/1.11.1/service.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<service name="flink-sql-gateway" role="FLINK-SQL-GATEWAY" version="1.11.1">
+    <metadata>
+        <context>/flink/sql-gateway</context>
+        <description>The Flink SQL Gateway is a REST endpoint for running 
Flink SQL queries and updates.</description>
+        <shortDesc>Flink SQL Gateway</shortDesc>
+        <type>API</type>
+    </metadata>
+    <dispatch classname="org.apache.knox.gateway.dispatch.DefaultDispatch" 
use-two-way-ssl="false"/>
+    <routes>
+        <route path="/flink/sql-gateway/**"/>
+    </routes>
+</service>
diff --git 
a/gateway-service-definitions/src/main/resources/services/flink/1.12.1/rewrite.xml
 
b/gateway-service-definitions/src/main/resources/services/flink/1.12.1/rewrite.xml
new file mode 100644
index 000000000..3250f2805
--- /dev/null
+++ 
b/gateway-service-definitions/src/main/resources/services/flink/1.12.1/rewrite.xml
@@ -0,0 +1,34 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+       http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<rules>
+    <rule name="FLINK/flink/inbound/root" pattern="*://*:*/**/flink/">
+        <rewrite template="{$serviceUrl[FLINK]}/"/>
+    </rule>
+    <rule name="FLINK/flink/inbound/path" pattern="*://*:*/**/flink/{**}">
+        <rewrite template="{$serviceUrl[FLINK]}/{**}"/>
+    </rule>
+    <rule name="FLINK/flink/inbound/query" 
pattern="*://*:*/**/flink/{path=**}?{**}">
+        <rewrite template="{$serviceUrl[FLINK]}/{path=**}?{**}"/>
+    </rule>
+    <rule dir="OUT" name="FLINK/flink/outbound/links">
+        <match pattern="*://*:*/proxy/{**}"/>
+        <rewrite template="{$frontend[url]}/yarnuiv2/proxy/{**}/"/>
+    </rule>
+    <filter name="FLINK/flink/outbound/json">
+        <content type="*/json">
+            <apply path="$.jobs[*].cluster.url" 
rule="FLINK/flink/outbound/links"/>
+        </content>
+    </filter>
+</rules>
diff --git 
a/gateway-service-definitions/src/main/resources/services/flink/1.12.1/service.xml
 
b/gateway-service-definitions/src/main/resources/services/flink/1.12.1/service.xml
new file mode 100644
index 000000000..8866cfcd5
--- /dev/null
+++ 
b/gateway-service-definitions/src/main/resources/services/flink/1.12.1/service.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+       http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<service name="flink" role="FLINK" version="1.12.1">
+    <metadata>
+        <context>/flink/</context>
+        <description>The Flink Dashboard acts as a single UI for all the Flink 
jobs running on the YARN cluster.</description>
+        <shortDesc>Flink Dashboard</shortDesc>
+        <type>UI</type>
+    </metadata>
+    <dispatch 
classname="org.apache.knox.gateway.dispatch.ConfigurableDispatch" 
use-two-way-ssl="false">
+        <param>
+            <name>responseExcludeHeaders</name>
+            <value>CONTENT-LENGTH,Www-Authenticate</value>
+        </param>
+    </dispatch>
+    <routes>
+        <route path="/flink/"/>
+        <route path="/flink/**"/>
+        <route path="/flink/**?**"/>
+        <route path="/flink/jobs/overview">
+            <rewrite apply="FLINK/flink/outbound/json" to="response.body"/>
+        </route>
+    </routes>
+</service>
diff --git a/knox-homepage-ui/home/assets/service-logos/flink-dashboard.png 
b/knox-homepage-ui/home/assets/service-logos/flink-dashboard.png
new file mode 100644
index 000000000..de69fb699
Binary files /dev/null and 
b/knox-homepage-ui/home/assets/service-logos/flink-dashboard.png differ
diff --git a/knox-homepage-ui/home/assets/service-logos/flink-sql-gateway.png 
b/knox-homepage-ui/home/assets/service-logos/flink-sql-gateway.png
new file mode 100644
index 000000000..de69fb699
Binary files /dev/null and 
b/knox-homepage-ui/home/assets/service-logos/flink-sql-gateway.png differ
diff --git a/knox-homepage-ui/home/assets/service-logos/flink.png 
b/knox-homepage-ui/home/assets/service-logos/flink.png
new file mode 100644
index 000000000..de69fb699
Binary files /dev/null and 
b/knox-homepage-ui/home/assets/service-logos/flink.png differ

Reply via email to