Re: [vdsm] getAllTasksInfo API

2012-04-17 Thread Adam Litke
On Tue, Apr 17, 2012 at 07:39:24AM -0400, Ayal Baron wrote:
> 
> 
> - Original Message -
> > Hi,
> > 
> > While developing the REST API I was having trouble using the
> > getAllTasks(Info|Statuses) API to get tasks information.  I found out
> > that hsm
> > is hard-coding a tagged search for 'spm' in the calls to the task
> > manager.  Is
> > there a reason that this tag must be hard-coded or can we remove it
> > as in the
> > patch below?  With this patch applied I am able to list all tasks.
> > 
> > If this patch is acceptable, I would be happy to submit it to gerrit
> > for
> > approval.  Thanks!
> 
> It is (unfortunately) not.
> There is an API guarantee to engine to return only SPM tasks.
> But I would be totally fine with exposing this in another way (either a new 
> API or a flag here to filter according to something).

Please see http://gerrit.ovirt.org/3613 for a solution that 'fixes' the API
while keeping the promise to ovirt-engine.  Here is the commit message to permit
continued discussion here on the list:

API: getAllTasks{Info|Statuses} does not return all tasks

As discussed on the list, I found that the getAllTasks* APIs do not return all
tasks but instead filter to return only spm tasks.  This is a requirement for
ovirt-engine.  To make it possible to view all tasks while preserving
compatibility for ovirt-engine I propose the following changes to the API:

The public API in API.py will be modified to add a 'tag' parameter which
defaults to None.  This will be passed all the way down into the taskManager
(which already expects such a parameter).  In this way, the new default mode of
operation will be fixed to return all tasks as the name of the API states.

To maintain compatibility for ovirt-engine, the XMLRPC binding will pass the tag
"spm" to these APIs to get the current filtering behavior.  Note that I have
also changed vdsClient so that it will return all tasks.

-- 
Adam Litke 
IBM Linux Technology Center

___
vdsm-devel mailing list
vdsm-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/vdsm-devel


Re: [vdsm] getAllTasksInfo API

2012-04-17 Thread Ayal Baron


- Original Message -
> Hi,
> 
> While developing the REST API I was having trouble using the
> getAllTasks(Info|Statuses) API to get tasks information.  I found out
> that hsm
> is hard-coding a tagged search for 'spm' in the calls to the task
> manager.  Is
> there a reason that this tag must be hard-coded or can we remove it
> as in the
> patch below?  With this patch applied I am able to list all tasks.
> 
> If this patch is acceptable, I would be happy to submit it to gerrit
> for
> approval.  Thanks!

It is (unfortunately) not.
There is an API guarantee to engine to return only SPM tasks.
But I would be totally fine with exposing this in another way (either a new API 
or a flag here to filter according to something).

> 
> 
> commit 72621b2ffe5a0a21ba1023dada36b405bf2111f2
> Author: Adam Litke 
> Date:   Mon Apr 16 13:56:55 2012 -0500
> 
> Don't hardcode the 'spm' tag when getting information for all
> tasks.
> 
> diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
> index 2755aef..51ee17c 100644
> --- a/vdsm/storage/hsm.py
> +++ b/vdsm/storage/hsm.py
> @@ -1694,7 +1694,7 @@ class HSM:
>  :options: ?
>  """
>  #getSharedLock(tasksResource...)
> -allTasksStatus = self.taskMng.getAllTasksStatuses("spm")
> +allTasksStatus = self.taskMng.getAllTasksStatuses()
>  return dict(allTasksStatus=allTasksStatus)
>  
>  
> @@ -1733,7 +1733,7 @@ class HSM:
>  """
>  #getSharedLock(tasksResource...)
>  # TODO: if spUUID passed, make sure tasks are relevant only
>  to pool
> -allTasksInfo = self.taskMng.getAllTasksInfo("spm")
> +allTasksInfo = self.taskMng.getAllTasksInfo()
>  return dict(allTasksInfo=allTasksInfo)
>  
>  
> 
> --
> Adam Litke 
> IBM Linux Technology Center
> 
> ___
> vdsm-devel mailing list
> vdsm-devel@lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/vdsm-devel
> 
___
vdsm-devel mailing list
vdsm-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/vdsm-devel