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

   ### Description
   
   When an affinity group is composed of dedicated resources, the 
`listAffinityGroups` API does not show any information about the resources of 
the group.
   
   This PR, therefore, adds which dedicated resources are related to a given 
affinity group in the `listAffinityGroups` API response and displays a link to 
them in the UI. Furthermore, the affinity groups default title and description 
were modified in order to reflect the type of the resource that they are 
associated with. 
   
   ### 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)
   - [ ] build/CI
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [X] Minor
   
   ### Screenshots:
   
   <details>
   <summary>Affinity group details for Root Admin users</summary>
   
   
![image](https://github.com/apache/cloudstack/assets/115510880/bb0df918-c28f-4b93-920b-e455def74ba7)
   </details>
   
   <details>
   <summary>Affinity group details for non Root Admin users</summary>
   
   
![image](https://github.com/apache/cloudstack/assets/115510880/907d8fc9-b3cb-4f5e-a2a6-f7d145e0e04d)
   </details>
   
   ### How Has This Been Tested?
   
   #### Tests with a root admin user
   
   1. I logged in as a root admin.
   2. I dedicated a host called `host-02` to the domain `ROOT`.
   3. I dedicated a host called `host-01` to the domain `ROOT`.
   4. I executed the `listAffinityGroups` API through CloudMonkey and I got the 
following response:
       
   <details>
   <summary><code>listAffinityGroups</code></summary>
   
   ```bash
   {
     "affinitygroup": [
       {
         "account": "system",
         "dedicatedresources": [
           {
             "resourceid": "8a783642-c6a0-4948-8128-61aa73aef8a9",
             "resourcename": "host-02",
             "resourcetype": "Host"
           },
           {
             "resourceid": "8928748b-cf9c-46df-b4c8-b39f476ebad3",
             "resourcename": "host-01",
             "resourcetype": "Host"
           }
         ],
         "description": "Dedicated host group",
         "domain": "ROOT",
         "domainid": "ba820fc7-12ea-11ef-9500-d283eea8b15e",
         "id": "6623fe64-2c01-41ba-bf79-58c8fa7c0e16",
         "name": "DedicatedHostGrp-domain-ROOT",
         "type": "ExplicitDedication"
       }
     ],
     "count": 1
   }
   ```
   </details>
   
   5. Through UI, I accessed the affinity groups submenu and I selected the 
created group, noticing the following result:
   
   <details>
   <summary>Affinity group details image</summary>
   
   
![image](https://github.com/apache/cloudstack/assets/115510880/c0eae33a-c286-41f6-944d-ace39705cdbd)
   </details>
   
   #### Tests with a non root admin user
   
   1. I logged in with an account with the User role.
   2. I executed the `listAffinityGroups` API through CloudMonkey and I got the 
following response:
   
   <details>
   <summary><code>listAffinityGroups</code></summary>
   
   ```bash
   {
     "affinitygroup": [
       {
         "account": "system",
         "description": "Dedicated host group",
         "domain": "ROOT",
         "domainid": "ba820fc7-12ea-11ef-9500-d283eea8b15e",
         "id": "6623fe64-2c01-41ba-bf79-58c8fa7c0e16",
         "name": "DedicatedHostGrp-domain-ROOT",
         "type": "ExplicitDedication"
       }
     ],
     "count": 1
   }
   ```
   </details>
   
   As it can be observed, the `dedicatedresources` field was not returned on 
the response.
   
   3. Through UI, I accessed the affinity groups submenu and I selected the 
created group, noticing the following result:
   <details>
   <summary>Affinity group details image</summary>
   
   
![image](https://github.com/apache/cloudstack/assets/115510880/609b867b-f723-41df-b246-322713f488dc)
   </details>


-- 
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-unsubscr...@cloudstack.apache.org

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

Reply via email to