Repository: knox Updated Branches: refs/heads/KNOX-998-Package_Restructuring 1451428f7 -> e70904b3d
KNOX-842 Add support for Livy (Spark REST Service). Project: http://git-wip-us.apache.org/repos/asf/knox/repo Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/4d60e414 Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/4d60e414 Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/4d60e414 Branch: refs/heads/KNOX-998-Package_Restructuring Commit: 4d60e4149a9fd484f8b54faeb082bf40fa3611d4 Parents: 11ec78a Author: Jeffrey E Rodriguez <[email protected]> Authored: Thu Nov 2 04:20:46 2017 -0700 Committer: Jeffrey E Rodriguez <[email protected]> Committed: Thu Nov 2 04:20:46 2017 -0700 ---------------------------------------------------------------------- .../resources/services/livy/0.4.0/rewrite.xml | 33 ++++++++++++++++++++ .../resources/services/livy/0.4.0/service.xml | 28 +++++++++++++++++ 2 files changed, 61 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/knox/blob/4d60e414/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 new file mode 100644 index 0000000..013fa99 --- /dev/null +++ b/gateway-service-definitions/src/main/resources/services/livy/0.4.0/rewrite.xml @@ -0,0 +1,33 @@ +<?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="LIVYSERVER/livy/user-name"> + <rewrite template="{$username}"/> + </rule> + <rule dir="IN" name="LIVYSERVER/livy/root/inbound" pattern="*://*:*/**/livy/v1"> + <rewrite template="{$serviceUrl[LIVYSERVER]}"/> + </rule> + <rule dir="IN" name="LIVYSERVER/livy/path/inbound" pattern="*://*:*/**/livy/v1/{path=**}?{**}"> + <rewrite template="{$serviceUrl[LIVYSERVER]}/{path=**}?{**}"/> + </rule> + <filter name="LIVYSERVER/livy/addusername/inbound"> + <content type="*/json"> + <apply path="$.proxyUser" rule="LIVYSERVER/livy/user-name"/> + </content> + </filter> +</rules> http://git-wip-us.apache.org/repos/asf/knox/blob/4d60e414/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 new file mode 100644 index 0000000..ef71d1e --- /dev/null +++ b/gateway-service-definitions/src/main/resources/services/livy/0.4.0/service.xml @@ -0,0 +1,28 @@ +<?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="LIVYSERVER" name="livy" version="0.4.0"> + <routes> + <route path="/livy/v1/sessions"> + <rewrite apply="LIVYSERVER/livy/addusername/inbound" to="request.body"/> + </route> + <route path="/livy/v1/**?**"/> + <route path="/livy/v1"/> + <route path="/livy/v1/"/> + </routes> +</service>
