@@ -341,6 +341,34 @@ def manager_cancel(execution_id, force, kill, logger, client, tenant_name):
341341 "cfy executions get {0}" .format (execution_id ))
342342
343343
344+ @cfy .command (name = 'resume' ,
345+ short_help = 'Resume a workflow execution [manager only]' )
346+ @cfy .argument ('execution-id' )
347+ @cfy .options .common_options
348+ @cfy .options .reset_operations
349+ @cfy .options .tenant_name (required = False , resource_name_for_help = 'execution' )
350+ @cfy .assert_manager_active ()
351+ @cfy .pass_client ()
352+ @cfy .pass_logger
353+ def manager_resume (execution_id , reset_operations , logger , client ,
354+ tenant_name ):
355+ """Resume the execution of a workflow in a failed or cancelled state.
356+
357+ `EXECUTION_ID` is the ID of the execution to resume.
358+ The workflow will run again, restoring the tasks graph from the storage,
359+ and retrying failed tasks when necessary.
360+ If reset-operations is passed, tasks that were started but didn't fail
361+ will be retried as well.
362+ """
363+ utils .explicit_tenant_name_message (tenant_name , logger )
364+ logger .info ('Resuming execution {0}' .format (execution_id ))
365+ client .executions .resume (execution_id , force = reset_operations )
366+ logger .info (
367+ "A resume request for execution {0} has been sent. "
368+ "To track the execution's status, use:\n "
369+ "cfy executions get {0}" .format (execution_id ))
370+
371+
344372@cfy .command (name = 'list' ,
345373 short_help = 'List deployment executions' )
346374@cfy .options .blueprint_id (required = True )
0 commit comments