----- Original Message ----- > From: "Yevgeny Zaspitsky" <yzasp...@redhat.com> > To: "Martin Mucha" <mmu...@redhat.com> > Cc: us...@ovrit.org, devel@ovirt.org > Sent: Sunday, April 27, 2014 2:29:46 PM > Subject: Re: [ovirt-devel] Feature Page: Mac Pool per DC > > Martin, > > I'd like to propose a different approach on how the ranges to be defined and > stored. > > Discussing this feature with Moti raised the alternative UX design: > Defining ranges could be added as a left-tab on create DC dialog and a > sub-tab on an existing DC. It would be a table of start and end address > fields and we can add a calculated # of MACs in the range and/or summary for > the DC. > Also that will make string parsing unneeded, prevent possible user mistakes > in the string format and make possible validating every field of the range > on the UI side easier. > As you can see on the screenshot you've attached even a single range doesn't > fit to the text box. In case of multiple ranges managing them in a single > line textbox would be very uncomfortable. > > A range is an object with at least 2 members (start and end). And we have few > of these for each data center. > Storing a collection of the objects in a single field in a relational DB > seems a bit awkward to me. > That has few disadvantages: > 1. is not normalized > 2. make data validation nearly impossible > 3. make querying the data very difficult > 4. is restraining our ability to extend the object (e.g. a user might like to > give a description to a range) > So IMHO a satellite table with the FK to storage_pool would be a more robust > design. >
Another major consideration is the API modelling. With the proposed design, the DataCenter element will be extended with a string type 'mac_pool_ranges' element which stores the DC mac pool ranges. In order to add/update/remove a range, the user will use the PUT method of the api/datacenters/{datacenter:id} api. I think a better approach (which completes the alternative) is having the data-center mac pool ranges as a sub collection of a specific data-center: List all of the data-center ranges: GET api/datacenters/{datacenter:id}/macpoolranges Add new range to a specific data-center: POST api/datacenters/{datacenter:id}/macpoolranges <mac_pool_range> <start>00:00:00:00:00:00</start> <end>00:00:00:00:00:AA</end> </mac_pool_range> Retrieve a specific range of a data-center: GET api/datacenters/{datacenter:id}/macpoolranges/{macpoolrange:id} Modifying a specific data-center range: PUT api/datacenters/{datacenter:id}/macpoolranges/{macpoolrange:id} <mac_pool_range> <end>00:00:00:00:00:BB</end> </mac_pool_range> Removing a specific data-center's range: DELETE api/datacenters/{datacenter:id}/macpoolranges/{macpoolrange:id} Such design will maintain the ability to extend the range, for example reporting the amount of allocated addresses in the range, add a name/description and so on. Juan, can you share your thoughts about the above from restapi pov ? > Best regards, > ____________________ > Yevgeny Zaspitsky > Senior Software Engineer > Red Hat Israel > > > ----- Original Message ----- > From: "Martin Mucha" <mmu...@redhat.com> > To: us...@ovirt.org, devel@ovirt.org > Sent: Thursday, April 10, 2014 9:59:44 AM > Subject: [ovirt-devel] new feature > > Hi, > > I'd like to notify you about new feature, which allows to specify distinct > MAC pools, currently one per data center. > http://www.ovirt.org/Scoped_MacPoolManager > > any comments/proposals for improvement are very welcomed. > Martin. > _______________________________________________ > Devel mailing list > Devel@ovirt.org > http://lists.ovirt.org/mailman/listinfo/devel > _______________________________________________ > Devel mailing list > Devel@ovirt.org > http://lists.ovirt.org/mailman/listinfo/devel > _______________________________________________ Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel