@@ -187,6 +187,49 @@ def reset_cli(api_client, pipeline_id):
187187 click .echo ("Reset triggered for pipeline {}" .format (pipeline_id ))
188188
189189
190+ @click .command (context_settings = CONTEXT_SETTINGS ,
191+ short_help = 'Starts the execution of a delta pipeline run' )
192+ @click .option ('--pipeline-id' , default = None , type = PipelineIdClickType (),
193+ help = PipelineIdClickType .help )
194+ @debug_option
195+ @profile_option
196+ @pipelines_exception_eater
197+ @provide_api_client
198+ def run_cli (api_client , pipeline_id ):
199+ """
200+ Starts the execution of a delta pipelines run by starting the cluster and processing data.
201+
202+ Usage:
203+
204+ databricks pipelines run --pipeline-id 1234
205+ """
206+ _validate_pipeline_id (pipeline_id )
207+ PipelinesApi (api_client ).run (pipeline_id )
208+ click .echo ("Run triggered for pipeline {}" .format (pipeline_id ))
209+
210+
211+ @click .command (context_settings = CONTEXT_SETTINGS ,
212+ short_help = 'Stops the execution of a delta pipeline run' )
213+ @click .option ('--pipeline-id' , default = None , type = PipelineIdClickType (),
214+ help = PipelineIdClickType .help )
215+ @debug_option
216+ @profile_option
217+ @pipelines_exception_eater
218+ @provide_api_client
219+ def stop_cli (api_client , pipeline_id ):
220+ """
221+ Stops the execution of a delta pipelines run by terminating the cluster. Processing of data can
222+ be resumed by calling `run`.
223+
224+ Usage:
225+
226+ databricks pipelines stop --pipeline-id 1234
227+ """
228+ _validate_pipeline_id (pipeline_id )
229+ PipelinesApi (api_client ).stop (pipeline_id )
230+ click .echo ("Stopped pipeline {}" .format (pipeline_id ))
231+
232+
190233def _read_spec (src ):
191234 """
192235 Reads the spec at src as a JSON if no file extension is provided, or if in the extension format
@@ -276,3 +319,5 @@ def pipelines_group(): # pragma: no cover
276319pipelines_group .add_command (delete_cli , name = 'delete' )
277320pipelines_group .add_command (get_cli , name = 'get' )
278321pipelines_group .add_command (reset_cli , name = 'reset' )
322+ pipelines_group .add_command (run_cli , name = 'run' )
323+ pipelines_group .add_command (stop_cli , name = 'stop' )
0 commit comments