[Kimchi-devel] [PATCH 1/5] Add function to get pending tasks according to filter

Aline Manera alinefm at linux.vnet.ibm.com
Mon Sep 8 03:07:32 UTC 2014


A Task is always associated to a resource and it can be identified by
the target_uri parameter.
That way we can properly get tasks related to a specific resource type.

Example:
GET /tasks?target_uri=^/debugreports will return all the tasks
associated to a debug report.

Signed-off-by: Aline Manera <alinefm at linux.vnet.ibm.com>
---
 ui/js/src/kimchi.api.js | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/ui/js/src/kimchi.api.js b/ui/js/src/kimchi.api.js
index 5fc456d..6f12455 100644
--- a/ui/js/src/kimchi.api.js
+++ b/ui/js/src/kimchi.api.js
@@ -533,6 +533,18 @@ var kimchi = {
         });
     },
 
+    getTasksByFilter : function(filter, suc, err, sync) {
+        kimchi.requestJSON({
+            url : kimchi.url + 'tasks?' + filter,
+            type : 'GET',
+            contentType : 'application/json',
+            dataType : 'json',
+            async : !sync,
+            success : suc,
+            error : err
+        });
+    },
+
     login : function(settings, suc, err) {
         $.ajax({
             url : "/login",
-- 
1.9.3




More information about the Kimchi-devel mailing list