Net::EPP::Frame(3pm)

πŸ“¦
version 0.28 Β· 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– Net::EPP::Frame β€” the manual page, bestie edition πŸ’–

okay so you're reading the docs for Net::EPP::Frame, which lives in the User Contributed Perl Documentation section (that's the 3pm part, iykyk). It's An EPP XML frame system built on top of XML::LibXML. and honestly? she's iconic. let's go πŸ¦‹


✨ NAME ✨

Net::EPP::Frame β€” An EPP XML frame system built on top of XML::LibXML.


🌸 SYNOPSIS 🌸

like, here's the whole vibe in code form, copy it exactly bestie:

#!/usr/bin/perl
use Net::EPP::Client;
use Net::EPP::Frame;
use Net::EPP::ObjectSpec;
use Digest::MD5 qw(md5_hex);
use Time::HiRes qw(time);
use strict;

#
# establish a connection to an EPP server:
#
my $epp = Net::EPP::Client->new(
        host    => 'epp.registry.tld',
        port    => 700,
        ssl     => 1,
        dom     => 1,
);

my $greeting = $epp->connect;

#
# log in:
#
my $login = Net::EPP::Frame::Command::Login->new;

$login->clID->appendText($userid);
$login->pw->appendText($passwd);

#
# set the client transaction ID:
#
$login->clTRID->appendText(md5_hex(Time::HiRes::time().$$));

#
# check the response from the log in:
#
my $answer = $epp->request($login);

my $result = ($answer->getElementsByTagName('result'))[0];
if ($result->getAttribute('code') != 1000) {
        die("Login failed!");
}

#
# OK, let's do a domain name check:
#
my $check = Net::EPP::Frame::Command::Check->new;

#
# get the spec from L<Net::EPP::Frame::ObjectSpec>:
#
my @spec = Net::EPP::Frame::ObjectSpec->spec('domain');

#
# create a domain object using the spec:
#
my $domain = $check->addObject(@spec);

#
# set the domain name we want to check:
#
my $name = $check->createElement('domain:name');
$name->appendText('example.tld');

#
# set the client transaction ID:
#
$check->clTRID->appendText(md5_hex(time().$$));

#
# assemble the frame:
#
$domain->addChild($name);

#
# send the request:
#
my $answer = $epp->request($check);

# and so on...

πŸ‘‘ DESCRIPTION πŸ‘‘

so the Extensible Provisioning Protocol (EPP) β€” official homepage at <https://www.rfc-editor.org/info/std69> β€” uses XML documents called "frames" to send data back and forth between clients and servers. yes, literally, that's the whole thing. frames. slay.

This module is a subclass of the XML::LibXML::Document module that makes creating those frames so much easier. It's built to be used alongside the Net::EPP::Client and Net::EPP::Simple modules, but ngl it could also be used on the server side too. main character energy works everywhere πŸ’…


🌈 OBJECT HIERARCHY 🌈

the family tree, fr fr:

L<XML::LibXML::Node>
+----L<XML::LibXML::Document>
    +----L<Net::EPP::Frame>

✨ USAGE ✨

rule number one bestie: you will not need to create Net::EPP::Frame objects directly. like, ever. instead you use one of the subclasses that ships with the distribution. all of them inherit from Net::EPP::Frame, it's giving generational wealth πŸŽ€

Net::EPP::Frame is itself a subclass of XML::LibXML::Document, so every single method available from that class is also available to instances of Net::EPP::Frame. free real estate.

The available subclasses of Net::EPP::Frame exist to add any additional elements required by the EPP specification. For example, the <login> frame must contain the <clID> and <pw> frames, so when you create a new Net::EPP::Frame::Command::Login object, you get these already defined. she comes pre-styled πŸ’…

These classes also have convenience methods, so for the above example, you can call the $login->clID and $login->pw methods to get the XML::LibXML::Node objects correesponding to those elements. (yes, the original says "correesponding" β€” typo and all, we keep the receipts πŸ’–)

🧚 RATIONALE 🧚

You could just as easily construct your EPP frames from templates or just lots of printf() calls. But using a programmatic approach such as this strongly couples the validity of your XML to the validity of your program. If the process by which your XML is built is broken, your program won't run. This has to be a win. no cap, that's a W πŸ”₯


πŸ’œ ADDITIONAL METHODS πŸ’œ

my $str = $frame->formatTimeStamp($timestamp);

This method returns a scalar in the required format (defined in RFC 3339). It's a convenience method. timestamps but make it cute ⭐

my $node = $frame->getNode($id);
my $node = $frame->getNode($ns, $id);

Another convenience method, bestie. It uses $id with the getElementsByTagName() method to get a list of nodes with that element name, and simply returns the first XML::LibXML::Element from the list.

If $ns is provided, then getElementsByTagNameNS() is used.

my $binary = $frame->header;

Returns a scalar containing the frame length packed into binary. This is only useful for low-level protocol stuff. like, down in the trenches 🫢

my $data = $frame->frame;

Returns a scalar containing the frame header (see the header() method above) concatenated with the XML frame itself. This is only useful for low-level protocol stuff. same energy, different method πŸ’€


πŸ“ AVAILABLE SUBCLASSES πŸ“

the whole roster, no skips:

  • Net::EPP::Frame, the base class
  • Net::EPP::Frame::Command, for EPP client command frames
  • Net::EPP::Frame::Command::Check, for EPP <check> client commands
  • Net::EPP::Frame::Command::Create, for EPP <create> client commands
  • Net::EPP::Frame::Command::Delete, for EPP <delete> client commands
  • Net::EPP::Frame::Command::Info, for EPP <info> client commands
  • Net::EPP::Frame::Command::Login, for EPP <login> client commands
  • Net::EPP::Frame::Command::Logout, for EPP <logout> client commands
  • Net::EPP::Frame::Command::Poll, for EPP <poll> client commands
  • Net::EPP::Frame::Command::Renew, for EPP <renew> client commands
  • Net::EPP::Frame::Command::Transfer, for EPP <transfer> client commands
  • Net::EPP::Frame::Command::Update, for <update> client commands
  • Net::EPP::Frame::Greeting, for EPP server greetings
  • Net::EPP::Frame::Hello, for EPP client greetings
  • Net::EPP::Frame::Response, for EPP server response frames

Each subclass has its own subclasses for various objects, for example Net::EPP::Frame::Command::Check::Domain creates a "<check>" frame for domain names. so meta. so nested. so her πŸ’…

Coverage for all combinations of command and object type is not complete, but work is ongoing. so like, don't come for her, she's growing 🌱

This module is (c) 2008 - 2023 CentralNic Ltd and 2024 Gavin Brown. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. iconic licensing behavior, we love to see it πŸ‘‘


and that's the whole page bestie!! this doc came from perl v5.40.1 and it's dated 2025-04-19 β€” go forth and build frames, you absolute legend πŸ¦‹βœ¨πŸ’–

πŸ“¦ where this page comes from