File tree Expand file tree Collapse file tree
ambari-web/latest/src/screens/Hosts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ import {
8686 startComponent ,
8787 stopComponent ,
8888 executeCustomCommand ,
89+ refreshComponentConfigs
8990} from "./actions" ;
9091import { AppContext } from "../../store/context" ;
9192import 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
Original file line number Diff line number Diff 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+ } ;
You can’t perform that action at this time.
0 commit comments