|
34 | 34 | 'NOTE: Executions currently in a "canceling/force-canceling" status ' |
35 | 35 | 'may take a while to change into "cancelled"') |
36 | 36 |
|
37 | | -FULL_EXECUTION_COLUMNS = ['id', 'workflow_id', 'status_display', 'is_dry_run', |
38 | | - 'deployment_id', 'created_at', 'ended_at', |
39 | | - 'error', 'visibility', 'tenant_name', |
40 | | - 'created_by', 'started_at', 'scheduled_for'] |
41 | | -MINIMAL_EXECUTION_COLUMNS = ['id', 'workflow_id', 'status_display', |
42 | | - 'is_dry_run', |
43 | | - 'deployment_id', 'created_at', 'started_at', |
44 | | - 'scheduled_for', 'visibility', 'tenant_name', |
45 | | - 'created_by'] |
| 37 | +BASE_EXECUTION_COLUMNS = ['id', 'workflow_id', 'status_display'] |
| 38 | +LOCAL_EXECUTION_COLUMNS = BASE_EXECUTION_COLUMNS + [ |
| 39 | + 'blueprint_id', 'started_at', 'ended_at', 'error'] |
| 40 | +FULL_EXECUTION_COLUMNS = BASE_EXECUTION_COLUMNS + [ |
| 41 | + 'is_dry_run', 'deployment_id', 'created_at', 'ended_at', 'error', |
| 42 | + 'visibility', 'tenant_name', 'created_by', 'started_at', 'scheduled_for'] |
| 43 | +MINIMAL_EXECUTION_COLUMNS = BASE_EXECUTION_COLUMNS + [ |
| 44 | + 'is_dry_run', 'deployment_id', 'created_at', 'started_at', 'scheduled_for', |
| 45 | + 'visibility', 'tenant_name', 'created_by'] |
46 | 46 | EXECUTION_TABLE_LABELS = {'status_display': 'status'} |
47 | 47 |
|
48 | 48 |
|
@@ -90,7 +90,7 @@ def manager_get(execution_id, logger, client, tenant_name): |
90 | 90 |
|
91 | 91 |
|
92 | 92 | @cfy.command(name='list', |
93 | | - short_help='List deployment executions [manager only]') |
| 93 | + short_help='List deployment executions') |
94 | 94 | @cfy.options.deployment_id(required=False) |
95 | 95 | @cfy.options.include_system_workflows |
96 | 96 | @cfy.options.sort_by() |
@@ -333,6 +333,46 @@ def manager_cancel(execution_id, force, kill, logger, client, tenant_name): |
333 | 333 | "cfy executions get {0}".format(execution_id)) |
334 | 334 |
|
335 | 335 |
|
| 336 | +@cfy.command(name='list', |
| 337 | + short_help='List deployment executions') |
| 338 | +@cfy.options.blueprint_id(required=True) |
| 339 | +@cfy.options.common_options |
| 340 | +@cfy.pass_logger |
| 341 | +def local_list(blueprint_id, logger): |
| 342 | + """Execute a workflow |
| 343 | +
|
| 344 | + `WORKFLOW_ID` is the id of the workflow to execute (e.g. `uninstall`) |
| 345 | + """ |
| 346 | + env = local.load_env(blueprint_id) |
| 347 | + executions = env.storage.get_executions() |
| 348 | + print_data(LOCAL_EXECUTION_COLUMNS, executions, 'Executions:', |
| 349 | + labels=EXECUTION_TABLE_LABELS) |
| 350 | + |
| 351 | + |
| 352 | +@cfy.command(name='get', |
| 353 | + short_help='Retrieve execution information') |
| 354 | +@cfy.argument('execution-id') |
| 355 | +@cfy.options.blueprint_id(required=True) |
| 356 | +@cfy.options.common_options |
| 357 | +@cfy.pass_logger |
| 358 | +def local_get(execution_id, blueprint_id, logger): |
| 359 | + """Retrieve information for a specific execution |
| 360 | +
|
| 361 | + `EXECUTION_ID` is the execution to get information on. |
| 362 | + """ |
| 363 | + env = local.load_env(blueprint_id) |
| 364 | + execution = env.storage.get_execution(execution_id) |
| 365 | + if not execution: |
| 366 | + raise CloudifyCliError('Execution {0} not found'.format(execution_id)) |
| 367 | + columns = LOCAL_EXECUTION_COLUMNS |
| 368 | + if get_global_json_output(): |
| 369 | + columns += ['parameters'] |
| 370 | + print_single(LOCAL_EXECUTION_COLUMNS, execution, 'Execution:', |
| 371 | + labels=EXECUTION_TABLE_LABELS) |
| 372 | + if not get_global_json_output(): |
| 373 | + print_details(execution['parameters'], 'Execution Parameters:') |
| 374 | + |
| 375 | + |
336 | 376 | @cfy.command(name='start', |
337 | 377 | short_help='Execute a workflow') |
338 | 378 | @cfy.argument('workflow-id') |
|
0 commit comments