Databricks CLI version 0.209 - reset an existing job in API v2.1

182 views Asked by At

How to reset an existing job in databricks using cli v 0.209.

Already referred to the below forum which talks about older version of databricks-cli Azure Databricks CLI: update workflow/job definition

In older versions, databricks jobs reset --job-id xxxx --json yyyy --profile DEFAULT seems to be working where xxx is the job id to be reset yyyy will be the settings part of the job.json file.

But in current version, there is no such flag called --job-id. So, when I tried to pass the job.json file to "databricks jobs reset --json JSON" command with the proper job id updated, it fails with the below error "One of job_cluster_key, new_cluster, or existing_cluster_id must be specified."

What could be the reason\fix for this error.
Note:

  1. databricks job reset command is passed only with the settings.json and not the whole jobs.json.
  2. new_cluster information is already provided as part of the settings.json
  3. Tried passing json file and also as an inline string.
  4. I am using databricks on AWS.

Kindly help!!

To reset the jobs using databricks cli version 0.209 by passing job.json and settings.json.

Expected: job to be reset with the new settings passed. Actual: CLI command fails with the error "One of job_cluster_key, new_cluster, or existing_cluster_id must be specified."

1

There are 1 answers

0
Pablo On

Try adding your job_id inside the .json and also rename settings for "new_settings":

{
  "job_id":713057302,
  "new_settings": {
   .............
  }
}