shwstppr opened a new pull request #3248: [WIP DO NOT MERGE] Enable service 
offerings to be scoped to domain(s) and zone(s) 
URL: https://github.com/apache/cloudstack/pull/3248
 
 
   ## Description
   **Problem**: Service, disk, network, and VPC offerings cannot be linked to 
specified multiple domain(s) and zone(s).
   **Root cause**: Service, disk, network, and VPC offerings are independent of 
zones. Service and disk offerings can be linked only to a single 
domain/sub-domain
   **Solution**: Service, disk, network, and VPC offerings will be allowed to 
be created with specified domain(s) and zone(s). Offerings linked with multiple 
domains and zones can be created both with UI and API. Refactored create 
offering  API to allow the passing list of domain and zone IDs with `domainid` 
and `zoneid` parameter respectively. UI has been refactored to allow selecting 
multiple domains and zones while creating offering using multi-select elements. 
When the list of passed domains contain both parent and child domains, the 
offering will be created for the parent domain. Offering details will now show 
a list of linked domains and zones as a comma-separated list of names. Linked 
domains and zones will be stored in the `cloud.*_offering_details` table in the 
database as a separate row for each domain and zone ID with key domainid and 
zoneid respectively.
   Linked domain(s) and zone(s) for an offering (service, disk, network, or 
VPC) can be updated using update*Offering API. To make a domain-specific 
offering public by root admin, `domainid=public` can be passed in the API call. 
To make a zone specific offering available for all zones by root admin, 
`zoneid=all` can be passed in the API call. Update Offering Access action has 
been added to the offerings page in UI which will allow updating linked 
domain(s) and zone(s) for an offering.
   Domain-admins can update compute and disk offerings. However, they can not 
change zones for the offerings specified for their domain or subdomains. They 
cannot change name, display text, sort-key for offerings specified for their 
domains/subdomains and also other domains which are not child domain for them. 
They can chnage domains(within their subdomains) for the offerings specified 
for their domains/subdomains.
   
   ## Types of changes
   <!--- What types of changes does your code introduce? Put an `x` in all the 
boxes that apply: -->
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [x] 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)
   
   ## Screenshots (if appropriate):
   Updated create offering forms
   ![Screenshot from 2019-05-24 
14-39-41](https://user-images.githubusercontent.com/153340/58317236-04c59400-7e33-11e9-9fbd-59546a1e4011.png)
   ![Screenshot from 2019-05-24 
14-40-46](https://user-images.githubusercontent.com/153340/58317255-0b540b80-7e33-11e9-98bf-0348dc538203.png)
   ![Screenshot from 2019-05-24 
14-41-18](https://user-images.githubusercontent.com/153340/58317266-0ee79280-7e33-11e9-93f3-d268b728e955.png)
   ![Screenshot from 2019-05-24 
14-41-42](https://user-images.githubusercontent.com/153340/58317273-11e28300-7e33-11e9-9d4a-9030942cd864.png)
   
   
   Updated disk offering details with domains and zones,
   ![Screenshot from 2019-03-27 
17-07-44](https://user-images.githubusercontent.com/153340/55073505-e9007480-50b3-11e9-81c6-82c161122b64.png)
   
   Update Offering Access UI
   ![Screenshot from 2019-06-24 
16-28-23](https://user-images.githubusercontent.com/153340/60013932-629d0400-969d-11e9-8ca2-37a4d36b009b.png)
   ![Screenshot from 2019-06-24 
16-28-34](https://user-images.githubusercontent.com/153340/60013940-6597f480-969d-11e9-81dd-195c9233f9da.png)
   
   
   Cloudmonkey API call
   ![Screenshot from 2019-03-27 
17-07-27](https://user-images.githubusercontent.com/153340/55073521-f0278280-50b3-11e9-8f50-c98bd6be3c26.png)
   
   Update offering API call
   ```
   update serviceoffering id=02cd857c-0009-4f8f-8dc6-96d86745a88f 
domainid=public zoneid=all
   {
     "serviceoffering": {
       "cpunumber": 1,
       "cpuspeed": 1000,
       "created": "2019-06-21T14:55:25+0530",
       "defaultuse": false,
       "displaytext": "lol",
       "id": "02cd857c-0009-4f8f-8dc6-96d86745a88f",
       "iscustomized": false,
       "issystem": false,
       "isvolatile": false,
       "limitcpuuse": false,
       "memory": 1234,
       "name": "lol",
       "offerha": false,
       "provisioningtype": "thin",
       "storagetype": "shared"
     }
   }
   
   update serviceoffering id=02cd857c-0009-4f8f-8dc6-96d86745a88f 
zoneid=3d2139c0-b122-46ec-9167-6312f5928f11,8d616250-146f-4694-a167-c6c0795f8bcf
 
domainid=804ebc06-f5d2-46e7-b84c-670bd0a02398,3aeefdda-f1e1-4c74-a0cb-062f42ccef05
   {
     "serviceoffering": {
       "cpunumber": 1,
       "cpuspeed": 1000,
       "created": "2019-06-21T14:55:25+0530",
       "defaultuse": false,
       "displaytext": "lol",
       "domain": "L11,Something",
       "domainid": 
"3aeefdda-f1e1-4c74-a0cb-062f42ccef05,804ebc06-f5d2-46e7-b84c-670bd0a02398",
       "id": "02cd857c-0009-4f8f-8dc6-96d86745a88f",
       "iscustomized": false,
       "issystem": false,
       "isvolatile": false,
       "limitcpuuse": false,
       "memory": 1234,
       "name": "lol",
       "offerha": false,
       "provisioningtype": "thin",
       "serviceofferingdetails": {
         "domainid": "5",
         "zoneid": "2"
       },
       "storagetype": "shared",
       "zone": "Sandbox-simulator,Sandbox-simulator1",
       "zoneid": 
"3d2139c0-b122-46ec-9167-6312f5928f11,8d616250-146f-4694-a167-c6c0795f8bcf"
     }
   }
   
   ```
   
   
   ## How Has This Been Tested?
   From UI and cmk
   
   
   <!-- Please read the 
[CONTRIBUTING](https://github.com/apache/cloudstack/blob/master/CONTRIBUTING.md)
 document -->
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to