Browse Source

AMBARI-4618. Proxy API path has changed from /api/v1/proxy to /proxy (srimanth)

Srimanth Gunturi 11 years ago
parent
commit
f303a4657b

+ 1 - 1
ambari-web/app/controllers/main/jobs_controller.js

@@ -62,7 +62,7 @@ App.MainJobsController = Em.ArrayController.extend({
     if (yarnService != null) {
     if (yarnService != null) {
       this.set('loading', true);
       this.set('loading', true);
       var historyServerHostName = yarnService.get('resourceManagerNode.hostName')
       var historyServerHostName = yarnService.get('resourceManagerNode.hostName')
-      var hiveQueriesUrl = App.testMode ? "/data/jobs/hive-queries.json" : App.apiPrefix + "/proxy?url=http://" + historyServerHostName
+      var hiveQueriesUrl = App.testMode ? "/data/jobs/hive-queries.json" : "/proxy?url=http://" + historyServerHostName
           + ":8188/ws/v1/apptimeline/HIVE_QUERY_ID?fields=events,primaryfilters";
           + ":8188/ws/v1/apptimeline/HIVE_QUERY_ID?fields=events,primaryfilters";
       if (jobsLimit > 0) {
       if (jobsLimit > 0) {
         hiveQueriesUrl += ("?limit=" + jobsLimit);
         hiveQueriesUrl += ("?limit=" + jobsLimit);

+ 8 - 4
ambari-web/app/utils/ajax.js

@@ -1606,15 +1606,18 @@ var urls = {
 
 
   'jobs.tezDag.NametoID': {
   'jobs.tezDag.NametoID': {
     'real': '/proxy?url=http://{historyServerHostName}:8188/ws/v1/apptimeline/TEZ_DAG_ID?primaryFilter=dagName:{tezDagName}',
     'real': '/proxy?url=http://{historyServerHostName}:8188/ws/v1/apptimeline/TEZ_DAG_ID?primaryFilter=dagName:{tezDagName}',
-    'mock': '/data/jobs/tezDag-name-to-id.json'
+    'mock': '/data/jobs/tezDag-name-to-id.json',
+    'apiPrefix': ''
   },
   },
   'jobs.tezDag.tezDagId': {
   'jobs.tezDag.tezDagId': {
     'real': '/proxy?url=http://{historyServerHostName}:8188/ws/v1/apptimeline/TEZ_DAG_ID/{tezDagId}?fields=relatedentities',
     'real': '/proxy?url=http://{historyServerHostName}:8188/ws/v1/apptimeline/TEZ_DAG_ID/{tezDagId}?fields=relatedentities',
-    'mock': '/data/jobs/tezDag.json'
+    'mock': '/data/jobs/tezDag.json',
+    'apiPrefix': ''
   },
   },
   'jobs.tezDag.tezDagVertexId': {
   'jobs.tezDag.tezDagVertexId': {
     'real': '/proxy?url=http://{historyServerHostName}:8188/ws/v1/apptimeline/TEZ_VERTEX_ID/{tezDagVertexId}?fields=otherinfo',
     'real': '/proxy?url=http://{historyServerHostName}:8188/ws/v1/apptimeline/TEZ_VERTEX_ID/{tezDagVertexId}?fields=otherinfo',
-    'mock': '/data/jobs/tezDagVertex.json'
+    'mock': '/data/jobs/tezDagVertex.json',
+    'apiPrefix': ''
   }
   }
 };
 };
 /**
 /**
@@ -1660,7 +1663,8 @@ var formatRequest = function (data) {
     opt.type = 'GET';
     opt.type = 'GET';
   }
   }
   else {
   else {
-    opt.url = App.apiPrefix + formatUrl(this.real, data);
+    var prefix = this.apiPrefix != null ? this.apiPrefix : App.apiPrefix;
+    opt.url = prefix + formatUrl(this.real, data);
   }
   }
 
 
   if (this.format) {
   if (this.format) {

+ 1 - 1
ambari-web/app/utils/jobs.js

@@ -52,7 +52,7 @@ module.exports = {
     var historyServerHostName = App.YARNService.find().objectAt(0).get('resourceManagerNode.hostName')
     var historyServerHostName = App.YARNService.find().objectAt(0).get('resourceManagerNode.hostName')
     var hiveJobId = hiveJob.get('id');
     var hiveJobId = hiveJob.get('id');
     // First refresh query
     // First refresh query
-    var hiveQueriesUrl = App.testMode ? "/data/jobs/hive-query-2.json" : App.apiPrefix + "/proxy?url=http://" + historyServerHostName
+    var hiveQueriesUrl = App.testMode ? "/data/jobs/hive-query-2.json" : "/proxy?url=http://" + historyServerHostName
         + ":8188/ws/v1/apptimeline/HIVE_QUERY_ID/" + hiveJob.get('id') + "?fields=otherinfo";
         + ":8188/ws/v1/apptimeline/HIVE_QUERY_ID/" + hiveJob.get('id') + "?fields=otherinfo";
     App.HttpClient.get(hiveQueriesUrl, App.hiveJobMapper, {
     App.HttpClient.get(hiveQueriesUrl, App.hiveJobMapper, {
       complete : function(jqXHR, textStatus) {
       complete : function(jqXHR, textStatus) {