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>  </details> <details> <summary>Affinity group details for non Root Admin users</summary>  </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>  </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>  </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