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?
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>