You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@knox.apache.org by kr...@apache.org on 2018/11/16 18:49:01 UTC
knox git commit: KNOX-1148 - Fix Livy Service Definition to align
with Livy API (Spark REST Service)
Repository: knox
Updated Branches:
refs/heads/master fc592f05f -> b5e73f184
KNOX-1148 - Fix Livy Service Definition to align with Livy API (Spark REST Service)
Signed-off-by: Kevin Risden <kr...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/b5e73f18
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/b5e73f18
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/b5e73f18
Branch: refs/heads/master
Commit: b5e73f184f88cc7ffbf3d874e5691689803f672c
Parents: fc592f0
Author: Kevin Risden <kr...@apache.org>
Authored: Fri Nov 16 10:14:48 2018 -0500
Committer: Kevin Risden <kr...@apache.org>
Committed: Fri Nov 16 13:48:38 2018 -0500
----------------------------------------------------------------------
.../main/resources/services/livy/0.4.0/rewrite.xml | 14 ++++++++++++--
.../main/resources/services/livy/0.4.0/service.xml | 6 +++---
2 files changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/knox/blob/b5e73f18/gateway-service-definitions/src/main/resources/services/livy/0.4.0/rewrite.xml
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/resources/services/livy/0.4.0/rewrite.xml b/gateway-service-definitions/src/main/resources/services/livy/0.4.0/rewrite.xml
index befa1e4..ab33bab 100644
--- a/gateway-service-definitions/src/main/resources/services/livy/0.4.0/rewrite.xml
+++ b/gateway-service-definitions/src/main/resources/services/livy/0.4.0/rewrite.xml
@@ -16,10 +16,20 @@
limitations under the License.
-->
<rules>
- <rule dir="IN" name="LIVYSERVER/livy/root/inbound" pattern="*://*:*/**/livy/v1">
+ <!-- These should be removed at some point since Livy
+ doesn't have /v1 in the REST API specification -->
+ <rule dir="IN" name="LIVYSERVER/livy/root/v1/inbound/" pattern="*://*:*/**/livy/v1">
<rewrite template="{$serviceUrl[LIVYSERVER]}"/>
</rule>
- <rule dir="IN" name="LIVYSERVER/livy/path/inbound" pattern="*://*:*/**/livy/v1/{path=**}?{**}">
+ <rule dir="IN" name="LIVYSERVER/livy/path/v1/inbound" pattern="*://*:*/**/livy/v1/{path=**}?{**}">
+ <rewrite template="{$serviceUrl[LIVYSERVER]}/{path=**}?{**}"/>
+ </rule>
+
+ <!-- Prefer these rules without v1 in the url -->
+ <rule dir="IN" name="LIVYSERVER/livy/root/inbound" pattern="*://*:*/**/livy">
+ <rewrite template="{$serviceUrl[LIVYSERVER]}"/>
+ </rule>
+ <rule dir="IN" name="LIVYSERVER/livy/path/inbound" pattern="*://*:*/**/livy/{path=**}?{**}">
<rewrite template="{$serviceUrl[LIVYSERVER]}/{path=**}?{**}"/>
</rule>
</rules>
http://git-wip-us.apache.org/repos/asf/knox/blob/b5e73f18/gateway-service-definitions/src/main/resources/services/livy/0.4.0/service.xml
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/resources/services/livy/0.4.0/service.xml b/gateway-service-definitions/src/main/resources/services/livy/0.4.0/service.xml
index 642ec2e..c04d66f 100644
--- a/gateway-service-definitions/src/main/resources/services/livy/0.4.0/service.xml
+++ b/gateway-service-definitions/src/main/resources/services/livy/0.4.0/service.xml
@@ -17,9 +17,9 @@
-->
<service role="LIVYSERVER" name="livy" version="0.4.0">
<routes>
- <route path="/livy/v1/**?**"/>
- <route path="/livy/v1"/>
- <route path="/livy/v1/"/>
+ <route path="/livy/**?**"/>
+ <route path="/livy"/>
+ <route path="/livy/"/>
</routes>
<dispatch classname="org.apache.knox.gateway.livy.LivyDispatch"/>
</service>