ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject ambari git commit: AMBARI-22699. Update FE to initiate regenerate keytab file operations for a service and a host (alexantonenko)
Date Wed, 27 Dec 2017 14:06:46 GMT
Repository: ambari
Updated Branches:
  refs/heads/AMBARI-22699 [created] 7a8747584


AMBARI-22699. Update FE to initiate regenerate keytab file operations for a service and a
host (alexantonenko)


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

Branch: refs/heads/AMBARI-22699
Commit: 7a874758495c196722e2c4604f8cac6249f3beeb
Parents: 935ea92
Author: Alex Antonenko <aantonenko@hortonworks.com>
Authored: Wed Dec 27 17:05:56 2017 +0300
Committer: Alex Antonenko <aantonenko@hortonworks.com>
Committed: Wed Dec 27 17:05:56 2017 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/main/host/details.js | 32 +++++++++++++++++++-
 ambari-web/app/controllers/main/service/item.js | 25 +++++++++++++++
 ambari-web/app/messages.js                      |  6 ++++
 ambari-web/app/models/host_component.js         |  6 ++++
 ambari-web/app/utils/ajax/ajax.js               | 30 ++++++++++++++++++
 ambari-web/app/views/main/host/details.js       |  4 +++
 ambari-web/app/views/main/service/item.js       |  4 +++
 7 files changed, 106 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7a874758/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 25a27b1..5e1cac7 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -2305,6 +2305,9 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
       case "checkHost":
         this.runHostCheckConfirmation();
         break;
+      case "regenerateKeytabFileOperations":
+        this.regenerateKeytabFileOperations();
+        break;
     }
   },
 
@@ -3241,6 +3244,33 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
         }
       });
     }
-  }
+  },
+
+
+  regenerateKeytabFileOperations: function () {
+    var self = this;
+    var hostName = this.content.get('hostName');
+    var clusterName = App.get('clusterName');
+    return App.showConfirmationPopup(function() {
+      return App.ajax.send({
+        name: "admin.kerberos_security.regenerate_keytabs.host",
+        sender: self,
+        data: {
+          clusterName: clusterName,
+          hostName: hostName
+        },
+        success: 'regenerateKeytabFileOperationsSuccess',
+        error: 'regenerateKeytabFileOperationsError'
+      });
+    }, Em.I18n.t('question.sure.regenerateKeytab.host').format(hostName));
+  },
+
+  regenerateKeytabFileOperationsSuccess: function(){
+    App.showAlertPopup(Em.I18n.t('common.success'), Em.I18n.t('alerts.notifications.regenerateKeytab.host.success').format(this.content.get('hostName')));
+  },
+
+  regenerateKeytabFileOperationsError: function () {
+    App.showAlertPopup(Em.I18n.t('common.error'), Em.I18n.t('alerts.notifications.regenerateKeytab.host.error').format(this.content.get('hostName')));
+  },
 
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/7a874758/ambari-web/app/controllers/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/item.js b/ambari-web/app/controllers/main/service/item.js
index 4f53391..34dfa58 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -780,6 +780,31 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
     App.showAlertPopup(Em.I18n.t('services.service.actions.run.rebalanceHdfsNodes.error'),
error);
   },
 
+  regenerateKeytabFileOperations: function () {
+    var self = this;
+    var serviceName = this.content.get('serviceName');
+    var clusterName = App.get('clusterName');
+    return App.showConfirmationPopup(function() {
+      return App.ajax.send({
+        name: "admin.kerberos_security.regenerate_keytabs.service",
+        sender: self,
+        data: {
+          clusterName: clusterName,
+          serviceName: serviceName
+        },
+        success: 'regenerateKeytabFileOperationsSuccess',
+        error: 'regenerateKeytabFileOperationsError'
+      });
+    }, Em.I18n.t('question.sure.regenerateKeytab.service').format(serviceName));
+  },
+
+  regenerateKeytabFileOperationsSuccess: function(){
+    App.showAlertPopup(Em.I18n.t('common.success'), Em.I18n.t('alerts.notifications.regenerateKeytab.service.success').format(this.content.get('serviceName')));
+  },
+
+  regenerateKeytabFileOperationsError: function () {
+    App.showAlertPopup(Em.I18n.t('common.error'), Em.I18n.t('alerts.notifications.regenerateKeytab.service.error').format(this.content.get('serviceName')));
+  },
   /**
    * On click callback for <code>run compaction</code> button
    * @param event

http://git-wip-us.apache.org/repos/asf/ambari/blob/7a874758/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index f570608..4d94934 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -439,6 +439,8 @@ Em.I18n.translations = {
   'question.sure.startAll':'Are you sure you want to start all the components?',
   'question.sure.stopAll':'Are you sure you want to stop all the components?',
   'question.sure.restartAll':'Are you sure you want to restart all the components?',
+  'question.sure.regenerateKeytab.service': 'Are you sure you want to regenerate keytab file
operations for a {0} service?',
+  'question.sure.regenerateKeytab.host': 'Are you sure you want to regenerate keytab file
operations for a {0} host?',
 
   'popup.highlight':'click to highlight',
   'popup.confirmation.commonHeader':'Confirmation',
@@ -1192,6 +1194,10 @@ Em.I18n.translations = {
   'alerts.notifications.addCustomPropertyPopup.header': 'Add Property',
   'alerts.notifications.addCustomPropertyPopup.error.propertyExists': 'Custom Property with
current name already exists',
   'alerts.notifications.addCustomPropertyPopup.error.invalidPropertyName': 'Property name
can only contain letters, numbers or . -_* characters',
+  'alerts.notifications.regenerateKeytab.service.success' : 'Keytabs for {0} service were
successfully regenerated',
+  'alerts.notifications.regenerateKeytab.host.success' : 'Keytabs for {0} host were successfully
regenerated',
+  'alerts.notifications.regenerateKeytab.service.error' : 'Keytabs for {0} service could
not be regenerated',
+  'alerts.notifications.regenerateKeytab.host.error' : 'Keytabs for {0} host could not be
regenerated',
 
 
   'wizard.progressPage.notice.completed':'Please proceed to the next step.',

http://git-wip-us.apache.org/repos/asf/ambari/blob/7a874758/ambari-web/app/models/host_component.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/host_component.js b/ambari-web/app/models/host_component.js
index cdcf991..19eb085 100644
--- a/ambari-web/app/models/host_component.js
+++ b/ambari-web/app/models/host_component.js
@@ -311,6 +311,12 @@ App.HostComponentActionMap = {
         cssClass: 'glyphicon glyphicon-refresh',
         disabled: false
       },
+      REGENERATE_KEYTAB_FILE_OPERATIONS: {
+        action: 'regenerateKeytabFileOperations',
+        label: Em.I18n.t('admin.kerberos.button.regenerateKeytabs'),
+        cssClass: 'glyphicon glyphicon-repeat',
+        isHidden: !App.get('isKerberosEnabled')
+      },
       REFRESHQUEUES: {
         action: 'refreshYarnQueues',
         customCommand: 'REFRESHQUEUES',

http://git-wip-us.apache.org/repos/asf/ambari/blob/7a874758/ambari-web/app/utils/ajax/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index 483be5e..10e62d1 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -1911,6 +1911,36 @@ var urls = {
     }
   },
 
+  'admin.kerberos_security.regenerate_keytabs.service' : {
+    'real': '/clusters/{clusterName}?regenerate_keytabs=all&regenerate_components={serviceName}',
+    'mock': '',
+    'type': 'PUT',
+    'format': function (data) {
+      return {
+        data: JSON.stringify({
+          "Clusters" : {
+            "security_type" : "KERBEROS"
+          }
+        })
+      }
+    }
+  },
+
+  'admin.kerberos_security.regenerate_keytabs.host' : {
+    'real': '/clusters/{clusterName}?regenerate_keytabs=all&regenerate_hosts={hostName}',
+    'mock': '',
+    'type': 'PUT',
+    'format': function (data) {
+      return {
+        data: JSON.stringify({
+          "Clusters" : {
+            "security_type" : "KERBEROS"
+          }
+        })
+      }
+    }
+  },
+
   'wizard.step1.post_version_definition_file.xml': {
     'real': '/version_definitions?dry_run=true',
     'mock': '',

http://git-wip-us.apache.org/repos/asf/ambari/blob/7a874758/ambari-web/app/views/main/host/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host/details.js b/ambari-web/app/views/main/host/details.js
index 54e3a76..2cf4f42 100644
--- a/ambari-web/app/views/main/host/details.js
+++ b/ambari-web/app/views/main/host/details.js
@@ -80,6 +80,10 @@ App.MainHostDetailsView = Em.View.extend({
         label: this.t('passiveState.turn' + onOff)
       });
     }
+    if (App.get('isKerberosEnabled')){
+      var actionMap = App.HostComponentActionMap.getMap(this);
+      result.push(actionMap.REGENERATE_KEYTAB_FILE_OPERATIONS);
+    }    
     if (App.isAuthorized("HOST.ADD_DELETE_HOSTS")) {
       result.push({
         action: 'deleteHost',

http://git-wip-us.apache.org/repos/asf/ambari/blob/7a874758/ambari-web/app/views/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/item.js b/ambari-web/app/views/main/service/item.js
index 945dc8f..72e5e39 100644
--- a/ambari-web/app/views/main/service/item.js
+++ b/ambari-web/app/views/main/service/item.js
@@ -259,6 +259,10 @@ App.MainServiceItemView = Em.View.extend({
        });
       }
 
+      if (App.get('isKerberosEnabled')){
+        options.push(actionMap.REGENERATE_KEYTAB_FILE_OPERATIONS);
+      }
+
       allMasters.forEach(function(master) {
         var component = App.StackServiceComponent.find(master);
         var commands = component.get('customCommands');


Mime
View raw message