diff --git a/nvflare/apis/fl_constant.py b/nvflare/apis/fl_constant.py index 7fcf10fbfe..aa2ed632ba 100644 --- a/nvflare/apis/fl_constant.py +++ b/nvflare/apis/fl_constant.py @@ -213,7 +213,7 @@ class AdminCommandNames(object): SUBMIT_JOB = "submit_job" LIST_JOBS = "list_jobs" GET_JOB_META = "get_job_meta" - LIST_JOB_COMPONENTS = "list_job_components" + LIST_JOB = "list_job" DOWNLOAD_JOB = "download_job" DOWNLOAD_JOB_COMPONENTS = "download_job_components" DOWNLOAD_JOB_FILE = "download_job_file" diff --git a/nvflare/apis/impl/job_def_manager.py b/nvflare/apis/impl/job_def_manager.py index 1505ad2e1d..674bf764ab 100644 --- a/nvflare/apis/impl/job_def_manager.py +++ b/nvflare/apis/impl/job_def_manager.py @@ -250,10 +250,10 @@ def get_client_data(self, jid: str, client_name: str, data_type: str, fl_ctx: FL except StorageException: return None - def list_client_data(self, jid: str, fl_ctx: FLContext): + def list_components(self, jid: str, fl_ctx: FLContext): store = self._get_job_store(fl_ctx) self.log_debug( - fl_ctx, f"list_client_data called for {jid}: {store.list_components_of_object(self.job_uri(jid))}" + fl_ctx, f"list_components called for {jid}: {store.list_components_of_object(self.job_uri(jid))}" ) return store.list_components_of_object(self.job_uri(jid)) diff --git a/nvflare/apis/job_def_manager_spec.py b/nvflare/apis/job_def_manager_spec.py index 07bf43d461..db63f71fa1 100644 --- a/nvflare/apis/job_def_manager_spec.py +++ b/nvflare/apis/job_def_manager_spec.py @@ -153,15 +153,15 @@ def get_client_data(self, jid: str, client_name: str, data_type: str, fl_ctx: FL pass @abstractmethod - def list_client_data(self, jid: str, fl_ctx: FLContext): - """Get list of all the client data for the specified job. + def list_components(self, jid: str, fl_ctx: FLContext): + """Get list of all the components for the specified job. Args: jid (str): Job ID fl_ctx (FLContext): FLContext information Returns: - data content + list of components """ pass diff --git a/nvflare/private/fed/server/job_cmds.py b/nvflare/private/fed/server/job_cmds.py index 8442cee8c1..b47ba15b9f 100644 --- a/nvflare/private/fed/server/job_cmds.py +++ b/nvflare/private/fed/server/job_cmds.py @@ -114,9 +114,9 @@ def get_spec(self): authz_func=self.authorize_job, ), CommandSpec( - name=AdminCommandNames.LIST_JOB_COMPONENTS, - description="get additional components of specified job", - usage=f"{AdminCommandNames.LIST_JOB_COMPONENTS} job_id", + name=AdminCommandNames.LIST_JOB, + description="list additional components of specified job", + usage=f"{AdminCommandNames.LIST_JOB} job_id", handler_func=self.list_job_components, authz_func=self.authorize_job, ), @@ -448,16 +448,15 @@ def list_job_components(self, conn: Connection, args: List[str]): f"job_def_manager in engine is not of type JobDefManagerSpec, but got {type(job_def_manager)}" ) with engine.new_context() as fl_ctx: - list_of_data = job_def_manager.list_client_data(jid=job_id, fl_ctx=fl_ctx) + list_of_data = job_def_manager.list_components(jid=job_id, fl_ctx=fl_ctx) if list_of_data: - filtered_data = [ - item for item in list_of_data if item not in {"workspace", "meta", "scheduled", "data"} - ] + system_components = {"workspace", "meta", "scheduled", "data"} + filtered_data = [item for item in list_of_data if item not in system_components] if filtered_data: data_str = ", ".join(filtered_data) conn.append_string(data_str) else: - conn.append_string("No client error logs found.") + conn.append_string("No additional job components found.") else: conn.append_error( f"job {job_id} does not exist", meta=make_meta(MetaStatusValue.INVALID_JOB_ID, job_id) @@ -721,7 +720,7 @@ def download_job_components(self, conn: Connection, args: List[str]): job_download_dir = self.tx_path(conn, tx_id) # absolute path of the job download dir. with engine.new_context() as fl_ctx: try: - list_of_data = job_def_manager.list_client_data(jid=job_id, fl_ctx=fl_ctx) + list_of_data = job_def_manager.list_components(jid=job_id, fl_ctx=fl_ctx) if list_of_data: job_components = [ item for item in list_of_data if item not in {"workspace", "meta", "scheduled", "data"}