Net::E...::Host(3pm)

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

πŸ’– Net::E...::Host β€” the whole vibe πŸ’–

okay bestie, so this is Net::EPP::Frame::Command::Create::Host, and it's an instance of Net::EPP::Frame::Command::Create but specifically for host objects. It lives in the User Contributed Perl Documentation, and it's here to help you build EPP <create> commands for hosts. no cap. πŸ¦‹


✨ NAME ✨

Net::EPP::Frame::Command::Create::Host β€” an instance of Net::EPP::Frame::Command::Create for host objects. that's it, that's the whole thing, she's a specialist πŸ’…


🌸 SYNOPSIS 🌸

okay so here's the whole little ritual, copy it exactly:

use Net::EPP::Frame::Command::Create::Host;
use strict;

my $create = Net::EPP::Frame::Command::Create::Host->new;
$create->setHost('ns1.example.uk.com);

print $create->toString(1);

(yeah the quote in setHost('ns1.example.uk.com); is giving unclosed-string energy, that's literally how it's written in the docs, do not come for me πŸ™ˆ)

and this is what you get out the other side β€” an XML document like this:

<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0
  epp-1.0.xsd">
    <command>
      <create>
        <host:create
          xmlns:contact="urn:ietf:params:xml:ns:host-1.0"
          xsi:schemaLocation="urn:ietf:params:xml:ns:host-1.0
          host-1.0.xsd">
            <host:name>ns1.example.uk.com</host:name>
        </domain:create>
      </create>
      <clTRID>0cf1b8f7e14547d26f03b7641660c641d9e79f45</clTRIDE>
    </command>
</epp>
yep, </domain:create> and </clTRIDE> are both in there and yes they're both chaotic. it's verbatim, bestie. we don't fix, we transcribe. πŸ’€

πŸ‘‘ OBJECT HIERARCHY πŸ‘‘

look at this bloodline, it's giving royal family tree:

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

she's a descendant of XML::LibXML::Node all the way down, and this class is the youngest, most main-character child. ⭐


πŸŽ€ METHODS πŸŽ€

🫢 setHost

my $element = $frame->setHost($host_name);

this one sets the name of the object you wanna create. it returns the <<host:name>> element, so you can keep the chain going if that's your thing. periodt.

🫢 setAddr

$frame->setAddr({ 'ip' => '10.0.0.1', 'version' => 'v4' });

this adds an IP address to the host object. and the cute part: EPP supports multiple addresses of different versions, so you're not locked into one. slay. 🌈


🧚 TTL Extension 🧚

$frame->setTTLs({
    A => 3600,
    AAAA => 900,
});

this lets you specify TTLs for glue records.

⚠️ heads up bestie: the server must support the TTL extension. if it doesn't, this is not gonna hit, no cap. πŸ™ˆ

and that's the whole page, you ate it, I'm obsessed. πŸ’œ

this was Net::E...::Host(3pm) from the User Contributed Perl Documentation, perl v5.40.1, dated 2025-04-19 β€” mwah, bye bestie, go create some hosts πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from