Version 5 (modified by 12 years ago) (diff) | ,
---|
Remote access to output files
Web service interface
Output files of completed jobs can be downloaded using web services of several forms:
PROJECT_URL/get_output.php?cmd=result_file&auth_str=AUTH&result_name=NAME&file_num=N PROJECT_URL/get_output.php?cmd=batch_files&auth_str=AUTH&batch_id=N PROJECT_URL/get_output.php?cmd=workunit_file&auth_str=AUTH&wu_name=NAME&file_num=N PROJECT_URL/get_output.php?cmd=workunit_files&auth_str=AUTH&wu_id=N
The variants are:
- result_file: download the Nth output file of the given result.
- batch_file: download all the output files of the given batch, as a zip archive.
- workunit_file: download the Nth output file of the canonical instance of the given workunit.
- workunit_files: download all the output files of the canonical instance of the given workunit, as a zip archive.
In each case, auth_str is the authenticator of the creator of the jobs involved.
Notes:
- These operations work only for jobs that are part of a batch.
- This interface is secure in sense that only the creator of a job can download its output files.
- In case of error, the resulting file will have the work "error" in the first line.
C++ interface
A C++ interface to the workunit_file variant is available in lib/remote_submit.cpp:
extern int get_output_file( const char* project_url, const char* authenticator, const char* job_name, int file_num, const char* dst_path );
PHP interface
The following PHP interfaces are available in html/inc/submit.inc:
$req->project = "http://project.url"; $req->authenticator = "..."; $req->instance_name = "result name"; $req->file_num = 0; $url = boinc_get_output_file($req); $x = file_get_contents($url); // read output file into memory
boinc_get_output_file() returns the URL from which the output file can be downloaded.
$req->project = "http://project.url"; $req->authenticator = "..."; $req->batch_id = 55; $url = boinc_get_output_file($req);
boinc_get_output_files() returns a URL from which a zipped archive of all output files from the batch can be downloaded (only the outputs of "canonical" instances are included).