This is an automated email from the ASF dual-hosted git repository.

arshad pushed a commit to branch frontend-refactor
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/frontend-refactor by this push:
     new 39138bec8b AMBARI:-26574: Ambari Web React: Component actions for 
masters/slaves - Re-Install (#4106)
39138bec8b is described below

commit 39138bec8bff7161ea56a1c4375910b680e94e6c
Author: Sandeep  Kumar <[email protected]>
AuthorDate: Mon Feb 2 10:18:42 2026 +0530

    AMBARI:-26574: Ambari Web React: Component actions for masters/slaves - 
Re-Install (#4106)
---
 .../latest/src/screens/Hosts/HostSummary.tsx       | 25 ++++++++++++-
 ambari-web/latest/src/screens/Hosts/actions.tsx    | 43 +++++++++++++++++++++-
 2 files changed, 65 insertions(+), 3 deletions(-)

diff --git a/ambari-web/latest/src/screens/Hosts/HostSummary.tsx 
b/ambari-web/latest/src/screens/Hosts/HostSummary.tsx
index a5dd2e7109..a99ef44d57 100644
--- a/ambari-web/latest/src/screens/Hosts/HostSummary.tsx
+++ b/ambari-web/latest/src/screens/Hosts/HostSummary.tsx
@@ -87,6 +87,7 @@ import {
   stopComponent,
   executeCustomCommand,
   installClients,
+  installComponent,
 } from "./actions";
 import { AppContext } from "../../store/context";
 import IHost from "../../models/host";
@@ -731,7 +732,17 @@ export default function HostsSummary({
                     <div
                         key="re-install-failed"
                         onClick={() => {
-                            //TODO: Will be implemented in future PR
+                        const data = {
+                          // getKDCSessionState, // TODO: will be added in 
future PR
+                        };
+                        setSelectedActionData(
+                          component,
+                          "install",
+                          false,
+                          installComponent,
+                          data
+                        );
+                        setShowConfirmationModal(true);
                         }}
                     >
                         Re-Install
@@ -784,7 +795,17 @@ export default function HostsSummary({
             <div
               key="re-install-init"
               onClick={() => {
-                //TODO: Will be implemented in future PR
+                const data = {
+                  // getKDCSessionState, TODO: will be added in future PR
+                };
+                setSelectedActionData(
+                  component,
+                  "install",
+                  false,
+                  installComponent,
+                  data
+                );
+                setShowConfirmationModal(true);
               }}
             >
               Re-Install
diff --git a/ambari-web/latest/src/screens/Hosts/actions.tsx 
b/ambari-web/latest/src/screens/Hosts/actions.tsx
index 86f95ddfe8..9781b7f3ed 100644
--- a/ambari-web/latest/src/screens/Hosts/actions.tsx
+++ b/ambari-web/latest/src/screens/Hosts/actions.tsx
@@ -29,7 +29,7 @@ import {
   showRegionServerWarning,
 } from "./utils";
 import { ComponentStatus } from "./enums";
-import { defaultSuccessCallback, restartHostComponents } from "./batchUtils";
+import { defaultSuccessCallback, defaultSuccessCallbackWithoutReload, 
restartHostComponents } from "./batchUtils";
 import modalManager from "../../store/ModalManager";
 import { nnCheckpointAgeAlertThreshold } from 
"../../data/configs/services/config";
 import { IHostComponent } from "../../models/hostComponent";
@@ -622,4 +622,45 @@ export const installClients = async (
     .replace("{1}", get(component, "hostName"));
 
   restartHostComponents([component], message, "HOST");
+};
+export const installComponent = async (
+  component: IHostComponent,
+  data: any
+) => {
+  const clusterName = get(component, "clusterName");
+  const hostName = get(component, "hostName");
+  const displayName = get(component, "displayName");
+  const serviceName = get(component, "serviceName");
+  const componentName = get(component, "componentName");
+
+  await data.getKDCSessionState(async () => {
+    const urlParams = "";
+
+    const data = JSON.stringify({
+      RequestInfo: {
+        context:
+          translate("requestInfo.installHostComponent") + " " + displayName,
+        operation_level: {
+          level: "HOST_COMPONENT",
+          cluster_name: clusterName,
+          host_name: hostName,
+          service_name: serviceName || null,
+        },
+      },
+      Body: {
+        HostRoles: {
+          state: "INSTALLED",
+        },
+      },
+    });
+    const response = await HostsApi.commonHostHostComponentUpdate(
+      clusterName,
+      hostName,
+      componentName,
+      urlParams,
+      data
+    );
+    const requestId = get(response, "Requests.id", -1);
+    defaultSuccessCallbackWithoutReload(requestId);
+  });
 };
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to