Skip to content

Commit afbc591

Browse files
committed
AMBARI:-26579: Ambari Web React: Component actions for masters/slaves - Refresh configs
1 parent fcf4c1a commit afbc591

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

ambari-web/latest/src/screens/Hosts/HostSummary.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ import {
8686
startComponent,
8787
stopComponent,
8888
executeCustomCommand,
89+
refreshComponentConfigs
8990
} from "./actions";
9091
import { AppContext } from "../../store/context";
9192
import IHost from "../../models/host";
@@ -790,7 +791,13 @@ export default function HostsSummary({
790791
<div
791792
key="refresh-component-configs"
792793
onClick={() => {
793-
//TODO: Will be implemented in future PR
794+
setSelectedActionData(
795+
component,
796+
"refresh",
797+
false,
798+
refreshComponentConfigs
799+
);
800+
setShowConfirmationModal(true);
794801
}}
795802
>
796803
Refresh configs

ambari-web/latest/src/screens/Hosts/actions.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,3 +405,27 @@ const executeCustomCommandErrorCallback = (error: any) => {
405405
error.message
406406
);
407407
};
408+
409+
export const refreshComponentConfigs = async (component: IHostComponent) => {
410+
const clusterName = get(component, "clusterName", "");
411+
const context = t("requestInfo.refreshComponentConfigs").replace(
412+
"{0}",
413+
getComponentDisplayName(component)
414+
);
415+
const resource_filters = [
416+
{
417+
service_name: get(component, "serviceName"),
418+
component_name: getComponentName(component),
419+
hosts: get(component, "hostName"),
420+
},
421+
];
422+
const data = JSON.stringify({
423+
RequestInfo: {
424+
command: "CONFIGURE",
425+
context: context,
426+
},
427+
"Requests/resource_filters": resource_filters,
428+
});
429+
430+
await HostsApi.clusterRequests(clusterName, data);
431+
};

0 commit comments

Comments
 (0)