-
Notifications
You must be signed in to change notification settings - Fork 21
AWE APIs
- Job submission
curl [-H "Datatoken: $TokenString"] -X POST -F upload=@job_script http://<awe_api_url>/job
- Show all jobs
curl -X GET http://<awe_api_url>/job
or
curl -X GET http://<awe_api_url>/job?limit=<INT>&offset=<INT>&order=<job_field>&direction=<asc|desc>
This API returns a page of job objects and total counts. Use limit & offset to control paginated view (by default limit=25, offset=0), to show all jobs, you can set limit=total_counts and offset = 0. By default the jobs will be sorted by last updated time (desc). You can change the sorting criteria by setting order=<job_field>&direction=<asc|desc>.
- Show all active jobs in the queue
curl -X GET http://<awe_api_url>/job?active[&limit=25&offset=0&order=updatetime&direction=desc]
- Show all suspended jobs in the queue
curl -X GET http://<awe_api_url>/job?suspend[&limit=25&offset=0&order=updatetime&direction=desc]
- Show all registered jobs in the queue (active + suspend, excluding jobs in mongodb only)
curl -X GET http://<awe_api_url>/job?registered[&limit=25&offset=0&order=updatetime&direction=desc]
- Show one job with specific job id
curl -X GET http://<awe_api_url>/job/<job_id>
- Query jobs by fields
curl -X GET http://<awe_api_url>/job?query&state=<in-progress|completed>&info.project=xxx&info.user=xxx&...[?limit=25&offset=0&order=updatetime&direction=desc]
- Suspend an in-progress job
curl -X PUT http://<awe_api_url>/job/<job_id>?suspend
- Resume a suspended job
curl -X PUT http://<awe_api_url>/job/<job_id>?resume
- Resume all the suspended jobs in the queue
curl -X PUT http://<awe_api_url>/job?resumeall
- Re-submit a job from mongodb
curl -X PUT http://<awe_api_url>/job/<job_id>?resubmit
- Recompute a job from task i, the downstream tasks of i will all be recomputed
curl -X PUT http://<awe_api_url>/job/<job_id>?recompute=<int>
- Change the clientgroup attribute of the job
curl -X PUT http://<awe_api_url>/job/<job_id>?clientgroup=<new_cliengroup>
- Delete all suspended jobs
curl -X DELETE http://<awe_api_url>/job/<job_id>?suspend
- Delete all zombie jobs (“in-progress” jobs in mongodb but not in the queue)
curl -X DELETE http://<awe_api_url>/job?zombie
###2. Workunit APIs
- view a workunit (Highlighted ones are called only by awe-clients)
curl -X GET http://<awe_api_url>/work/<work_id>
- client request data token for the specific workunit
curl -X GET http://<awe_api_url>/work/<work_id>?datatoken&client=<client_id>
- client checkout workunit
curl -X GET http://<awe_api_url>/work?client=<client_id>
- client update workunit status (with optional logs/reports in files)
curl -X GET [-F perf=@perf_log] [-F notes=notes_file] http://<awe_api_url>/work/<work_id>?status=<new_status>&client=<client_id>&report
- view awe-client error log related to the failed workunit (need client side config: [Client] print_app_msg=True):
curl -X GET http://<awe_api_url>/work/<work_id>?report=worknotes
- view stdout of one workunit (need client side config: [Client] print_app_msg=True)
curl -X GET http://<awe_api_url>/work/<work_id>?report=stdout
- view stderr of one workunit (need client side config: [Client] print_app_msg=True)
curl -X GET http://<awe_api_url>/work/<work_id>?report=stderr
- Register a new client
curl -X POST -F profile=@clientprofile http://<awe_api_url>/client
- View all clients
curl -X GET http://<awe_api_url>/client
- View all busy clients
curl -X GET http://<awe_api_url>/client?busy
- View a client
curl -X GET http://<awe_api_url>/client/<client_id>
- Client sends heartbeat to server
curl -X GET http://<awe_api_url>/client/<client_id>?heartbeat
- Suspend all the clients
curl -X PUT http://<awe_api_url>/client?suspendall
- Resume all suspended clients
curl -X PUT http://<awe_api_url>/client?resumeall
- Suspend a client
curl -X PUT http://<awe_api_url>/client/<client_id>?suspend
- Resume a client
curl -X PUT http://<awe_api_url>/client/<client_id>?resume