You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2023/01/11 16:57:16 UTC

[GitHub] [cloudstack] RodrigoDLopez opened a new pull request, #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

RodrigoDLopez opened a new pull request, #7082:
URL: https://github.com/apache/cloudstack/pull/7082

   ### Description
   
   ACS does not allow disk and service offerings to be filtered by account or project. An extension was created that allows operators to inform a project or an account and domain when executing the `listDiskOffering` and `listServiceOffering` APIs. In this way, the APIs will only return offers whose account/project has access permission.
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [x] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [x] Minor
   
   ### How Has This Been Tested?
   Tests were executed via CMK by calling `listDiskOffering` and `listServiceOffering` informing the parameters account and domainId or projectId. To verify the consistency of the data returned by the APIs, `listDiskOffering` and `listServiceOffering` calls were executed with the target account from the previous step, without informing the filtering parameters.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] weizhouapache commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1691235928

   moved to 4.18.2.0


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1749046003

   Packaging result [SF]: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: el9 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 7242


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1446855474

   <b>Trillian test result (tid-6234)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 37390 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7082-t6234-kvm-centos7.zip
   Smoke tests completed. 107 look OK, 0 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] kiranchavala commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "kiranchavala (via GitHub)" <gi...@apache.org>.
kiranchavala commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1447621964

   Manually tested 
   
   Able to see the account id and project id in the api calls when execting the api calls
   
   Tested by creating service offerings and was able to filter them based on account id
   
   ~~~
   (4.17.2) 🐱 > list serviceofferings 
   cpunumber=         cpuspeed=          domainid=          encryptroot=       
   filter=            id=                isrecursive=       issystem=          
   keyword=           listall=           memory=            name=              
   page=              pagesize=          systemvmtype=      virtualmachineid=  
   zoneid=            
   
   (pr-7082) 🐱 > list serviceofferings 
   account=           cpunumber=         cpuspeed=          domainid=          
   encryptroot=       filter=            id=                isrecursive=       
   issystem=          keyword=           listall=           memory=            
   name=              page=              pagesize=          projectid=         
   systemvmtype=      virtualmachineid=  zoneid= 
   
   ------------------------------------
   
   (4.17.2) 🐱 > list diskofferings 
   domainid=    encrypt=     filter=      id=          isrecursive= keyword=     listall=     name=        page=        pagesize=    storageid=   volumeid=    
   zoneid=      
   
   
   (pr-7082) 🐱 > list diskofferings 
   account=     domainid=    encrypt=     filter=      id=          isrecursive= keyword=     listall=     name=        page=        pagesize=    projectid=   
   storageid=   volumeid=    zoneid= 
   ~~~


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1380251348

   @DaanHoogland a Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1380335324

   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: el9 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 5245


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland merged PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1816085914

   @DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1381218126

   <b>Trillian test result (tid-5815)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 43845 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7082-t5815-kvm-centos7.zip
   Smoke tests completed. 106 look OK, 1 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_08_upgrade_kubernetes_ha_cluster | `Failure` | 571.91 | test_kubernetes_clusters.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1380357907

   @DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] soreana commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "soreana (via GitHub)" <gi...@apache.org>.
soreana commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1667987951

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1672644505

   @soreana I would say the use is for the user to see which offerings are available to an account (??) cc @RodrigoDLopez 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1750128223

   @DaanHoogland a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "RodrigoDLopez (via GitHub)" <gi...@apache.org>.
RodrigoDLopez commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1748919659

   @DaanHoogland, @soreana 
   I just pushed new changes to when to use the caller and when to use the owner for some checks. I'm a bit removed from the community due to other activities that are consuming a lot of my time. But I'll try to be more active here from now on.
   If anyone can test this latest version, I would greatly appreciate it, and if further changes are necessary, please give me feedback here.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1748927490

   @DaanHoogland a [SF] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1816178325

   Packaging result [SF]: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: el9 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 7782


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1680672269

   @soreana a [SF] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] RodrigoDLopez commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "RodrigoDLopez (via GitHub)" <gi...@apache.org>.
RodrigoDLopez commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1679043213

   > @soreana I would say the use is for the user to see what offers are available for an account (??) cc @RodrigoDLopez
   
   You are correct @DaanHoogland, the purpose is to allow resource listing for a given account or project.
   
   > you can use `BaseListProjectAndAccountResourcesCmd` instead of `BaseListDomainResourcesCmd`
   > then these are not needed.
   
   Thanks for the review @weizhouapache.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on a diff in pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#discussion_r1295606344


##########
api/src/main/java/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java:
##########
@@ -82,6 +84,12 @@ public class ListServiceOfferingsCmd extends BaseListDomainResourcesCmd {
             since = "4.15")
     private Integer cpuSpeed;
 
+    @Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "list resources by account.")
+    private String accountName;
+
+    @Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.UUID, entityType = ProjectResponse.class, description = "list objects by project.")
+    private Long projectId;
+

Review Comment:
   ```suggestion
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on a diff in pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#discussion_r1295605917


##########
api/src/main/java/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java:
##########
@@ -84,6 +91,14 @@ public Long getVolumeId() {
 
     public Boolean getEncrypt() { return encrypt; }
 
+    public String getAccountName() {
+        return accountName;
+    }
+
+    public Long getProjectId() {
+        return projectId;
+    }
+

Review Comment:
   ```suggestion
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1668409706

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "soreana (via GitHub)" <gi...@apache.org>.
soreana commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1819022844

   @DaanHoogland @RodrigoDLopez I'm checking this one.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "soreana (via GitHub)" <gi...@apache.org>.
soreana commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1827888430

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1668412126

   @DaanHoogland a [SF] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] soreana commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "soreana (via GitHub)" <gi...@apache.org>.
soreana commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1673105746

   > @soreana I would say the use is for the user to see which offerings are available to an account (??) cc @RodrigoDLopez
   
   @DaanHoogland So in that case I would say it is working :D
   
   I've created the following setup, and tested the cloudmonkey output.
   
   ```
   Root
     |----- Domain
     |       |== Account
     |       |== DomainOffering
     |----- Domain2
             |== Account2
             |== Domain2Offering
   ```
   
   #### No domainid passed -> all the service offerings are listed
   
   ```
   (localcloud)  > list serviceofferings filter=name,id
   {
     "count": 4,
     "serviceoffering": [
       {
         "id": "95d95db2-2b2d-4660-853d-7871104505b5",
         "name": "Small Instance"
       },
       {
         "id": "cfdc2dc3-48c2-41db-bacf-6ef261e01b13",
         "name": "Medium Instance"
       },
       {
         "id": "c041a46b-3d52-4835-84f8-889be36b3057",
         "name": "DomainOffering"
       },
       {
         "id": "89bbe884-2aa2-4d76-9c10-e74796a0c27d",
         "name": "Domain2Offering"
       }
     ]
   }
   ```
   
   #### Only the domainid passed -> service offerings in that domain are listed
   
   ```
   (localcloud)  > list serviceofferings domainid=33f0fc41-5637-48d5-8db6-f0ce866e1753 filter=name,id
   {
     "count": 1,
     "serviceoffering": [
       {
         "id": "89bbe884-2aa2-4d76-9c10-e74796a0c27d",
         "name": "Domain2Offering"
       }
     ]
   }
   ```
   #### the domainid and account are passed -> all the service offerings that account has access to are listed
   
   ```
   (localcloud)  > list serviceofferings domainid=33f0fc41-5637-48d5-8db6-f0ce866e1753 account=account2 filter=name,id
   {
     "count": 3,
     "serviceoffering": [
       {
         "id": "95d95db2-2b2d-4660-853d-7871104505b5",
         "name": "Small Instance"
       },
       {
         "id": "cfdc2dc3-48c2-41db-bacf-6ef261e01b13",
         "name": "Medium Instance"
       },
       {
         "id": "89bbe884-2aa2-4d76-9c10-e74796a0c27d",
         "name": "Domain2Offering"
       }
     ]
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1816085116

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1816370977

   @DaanHoogland a [LL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1679328751

   Packaging result [SF]: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: el9 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 6786


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1680443972

   Packaging result [SF]: :heavy_multiplication_x: el7 :heavy_multiplication_x: el8 :heavy_multiplication_x: el9 :heavy_multiplication_x: debian :heavy_multiplication_x: suse15. SL-JID 6800


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1680435821

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] weizhouapache commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1679255221

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1445918909

   @kiranchavala a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] RodrigoDLopez commented on a diff in pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by GitBox <gi...@apache.org>.
RodrigoDLopez commented on code in PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#discussion_r1074032097


##########
server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:
##########
@@ -3378,6 +3384,63 @@ private Pair<List<ServiceOfferingJoinVO>, Integer> searchForServiceOfferingsInte
         return _srvOfferingJoinDao.searchAndCount(sc, searchFilter);
     }
 
+    /**
+     * Retrieves the API caller. If the projectId or accountName parameters were provided in the API call, consider the account or project as the API caller.
+     * With that, the APIs return will be filtered by the account defined in the API call.
+     * @param originalCaller Account that made the API call
+     * @param projectId projectId provided in API call
+     * @param accountName accountName provided in API call
+     * @param domainId domainId provided in API call
+     * @return Account object
+     */
+    protected Account getCallerAccordingToProjectIdAndAccountNameAndDomainId(Account originalCaller, Long projectId, String accountName, Long domainId) {

Review Comment:
   @weizhouapache 
   Thanks for the hint



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1380250969

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] soreana commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "soreana (via GitHub)" <gi...@apache.org>.
soreana commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1689614342

   @RodrigoDLopez @weizhouapache shall we move this one to 4.18.2 ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1748870451

   @RodrigoDLopez any update?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1668473986

   Packaging result [SF]: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: el9 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 6697


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] weizhouapache commented on a diff in pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on code in PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#discussion_r1295468152


##########
api/src/main/java/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java:
##########
@@ -44,6 +45,12 @@ public class ListDiskOfferingsCmd extends BaseListDomainResourcesCmd {
     @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "name of the disk offering")
     private String diskOfferingName;
 
+    @Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "list resources by account.")

Review Comment:
   @RodrigoDLopez 
   If you use `BaseListProjectAndAccountResourcesCmd`,  `accountName` and `projectId` are not needed any more.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1680770244

   Packaging result [SF]: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: el9 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 6803


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "soreana (via GitHub)" <gi...@apache.org>.
soreana commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1752543027

   > > @DaanHoogland, @soreana I just pushed new changes to when to use the caller and when to use the owner for some checks. I'm a bit removed from the community due to other activities that are consuming a lot of my time. But I'll try to be more active here from now on. If anyone can test this latest version, I would greatly appreciate it, and if further changes are necessary, please give me feedback here.
   > 
   > @RodrigoDLopez I think that was the last remaining comment @soreana can you re-test?
   
   @DaanHoogland I caught up with lots of work, I can test it later this week.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] soreana commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "soreana (via GitHub)" <gi...@apache.org>.
soreana commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1680669901

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland closed pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland closed pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project
URL: https://github.com/apache/cloudstack/pull/7082


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "shwstppr (via GitHub)" <gi...@apache.org>.
shwstppr commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1801378347

   Hi @soreana, will you be able to test it this week?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1816365926

   @blueorangutan LLtest


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1816484938

   @DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1751332847

   <b>[SF] Trillian test result (tid-7863)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 42517 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7082-t7863-kvm-centos7.zip
   Smoke tests completed. 108 look OK, 0 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1752537578

   @weizhouapache can you check if all "owner" vs "caller" references are now correct (afayct of course)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "soreana (via GitHub)" <gi...@apache.org>.
soreana commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1829869015

   > > @soreana I would say the use is for the user to see which offerings are available to an account (??) cc @RodrigoDLopez
   > 
   > @DaanHoogland So in that case I would say it is working :D
   > 
   > I've created the following setup, and tested the cloudmonkey output.
   > 
   > ```
   > Root
   >   |----- Domain
   >   |       |== Account
   >   |       |== DomainOffering
   >   |----- Domain2
   >           |== Account2
   >           |== Domain2Offering
   > ```
   > 
   > #### No domainid passed -> all the service offerings are listed
   > ```
   > (localcloud)  > list serviceofferings filter=name,id
   > {
   >   "count": 4,
   >   "serviceoffering": [
   >     {
   >       "id": "95d95db2-2b2d-4660-853d-7871104505b5",
   >       "name": "Small Instance"
   >     },
   >     {
   >       "id": "cfdc2dc3-48c2-41db-bacf-6ef261e01b13",
   >       "name": "Medium Instance"
   >     },
   >     {
   >       "id": "c041a46b-3d52-4835-84f8-889be36b3057",
   >       "name": "DomainOffering"
   >     },
   >     {
   >       "id": "89bbe884-2aa2-4d76-9c10-e74796a0c27d",
   >       "name": "Domain2Offering"
   >     }
   >   ]
   > }
   > ```
   > 
   > #### Only the domainid passed -> service offerings in that domain are listed
   > ```
   > (localcloud)  > list serviceofferings domainid=33f0fc41-5637-48d5-8db6-f0ce866e1753 filter=name,id
   > {
   >   "count": 1,
   >   "serviceoffering": [
   >     {
   >       "id": "89bbe884-2aa2-4d76-9c10-e74796a0c27d",
   >       "name": "Domain2Offering"
   >     }
   >   ]
   > }
   > ```
   > 
   > #### the domainid and account are passed -> all the service offerings that account has access to are listed
   > ```
   > (localcloud)  > list serviceofferings domainid=33f0fc41-5637-48d5-8db6-f0ce866e1753 account=account2 filter=name,id
   > {
   >   "count": 3,
   >   "serviceoffering": [
   >     {
   >       "id": "95d95db2-2b2d-4660-853d-7871104505b5",
   >       "name": "Small Instance"
   >     },
   >     {
   >       "id": "cfdc2dc3-48c2-41db-bacf-6ef261e01b13",
   >       "name": "Medium Instance"
   >     },
   >     {
   >       "id": "89bbe884-2aa2-4d76-9c10-e74796a0c27d",
   >       "name": "Domain2Offering"
   >     }
   >   ]
   > }
   > ```
   @DaanHoogland @RodrigoDLopez The PR LGTM.
   
   I tested it manually, get the same result as my previous tests.. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] weizhouapache commented on a diff in pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on code in PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#discussion_r1290055358


##########
api/src/main/java/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java:
##########
@@ -82,6 +83,12 @@ public class ListServiceOfferingsCmd extends BaseListDomainResourcesCmd {
             since = "4.15")
     private Integer cpuSpeed;
 
+    @Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "list resources by account. Must be used with the domainId parameter.")

Review Comment:
   @RodrigoDLopez 
   same here, you can use `BaseListProjectAndAccountResourcesCmd` 



##########
api/src/main/java/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java:
##########
@@ -44,6 +45,12 @@ public class ListDiskOfferingsCmd extends BaseListDomainResourcesCmd {
     @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "name of the disk offering")
     private String diskOfferingName;
 
+    @Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "list resources by account. Must be used with the domainId parameter.")

Review Comment:
   @RodrigoDLopez 
   you can use `BaseListProjectAndAccountResourcesCmd` instead of `BaseListDomainResourcesCmd`
   then these are not needed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1679564304

   @weizhouapache a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] RodrigoDLopez commented on a diff in pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "RodrigoDLopez (via GitHub)" <gi...@apache.org>.
RodrigoDLopez commented on code in PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#discussion_r1296177282


##########
server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:
##########
@@ -3105,19 +3109,20 @@ private Pair<List<ServiceOfferingJoinVO>, Integer> searchForServiceOfferingsInte
         Integer cpuSpeed = cmd.getCpuSpeed();
         Boolean encryptRoot = cmd.getEncryptRoot();
 
+        final Account owner = _accountMgr.finalizeOwner(caller, accountName, domainId, projectId);
         SearchCriteria<ServiceOfferingJoinVO> sc = _srvOfferingJoinDao.createSearchCriteria();
-        if (!_accountMgr.isRootAdmin(caller.getId()) && isSystem) {
-            throw new InvalidParameterValueException("Only ROOT admins can access system's offering");
+        if (!_accountMgr.isRootAdmin(owner.getId()) && isSystem) {

Review Comment:
   I'll check further and get back to you.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] soreana commented on a diff in pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "soreana (via GitHub)" <gi...@apache.org>.
soreana commented on code in PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#discussion_r1295931684


##########
api/src/main/java/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java:
##########
@@ -16,21 +16,22 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.offering;
 
+import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd;
 import org.apache.cloudstack.api.response.StoragePoolResponse;
+import org.apache.cloudstack.api.response.ProjectResponse;

Review Comment:
   Can you please remove this line?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] codecov[bot] commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1379586740

   # [Codecov](https://codecov.io/gh/apache/cloudstack/pull/7082?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#7082](https://codecov.io/gh/apache/cloudstack/pull/7082?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6dc851a) into [main](https://codecov.io/gh/apache/cloudstack/commit/a3289f8ac0c611155130cefdadb2e73428478683?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a3289f8) will **increase** coverage by `0.18%`.
   > The diff coverage is `53.12%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##               main    #7082      +/-   ##
   ============================================
   + Coverage     11.59%   11.77%   +0.18%     
   - Complexity     7560     7670     +110     
   ============================================
     Files          2494     2503       +9     
     Lines        247109   245985    -1124     
     Branches      38619    38380     -239     
   ============================================
   + Hits          28646    28968     +322     
   + Misses       214719   213252    -1467     
   - Partials       3744     3765      +21     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/cloudstack/pull/7082?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ain/java/com/cloud/api/query/QueryManagerImpl.java](https://codecov.io/gh/apache/cloudstack/pull/7082?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvY29tL2Nsb3VkL2FwaS9xdWVyeS9RdWVyeU1hbmFnZXJJbXBsLmphdmE=) | `3.61% <53.12%> (+0.65%)` | :arrow_up: |
   | [...er/src/main/java/com/cloud/hypervisor/KVMGuru.java](https://codecov.io/gh/apache/cloudstack/pull/7082?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvY29tL2Nsb3VkL2h5cGVydmlzb3IvS1ZNR3VydS5qYXZh) | `50.81% <0.00%> (-22.41%)` | :arrow_down: |
   | [...ava/com/cloud/api/dispatch/ParamProcessWorker.java](https://codecov.io/gh/apache/cloudstack/pull/7082?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvY29tL2Nsb3VkL2FwaS9kaXNwYXRjaC9QYXJhbVByb2Nlc3NXb3JrZXIuamF2YQ==) | `13.82% <0.00%> (-0.29%)` | :arrow_down: |
   | [...n/java/com/cloud/storage/VolumeApiServiceImpl.java](https://codecov.io/gh/apache/cloudstack/pull/7082?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvY29tL2Nsb3VkL3N0b3JhZ2UvVm9sdW1lQXBpU2VydmljZUltcGwuamF2YQ==) | `12.99% <0.00%> (-0.03%)` | :arrow_down: |
   | [.../cloud/configuration/ConfigurationManagerImpl.java](https://codecov.io/gh/apache/cloudstack/pull/7082?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvY29tL2Nsb3VkL2NvbmZpZ3VyYXRpb24vQ29uZmlndXJhdGlvbk1hbmFnZXJJbXBsLmphdmE=) | `12.48% <0.00%> (-0.02%)` | :arrow_down: |
   | [...in/java/com/cloud/server/ManagementServerImpl.java](https://codecov.io/gh/apache/cloudstack/pull/7082?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvY29tL2Nsb3VkL3NlcnZlci9NYW5hZ2VtZW50U2VydmVySW1wbC5qYXZh) | `5.72% <0.00%> (-0.01%)` | :arrow_down: |
   | [...hypervisor/kvm/storage/StorPoolStorageAdaptor.java](https://codecov.io/gh/apache/cloudstack/pull/7082?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGx1Z2lucy9zdG9yYWdlL3ZvbHVtZS9zdG9ycG9vbC9zcmMvbWFpbi9qYXZhL2NvbS9jbG91ZC9oeXBlcnZpc29yL2t2bS9zdG9yYWdlL1N0b3JQb29sU3RvcmFnZUFkYXB0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...loudstack/storage/datastore/util/StorPoolUtil.java](https://codecov.io/gh/apache/cloudstack/pull/7082?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGx1Z2lucy9zdG9yYWdlL3ZvbHVtZS9zdG9ycG9vbC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvY2xvdWRzdGFjay9zdG9yYWdlL2RhdGFzdG9yZS91dGlsL1N0b3JQb29sVXRpbC5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...orage/datastore/provider/StorPoolHostListener.java](https://codecov.io/gh/apache/cloudstack/pull/7082?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGx1Z2lucy9zdG9yYWdlL3ZvbHVtZS9zdG9ycG9vbC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvY2xvdWRzdGFjay9zdG9yYWdlL2RhdGFzdG9yZS9wcm92aWRlci9TdG9yUG9vbEhvc3RMaXN0ZW5lci5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...e/wrapper/StorPoolModifyStorageCommandWrapper.java](https://codecov.io/gh/apache/cloudstack/pull/7082?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGx1Z2lucy9zdG9yYWdlL3ZvbHVtZS9zdG9ycG9vbC9zcmMvbWFpbi9qYXZhL2NvbS9jbG91ZC9oeXBlcnZpc29yL2t2bS9yZXNvdXJjZS93cmFwcGVyL1N0b3JQb29sTW9kaWZ5U3RvcmFnZUNvbW1hbmRXcmFwcGVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | ... and [36 more](https://codecov.io/gh/apache/cloudstack/pull/7082?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1445925853

   UI build: :heavy_check_mark:
   Live QA URL: https://qa.cloudstack.cloud/simulator/pr/7082 (QA-JID-57)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1748926633

   > @DaanHoogland, @soreana I just pushed new changes to when to use the caller and when to use the owner for some checks. I'm a bit removed from the community due to other activities that are consuming a lot of my time. But I'll try to be more active here from now on. If anyone can test this latest version, I would greatly appreciate it, and if further changes are necessary, please give me feedback here.
   
   @RodrigoDLopez I think that was the last remaining comment
   @soreana can you re-test?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1750125616

   @blueorangutan test


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1816405543

   <b>[LL] Trillian Build Failed (tid-6898)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1816482177

   @blueorangutan test


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] weizhouapache commented on a diff in pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by GitBox <gi...@apache.org>.
weizhouapache commented on code in PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#discussion_r1069859352


##########
server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:
##########
@@ -3378,6 +3384,63 @@ private Pair<List<ServiceOfferingJoinVO>, Integer> searchForServiceOfferingsInte
         return _srvOfferingJoinDao.searchAndCount(sc, searchFilter);
     }
 
+    /**
+     * Retrieves the API caller. If the projectId or accountName parameters were provided in the API call, consider the account or project as the API caller.
+     * With that, the APIs return will be filtered by the account defined in the API call.
+     * @param originalCaller Account that made the API call
+     * @param projectId projectId provided in API call
+     * @param accountName accountName provided in API call
+     * @param domainId domainId provided in API call
+     * @return Account object
+     */
+    protected Account getCallerAccordingToProjectIdAndAccountNameAndDomainId(Account originalCaller, Long projectId, String accountName, Long domainId) {

Review Comment:
   @RodrigoDLopez 
   I think these new methods can be replaced by _accountMgr.finalizeOwner
   please try with it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1380356815

   @blueorangutan test


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] kiranchavala commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "kiranchavala (via GitHub)" <gi...@apache.org>.
kiranchavala commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1445918157

   @blueorangutan ui


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1668120670

   Packaging result [SF]: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: el9 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 6694


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1679258921

   @weizhouapache a [SF] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] weizhouapache commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1679562556

   @blueorangutan test


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] weizhouapache commented on a diff in pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on code in PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#discussion_r1295765587


##########
api/src/main/java/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java:
##########
@@ -16,28 +16,30 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.offering;
 
+import org.apache.cloudstack.api.BaseCmd;

Review Comment:
   `BaseCmd` is not required



##########
server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:
##########
@@ -3105,9 +3109,10 @@ private Pair<List<ServiceOfferingJoinVO>, Integer> searchForServiceOfferingsInte
         Integer cpuSpeed = cmd.getCpuSpeed();
         Boolean encryptRoot = cmd.getEncryptRoot();
 
+        caller = _accountMgr.finalizeOwner(caller, accountName, domainId, projectId);

Review Comment:
   should this be `owner` ?
   `caller` should be a final variable which cannot be modified.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1680437604

   @DaanHoogland a [SF] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1680507123

   @RodrigoDLopez , some errors from the build:
   ```
   13:37:33 [INFO] Starting audit...
   13:37:36 [ERROR] /jenkins/workspace/acs-centos7-pkg-builder/dist/rpmbuild/BUILD/cloudstack-4.18.1.0-SNAPSHOT/api/src/main/java/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java:21:8: Unused import - org.apache.cloudstack.api.response.ProjectResponse. [UnusedImports]
   13:37:36 [ERROR] /jenkins/workspace/acs-centos7-pkg-builder/dist/rpmbuild/BUILD/cloudstack-4.18.1.0-SNAPSHOT/api/src/main/java/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java:21:8: Unused import - org.apache.cloudstack.api.response.ProjectResponse. [UnusedImports]
   13:37:36 Audit done.
   ```
   
   also found at https://github.com/apache/cloudstack/actions/runs/5878088774/job/15939912956?pr=7082#step:7:4621


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "soreana (via GitHub)" <gi...@apache.org>.
soreana commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1743233778

   > @soreana @RodrigoDLopez , will you work on this in the near future?
   
   @DaanHoogland I'm waiting for @RodrigoDLopez to update the PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1828005063

   Packaging result [SF]: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: el9 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 7839


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1827891621

   @soreana a [SL] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1772906392

   @soreana busy weekend ? ;)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] sonarcloud[bot] commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1396097018

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=7082)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7082&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7082&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7082&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7082&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7082&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7082&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=7082&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=7082&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=7082&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7082&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7082&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=7082&resolved=false&types=CODE_SMELL)
   
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7082&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7082&metric=new_coverage&view=list)  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7082&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=7082&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1667991743

   @soreana a [SF] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] soreana commented on a diff in pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "soreana (via GitHub)" <gi...@apache.org>.
soreana commented on code in PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#discussion_r1295931684


##########
api/src/main/java/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java:
##########
@@ -16,21 +16,22 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.offering;
 
+import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd;
 import org.apache.cloudstack.api.response.StoragePoolResponse;
+import org.apache.cloudstack.api.response.ProjectResponse;

Review Comment:
   Can you please remove this line?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on a diff in pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#discussion_r1295605507


##########
api/src/main/java/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java:
##########
@@ -44,6 +45,12 @@ public class ListDiskOfferingsCmd extends BaseListDomainResourcesCmd {
     @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "name of the disk offering")
     private String diskOfferingName;
 
+    @Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "list resources by account.")
+    private String accountName;
+
+    @Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.UUID, entityType = ProjectResponse.class, description = "list objects by project.")
+    private Long projectId;
+

Review Comment:
   @RodrigoDLopez , now that you inherit `BaseListProjectAndAccountResourcesCmd`
   ```suggestion
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] blueorangutan commented on pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1680238262

   <b>[SF] Trillian test result (tid-7432)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 44038 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7082-t7432-kvm-centos7.zip
   Smoke tests completed. 108 look OK, 0 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] DaanHoogland commented on a diff in pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#discussion_r1295606625


##########
api/src/main/java/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java:
##########
@@ -130,6 +138,14 @@ public Integer getCpuSpeed() {
 
     public Boolean getEncryptRoot() { return encryptRoot; }
 
+    public String getAccountName() {
+        return accountName;
+    }
+
+    public Long getProjectId() {
+        return projectId;
+    }
+

Review Comment:
   ```suggestion
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] weizhouapache commented on a diff in pull request #7082: allow filtering of listDiskOffering and listServiceOffering APIs by account or project

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on code in PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#discussion_r1296166728


##########
server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:
##########
@@ -3105,19 +3109,20 @@ private Pair<List<ServiceOfferingJoinVO>, Integer> searchForServiceOfferingsInte
         Integer cpuSpeed = cmd.getCpuSpeed();
         Boolean encryptRoot = cmd.getEncryptRoot();
 
+        final Account owner = _accountMgr.finalizeOwner(caller, accountName, domainId, projectId);
         SearchCriteria<ServiceOfferingJoinVO> sc = _srvOfferingJoinDao.createSearchCriteria();
-        if (!_accountMgr.isRootAdmin(caller.getId()) && isSystem) {
-            throw new InvalidParameterValueException("Only ROOT admins can access system's offering");
+        if (!_accountMgr.isRootAdmin(owner.getId()) && isSystem) {

Review Comment:
   @RodrigoDLopez 
   I did not look into it yet,
   I think in some lines, we should use `caller` , not `owner`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1743048885

   @soreana @RodrigoDLopez , will you work on this in the near future?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1748927078

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1817483743

   @weizhouapache can you approve of the current state of this PR?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] allow filtering of listDiskOffering and listServiceOffering APIs by account or project [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #7082:
URL: https://github.com/apache/cloudstack/pull/7082#issuecomment-1817329156

   <b>[SF] Trillian test result (tid-8360)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 42449 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7082-t8360-kvm-centos7.zip
   Smoke tests completed. 107 look OK, 2 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_08_upgrade_kubernetes_ha_cluster | `Failure` | 675.71 | test_kubernetes_clusters.py
   test_08_migrate_vm | `Error` | 0.05 | test_vm_life_cycle.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org