Databricks Jobs API "INVALID_PARAMETER_VALUE" when trying to get job

3.3k Views Asked by At

I'm just starting to explore the Databricks API. I've created a .netrc file as described in this doc and am able to get the API to work with this for other operations like "list clusters" and "list jobs". But when I try to query details of a particular job, it fails:

$ curl --netrc -X GET https://<my_workspace>.cloud.databricks.com/api/2.0/jobs/get/?job_id=job-395565384955064-run-12345678

{"error_code":"INVALID_PARAMETER_VALUE","message":"Job 0 does not exist."}

What am I doing wrong here?

2

There are 2 best solutions below

0
On BEST ANSWER

Job ID should be a numeric identifier while you're providing the job cluster name instead. You need to use first number (395565384955064) from that name as a job ID in REST API. Also, remove / after get - it should be /api/2.0/jobs/get?job_id=<job-ID>

0
On
$ curl --netrc -X GET https://<my_workspace>.cloud.databricks.com/api/2.0/jobs/get/?job_id=job-395565384955064-run-12345678

In this link, looks like job_name had been mentioned as alphanumeric value instead of job_id. You can find job_id where you can find it .

enter image description here