@@ -22,7 +22,7 @@ def _log_object(self, instance):
2222 if instance is None :
2323 self .logger .warning ("Not found" )
2424 return
25-
25+
2626 json_formatted_str = json .dumps (instance , indent = 4 )
2727 print (json_formatted_str )
2828
@@ -54,25 +54,29 @@ def execute(self, name, project_id):
5454
5555 return workflow
5656
57+
5758class CreateWorkflowRunCommand (BaseWorkflowCommand ):
5859 def execute (self , spec_path = None , input_path = None , workflow_id = None , cluster_id = None ):
5960 spec = None
6061 inputs = None
6162 if spec_path :
6263 if not os .path .exists (spec_path ):
63- raise ApplicationError ('Source path not found: {}' .format (spec_path ))
64+ raise ApplicationError (
65+ 'Source path not found: {}' .format (spec_path ))
6466 else :
6567 yaml_spec = open (spec_path , 'r' )
6668 spec = yaml .safe_load (yaml_spec )
6769
6870 if input_path :
6971 if not os .path .exists (input_path ):
70- raise ApplicationError ('Source path not found: {}' .format (input_path ))
72+ raise ApplicationError (
73+ 'Source path not found: {}' .format (input_path ))
7174 else :
7275 yaml_inputs = open (input_path , 'r' )
7376 inputs = yaml .safe_load (yaml_inputs )
7477
75- workflow = self .client .run_workflow (spec = spec , inputs = inputs , workflow_id = workflow_id , cluster_id = cluster_id )
78+ workflow = self .client .run_workflow (
79+ spec = spec , inputs = inputs , workflow_id = workflow_id , cluster_id = cluster_id )
7680 return workflow
7781
7882
@@ -90,18 +94,20 @@ def _get_table_data(self, objects):
9094 ))
9195 return data
9296
97+
9398class ListWorkflowRunsCommand (ListCommandMixin , BaseWorkflowCommand ):
9499 def _get_instances (self , kwargs ):
95100 instances = self .client .list_runs (** kwargs )
96101 return instances
97-
102+
98103 def _get_table_data (self , objects ):
99- data = [('Run' , 'Cluster ID' , 'Status' )]
104+ data = [('Run' , 'Cluster ID' , 'Status' , 'Log ID' )]
100105 for workflow_run in objects :
101106 data .append ((
102107 workflow_run ['id' ],
103108 workflow_run ['cluster' ]['id' ],
104109 workflow_run ['status' ]['phase' ],
110+ workflow_run ['status' ]['logId' ],
105111 ))
106112 return data
107113
@@ -117,6 +123,7 @@ def get_instance(self, workflow_id):
117123 instance = self .client .get (workflow_id = workflow_id )
118124 return instance
119125
126+
120127class GetWorkflowRunCommand (DetailJSONCommandMixin , BaseWorkflowCommand ):
121128 def execute (self , workflow_id , run ):
122129 with halo .Halo (text = self .WAITING_FOR_RESPONSE_MESSAGE , spinner = "dots" ):
@@ -128,6 +135,6 @@ def get_instance(self, workflow_id, run):
128135 instance = self .client .get_run (workflow_id = workflow_id , run = run )
129136 return instance
130137
138+
131139class WorkflowLogsCommand (LogsCommandMixin , BaseWorkflowCommand ):
132140 ENTITY = "Workflows"
133-
0 commit comments