Azure-Samples / azure-batch-samples

Azure Batch and HPC Code Samples
Other
260 stars 487 forks source link

Download stdout from jobs #197

Closed liorko87 closed 7 years ago

liorko87 commented 7 years ago

Hi,

I have task with 100 jobs and I want to download all the stdout.txt files.

I tried to do it using this python command :

txtfile = urllib2.urlopen('https://barilanbatchhpcuseast.eastus.batch.azure.com/jobs/Job1/tasks/task1_0_1/files/stdout.txt').read()

But i got the following error : urllib2.HTTPError: HTTP Error 400: A query parameter that's mandatory for this request is not specified

What can be the problem?

itowlson commented 7 years ago

At minimum you are missing the apiversion query string (apiversion=20xx-yy-zz.maj.min). You also need to authenticate by signing your request with the Batch account key, as your files are not publicly readable. You may find it easier to do both of these by using the Batch client library for Python; otherwise, the REST API docs include info on API versions and on request signing. (The Python implementation of the signing algorithm is open source if you want to reuse it.)

alfpark commented 7 years ago

Closing as it looks like the issue has been resolved.