Abhinav Roy created CLOUDSTACK-1449: ---------------------------------------
Summary: listAccounts and listProjectAccounts API lists all the accounts even when the "id" parameter of a particular account is passed Key: CLOUDSTACK-1449 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-1449 Project: CloudStack Issue Type: Bug Security Level: Public (Anyone can view this level - this is the default.) Components: API Affects Versions: 4.1.0 Environment: MS - Rhel 6.3 CS - 4.1.0 Reporter: Abhinav Roy Fix For: 4.1.0 Description : ====================================== listAccounts and listProjectAccounts APIs list all the accounts even when the id of a particular account is passed. Steps : ====================================== 1. Deploy a CS setup of version 4.1.0 2. Create multiple accounts 3. Create Projects. 4. Execute the listAccounts API to list details of a prticular account by ruuning the following URL in your browser http://10.102.192.125:8096/client/api?command=listAccounts&id=3 Execute the listProjectAccounts API to list details of a prticular account by ruuning the following URL in your browser http://10.102.192.125:8096/client/api?command=listProjectAccounts&projectid=1 Expected behaviour : ====================================== 1. Details of only that account should be listed whose "id" has been passed as a parameter in the URL or account details of only that project should be listed whose "projectid" has been passed in the URL. Observed Behaviour : ====================================== 1. The output of http://10.102.192.125:8096/client/api?command=listProjectAccounts&projectid=1 is <listprojectaccountsresponse cloud-stack-version="4.1.0-SNAPSHOT"><count>1</count><projectaccount><projectid>36cf833d-092f-47df-b911-8de7adfd03ba</projectid><project>root project</project><accountid>51ef2f64-8189-11e2-983c-fef34996d384</accountid><account>admin</account><accounttype>1</accounttype><role>Admin</role><domainid>2bcf95c6-8189-11e2-983c-fef34996d384</domainid><domain>ROOT</domain><user><id>51eedc08-8189-11e2-983c-fef34996d384</id><username>system</username><firstname>system</firstname><lastname>cloud</lastname><created>2013-02-28T20:29:15+0530</created><state>enabled</state><account>system</account><accounttype>1</accounttype><domainid>2bcf95c6-8189-11e2-983c-fef34996d384</domainid><domain>ROOT</domain><accountid>51ee9c16-8189-11e2-983c-fef34996d384</accountid><iscallerchilddomain>false</iscallerchilddomain><jobstatus>0</jobstatus></user><user><id>51ef648e-8189-11e2-983c-fef34996d384</id><username>admin</username><firstname>admin</firstname><lastname>cloud</lastname><created>2013-02-28T20:29:15+0530</created><state>enabled</state><account>admin</account><accounttype>1</accounttype><domainid>2bcf95c6-8189-11e2-983c-fef34996d384</domainid><domain>ROOT</domain><accountid>51ef2f64-8189-11e2-983c-fef34996d384</accountid><iscallerchilddomain>false</iscallerchilddomain><jobstatus>0</jobstatus></user><user><id>9bb460ef-a3e8-4339-9087-af50d5e7c15a</id><username>user1</username><firstname>user1</firstname><lastname>cloud</lastname><email>us...@cloud.com</email><created>2013-02-28T15:23:53+0530</created><state>enabled</state><account>user1</account><accounttype>0</accounttype><domainid>d88d231d-0c99-46e9-b252-155b66fb5554</domainid><domain>user</domain><accountid>4bdc3ebb-32e2-4a4b-aca5-de11d6434a0e</accountid><iscallerchilddomain>false</iscallerchilddomain><jobstatus>0</jobstatus></user></projectaccount></listprojectaccountsresponse> -- > > here we see that even though we asked for account details only for project having project id=1 , it has listed all the CS accounts. Also the "count=1 ", which is correct. 2. The output of http://10.102.192.125:8096/client/api?command=listAccounts&id=3 is <listaccountsresponse cloud-stack-version="4.1.0-SNAPSHOT"><count>1</count><account><id>4bdc3ebb-32e2-4a4b-aca5-de11d6434a0e</id><name>user1</name><accounttype>0</accounttype><domainid>d88d231d-0c99-46e9-b252-155b66fb5554</domainid><domain>user</domain><vmlimit>20</vmlimit><vmtotal>0</vmtotal><vmavailable>20</vmavailable><iplimit>20</iplimit><iptotal>0</iptotal><ipavailable>13</ipavailable><volumelimit>20</volumelimit><volumetotal>0</volumetotal><volumeavailable>20</volumeavailable><snapshotlimit>20</snapshotlimit><snapshottotal>0</snapshottotal><snapshotavailable>20</snapshotavailable><templatelimit>20</templatelimit><templatetotal>0</templatetotal><templateavailable>20</templateavailable><projectlimit>Unlimited</projectlimit><projecttotal>0</projecttotal><projectavailable>Unlimited</projectavailable><networklimit>20</networklimit><networktotal>0</networktotal><networkavailable>20</networkavailable><state>enabled</state><user><id>51eedc08-8189-11e2-983c-fef34996d384</id><username>system</username><firstname>system</firstname><lastname>cloud</lastname><created>2013-02-28T20:29:15+0530</created><state>enabled</state><account>system</account><accounttype>1</accounttype><domainid>2bcf95c6-8189-11e2-983c-fef34996d384</domainid><domain>ROOT</domain><accountid>51ee9c16-8189-11e2-983c-fef34996d384</accountid><iscallerchilddomain>false</iscallerchilddomain><jobstatus>0</jobstatus></user><user><id>51ef648e-8189-11e2-983c-fef34996d384</id><username>admin</username><firstname>admin</firstname><lastname>cloud</lastname><created>2013-02-28T20:29:15+0530</created><state>enabled</state><account>admin</account><accounttype>1</accounttype><domainid>2bcf95c6-8189-11e2-983c-fef34996d384</domainid><domain>ROOT</domain><accountid>51ef2f64-8189-11e2-983c-fef34996d384</accountid><iscallerchilddomain>false</iscallerchilddomain><jobstatus>0</jobstatus></user><user><id>9bb460ef-a3e8-4339-9087-af50d5e7c15a</id><username>user1</username><firstname>user1</firstname><lastname>cloud</lastname><email>us...@cloud.com</email><created>2013-02-28T15:23:53+0530</created><state>enabled</state><account>user1</account><accounttype>0</accounttype><domainid>d88d231d-0c99-46e9-b252-155b66fb5554</domainid><domain>user</domain><accountid>4bdc3ebb-32e2-4a4b-aca5-de11d6434a0e</accountid><iscallerchilddomain>false</iscallerchilddomain><jobstatus>0</jobstatus></user><jobstatus>0</jobstatus></account></listaccountsresponse> --- > > here again we see that we asked details only for account having id=3 but the response has all the accounts. Here again "count=1" is correct. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira