Quellcode durchsuchen

Revert "AMBARI-10327. Make changes on UI according to changes for GET/PUT hostcomponents API (alexantonenko)"

This reverts commit 05de8adfc7da3cdf9786142920c14bc778c8eca3.
Alex Antonenko vor 10 Jahren
Ursprung
Commit
05b0d0b7e6

+ 2 - 2
ambari-web/app/controllers/main/host.js

@@ -643,7 +643,7 @@ App.MainHostController = Em.ArrayController.extend(App.TableServerMixin, {
         data: {
           query: query,
           HostRoles: {
-            desired_state: operationData.action
+            state: operationData.action
           },
           context: operationData.message,
           hostName: hostNames
@@ -751,7 +751,7 @@ App.MainHostController = Em.ArrayController.extend(App.TableServerMixin, {
           sender: self,
           data: {
             HostRoles: {
-              desired_state: operationData.action
+              state: operationData.action
             },
             query: 'HostRoles/component_name=' + operationData.componentName + '&HostRoles/host_name.in(' + hostsWithComponentInProperState.join(',') + ')&HostRoles/maintenance_state=OFF',
             context: operationData.message + ' ' + operationData.componentNameFormatted,

+ 1 - 1
ambari-web/app/controllers/main/host/add_controller.js

@@ -402,7 +402,7 @@ App.AddHostController = App.WizardController.extend({
       data: {
         "context": Em.I18n.t('requestInfo.installComponents'),
         "query": "HostRoles/host_name.in(" + hostNames.join(',') + ")",
-        "HostRoles": {"desired_state": "INSTALLED"},
+        "HostRoles": {"state": "INSTALLED"},
         "level": "HOST_COMPONENT"
       },
       success: 'installServicesSuccessCallback',

+ 7 - 7
ambari-web/app/controllers/main/host/details.js

@@ -126,7 +126,7 @@ App.MainHostDetailsController = Em.Controller.extend({
       context: context,
       component: component,
       HostRoles: {
-        desired_state: state
+        state: state
       }
     };
     if (Array.isArray(component)) {
@@ -152,11 +152,11 @@ App.MainHostDetailsController = Em.Controller.extend({
    * @method stopComponentSuccessCallback
    */
   sendComponentCommandSuccessCallback: function (data, opt, params) {
-    var running = (params.HostRoles.desired_state === App.HostComponentStatus.stopped) ? App.HostComponentStatus.stopping : App.HostComponentStatus.starting;
+    var running = (params.HostRoles.state === App.HostComponentStatus.stopped) ? App.HostComponentStatus.stopping : App.HostComponentStatus.starting;
     console.log('Send request for ' + running + ' successfully');
     params.component.set('workStatus', running);
     if (App.get('testMode')) {
-      this.mimicWorkStatusChange(params.component, running, params.HostRoles.desired_state);
+      this.mimicWorkStatusChange(params.component, running, params.HostRoles.state);
     }
     this.showBackgroundOperationsPopup();
   },
@@ -380,7 +380,7 @@ App.MainHostDetailsController = Em.Controller.extend({
             Body: {
               HostRoles: {
                 stack_id: 'HDP-1.2.2',
-                desired_state: 'INSTALLED'
+                state: 'INSTALLED'
               }
             }
           })
@@ -1060,7 +1060,7 @@ App.MainHostDetailsController = Em.Controller.extend({
             component: component,
             context: Em.I18n.t('requestInfo.installHostComponent') + " " + displayName,
             HostRoles: {
-              desired_state: 'INSTALLED'
+              state: 'INSTALLED'
             }
           },
           success: 'installComponentSuccessCallback',
@@ -1311,7 +1311,7 @@ App.MainHostDetailsController = Em.Controller.extend({
           },
           "Body": {
             HostRoles: {
-              desired_state: "INSTALLED"
+              state: "INSTALLED"
             }
           }
         }
@@ -1447,7 +1447,7 @@ App.MainHostDetailsController = Em.Controller.extend({
           },
           "Body": {
             HostRoles: {
-              desired_state: "STARTED"
+              state: "STARTED"
             }
           }
         }

+ 1 - 1
ambari-web/app/controllers/main/service/add_controller.js

@@ -578,7 +578,7 @@ App.AddServiceController = App.WizardController.extend(App.AddSecurityConfigs, {
               query: queryStr,
               context: 'Install ' + App.format.role(c.componentName),
               HostRoles: {
-                desired_state: 'INSTALLED'
+                state: 'INSTALLED'
               },
               counter: k,
               deferred: dfd

+ 2 - 2
ambari-web/app/controllers/main/service/reassign/step4_controller.js

@@ -920,7 +920,7 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
         serviceName: "HIVE",
         componentName: "MYSQL_SERVER",
         HostRoles: {
-          desired_state: "STARTED"
+          state: "STARTED"
         }
       },
       success: 'startPolling',
@@ -938,7 +938,7 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
         serviceName: "HIVE",
         componentName: "MYSQL_SERVER",
         HostRoles: {
-          desired_state: "STARTED"
+          state: "STARTED"
         }
       },
       success: 'startPolling',

+ 1 - 1
ambari-web/app/controllers/main/service/reassign/step6_controller.js

@@ -179,7 +179,7 @@ App.ReassignMasterWizardStep6Controller = App.HighAvailabilityProgressPageContro
     data.context = "Stop required services";
     data.hostName = this.get('content.reassignHosts.source');
     data.serviceName = 'HIVE';
-    data.HostRoles = { "desired_state": "INSTALLED" };
+    data.HostRoles = { "state": "INSTALLED" };
     data.componentName = "MYSQL_SERVER";
 
     App.ajax.send({

+ 2 - 2
ambari-web/app/controllers/wizard.js

@@ -334,8 +334,8 @@ App.WizardController = Em.Controller.extend(App.LocalStorage, App.ThemesMappingM
     if (isRetry) {
       data = {
         context: Em.I18n.t('requestInfo.installComponents'),
-        HostRoles: {"desired_state": "INSTALLED"},
-        urlParams: "HostRoles/desired_state=INSTALLED"
+        HostRoles: {"state": "INSTALLED"},
+        urlParams: "HostRoles/state=INSTALLED"
       }
     } else {
       data = {

+ 1 - 1
ambari-web/app/controllers/wizard/step9_controller.js

@@ -477,7 +477,7 @@ App.WizardStep9Controller = Em.Controller.extend(App.ReloadPopupMixin, {
         data = {
           "context": Em.I18n.t("requestInfo.startHostComponents"),
           "query": "HostRoles/component_name.in(" + App.get('components.slaves').join(',') + ")&HostRoles/state=INSTALLED&HostRoles/host_name.in(" + hostnames.join(',') + ")",
-          "HostRoles": { "desired_state": "STARTED"}
+          "HostRoles": { "state": "STARTED"}
         };
         break;
       case 'addServiceController':

+ 1 - 1
ambari-web/app/mixins/main/host/details/host_components/decommissionable.js

@@ -206,7 +206,7 @@ App.Decommissionable = Em.Mixin.create({
   getDecommissionStatusSuccessCallback: function (response) {
     var statusObject = response.ServiceComponentInfo;
     if ( statusObject != null) {
-      statusObject.component_state = response.host_components[0].HostRoles.desired_state;
+      statusObject.component_state = response.host_components[0].HostRoles.state;
       this.setDecommissionStatus(statusObject);
       return statusObject;
     }

+ 1 - 1
ambari-web/app/mixins/wizard/wizardProgressPageController.js

@@ -491,7 +491,7 @@ App.wizardProgressPageControllerMixin = Em.Mixin.create({
       sender: this,
       data: {
         HostRoles: {
-          desired_state: state
+          state: state
         },
         query: 'HostRoles/component_name=' + componentName + '&HostRoles/host_name.in(' + hostName.join(',') + ')&HostRoles/maintenance_state=OFF',
         context: context + " " + App.format.role(componentName),

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

@@ -68,7 +68,7 @@ module.exports = {
         component: params.component,
         "context": Em.I18n.t('requestInfo.installNewHostComponent') + " " + params.component.get('displayName'),
         HostRoles: {
-          desired_state: 'INSTALLED'
+          state: 'INSTALLED'
         },
         urlParams: "HostRoles/state=INIT"
       },

+ 5 - 5
ambari-web/test/controllers/main/host/details_test.js

@@ -110,7 +110,7 @@ describe('App.MainHostDetailsController', function () {
           componentName: 'COMP1'
         }),
         "HostRoles": {
-          "desired_state": "state"
+          "state": "state"
         },
         "componentName": "COMP1",
         "serviceName": "S1"
@@ -145,7 +145,7 @@ describe('App.MainHostDetailsController', function () {
           })
         ],
         "HostRoles": {
-          "desired_state": "state"
+          "state": "state"
         },
         "query": "HostRoles/component_name.in(COMP1,COMP2)"
       });
@@ -165,7 +165,7 @@ describe('App.MainHostDetailsController', function () {
       var params = {
         component: Em.Object.create({}),
         HostRoles: {
-          desired_state: App.HostComponentStatus.started
+          state: App.HostComponentStatus.started
         }
       };
 
@@ -180,7 +180,7 @@ describe('App.MainHostDetailsController', function () {
       var params = {
         component: Em.Object.create({}),
         HostRoles: {
-          desired_state: App.HostComponentStatus.stopped
+          state: App.HostComponentStatus.stopped
         }
       };
 
@@ -195,7 +195,7 @@ describe('App.MainHostDetailsController', function () {
       var params = {
         component: Em.Object.create({}),
         HostRoles: {
-          desired_state: App.HostComponentStatus.stopped
+          state: App.HostComponentStatus.stopped
         }
       };
 

+ 1 - 1
ambari-web/test/controllers/main/service/add_controller_test.js

@@ -44,7 +44,7 @@ describe('App.AddServiceController', function() {
       },
       Body: {
         HostRoles: {
-          desired_state: 'INSTALLED'
+          state: 'INSTALLED'
         }
       }
     };

+ 2 - 2
ambari-web/test/mixins/wizard/wizardProgressPageController_test.js

@@ -96,7 +96,7 @@ describe('App.wizardProgressPageControllerMixin', function() {
       {
         callParams: ['ZOOKEEPER_SERVER', 'host1', 'ZOOKEEPER', 'Install', 1],
         e: [
-          { key: 'data.HostRoles.desired_state', value: 'INSTALLED'},
+          { key: 'data.HostRoles.state', value: 'INSTALLED'},
           { key: 'data.hostName[0]', value: 'host1'},
           { key: 'data.query', value: 'HostRoles/component_name=ZOOKEEPER_SERVER&HostRoles/host_name.in(host1)&HostRoles/maintenance_state=OFF'}
         ]
@@ -104,7 +104,7 @@ describe('App.wizardProgressPageControllerMixin', function() {
       {
         callParams: ['ZOOKEEPER_SERVER', ['host1', 'host2'], 'ZOOKEEPER', 'start', 1],
         e: [
-          { key: 'data.HostRoles.desired_state', value: 'STARTED'},
+          { key: 'data.HostRoles.state', value: 'STARTED'},
           { key: 'data.hostName[0]', value: 'host1'},
           { key: 'data.hostName[1]', value: 'host2'},
           { key: 'data.query', value: 'HostRoles/component_name=ZOOKEEPER_SERVER&HostRoles/host_name.in(host1,host2)&HostRoles/maintenance_state=OFF'}