so many if-else statements :) I would prefer making zoneid optional and defaulting it to -1.
simple and clear. ~Rajani On 26-Sep-2015, at 1:34 am, Boris Schrijver <[email protected]> wrote: > Hi Patrick, > > We're using S3 and are facing the same issues. > > This would indeed be a very good idea. Though I think it will also remove a > kind > of safety check by making it optional. > > The solution would be to make zoneId optional and add a optional boolean > variable crossZones. > > If zoneId is empty and crossZones is not set, or not set to true, then fail. > If zoneId is empty and crossZones is set to true then succeed and add -1 in > the > background (for now, maybe add a boolean crossZones to the template as well.) > If zoneId is set and crossZones is not set, or not set to true, then succeed. > If zoneId is set and crossZones is set to true, then fail > > Even add a check if zoneId is set to -1 and crossZones is set to true, then > still succeed. And the other way around. > > This way it doesn't alter the default behavior. > > Any opinions? > > Best regards, > > Boris Schrijver > > TEL: +31633784542 > MAIL: [email protected] > >> >> On September 25, 2015 at 9:32 PM Patrick Dube <[email protected]> >> wrote: >> >> >> Hey guys/gals, >> >> I am using Swift as secondary storage, which is cross zones. To register >> templates, there is a mandatory zoneid field. I have found that if i put >> zoneid=-1, it will work (mark the templates as cross zones), but it is >> very >> unintuitive. This also causes problems using a tool like Terraform, which >> expects the zoneid in the response (since it is a required field). What do >> you think about rendering the zone field optional (defaulting to -1 on the >> server)? This would simplify the API and make region wide templates more >> intuitive. >> >> Thank you, >> >> Patrick
