Parsing responses from the syncupdates-API

Hi all, for my current work I occasionally patch the Net::Whois::Object Perl module (http://search.cpan.org/perldoc?Net%3A%3AWhois%3A%3AObject) which supports talking to the RIPE syncupdates API. Now I'm facing the challenge of parsing the response when creating an object. For example when creating a new handle, the response used to include something along the lines of *** Info: Authorisation for [TS34027-RIPE] from which I could easily extract the handle (which I don't know in advance, because the request I sent contained AUTO-1 as the handle). Now the response doesn't include that information anymore, and instead I get Create SUCCEEDED: [person] TS34027-RIPE Thomas Schoeller from which I don't know how to extract the new handle. I've considered simply using the first word after the [person] block (as regex, \[.*?\]\s+(\S+) or something similar), but that won't work for an inetnum, where the primary key contains spaces. Is there any robust approach on how to extract the primary key from the response? (If person records are the only ones where the primary key is generated from the database, I can special-case that, but it still feels rather fragile). Cheers, Moritz P.S. I should add that so far, I've been pretty amazed by the quality of responses on this mailing list, and from RIPE in general. Thanks everybody, and keep up the good work!

Hi Moritz, I am sure there are other list members who can provide solutions to this, but from RIPE Database behaviour point of view only creation of "person", "role" and "organisation" objects support use of auto-generated primary keys(*). For creation of other object types and modification or deletion of all objects types, the primary key should be explicitly provided. Hope that helps. Kind Regards, Kaveh. (*)- It is also the case for creation of key-cert objects, only if the object contains an X.509 key. In that case, the "key-cert:" value is auto generated. --- Kaveh Ranjbar, RIPE NCC Database Group Manager On Jan 11, 2013, at 10:20 AM, Moritz Lenz <moritz.lenz@noris.de> wrote:
Hi all,
for my current work I occasionally patch the Net::Whois::Object Perl module (http://search.cpan.org/perldoc?Net%3A%3AWhois%3A%3AObject) which supports talking to the RIPE syncupdates API.
Now I'm facing the challenge of parsing the response when creating an object. For example when creating a new handle, the response used to include something along the lines of
*** Info: Authorisation for [TS34027-RIPE]
from which I could easily extract the handle (which I don't know in advance, because the request I sent contained AUTO-1 as the handle).
Now the response doesn't include that information anymore, and instead I get
Create SUCCEEDED: [person] TS34027-RIPE Thomas Schoeller
from which I don't know how to extract the new handle.
I've considered simply using the first word after the [person] block (as regex, \[.*?\]\s+(\S+) or something similar), but that won't work for an inetnum, where the primary key contains spaces.
Is there any robust approach on how to extract the primary key from the response?
(If person records are the only ones where the primary key is generated from the database, I can special-case that, but it still feels rather fragile).
Cheers, Moritz
P.S. I should add that so far, I've been pretty amazed by the quality of responses on this mailing list, and from RIPE in general. Thanks everybody, and keep up the good work!
participants (2)
-
Kaveh Ranjbar
-
Moritz Lenz