Databricks Data Engineer Professional Question 309
Single answerYou are tasked with automating a Databricks workflow and need to achieve the following: 1) Clone an existing job, 2) Trigger a run of the cloned job, and 3) Export the run output for logging purposes. Which sequence of REST API calls should you use to accomplish this task?
- A
- Use the 'POST /jobs/create' endpoint to clone the job, 2) Use the 'POST /jobs/run-now' endpoint to trigger the run, 3) Use the 'GET /jobs/runs/output' endpoint to export the run output.
- B
- Use the 'POST /jobs/update' endpoint to clone the job, 2) Use the 'POST /jobs/run-now' endpoint to trigger the run, 3) Use the 'GET /jobs/runs/get' endpoint to export the run output.
- C
- Use the 'GET /jobs/list' endpoint to clone the job, 2) Use the 'POST /jobs/run-now' endpoint to trigger the run, 3) Use the 'GET /jobs/runs/output' endpoint to export the run output.
- D
- Use the 'POST /jobs/reset' endpoint to clone the job, 2) Use the 'POST /jobs/run-now' endpoint to trigger the run, 3) Use the 'GET /jobs/runs/output' endpoint to export the run output.
Show answer and explanation
Correct answer: A
Explanation
To automate the workflow, you need to first clone the job using the 'POST /jobs/create' endpoint, which allows you to duplicate an existing job. After cloning, the job can be executed immediately using the 'POST /jobs/run-now' endpoint. Finally, the output of the triggered run can be retrieved using the 'GET /jobs/runs/output' endpoint to log the results. The other options misuse endpoints that are not intended for cloning, triggering, or exporting job outputs.
- A. Correct.
This is the correct sequence. The 'POST /jobs/create' endpoint is used to clone a new job based on the existing job's configuration. The 'POST /jobs/run-now' endpoint triggers the execution of the newly cloned job, and the 'GET /jobs/runs/output' endpoint retrieves the output of the specific run.
- B. Incorrect.
The 'POST /jobs/update' endpoint is used to update an existing job, not to clone a job. This makes it an incorrect choice for the first step.
- C. Incorrect.
The 'GET /jobs/list' endpoint only retrieves a list of jobs and cannot be used to clone a job. This makes it an incorrect choice for the first step.
- D. Incorrect.
The 'POST /jobs/reset' endpoint is used to reset a job's settings, not to clone a job. This makes it an incorrect choice for the first step.