1

I have some R and python scripts in CDSW "Cloudera-Data-Science-Workbench". I create a shell script to run this with curl -v -XPOST.

How to get the status of a job from the API CDSW?

EvilDr
  • 8,943
  • 14
  • 73
  • 133
Zied Hermi
  • 229
  • 1
  • 2
  • 11

1 Answers1

0

Hi it's been a while since this question was posted but hopefully the answer can still be useful to someone :)

After you run:

curl -v -XPOST http://cdsw.example.com/api/v1/projects/<$USERNAME>/<$PROJECT_NAME>/jobs/<$JOB_ID>/start --user "API_KEY:" --header "Content-type: application/json"

You should be able to see in the output a URL that looks like this:

http://cdsw.example.com/api/v1/projects/<$USERNAME>/<$PROJECT_NAME>/dashboards/<$ID>

So then you can use it to retrieve the job status for example with piping the status using jq (or without it so you can also see the status in the output as well as other stuff returned):

curl -v http://cdsw.example.com/api/v1/projects/<$USERNAME>/<$PROJECT_NAME>/dashboards/<$ID> --user "API_KEY:" | jq '.status'

kainka
  • 1
  • 1