@@ -373,29 +373,37 @@ def process_batches_in_parallel(
373373
374374 raise
375375
376- def backup_workspaces (self , path_to_csv : str ) -> None :
376+ def backup_workspaces (
377+ self , path_to_csv : str | None , workspace_ids : list [str ] | None
378+ ) -> None :
377379 """Runs the backup process for a list of workspace IDs.
378380
379- Will read the list of workspace IDs from a CSV file and create backup for
380- each workspace in storage specified in the configuration.
381+ Will take the list of workspace IDs or read the list of
382+ workspace IDs from a CSV file and create backup for each
383+ workspace in storage specified in the configuration.
381384
382385 Args:
383386 path_to_csv (str): Path to a CSV file containing a list of workspace IDs.
387+ workspace_ids (list[str]): List of workspace IDs
384388 """
385- self .backup (InputType .LIST_OF_WORKSPACES , path_to_csv )
389+ self .backup (InputType .LIST_OF_WORKSPACES , path_to_csv , workspace_ids )
386390
387- def backup_hierarchies (self , path_to_csv : str ) -> None :
391+ def backup_hierarchies (
392+ self , path_to_csv : str | None , workspace_ids : list [str ] | None
393+ ) -> None :
388394 """Runs the backup process for a list of hierarchies.
389395
390- Will read the list of workspace IDs from a CSV file and create backup for
391- each those workspaces' hierarchies in storage specified in the configuration.
396+ Will take the list of workspace IDs or read the list of workspace IDs
397+ from a CSV file and create backup for each those workspaces' hierarchies
398+ in storage specified in the configuration.
392399 Workspace hierarchy means the workspace itself and all its direct and
393400 indirect children.
394401
395402 Args:
396403 path_to_csv (str): Path to a CSV file containing a list of workspace IDs.
404+ workspace_ids (list[str]): List of workspace IDs
397405 """
398- self .backup (InputType .HIERARCHY , path_to_csv )
406+ self .backup (InputType .HIERARCHY , path_to_csv , workspace_ids )
399407
400408 def backup_entire_organization (self ) -> None :
401409 """Runs the backup process for the entire organization.
@@ -406,12 +414,17 @@ def backup_entire_organization(self) -> None:
406414 self .backup (InputType .ORGANIZATION )
407415
408416 def backup (
409- self , input_type : InputType , path_to_csv : str | None = None
417+ self ,
418+ input_type : InputType ,
419+ path_to_csv : str | None = None ,
420+ workspace_ids : list [str ] | None = None ,
410421 ) -> None :
411422 """Runs the backup process with selected input type."""
412423 try :
413424 workspaces_to_export : list [str ] = self .loader .get_ids_to_backup (
414- input_type , path_to_csv
425+ input_type ,
426+ path_to_csv ,
427+ workspace_ids ,
415428 )
416429 batches = self .split_to_batches (
417430 workspaces_to_export , self .config .batch_size
0 commit comments