@@ -657,6 +657,7 @@ void CommandLineParser::SetupSystemCommands() {
657657 auto start_cmd = app_.add_subcommand (" start" , " Start the API server" );
658658 start_cmd->group (kSystemGroup );
659659 cml_data_.port = std::stoi (cml_data_.config .apiServerPort );
660+ start_cmd->add_option (" --host" , cml_data_.server_host , " Server host" );
660661 start_cmd->add_option (" -p, --port" , cml_data_.port , " Server port to listen" );
661662 start_cmd->add_option (" --loglevel" , cml_data_.log_level ,
662663 " Set up log level for server, accepted TRACE, DEBUG, "
@@ -671,10 +672,14 @@ void CommandLineParser::SetupSystemCommands() {
671672 start_cmd->callback ([this ] {
672673 if (std::exchange (executed_, true ))
673674 return ;
674- if (cml_data_.port != stoi (cml_data_.config .apiServerPort )) {
675- CTL_INF (" apiServerPort changed from " << cml_data_.config .apiServerPort
676- << " to " << cml_data_.port );
675+ if (cml_data_.port != stoi (cml_data_.config .apiServerPort ) ||
676+ cml_data_.server_host != cml_data_.config .apiServerHost ) {
677+ CTL_INF (" API server host:port changed from "
678+ << cml_data_.config .apiServerHost << " :"
679+ << cml_data_.config .apiServerPort << " to "
680+ << cml_data_.server_host << " :" << cml_data_.port );
677681 auto config_path = file_manager_utils::GetConfigurationPath ();
682+ cml_data_.config .apiServerHost = cml_data_.server_host ;
678683 cml_data_.config .apiServerPort = std::to_string (cml_data_.port );
679684 auto result =
680685 config_yaml_utils::CortexConfigMgr::GetInstance ().DumpYamlConfig (
0 commit comments