KNOX-1193 - NiFi service discovery support
authorPhil Zampino <pzampino@apache.org>
Wed, 16 May 2018 20:32:33 +0000 (16:32 -0400)
committerPhil Zampino <pzampino@apache.org>
Wed, 16 May 2018 20:33:00 +0000 (16:33 -0400)
gateway-discovery-ambari/src/main/resources/ambari-service-discovery-component-config-mapping.properties
gateway-discovery-ambari/src/main/resources/ambari-service-discovery-url-mappings.xml

index cfbc091..1ad7fc5 100644 (file)
         </properties>
     </service>
 
+    <service name="NIFI">
+        <url-pattern>{SCHEME}://{HOST}:{PORT}</url-pattern>
+        <properties>
+            <property name="COMPONENT_HOST">
+                <component>NIFI_MASTER</component>
+                <hostname/>
+            </property>
+            <property name="HTTP_HOST">
+                <component>NIFI_MASTER</component>
+                <config-property>nifi.web.http.host</config-property>
+            </property>
+            <property name="HTTPS_HOST">
+                <component>NIFI_MASTER</component>
+                <config-property>nifi.web.https.host</config-property>
+            </property>
+            <property name="HTTP_PORT">
+                <component>NIFI_MASTER</component>
+                <config-property>nifi.web.http.port</config-property>
+            </property>
+            <property name="HTTPS_PORT">
+                <component>NIFI_MASTER</component>
+                <config-property>nifi.web.https.port</config-property>
+            </property>
+            <property name="SCHEME">
+                <config-property>
+                    <if property="HTTPS_PORT">
+                        <then>https</then>
+                        <else>http</else>
+                    </if>
+                </config-property>
+            </property>
+            <property name="HOST">
+                <config-property>
+                    <if property="HTTPS_HOST">
+                        <then>HTTPS_HOST</then>
+                        <else>
+                            <if property="HTTP_HOST">
+                                <then>HTTP_HOST</then>
+                                <else>COMPONENT_HOST</else>
+                            </if>
+                        </else>
+                    </if>
+                </config-property>
+            </property>
+            <property name="PORT">
+                <config-property>
+                    <if property="SCHEME" value="https">
+                        <then>HTTPS_PORT</then>
+                        <else>HTTP_PORT</else>
+                    </if>
+                </config-property>
+            </property>
+        </properties>
+    </service>
+
 </service-discovery-url-mappings>