knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lmc...@apache.org
Subject [2/2] knox git commit: KNOX-982 - Datanode JMX REST Knox service
Date Thu, 20 Jul 2017 03:45:31 GMT
KNOX-982 - Datanode JMX REST Knox service

Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/3d2901be
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/3d2901be
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/3d2901be

Branch: refs/heads/master
Commit: 3d2901be41a3b4eaa777d996c0fc408e267ba923
Parents: a59b404
Author: Larry McCay <lmccay@hortonworks.com>
Authored: Wed Jul 19 23:34:50 2017 -0400
Committer: Larry McCay <lmccay@hortonworks.com>
Committed: Wed Jul 19 23:34:50 2017 -0400

----------------------------------------------------------------------
 .../services/datanode/1.0.0/rewrite.xml         | 74 ++++++++++++++++++++
 .../services/datanode/1.0.0/service.xml         | 31 ++++++++
 2 files changed, 105 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/3d2901be/gateway-service-definitions/src/main/resources/services/datanode/1.0.0/rewrite.xml
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/resources/services/datanode/1.0.0/rewrite.xml
b/gateway-service-definitions/src/main/resources/services/datanode/1.0.0/rewrite.xml
new file mode 100644
index 0000000..b10de1a
--- /dev/null
+++ b/gateway-service-definitions/src/main/resources/services/datanode/1.0.0/rewrite.xml
@@ -0,0 +1,74 @@
+<?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="DATANODE/datanode/inbound/master/root" pattern="*://${host}:*/**/datanode/">
+        <rewrite template="{$serviceUrl[DATANODE]}/?host={$hostmap(host)}"/>
+    </rule>
+    <rule dir="IN" name="DATANODE/datanode/inbound/master/path" pattern="*://${host}:*/**/datanode/{**}?host={host}?port={port}">
+        <rewrite template="http://{host}:{port}/?{**}"/>
+    </rule>
+    <rule dir="IN" name="DATANODE/datanode/inbound/master/query" pattern="*://*:*/**/datanode/{**}?host={host}?{**}">
+        <rewrite template="{host}/{**}?{**}"/>
+    </rule>
+    <rule dir="IN" name="DATANODE/datanode/inbound/master/query2" pattern="*://*:*/**/datanode/?host={host}?{**}">
+        <rewrite template="{host}/?{**}"/>
+    </rule>
+    <rule dir="IN" name="DATANODE/datanode/inbound/static" pattern="*://*:*/**/static/{**}?host={host}?{**}">
+       <rewrite template="{host}/static/{**}?{**}"/>
+    </rule>
+    <rule dir="IN" name="DATANODE/datanode/inbound/logs" pattern="*://*:*/**/datanode/logs/?host={host}">
+       <rewrite template="{host}/logs/"/>
+    </rule>
+    <rule dir="IN" name="DATANODE/datanode/inbound/logs/files" pattern="*://*:*/**/datanode/logs/{**}?host={host}">
+       <rewrite template="{host}/logs/{**}"/>
+    </rule>
+
+  <filter name="DATANODE/outbound/datanode/static">
+     <content type="*/html">
+      <apply path="dn.js"    rule="DATANODE/outbound/datanode/dn"/>
+    </content>
+    <content type="application/x-javascript">
+      <apply path="/jmx" rule="DATANODE/outbound/datanode/dfs/jmx"/>
+   </content>
+  </filter>
+
+  <rule dir="OUT" name="DATANODE/outbound/datanode/window/location">
+    <rewrite template="'{$inboundurl[host]}'"/>
+  </rule>
+  <rule dir="OUT" name="DATANODE/datanode/html/OUT" pattern="/static/{**}">
+    <rewrite template="{gateway.url}/datanode/static/{**}?host={$inboundurl[host]}"/>
+  </rule>
+  <rule dir="OUT" name="DATANODE/datanode/html/logs" pattern="/logs">
+    <rewrite template="{gateway.url}/datanode/logs/?host={$inboundurl[host]}"/>
+  </rule>
+
+  <rule dir="OUT" name="DATANODE/outbound/datanode/dn" pattern="/dn.js">
+    <rewrite template="{gateway.url}/datanode/dn.js?host={$inboundurl[host]}"/>
+  </rule>
+
+  <rule dir="OUT" name="DATANODE/outbound/datanode/dfs/jmx" pattern="/jmx?{**}">
+      <rewrite template="{gateway.url}/datanode/jmx?host={$inboundurl[host]}?{**}"/>
+  </rule>
+
+  <rule dir="OUT" name="DATANODE/inbound/datanode/html" pattern="*0;url=datanode.html">
+    <rewrite template="0;url=/gateway/default/datanode/datanode.html?host={$inboundurl[host]}"/>
+  </rule>
+  <rule dir="OUT" name="DATANODE/datanode/outbound/logs/files" pattern="/logs/{**}">
+    <rewrite template="{gateway.url}/datanode/logs/{**}?host={$inboundurl[host]}"/>
+  </rule>
+</rules>

http://git-wip-us.apache.org/repos/asf/knox/blob/3d2901be/gateway-service-definitions/src/main/resources/services/datanode/1.0.0/service.xml
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/resources/services/datanode/1.0.0/service.xml
b/gateway-service-definitions/src/main/resources/services/datanode/1.0.0/service.xml
new file mode 100644
index 0000000..39bd7dd
--- /dev/null
+++ b/gateway-service-definitions/src/main/resources/services/datanode/1.0.0/service.xml
@@ -0,0 +1,31 @@
+<?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 role="DATANODE" name="datanode" version="1.0.0">
+    <routes>
+        <route path="/datanode/">
+           <rewrite apply="DATANODE/outbound/datanode/static" to="response.body"/>
+        </route>
+        <route path="/datanode/**">
+           <rewrite apply="DATANODE/outbound/datanode/static" to="response.body"/>
+        </route>
+        <route path="/datanode/**?**">
+           <rewrite apply="DATANODE/outbound/datanode/static" to="response.body"/>
+        </route>
+        <route path="/datanode/?**"/>
+    </routes>
+</service>


Mime
View raw message