You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2015/04/02 20:48:06 UTC

ambari git commit: AMBARI-10327. Make changes on UI according to changes for GET/PUT hostcomponents API (alexantonenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk fb92ad29f -> 05de8adfc


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


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/05de8adf
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/05de8adf
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/05de8adf

Branch: refs/heads/trunk
Commit: 05de8adfc7da3cdf9786142920c14bc778c8eca3
Parents: fb92ad2
Author: Alex Antonenko <hi...@gmail.com>
Authored: Thu Apr 2 18:36:10 2015 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Thu Apr 2 21:46:28 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/main/host.js               |  4 ++--
 .../app/controllers/main/host/add_controller.js       |  2 +-
 ambari-web/app/controllers/main/host/details.js       | 14 +++++++-------
 .../app/controllers/main/service/add_controller.js    |  2 +-
 .../main/service/reassign/step4_controller.js         |  4 ++--
 .../main/service/reassign/step6_controller.js         |  2 +-
 ambari-web/app/controllers/wizard.js                  |  4 ++--
 ambari-web/app/controllers/wizard/step9_controller.js |  2 +-
 .../host/details/host_components/decommissionable.js  |  2 +-
 .../app/mixins/wizard/wizardProgressPageController.js |  2 +-
 ambari-web/app/utils/components.js                    |  2 +-
 ambari-web/test/controllers/main/host/details_test.js | 10 +++++-----
 .../controllers/main/service/add_controller_test.js   |  2 +-
 .../wizard/wizardProgressPageController_test.js       |  4 ++--
 14 files changed, 28 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/05de8adf/ambari-web/app/controllers/main/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host.js b/ambari-web/app/controllers/main/host.js
index 9d8f9c4..42ad645 100644
--- a/ambari-web/app/controllers/main/host.js
+++ b/ambari-web/app/controllers/main/host.js
@@ -643,7 +643,7 @@ App.MainHostController = Em.ArrayController.extend(App.TableServerMixin, {
         data: {
           query: query,
           HostRoles: {
-            state: operationData.action
+            desired_state: operationData.action
           },
           context: operationData.message,
           hostName: hostNames
@@ -751,7 +751,7 @@ App.MainHostController = Em.ArrayController.extend(App.TableServerMixin, {
           sender: self,
           data: {
             HostRoles: {
-              state: operationData.action
+              desired_state: operationData.action
             },
             query: 'HostRoles/component_name=' + operationData.componentName + '&HostRoles/host_name.in(' + hostsWithComponentInProperState.join(',') + ')&HostRoles/maintenance_state=OFF',
             context: operationData.message + ' ' + operationData.componentNameFormatted,

http://git-wip-us.apache.org/repos/asf/ambari/blob/05de8adf/ambari-web/app/controllers/main/host/add_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/add_controller.js b/ambari-web/app/controllers/main/host/add_controller.js
index 39e1def..079c86c 100644
--- a/ambari-web/app/controllers/main/host/add_controller.js
+++ b/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": {"state": "INSTALLED"},
+        "HostRoles": {"desired_state": "INSTALLED"},
         "level": "HOST_COMPONENT"
       },
       success: 'installServicesSuccessCallback',

http://git-wip-us.apache.org/repos/asf/ambari/blob/05de8adf/ambari-web/app/controllers/main/host/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js
index 40254d6..b9b4e79 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -126,7 +126,7 @@ App.MainHostDetailsController = Em.Controller.extend({
       context: context,
       component: component,
       HostRoles: {
-        state: state
+        desired_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.state === App.HostComponentStatus.stopped) ? App.HostComponentStatus.stopping : App.HostComponentStatus.starting;
+    var running = (params.HostRoles.desired_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.state);
+      this.mimicWorkStatusChange(params.component, running, params.HostRoles.desired_state);
     }
     this.showBackgroundOperationsPopup();
   },
@@ -380,7 +380,7 @@ App.MainHostDetailsController = Em.Controller.extend({
             Body: {
               HostRoles: {
                 stack_id: 'HDP-1.2.2',
-                state: 'INSTALLED'
+                desired_state: 'INSTALLED'
               }
             }
           })
@@ -1060,7 +1060,7 @@ App.MainHostDetailsController = Em.Controller.extend({
             component: component,
             context: Em.I18n.t('requestInfo.installHostComponent') + " " + displayName,
             HostRoles: {
-              state: 'INSTALLED'
+              desired_state: 'INSTALLED'
             }
           },
           success: 'installComponentSuccessCallback',
@@ -1311,7 +1311,7 @@ App.MainHostDetailsController = Em.Controller.extend({
           },
           "Body": {
             HostRoles: {
-              state: "INSTALLED"
+              desired_state: "INSTALLED"
             }
           }
         }
@@ -1447,7 +1447,7 @@ App.MainHostDetailsController = Em.Controller.extend({
           },
           "Body": {
             HostRoles: {
-              state: "STARTED"
+              desired_state: "STARTED"
             }
           }
         }

http://git-wip-us.apache.org/repos/asf/ambari/blob/05de8adf/ambari-web/app/controllers/main/service/add_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/add_controller.js b/ambari-web/app/controllers/main/service/add_controller.js
index d3d3a37..f7322d5 100644
--- a/ambari-web/app/controllers/main/service/add_controller.js
+++ b/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: {
-                state: 'INSTALLED'
+                desired_state: 'INSTALLED'
               },
               counter: k,
               deferred: dfd

http://git-wip-us.apache.org/repos/asf/ambari/blob/05de8adf/ambari-web/app/controllers/main/service/reassign/step4_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/reassign/step4_controller.js b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
index d9ec6d2..78615c8 100644
--- a/ambari-web/app/controllers/main/service/reassign/step4_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
@@ -920,7 +920,7 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
         serviceName: "HIVE",
         componentName: "MYSQL_SERVER",
         HostRoles: {
-          state: "STARTED"
+          desired_state: "STARTED"
         }
       },
       success: 'startPolling',
@@ -938,7 +938,7 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
         serviceName: "HIVE",
         componentName: "MYSQL_SERVER",
         HostRoles: {
-          state: "STARTED"
+          desired_state: "STARTED"
         }
       },
       success: 'startPolling',

http://git-wip-us.apache.org/repos/asf/ambari/blob/05de8adf/ambari-web/app/controllers/main/service/reassign/step6_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/reassign/step6_controller.js b/ambari-web/app/controllers/main/service/reassign/step6_controller.js
index e3cdab7..36f3699 100644
--- a/ambari-web/app/controllers/main/service/reassign/step6_controller.js
+++ b/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 = { "state": "INSTALLED" };
+    data.HostRoles = { "desired_state": "INSTALLED" };
     data.componentName = "MYSQL_SERVER";
 
     App.ajax.send({

http://git-wip-us.apache.org/repos/asf/ambari/blob/05de8adf/ambari-web/app/controllers/wizard.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard.js b/ambari-web/app/controllers/wizard.js
index 0c54fa2..5e323f0 100644
--- a/ambari-web/app/controllers/wizard.js
+++ b/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: {"state": "INSTALLED"},
-        urlParams: "HostRoles/state=INSTALLED"
+        HostRoles: {"desired_state": "INSTALLED"},
+        urlParams: "HostRoles/desired_state=INSTALLED"
       }
     } else {
       data = {

http://git-wip-us.apache.org/repos/asf/ambari/blob/05de8adf/ambari-web/app/controllers/wizard/step9_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step9_controller.js b/ambari-web/app/controllers/wizard/step9_controller.js
index 4422f3f..54a1fa6 100644
--- a/ambari-web/app/controllers/wizard/step9_controller.js
+++ b/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": { "state": "STARTED"}
+          "HostRoles": { "desired_state": "STARTED"}
         };
         break;
       case 'addServiceController':

http://git-wip-us.apache.org/repos/asf/ambari/blob/05de8adf/ambari-web/app/mixins/main/host/details/host_components/decommissionable.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/main/host/details/host_components/decommissionable.js b/ambari-web/app/mixins/main/host/details/host_components/decommissionable.js
index 2a597b2..328153b 100644
--- a/ambari-web/app/mixins/main/host/details/host_components/decommissionable.js
+++ b/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.state;
+      statusObject.component_state = response.host_components[0].HostRoles.desired_state;
       this.setDecommissionStatus(statusObject);
       return statusObject;
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/05de8adf/ambari-web/app/mixins/wizard/wizardProgressPageController.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/wizard/wizardProgressPageController.js b/ambari-web/app/mixins/wizard/wizardProgressPageController.js
index 74e83cd..3801b42 100644
--- a/ambari-web/app/mixins/wizard/wizardProgressPageController.js
+++ b/ambari-web/app/mixins/wizard/wizardProgressPageController.js
@@ -491,7 +491,7 @@ App.wizardProgressPageControllerMixin = Em.Mixin.create({
       sender: this,
       data: {
         HostRoles: {
-          state: state
+          desired_state: state
         },
         query: 'HostRoles/component_name=' + componentName + '&HostRoles/host_name.in(' + hostName.join(',') + ')&HostRoles/maintenance_state=OFF',
         context: context + " " + App.format.role(componentName),

http://git-wip-us.apache.org/repos/asf/ambari/blob/05de8adf/ambari-web/app/utils/components.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/components.js b/ambari-web/app/utils/components.js
index 6264895..4b7830a 100644
--- a/ambari-web/app/utils/components.js
+++ b/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: {
-          state: 'INSTALLED'
+          desired_state: 'INSTALLED'
         },
         urlParams: "HostRoles/state=INIT"
       },

http://git-wip-us.apache.org/repos/asf/ambari/blob/05de8adf/ambari-web/test/controllers/main/host/details_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/host/details_test.js b/ambari-web/test/controllers/main/host/details_test.js
index 5a383a3..23d569f 100644
--- a/ambari-web/test/controllers/main/host/details_test.js
+++ b/ambari-web/test/controllers/main/host/details_test.js
@@ -110,7 +110,7 @@ describe('App.MainHostDetailsController', function () {
           componentName: 'COMP1'
         }),
         "HostRoles": {
-          "state": "state"
+          "desired_state": "state"
         },
         "componentName": "COMP1",
         "serviceName": "S1"
@@ -145,7 +145,7 @@ describe('App.MainHostDetailsController', function () {
           })
         ],
         "HostRoles": {
-          "state": "state"
+          "desired_state": "state"
         },
         "query": "HostRoles/component_name.in(COMP1,COMP2)"
       });
@@ -165,7 +165,7 @@ describe('App.MainHostDetailsController', function () {
       var params = {
         component: Em.Object.create({}),
         HostRoles: {
-          state: App.HostComponentStatus.started
+          desired_state: App.HostComponentStatus.started
         }
       };
 
@@ -180,7 +180,7 @@ describe('App.MainHostDetailsController', function () {
       var params = {
         component: Em.Object.create({}),
         HostRoles: {
-          state: App.HostComponentStatus.stopped
+          desired_state: App.HostComponentStatus.stopped
         }
       };
 
@@ -195,7 +195,7 @@ describe('App.MainHostDetailsController', function () {
       var params = {
         component: Em.Object.create({}),
         HostRoles: {
-          state: App.HostComponentStatus.stopped
+          desired_state: App.HostComponentStatus.stopped
         }
       };
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/05de8adf/ambari-web/test/controllers/main/service/add_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/service/add_controller_test.js b/ambari-web/test/controllers/main/service/add_controller_test.js
index 79b0f21..72b6580 100644
--- a/ambari-web/test/controllers/main/service/add_controller_test.js
+++ b/ambari-web/test/controllers/main/service/add_controller_test.js
@@ -44,7 +44,7 @@ describe('App.AddServiceController', function() {
       },
       Body: {
         HostRoles: {
-          state: 'INSTALLED'
+          desired_state: 'INSTALLED'
         }
       }
     };

http://git-wip-us.apache.org/repos/asf/ambari/blob/05de8adf/ambari-web/test/mixins/wizard/wizardProgressPageController_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mixins/wizard/wizardProgressPageController_test.js b/ambari-web/test/mixins/wizard/wizardProgressPageController_test.js
index d72b3f6..eeda52e 100644
--- a/ambari-web/test/mixins/wizard/wizardProgressPageController_test.js
+++ b/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.state', value: 'INSTALLED'},
+          { key: 'data.HostRoles.desired_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.state', value: 'STARTED'},
+          { key: 'data.HostRoles.desired_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'}