You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Girish Shilamkar <gi...@clogeny.com> on 2013/05/17 09:22:55 UTC

listAffinityGroups API parameters

Hello,

While writing automation tests for listAffinityGroups API I found that the
specs (http://tinyurl.com/agedzm2) specify account and domainid as
parameters. But in marvin cloudstackAPI/listAffinityGroups.py it does not
expect these parameters.

I tried to list Affinity Groups through UI and it lists user's Affinity
groups by listing vms only and not directly.

Could someone please confirm ?

Regards,
Girish

Re: listAffinityGroups API parameters

Posted by Girish Shilamkar <gi...@clogeny.com>.
Sangeetha, Prachi,

Thanks for the clarifying.

Regards,
Girish


On Fri, May 17, 2013 at 11:30 PM, Prachi Damle <Pr...@citrix.com>wrote:

> There is bug logged already to cover this:
> https://issues.apache.org/jira/browse/CLOUDSTACK-2350
>
> Will be changing the list Cmd to take in account/domain as mentioned in FS.
>
> Thanks,
> Prachi
>
> -----Original Message-----
> From: Prasanna Santhanam [mailto:tsp@apache.org]
> Sent: Friday, May 17, 2013 1:17 AM
> To: dev@cloudstack.apache.org
> Cc: Prachi Damle
> Subject: Re: listAffinityGroups API parameters
>
> On Fri, May 17, 2013 at 12:52:55PM +0530, Girish Shilamkar wrote:
> > Hello,
> >
> > While writing automation tests for listAffinityGroups API I found that
> > the specs (http://tinyurl.com/agedzm2) specify account and domainid as
> > parameters. But in marvin cloudstackAPI/listAffinityGroups.py it does
> > not expect these parameters.
> >
> > I tried to list Affinity Groups through UI and it lists user's
> > Affinity groups by listing vms only and not directly.
> >
> > Could someone please confirm ?
> >
>
> The marvin APIs are built from what API discovery service exposes of the
> serverside API. In this case in ListAffinityGroupsCmd.java I see has the
> following params:
>
>  40     @Parameter(name = ApiConstants.NAME, type = CommandType.STRING,
> description = "lists affinity groups by name")
>  41     private String affinityGroupName;
>  42
>  43     @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID, type =
> CommandType.UUID, description = "lists affinity groups by virtual machine
> id", entityType = UserVmResponse.class)
>  44     private Long virtualMachineId;
>  45
>  46     @Parameter(name = ApiConstants.ID, type = CommandType.UUID,
> description = "list the affinity group by the id provided", entityType =
> AffinityGroupResponse.class)
>  47     private Long id;
>  48
>  49     @Parameter(name = ApiConstants.TYPE, type = CommandType.STRING,
> description = "lists affinity groups by type")
>  50     private String affinityGroupType;
>
> Perhaps the spec is out of date? I've included Prachi for comment.
>
> --
> Prasanna.,
>
> ------------------------
> Powered by BigRock.com
>
>

RE: listAffinityGroups API parameters

Posted by Prachi Damle <Pr...@citrix.com>.
There is bug logged already to cover this: https://issues.apache.org/jira/browse/CLOUDSTACK-2350

Will be changing the list Cmd to take in account/domain as mentioned in FS.

Thanks,
Prachi

-----Original Message-----
From: Prasanna Santhanam [mailto:tsp@apache.org] 
Sent: Friday, May 17, 2013 1:17 AM
To: dev@cloudstack.apache.org
Cc: Prachi Damle
Subject: Re: listAffinityGroups API parameters

On Fri, May 17, 2013 at 12:52:55PM +0530, Girish Shilamkar wrote:
> Hello,
> 
> While writing automation tests for listAffinityGroups API I found that 
> the specs (http://tinyurl.com/agedzm2) specify account and domainid as 
> parameters. But in marvin cloudstackAPI/listAffinityGroups.py it does 
> not expect these parameters.
> 
> I tried to list Affinity Groups through UI and it lists user's 
> Affinity groups by listing vms only and not directly.
> 
> Could someone please confirm ?
> 

The marvin APIs are built from what API discovery service exposes of the serverside API. In this case in ListAffinityGroupsCmd.java I see has the following params:

 40     @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "lists affinity groups by name")
 41     private String affinityGroupName;
 42 
 43     @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID, type = CommandType.UUID, description = "lists affinity groups by virtual machine id", entityType = UserVmResponse.class)
 44     private Long virtualMachineId;
 45 
 46     @Parameter(name = ApiConstants.ID, type = CommandType.UUID, description = "list the affinity group by the id provided", entityType = AffinityGroupResponse.class)
 47     private Long id;
 48 
 49     @Parameter(name = ApiConstants.TYPE, type = CommandType.STRING, description = "lists affinity groups by type")
 50     private String affinityGroupType;

Perhaps the spec is out of date? I've included Prachi for comment.

--
Prasanna.,

------------------------
Powered by BigRock.com


Re: listAffinityGroups API parameters

Posted by Prasanna Santhanam <ts...@apache.org>.
On Fri, May 17, 2013 at 12:52:55PM +0530, Girish Shilamkar wrote:
> Hello,
> 
> While writing automation tests for listAffinityGroups API I found that the
> specs (http://tinyurl.com/agedzm2) specify account and domainid as
> parameters. But in marvin cloudstackAPI/listAffinityGroups.py it does not
> expect these parameters.
> 
> I tried to list Affinity Groups through UI and it lists user's Affinity
> groups by listing vms only and not directly.
> 
> Could someone please confirm ?
> 

The marvin APIs are built from what API discovery service exposes of
the serverside API. In this case in ListAffinityGroupsCmd.java I see has
the following params:

 40     @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "lists affinity groups by name")
 41     private String affinityGroupName;
 42 
 43     @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID, type = CommandType.UUID, description = "lists affinity groups by virtual machine id", entityType = UserVmResponse.class)
 44     private Long virtualMachineId;
 45 
 46     @Parameter(name = ApiConstants.ID, type = CommandType.UUID, description = "list the affinity group by the id provided", entityType = AffinityGroupResponse.class)
 47     private Long id;
 48 
 49     @Parameter(name = ApiConstants.TYPE, type = CommandType.STRING, description = "lists affinity groups by type")
 50     private String affinityGroupType;

Perhaps the spec is out of date? I've included Prachi for comment.

-- 
Prasanna.,

------------------------
Powered by BigRock.com


RE: listAffinityGroups API parameters

Posted by Sangeetha Hariharan <Sa...@citrix.com>.
Hi,

listAffinityGroups API should support for account and domainId parameters .
All regular users (other than admin users) can list only affinity group that belongs to them.
But  Admin users should be able to list affinity groups that belong to other accounts passed in account and domain Id parameters.

Following 2 bugs have already been logged for this regards:

    CLOUDSTACK-2350 - Anti-Affinity - As admin user, when trying to update the affinity group for a Vm that is deployed by a regular user , he is presented with admin's affinity groups.
  **This issue tracks the following 2 api issues which is the root cause of the bug:
Using listAffinityGroups() call , Admin is not able to list affinity groups of other accounts by passing account and domainid parameter.

when admin calls listAffinityGroups() without account and domainid parameter, all affinity groups belonging to all users need to be returned.
  
  CLOUDSTACK-2352 - Anti-Affinity - As admin user , not able to list affinity group created by other users by passing id parameter to listaffinitygroups command. .


-Thanks
Sangeetha

-----Original Message-----
From: Devdeep Singh [mailto:devdeep.singh@citrix.com] 
Sent: Friday, May 17, 2013 1:03 AM
To: dev@cloudstack.apache.org
Subject: RE: listAffinityGroups API parameters

Looking at the code listAffinityGroup api doesn't take account name or domain id as a parameter. You may file a bug for this. Either the FS needs to be updated or the api needs to be updated for honoring these parameters.

Regards,
Devdeep

> -----Original Message-----
> From: Girish Shilamkar [mailto:girish@clogeny.com]
> Sent: Friday, May 17, 2013 12:53 PM
> To: dev@cloudstack.apache.org
> Subject: listAffinityGroups API parameters
> 
> Hello,
> 
> While writing automation tests for listAffinityGroups API I found that 
> the specs
> (http://tinyurl.com/agedzm2) specify account and domainid as parameters.
> But in marvin cloudstackAPI/listAffinityGroups.py it does not expect 
> these parameters.
> 
> I tried to list Affinity Groups through UI and it lists user's 
> Affinity groups by listing vms only and not directly.
> 
> Could someone please confirm ?
> 
> Regards,
> Girish

RE: listAffinityGroups API parameters

Posted by Devdeep Singh <de...@citrix.com>.
Looking at the code listAffinityGroup api doesn't take account name or domain id as a parameter. You may file a bug for this. Either the FS needs to be updated or the api needs to be updated for honoring these parameters.

Regards,
Devdeep

> -----Original Message-----
> From: Girish Shilamkar [mailto:girish@clogeny.com]
> Sent: Friday, May 17, 2013 12:53 PM
> To: dev@cloudstack.apache.org
> Subject: listAffinityGroups API parameters
> 
> Hello,
> 
> While writing automation tests for listAffinityGroups API I found that the specs
> (http://tinyurl.com/agedzm2) specify account and domainid as parameters.
> But in marvin cloudstackAPI/listAffinityGroups.py it does not expect these
> parameters.
> 
> I tried to list Affinity Groups through UI and it lists user's Affinity groups by
> listing vms only and not directly.
> 
> Could someone please confirm ?
> 
> Regards,
> Girish