From ac0ea2b4b39aca4f3af8272cb00b514ebbfd7549 Mon Sep 17 00:00:00 2001 From: renat Date: Tue, 16 Dec 2014 17:05:23 +0600 Subject: [PATCH] Added queued tasks pausing/resuming functionality description - pause_task_queue, resume_task_queue . --- worker/reference/api/index.md | 64 +++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/worker/reference/api/index.md b/worker/reference/api/index.md index 597f4cf9..14c5bbf7 100644 --- a/worker/reference/api/index.md +++ b/worker/reference/api/index.md @@ -52,6 +52,16 @@ IronWorker provides a RESTful HTTP API to allow you to interact programmatically GET List Code Package Revisions + + /projects/{Project ID}/codes/{Code ID}/pause_task_queue + POST + Pause Task Queue for Code Package + + + /projects/{Project ID}/codes/{Code ID}/resume_task_queue + POST + Resume Paused Task Queue for Code Package + @@ -457,7 +467,7 @@ Sample: #### URL Parameters -* **Project ID**: The ID of the project that the task belongs to. +* **Project ID**: The ID of the project that the code package belongs to. * **Code Package ID**: The ID of the task you want details on. #### Optional Query Parameters @@ -478,7 +488,7 @@ The response will be a zip file containing your code package. The response heade #### URL Parameters -* **Project ID**: The ID of the project that the task belongs to. +* **Project ID**: The ID of the project that the code package belongs to. * **Code Package ID**: The ID of the code package whose revisions you’re retrieving. #### Optional Query Parameters @@ -517,6 +527,56 @@ Sample: } ``` +### Pause Task Queue for Code Package + +#### Endpoint + +
+ POST /projects/{Project ID}/codes/{Code ID}/pause_task_queue +
+ +#### URL Parameters + +* **Project ID**: The ID of the project that the code package belongs to. +* **Code Package ID**: The ID of the code package whose tasks (queued and scheduled) you want to pause. + +#### Response + +The response will be a JSON object containing a message explaining whether the request was successful or not. + +Sample: + +```js +{ + "msg": "Paused" +} +``` + +### Resume Paused Task Queue for Code Package + +#### Endpoint + +
+ POST /projects/{Project ID}/codes/{Code ID}/resume_task_queue +
+ +#### URL Parameters + +* **Project ID**: The ID of the project that the code package belongs to. +* **Code Package ID**: The ID of the code package whose paused tasks (queued and scheduled) you want to resume. + +#### Response + +The response will be a JSON object containing a message explaining whether the request was successful or not. + +Sample: + +```js +{ + "msg": "Resumed" +} +``` + ## Tasks Tasks are specific instance of your workers being run. They encompass a single execution of a code package. Tasks consist of the code package to be run and the data to pass to the code package.