NAME

UltraDNS - Client API for the NeuStar UltraDNS Transaction Protocol

SYNOPSIS

use UltraDNS;

# establish a secure connection
my $udns = UltraDNS->connect("$host:$port", $sponsor, $username, $password);

# Queue up one or more actions to be performed
$udns->CreateARecord($zone);
$udns->CreateCNAMERecord($zone);

# Send actions as a single transaction
$udns->commit(...); # throws exception on error

# queue up and commit more requests on the same connection

Getting multiple results:

# Actions can return results. Each return value is a reference
# to where the result will be stored when commit() is called.
$result_ref1 = $udns->GetZoneInfo($zone);
$result_ref2 = $udns->GetMXRecordsOfZone($zone);

$udns->commit(...);

# $result_ref values above now refer to the results for each method

Getting a single result:

# utility method that calls commit and returns the dereferenced result
$result = $udns->do( ...some method that queues a request... );

$result = $udns->do( $udns->AutoSerialUpdateState );
# $result is either 1 or 0

DESCRIPTION

A simple and efficient client for the NeuStar UltraDNS Transaction Protocol as defined in http://www.ultradns.net/api/NUS_API_XML.pdf (version 3.0, dated September 5, 2008),

All requests are batched and performed in transactions. A single secure connection is established and reused for any number of transactions.

All errors are reported via exceptions.

STATUS

All methods are supported, though currently some data types don't work. The handling of results and non-scalar arguments is likely to change.

Experimentation and feedback are encouraged.

METHODS

connect

$udns = UltraDNS->connect($host_and_port, $sponsor, $username, $password, $attr);

Establish a secure https connection to the specified UltraDNS host and port, and login using the specified $sponsor, $username, $password.

Returns an UltraDNS object. Throws an exception on error.

The optional $attr parameter is a reference to a hash of attributes:

trace

Specifies the integer trace (debug) level. 0 for none, 1 for basic tracing, and 2 and above for more detailed, and more verbose, tracing. Trace messages are output via warn.

ssl_trace

Sets $Net::SSLeay::trace. 0=no warns, 1=only errors, 2=ciphers, 3=progress, 4=dump data. See Net::SSLeay for more information.

version

Specifies the protocol version argument value used in the UDNS_OpenConnection request.

See UltraDNS::Methods for a list of the UltraDNS Transaction Protocol methods you can call once a connection is established.

commit

$udns->commit;

Submits the queued requests. An exception is thown on error.

rollback

$udns->rollback;

Discards the queued requests.

do

$result = $udns->do( $udns->SomeMethodThatReturnsAResult(...) );

A convienience method that calls commit() and returns the de-referenced argument. The one-line call has the same effect as these three lines:

$result_ref = $udns->SomeMethodThatReturnsAResult(...);
$udns->commit;
$result = $$result_ref; # de-reference to get return value

but is much more convienient when you just want to get a value from the server.

Multiple calls can be combined into a single request like this:

my ($a, $b, $c) = $udns->do(
    $udns->MethodReturningA(...),
    $udns->MethodReturningB(...),
    $udns->MethodReturningC(...)
);

LIMITATIONS

A transaction can only contain 10 requests by default because the UltraDNS module calls UDNS_NoAutoCommit on connection, to ensure reliability, and NeuStar impose the 10 requests per transaction limit. This shouldn't be a problem in practice because transactions are cheap (since they reuse the same connection) so you can issue your requests grouped into multiple transactions.

BUGS

Please report any bugs or feature requests to bug-ultradns@rt.cpan.org, or through the web interface at http://rt.cpan.org.

AUTHOR

Tim Bunce <Tim.Bunce@pobox.com>

LICENCE AND COPYRIGHT

Copyright (c) 2009, TigerLead.com. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.