@@ -51,7 +51,7 @@ def start(platform: str, create_run_result: FedMLRunStartedModel, device_server:
5151
5252 run_start_result = FedMLRunManager .get_instance ().start_run (platform = platform , create_run_result = create_run_result ,
5353 device_server = device_server , device_edges = device_edges ,
54- api_key = api_key ,
54+ api_key = get_api_key () ,
5555 feature_entry_point = feature_entry_point )
5656
5757 return run_start_result
@@ -79,7 +79,7 @@ def status(run_name: Optional[str], run_id: str, platform: str, api_key: str) ->
7979 _authenticate_and_validate_platform (api_key , platform )
8080
8181 run_status = None
82- run_list_obj = list_run (run_name = run_name , run_id = run_id , platform = platform , api_key = api_key )
82+ run_list_obj = list_run (run_name = run_name , run_id = run_id , platform = platform , api_key = get_api_key () )
8383
8484 if run_list_obj is not None :
8585 if len (run_list_obj .run_list ) > 1 :
@@ -93,12 +93,13 @@ def status(run_name: Optional[str], run_id: str, platform: str, api_key: str) ->
9393# input: run_id, page_num, page_size, need_all_logs, platform, api_key
9494# return RunLogResult(run_status, total_log_lines, total_log_pages, log_line_list, run_logs)
9595def logs (run_id : str , page_num : int , page_size : int , need_all_logs : bool , platform : str , api_key : str ) -> RunLogResult :
96- _authenticate_and_validate_platform (api_key , platform )
96+ api_key = authenticate (api_key )
97+ validate_platform (platform )
9798
9899 if run_id is None :
99100 raise Exception ("Please specify run id." )
100101
101- _ , run_status = status (run_name = None , run_id = run_id , platform = platform , api_key = get_api_key () )
102+ _ , run_status = status (run_name = None , run_id = run_id , platform = platform , api_key = api_key )
102103
103104 total_log_nums , total_log_pages , log_line_list , run_logs = 0 , 0 , list (), None
104105
@@ -110,7 +111,7 @@ def logs(run_id: str, page_num: int, page_size: int, need_all_logs: bool, platfo
110111 user_api_key = api_key )
111112
112113 if run_logs is not None :
113- total_log_pages , total_log_nums = run_logs .total_num , run_logs .total_pages
114+ total_log_pages , total_log_nums = run_logs .total_pages , run_logs .total_num
114115 _parse_logs (log_line_list , run_logs )
115116
116117 return RunLogResult (run_status = run_status , total_log_lines = total_log_nums , total_log_pages = total_log_pages ,
0 commit comments