[Freeipa-devel] Structured DNS record API proposal

Martin Kosek mkosek at redhat.com
Tue Sep 20 15:11:30 UTC 2011


On Tue, 2011-09-20 at 10:02 -0400, Adam Young wrote:
> This discussion got me thinking, always a dangerous proposal:
> 
> We are currently exposing record add with the lie  that  when you add a 
> record, it has a type.  THe reality is that a record is just this big 
> collection of multi value attributes, and each of those  is the "type"  
> of the record.

The way I see it is that we have different types of Resource Records
with a (domain) name that can be shared.

> 
> 
> If all of the 'records'  have the same idnsname, then they really fall 
> under the same Record object in LDAP.

Yes. 

> 
> What if we focuses on the attribtutes themselves, and add the type info 
> there.

I thought we do this already.

> 
> 
> Pie in the sky proposal.   Treat it as a starting point:
> 
>  From the webui perspective
> dnsrecord-add   allows the case where it just has the the idnsname with 
> no "records"
> 
> dnsrecordattr-mod  takes record type specific values.
> 
> To add a location entry:
> 
> ipa dnsrecordattr-mod --append location --lat-deg=INT --lat-min=INT --lat-sec=FLOAT --lat-dir=ENUM --lon-deg=INT --lon-min=INT --lon-sec=FLOAT --lon-dir=ENUM --alt=FLOAT --h-precision=FLOAT --v-precision=FLOAT
> 
> 
> And to remove it
> 
> ipa dnsrecordattr-mod --remove location --lat-deg=INT --lat-min=INT --lat-sec=FLOAT --lat-dir=ENUM --lon-deg=INT --lon-min=INT --lon-sec=FLOAT --lon-dir=ENUM --alt=FLOAT --h-precision=FLOAT --v-precision=FLOAT

So if user would want to remove a LOC record, he would have to pass all
these attributes to refer which attribute value to remove?

> 
> mod2 is expected to work on a single attribute at a time.
> 

I don't think this is good, dnsrecordattr would then have to accept all
possible DNS parts from all supported structured DNS records, i.e. if
you'd run "ipa dnsrecordattr-mod --help" you would get a list of DNS
parts from LOC (you wrote the options above), KX, NAPTR, etc. which
would be handled by dnsrecordattr.

Each RR type should have its own command, as I proposed. Then if user
wants to add a LOC record, he can just execute:

# ipa dnsrecord-loc-add --help

CLI then offers a list of options for all parts of the structured DNS
record.

I designed it this way so that it keeps current DNS API and is
consistent with the rest of the record.

I think that proposed interface for adding is OK, Adam Tkac acked it
too. I just wasn't sure how to help webui show structured DNS record
(fill the fields/parts from the "raw" structured DNS record) and how to
modify. Proposed API is in the mail you replied to.

Martin




More information about the Freeipa-devel mailing list