Skip to content

Commit

Permalink
add commands for flare api for the job components
Browse files Browse the repository at this point in the history
  • Loading branch information
nvkevlu committed Feb 21, 2025
1 parent 272a47f commit c1f83b5
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions nvflare/fuel/flare_api/flare_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,36 @@ def download_job_result(self, job_id: str) -> str:
location = meta.get(MetaKey.LOCATION)
return location

def list_job_components(self, job_id: str) -> List[str]:
"""Get the list of additional job components for the specified job.
Args:
job_id (str): ID of the job
Returns: a list of the additional job components
"""
self._validate_job_id(job_id)
result = self._do_command(AdminCommandNames.LIST_JOB + " " + job_id)
meta = result[ResultKey.META]
job_components_list = meta.get(MetaKey.JOB_COMPONENTS, [])
return job_components_list

def download_job_components(self, job_id: str) -> str:
"""Download additional job components (e.g., ERRORLOG_site-1) for a specified job.
Args:
job_id (str): ID of the job
Returns: folder path to the location of the downloaded additional job components
"""
self._validate_job_id(job_id)
result = self._do_command(AdminCommandNames.DOWNLOAD_JOB_COMPONENTS + " " + job_id)
meta = result[ResultKey.META]
location = meta.get(MetaKey.LOCATION)
return location

def abort_job(self, job_id: str):
"""Abort the specified job.
Expand Down

0 comments on commit c1f83b5

Please sign in to comment.