I didn't realize this. Checking into it now, this is what Google does: Looks like for the single-record response method (get, create), they just return the first one:
https://github.com/apache/libcloud/blob/trunk/libcloud/dns/drivers/google.p y#L146 But for list, it puts the entire recordset dict in the 'data' field: https://github.com/apache/libcloud/blob/trunk/libcloud/dns/drivers/google.p y#L374 This is almost certainly undesirable and it should probably flatten the list into individual records. It's possible I'm misreading the code here, as I can't imagine anyone is actually using it as-is. Route53 does something similar on get record (returns only the first): https://github.com/apache/libcloud/blob/trunk/libcloud/dns/drivers/route53. py#L148 But for iterate_records, it appears to flatten the list as I proposed for Designate: https://github.com/apache/libcloud/blob/trunk/libcloud/dns/drivers/route53. py#L430 I think the Route53 model seems to make the most sense, although IMO if the recordset has multiple records and they do a get_record on it, it should throw an exception rather than just returning the first one. But for consistency I can follow that model. Greg On 12/8/15, 10:15 AM, "Mac Innes, Kiall" <ki...@hpe.com> wrote: >Hey Greg, > >Awesome! Nice to see libcloud growing support for OpenStack Designate :) > >To my knowledge, nobody else is currently implementing support in >libcloud.. > >To the RRSets issue - I'm curious how this was implemented in the Google >DNS and AWS Route53 drivers, as both of these services also group RR's >into RRSets: > >https://cloud.google.com/dns/api/v1/resourceRecordSets#resource >http://docs.aws.amazon.com/Route53/latest/APIReference/API_ListResourceRec >ordSets.html > >Thanks, >Kiall > >-----Original Message----- >From: Greg Hill [mailto:greg.h...@rackspace.com] >Sent: 08 December 2015 16:01 >To: dev@libcloud.apache.org >Cc: Mac Innes, Kiall >Subject: Re: [dev] Openstack Designate support? > >I am looking at the API docs. Apparently they group records in to >"record sets". So if you have multiple records with the same name and >type (like multiple A records for round-robin DNS, or multiple MX >records), those get lumped together into a single "record set". Since >the libcloud dns driver handles individual records, I was thinking I >would just take the set and flatten it into multiple records with the >same id and then have the designate driver internally handle the >create/update/delete logic on individual records by merging them into >record sets for the API. I could expose the record sets directly as >extension methods (ex_iterate_record_sets, etc) for people who wanted to >leverage the sets, but leave the builtin methods in terms of records. > >Any objections to that approach? > >https://wiki.openstack.org/wiki/Designate/APIv2 > > >Greg > >On 12/4/15, 2:29 PM, "Patrick Galbraith" <p...@patg.net> wrote: > >>Hi there < KIall would knowŠ. >> >> >>> On Dec 4, 2015, at 2:59 PM, Greg Hill <greg.h...@rackspace.com> wrote: >>> >>> Designate is the Openstack DNS API. I don't think libcloud supports >>>it yet. Is anyone working on this? If not, I can probably get to it >>>soon(ish). >>> >>> Greg >> >