Skip to content

Commit 532c436

Browse files
KNOX-3243 : Added Ambari 3.0.0 support (#1140)
Co-authored-by: Harshith Gandhe <harshith@acceldata.io>
1 parent a5552e1 commit 532c436

6 files changed

Lines changed: 428 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<rules>
18+
<rule dir="IN" name="AMBARI/ambari/inbound" pattern="*://*:*/**/ambari/api/v1/{**}?{**}">
19+
<rewrite template="{$serviceUrl[AMBARI]}/api/v1/{**}?{**}"/>
20+
</rule>
21+
<rule dir="OUT" name="AMBARI/ambari/href/outbound">
22+
<match pattern="*://*:*/api/{**}?{**}"/>
23+
<rewrite template="{$frontend[url]}/ambari/api/{**}?{**}"/>
24+
</rule>
25+
<rule dir="OUT" name="AMBARI/ambari/context_path/outbound">
26+
<match pattern="/{**}"/>
27+
<rewrite template="{$frontend[path]}/ambari/{**}"/>
28+
</rule>
29+
<filter name="AMBARI/ambari/api/outbound">
30+
<content type="text/plain" asType="application/json">
31+
<apply path="$.**.href" rule="AMBARI/ambari/href/outbound"/>
32+
<apply path="$.**.context_path" rule="AMBARI/ambari/context_path/outbound"/>
33+
</content>
34+
</filter>
35+
<filter name="AMBARI/ambari/api/inbound">
36+
<content type="application/x-www-form-urlencoded" asType="application/octet-stream">
37+
</content>
38+
</filter>
39+
</rules>
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<service role="AMBARI" name="ambari" version="3.0.0">
18+
<metadata>
19+
<type>API</type>
20+
<context>/ambari/api</context>
21+
<shortDesc>Apache Ambari API</shortDesc>
22+
<description>The Ambari API facilitates the management and monitoring of the resources of an Apache Hadoop cluster.</description>
23+
<samples>
24+
<sample>
25+
<description>Fetch all Ambari-managed clusters</description>
26+
<method>GET</method>
27+
<path>v1/clusters</path>
28+
</sample>
29+
<sample>
30+
<description>Get the DATANODE component resource for the HDFS service of the cluster named 'c1'</description>
31+
<method>GET</method>
32+
<path>v1/clusters/c1/services/HDFS/components/DATANODE</path>
33+
</sample>
34+
<sample>
35+
<description>Create the HDFS service.</description>
36+
<method>POST</method>
37+
<path>v1/clusters/c1/services/HDFS</path>
38+
</sample>
39+
<sample>
40+
<description>Delete the cluster named 'c1'</description>
41+
<method>DELETE</method>
42+
<path>v1/clusters/c1</path>
43+
</sample>
44+
<sample>
45+
<description>See the Apache Ambari's REST API documentation here</description>
46+
<value>https://github.com/apache/ambari/blob/trunk/ambari-server/docs/api/v1/index.md</value>
47+
</sample>
48+
</samples>
49+
</metadata>
50+
<policies>
51+
<policy role="webappsec"/>
52+
<policy role="authentication" name="Anonymous"/>
53+
<policy role="rewrite"/>
54+
<policy role="authorization"/>
55+
</policies>
56+
<routes>
57+
<route path="/ambari/api/v1/**">
58+
<rewrite apply="AMBARI/ambari/api/outbound" to="response.body"/>
59+
<rewrite apply="AMBARI/ambari/api/inbound" to="request.body"/>
60+
</route>
61+
<route path="/ambari/api/v1/persist/*?*">
62+
<rewrite apply="AMBARI/ambari/api/inbound" to="request.body"/>
63+
</route>
64+
</routes>
65+
<dispatch classname="org.apache.knox.gateway.dispatch.PassAllHeadersNoEncodingDispatch"/>
66+
</service>
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<rules>
18+
<rule dir="IN" name="AMBARIUI/ambari/inbound/root" pattern="*://*:*/**/ambari/">
19+
<rewrite template="{$serviceUrl[AMBARIUI]}/"/>
20+
</rule>
21+
<rule dir="IN" name="AMBARIUI/ambari/inbound/path" pattern="*://*:*/**/ambari/{**}">
22+
<rewrite template="{$serviceUrl[AMBARIUI]}/{**}"/>
23+
</rule>
24+
<rule dir="IN" name="AMBARIUI/ambari/inbound/query" pattern="*://*:*/**/ambari/{**}?{**}">
25+
<rewrite template="{$serviceUrl[AMBARIUI]}/{**}?{**}"/>
26+
</rule>
27+
28+
<rule dir="OUT" name="AMBARIUI/ambari/outbound/sitepath">
29+
<rewrite template="/gateway/{$frontend[topology]}/ambari"/>
30+
</rule>
31+
32+
<rule dir="OUT" name="AMBARIUI/ambari/outbound/extrapath">
33+
<rewrite template="/gateway/{$frontend[topology]}/ambari/api/v1"/>
34+
</rule>
35+
36+
<rule dir="OUT" name="AMBARIUI/ambari/outbound/img">
37+
<rewrite template="/gateway/{$frontend[topology]}/ambari/img/"/>
38+
</rule>
39+
40+
<rule dir="OUT" name="AMBARIUI/ambari/outbound/ambarilogo">
41+
<rewrite template="/gateway/{$frontend[topology]}/ambari/img/ambari-logo.png"/>
42+
</rule>
43+
44+
<rule dir="OUT" name="AMBARIUI/ambari/outbound/logohref">
45+
<rewrite template="#/main/dashboard"/>
46+
</rule>
47+
48+
<rule dir="OUT" name="AMBARIUI/ambari/outbound/vendorcss">
49+
<rewrite template="/gateway/{$frontend[topology]}/ambari/stylesheets/vendor.css"/>
50+
</rule>
51+
<rule dir="OUT" name="AMBARIUI/ambari/outbound/appcss">
52+
<rewrite template="/gateway/{$frontend[topology]}/ambari/stylesheets/app.css"/>
53+
</rule>
54+
<rule dir="OUT" name="AMBARIUI/ambari/outbound/vendorjs">
55+
<rewrite template="/gateway/{$frontend[topology]}/ambari/javascripts/vendor.js"/>
56+
</rule>
57+
<rule dir="OUT" name="AMBARIUI/ambari/outbound/appjs">
58+
<rewrite template="/gateway/{$frontend[topology]}/ambari/javascripts/app.js"/>
59+
</rule>
60+
<rule dir="OUT" name="AMBARIUI/ambari/outbound/favicon">
61+
<rewrite template="/gateway/{$frontend[topology]}/ambari/img/logo.png"/>
62+
</rule>
63+
<rule dir="OUT" name="AMBARIUI/ambari/outbound/notice">
64+
<rewrite template="/gateway/{$frontend[topology]}/ambari/licenses/NOTICE.txt"/>
65+
</rule>
66+
67+
<!-- WS support -->
68+
<rule dir="OUT" name="AMBARIUI/ambari/outbound/websocket">
69+
<rewrite template="/gateway/{$frontend[topology]}/ambariws/api/stomp/v1"/>
70+
</rule>
71+
72+
<filter name="AMBARIUI/ambari/outbound/proxyroot">
73+
<content type="*/x-javascript">
74+
<apply path="\{proxy_root\}" rule="AMBARIUI/ambari/outbound/sitepath"/>
75+
</content>
76+
<content type="application/javascript">
77+
<apply path="\{proxy_root\}" rule="AMBARIUI/ambari/outbound/sitepath"/>
78+
</content>
79+
<content type="text/javascript">
80+
<apply path="\{proxy_root\}" rule="AMBARIUI/ambari/outbound/sitepath"/>
81+
</content>
82+
</filter>
83+
84+
<!-- filter to rewrite api prefix defined in .js from root -->
85+
<!-- e.g. /api/v1 -->
86+
<filter name="AMBARIUI/ambari/outbound/apiendpoint">
87+
<content type="*/x-javascript">
88+
<apply path="/api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/>
89+
</content>
90+
<content type="application/javascript">
91+
<apply path="/api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/>
92+
</content>
93+
<content type="text/javascript">
94+
<apply path="/api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/>
95+
</content>
96+
</filter>
97+
98+
<filter name="AMBARIUI/ambari/outbound/apiendpoint/html">
99+
<content type="text/html">
100+
<apply path="/api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/>
101+
</content>
102+
</filter>
103+
104+
<filter name="AMBARIUI/ambari/outbound/apiendpoint/noroot">
105+
<content type="*/x-javascript">
106+
<apply path="api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/>
107+
</content>
108+
<content type="application/javascript">
109+
<apply path="api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/>
110+
</content>
111+
<content type="text/javascript">
112+
<apply path="api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/>
113+
</content>
114+
</filter>
115+
116+
<filter name="AMBARIUI/ambari/outbound/links">
117+
<content type="*/x-javascript">
118+
<apply path="/api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/>
119+
<apply path="/img/" rule="AMBARIUI/ambari/outbound/img"/>
120+
<apply path="/img/ambari-logo.png" rule="AMBARIUI/ambari/outbound/ambarilogo"/>
121+
<apply path="\{proxy_root\}" rule="AMBARIUI/ambari/outbound/sitepath"/>
122+
<apply path="/#/main/dashboard" rule="AMBARIUI/ambari/outbound/logohref"/>
123+
<!-- WS support -->
124+
<apply path="/api/stomp/v1" rule="AMBARIUI/ambari/outbound/websocket"/>
125+
</content>
126+
<content type="application/javascript">
127+
<apply path="/api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/>
128+
<apply path="/img/" rule="AMBARIUI/ambari/outbound/img"/>
129+
<apply path="/img/ambari-logo.png" rule="AMBARIUI/ambari/outbound/ambarilogo"/>
130+
<apply path="\{proxy_root\}" rule="AMBARIUI/ambari/outbound/sitepath"/>
131+
<apply path="/#/main/dashboard" rule="AMBARIUI/ambari/outbound/logohref"/>
132+
<!-- WS support -->
133+
<apply path="/api/stomp/v1" rule="AMBARIUI/ambari/outbound/websocket"/>
134+
</content>
135+
<content type="text/javascript">
136+
<apply path="/api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/>
137+
<apply path="/img/" rule="AMBARIUI/ambari/outbound/img"/>
138+
<apply path="/img/ambari-logo.png" rule="AMBARIUI/ambari/outbound/ambarilogo"/>
139+
<apply path="\{proxy_root\}" rule="AMBARIUI/ambari/outbound/sitepath"/>
140+
<apply path="/#/main/dashboard" rule="AMBARIUI/ambari/outbound/logohref"/>
141+
<!-- WS support -->
142+
<apply path="/api/stomp/v1" rule="AMBARIUI/ambari/outbound/websocket"/>
143+
</content>
144+
<content type="*/html">
145+
</content>
146+
</filter>
147+
<filter name="AMBARIUI/ambari/outbound/mainpage">
148+
<content type="*/html">
149+
<apply path="stylesheets/vendor.css" rule="AMBARIUI/ambari/outbound/vendorcss" />
150+
<apply path="stylesheets/app.css" rule="AMBARIUI/ambari/outbound/appcss" />
151+
<apply path="javascripts/vendor.js" rule="AMBARIUI/ambari/outbound/vendorjs" />
152+
<apply path="javascripts/app.js" rule="AMBARIUI/ambari/outbound/appjs" />
153+
<apply path="/img/logo.png" rule="AMBARIUI/ambari/outbound/favicon"/>
154+
<apply path="/img/ambari-logo.png" rule="AMBARIUI/ambari/outbound/ambarilogo"/>
155+
<apply path="/licenses/NOTICE.txt" rule="AMBARIUI/ambari/outbound/notice"/>
156+
</content>
157+
</filter>
158+
</rules>
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<service role="AMBARIUI" name="ambariui" version="3.0.0">
18+
<metadata>
19+
<type>UI</type>
20+
<context>/ambari/</context>
21+
<shortDesc>Apache Ambari Web UI</shortDesc>
22+
<description>The Apache Ambari project is aimed at making Hadoop management simpler by developing software for provisioning, managing, and monitoring Apache Hadoop clusters.
23+
Ambari provides an intuitive, easy-to-use Hadoop management web UI backed by its RESTful APIs.</description>
24+
</metadata>
25+
<policies>
26+
<policy role="webappsec"/>
27+
<policy role="authentication" name="Anonymous"/>
28+
<policy role="rewrite"/>
29+
<policy role="authorization"/>
30+
</policies>
31+
<routes>
32+
<route path="/ambari">
33+
<rewrite apply="AMBARIUI/ambari/inbound/root" to="request.url"/>
34+
<rewrite apply="AMBARIUI/ambari/outbound/mainpage" to="response.body"/>
35+
</route>
36+
<route path="/ambari/**">
37+
<rewrite apply="AMBARIUI/ambari/inbound/path" to="request.url"/>
38+
</route>
39+
<route path="/ambari/**?**">
40+
<rewrite apply="AMBARIUI/ambari/inbound/query" to="request.url"/>
41+
</route>
42+
<route path="/ambari/**/app.js">
43+
<rewrite apply="AMBARIUI/ambari/outbound/links" to="response.body"/>
44+
</route>
45+
<route path="/ambari/**/vendor.js">
46+
<rewrite apply="AMBARIUI/ambari/outbound/links" to="response.body"/>
47+
</route>
48+
49+
<!-- Admin View route -->
50+
<route path="/ambari/views/ADMIN_VIEW/**/INSTANCE/**">
51+
<rewrite apply="AMBARIUI/ambari/outbound/proxyroot" to="response.body"/>
52+
</route>
53+
54+
<!-- Files view -->
55+
<route path="/ambari/views/FILES/**/assets/files-view.js">
56+
<rewrite apply="AMBARIUI/ambari/outbound/apiendpoint/noroot" to="response.body"/>
57+
</route>
58+
59+
<!-- Capacity Scheduler view -->
60+
<route path="/ambari/views/CAPACITY-SCHEDULER/**/javascripts/app.js">
61+
<rewrite apply="AMBARIUI/ambari/outbound/apiendpoint/noroot" to="response.body"/>
62+
</route>
63+
64+
<!-- Pig view -->
65+
<route path="/ambari/views/PIG/**/javascripts/app.js">
66+
<rewrite apply="AMBARIUI/ambari/outbound/apiendpoint/noroot" to="response.body"/>
67+
</route>
68+
69+
<!-- Hive view route -->
70+
<route path="/ambari/views/HIVE/**/assets/hive.js">
71+
<rewrite apply="AMBARIUI/ambari/outbound/apiendpoint" to="response.body"/>
72+
</route>
73+
74+
<!-- Storm View -->
75+
<route path="/ambari/views/Storm_Monitoring/**/scripts/models/*.js">
76+
<rewrite apply="AMBARIUI/ambari/outbound/apiendpoint" to="response.body"/>
77+
</route>
78+
79+
<route path="/ambari/views/ZEPPELIN/*/*/">
80+
<rewrite apply="AMBARIUI/ambari/outbound/apiendpoint/html" to="response.body"/>
81+
</route>
82+
83+
<!-- Tez View -->
84+
<route path="/ambari/views/TEZ/*/*/ambari-scripts/init-view.js">
85+
<rewrite apply="AMBARIUI/ambari/outbound/apiendpoint" to="response.body"/>
86+
</route>
87+
88+
<!-- Hive 2.0 view -->
89+
<route path="/ambari/views/HIVE/**/assets/ui.js">
90+
<rewrite apply="AMBARIUI/ambari/outbound/apiendpoint/noroot" to="response.body"/>
91+
</route>
92+
93+
<!-- Wfmanager view -->
94+
<route path="/ambari/views/WORKFLOW_MANAGER/*/*/">
95+
<rewrite apply="AMBARIUI/ambari/outbound/apiendpoint/html" to="response.body"/>
96+
</route>
97+
98+
<!-- SmartSense view -->
99+
<route path="/ambari/views/SMARTSENSE/**/assets/hstapp-*.js">
100+
<rewrite apply="AMBARIUI/ambari/outbound/apiendpoint" to="response.body"/>
101+
</route>
102+
103+
<!-- No need to rewrite Slider View -->
104+
</routes>
105+
<dispatch classname="org.apache.knox.gateway.dispatch.PassAllHeadersNoEncodingDispatch"/>
106+
</service>
107+

0 commit comments

Comments
 (0)