.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Net::EPP::Simple 3pm" .TH Net::EPP::Simple 3pm "2021-01-09" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "Name" .IX Header "Name" Net::EPP::Simple \- a simple \s-1EPP\s0 client interface for the most common jobs .SH "Synopsis" .IX Header "Synopsis" .Vb 3 \& #!/usr/bin/perl \& use Net::EPP::Simple; \& use strict; \& \& my $epp = Net::EPP::Simple\->new( \& host => \*(Aqepp.nic.tld\*(Aq, \& user => \*(Aqmy\-id\*(Aq, \& pass => \*(Aqmy\-password\*(Aq, \& ); \& \& my $domain = \*(Aqexample.tld\*(Aq; \& \& if ($epp\->check_domain($domain) == 1) { \& print "Domain is available\en" ; \& \& } else { \& my $info = $epp\->domain_info($domain); \& printf("Domain was registered on %s by %s\en", $info\->{crDate}, $info\->{crID}); \& \& } .Ve .SH "Description" .IX Header "Description" \&\s-1EPP\s0 is the Extensible Provisioning Protocol. \s-1EPP\s0 (defined in \s-1RFC 4930\s0) is an application layer client-server protocol for the provisioning and management of objects stored in a shared central repository. Specified in \s-1XML,\s0 the protocol defines generic object management operations and an extensible framework that maps protocol operations to objects. As of writing, its only well-developed application is the provisioning of Internet domain names, hosts, and related contact details. .PP This module provides a high level interface to the \s-1EPP\s0 protocol. It hides all the boilerplate of connecting, logging in, building request frames and parsing response frames behind a simple, Perlish interface. .PP It is based on the \f(CW\*(C`Net::EPP::Client\*(C'\fR module and uses \f(CW\*(C`Net::EPP::Frame\*(C'\fR to build request frames. .SH "Constructor" .IX Header "Constructor" The constructor for \f(CW\*(C`Net::EPP::Simple\*(C'\fR has the same general form as the one for \f(CW\*(C`Net::EPP::Client\*(C'\fR, but with the following exceptions: .IP "\(bu" 4 Unless otherwise set, \f(CW\*(C`port\*(C'\fR defaults to 700 .IP "\(bu" 4 Unless the \f(CW\*(C`no_ssl\*(C'\fR parameter is set, \s-1SSL\s0 is always on .IP "\(bu" 4 You can use the \f(CW\*(C`user\*(C'\fR and \f(CW\*(C`pass\*(C'\fR parameters to supply authentication information. .IP "\(bu" 4 The \f(CW\*(C`timeout\*(C'\fR parameter controls how long the client waits for a response from the server before returning an error. .IP "\(bu" 4 if \f(CW\*(C`debug\*(C'\fR is set, \f(CW\*(C`Net::EPP::Simple\*(C'\fR will output verbose debugging information on \f(CW\*(C`STDERR\*(C'\fR, including all frames sent to and received from the server. .IP "\(bu" 4 \&\f(CW\*(C`reconnect\*(C'\fR can be used to disable automatic reconnection (it is enabled by default). Before sending a frame to the server, \f(CW\*(C`Net::EPP::Simple\*(C'\fR will send a \f(CW\*(C`\*(C'\fR to check that the connection is up, if not, it will try to reconnect, aborting after the \fIn\fRth time, where \fIn\fR is the value of \f(CW\*(C`reconnect\*(C'\fR (the default is 3). .IP "\(bu" 4 \&\f(CW\*(C`login\*(C'\fR can be used to disable automatic logins. If you set it to \f(CW0\fR, you can manually log in using the \f(CW\*(C`$epp\-\*(C'\fR\fB_login()\fR> method. .IP "\(bu" 4 \&\f(CW\*(C`objects\*(C'\fR is a reference to an array of the \s-1EPP\s0 object schema URIs that the client requires. .IP "\(bu" 4 \&\f(CW\*(C`stdobj\*(C'\fR is a flag saying the client only requires the standard \s-1EPP\s0 \f(CW\*(C`contact\-1.0\*(C'\fR, \f(CW\*(C`domain\-1.0\*(C'\fR, and \f(CW\*(C`host\-1.0\*(C'\fR schemas. .IP "\(bu" 4 If neither \f(CW\*(C`objects\*(C'\fR nor \f(CW\*(C`stdobj\*(C'\fR is specified then the client will echo the server's object schema list. .IP "\(bu" 4 \&\f(CW\*(C`extensions\*(C'\fR is a reference to an array of the \s-1EPP\s0 extension schema URIs that the client requires. .IP "\(bu" 4 \&\f(CW\*(C`stdext\*(C'\fR is a flag saying the client only requires the standard \s-1EPP\s0 \f(CW\*(C`secDNS\-1.1\*(C'\fR \s-1DNSSEC\s0 extension schema. .IP "\(bu" 4 If neither \f(CW\*(C`extensions\*(C'\fR nor \f(CW\*(C`stdext\*(C'\fR is specified then the client will echo the server's extension schema list. .PP The constructor will establish a connection to the server and retrieve the greeting (which is available via \f(CW$epp\fR\->{greeting}) and then send a request. .PP If the login fails, the constructor will return \f(CW\*(C`undef\*(C'\fR and set \&\f(CW$Net::EPP::Simple::Error\fR and \f(CW$Net::EPP::Simple::Code\fR. .SS "Client and Server \s-1SSL\s0 options" .IX Subsection "Client and Server SSL options" \&\s-1RFC 5730\s0 requires that all \s-1EPP\s0 instances must be protected using \*(L"mutual, strong client-server authentication\*(R". In practice, this means that both client and server must present an \s-1SSL\s0 certificate, and that they must both verify the certificate of their peer. .PP \fIServer Certificate Verification\fR .IX Subsection "Server Certificate Verification" .PP \&\f(CW\*(C`Net::EPP::Simple\*(C'\fR will verify the certificate presented by a server if the \f(CW\*(C`verify\*(C'\fR, and either \f(CW\*(C`ca_file\*(C'\fR or \f(CW\*(C`ca_path\*(C'\fR are passed to the constructor: .PP .Vb 8 \& my $epp = Net::EPP::Simple\->new( \& host => \*(Aqepp.nic.tld\*(Aq, \& user => \*(Aqmy\-id\*(Aq, \& pass => \*(Aqmy\-password\*(Aq, \& verify => 1, \& ca_file => \*(Aq/etc/pki/tls/certs/ca\-bundle.crt\*(Aq, \& ca_path => \*(Aq/etc/pki/tls/certs\*(Aq, \& ); .Ve .PP \&\f(CW\*(C`Net::EPP::Simple\*(C'\fR will fail to connect to the server if the certificate is not valid. .PP You can disable \s-1SSL\s0 certificate verification by omitting the \f(CW\*(C`verify\*(C'\fR argument or setting it to \f(CW\*(C`undef\*(C'\fR. This is strongly discouraged, particularly in production environments. .PP \fI\s-1SSL\s0 Cipher Selection\fR .IX Subsection "SSL Cipher Selection" .PP You can restrict the ciphers that you will use to connect to the server by passing a \f(CW\*(C`ciphers\*(C'\fR parameter to the constructor. This is a colon\- separated list of cipher names and aliases. See for further details. As an example, the following cipher list is suggested for clients who wish to ensure high-security connections to servers: .PP .Vb 1 \& HIGH:!ADH:!MEDIUM:!LOW:!SSLv2:!EXP .Ve .PP \fIClient Certificates\fR .IX Subsection "Client Certificates" .PP If you are connecting to an \s-1EPP\s0 server which requires a client certificate, you can configure \f(CW\*(C`Net::EPP::Simple\*(C'\fR to use one as follows: .PP .Vb 8 \& my $epp = Net::EPP::Simple\->new( \& host => \*(Aqepp.nic.tld\*(Aq, \& user => \*(Aqmy\-id\*(Aq, \& pass => \*(Aqmy\-password\*(Aq, \& key => \*(Aq/path/to/my.key\*(Aq, \& cert => \*(Aq/path/to/my.crt\*(Aq, \& passphrase => \*(Aqfoobar123\*(Aq, \& ); .Ve .PP \&\f(CW\*(C`key\*(C'\fR is the filename of the private key, \f(CW\*(C`cert\*(C'\fR is the filename of the certificate. If the private key is encrypted, the \f(CW\*(C`passphrase\*(C'\fR parameter will be used to decrypt it. .SS "Configuration File" .IX Subsection "Configuration File" \&\f(CW\*(C`Net::EPP::Simple\*(C'\fR supports the use of a simple configuration file. To use this feature, you need to install the Config::Simple module. .PP When starting up, \f(CW\*(C`Net::EPP::Simple\*(C'\fR will look for \&\f(CW\*(C`$HOME/.net\-epp\-simple\-rc\*(C'\fR. This file is an ini-style configuration file. .PP \fIDefault Options\fR .IX Subsection "Default Options" .PP You can specify default options for all \s-1EPP\s0 servers using the \f(CW\*(C`[default]\*(C'\fR section: .PP .Vb 3 \& [default] \& default=epp.nic.tld \& debug=1 .Ve .PP \fIServer Specific Options\fR .IX Subsection "Server Specific Options" .PP You can specify options for for specific \s-1EPP\s0 servers by giving each \s-1EPP\s0 server its own section: .PP .Vb 5 \& [epp.nic.tld] \& user=abc123 \& pass=foo2bar \& port=777 \& ssl=0 .Ve .PP This means that when you write a script that uses \f(CW\*(C`Net::EPP::Simple\*(C'\fR, you can do the following: .PP .Vb 2 \& # config file has a default server: \& my $epp = Net::EPP::Simple\->new; \& \& # config file has connection options for this EPP server: \& my $epp = Net::EPP:Simple\->new(\*(Aqhost\*(Aq => \*(Aqepp.nic.tld\*(Aq); .Ve .PP Any parameters provided to the constructor will override those in the config file. .SH "Availability Checks" .IX Header "Availability Checks" You can do a simple \f(CW\*(C`\*(C'\fR request for an object like so: .PP .Vb 1 \& my $result = $epp\->check_domain($domain); \& \& my $result = $epp\->check_host($host); \& \& my $result = $epp\->check_contact($contact); .Ve .PP Each of these methods has the same profile. They will return one of the following: .IP "\(bu" 4 \&\f(CW\*(C`undef\*(C'\fR in the case of an error (check \f(CW$Net::EPP::Simple::Error\fR and \f(CW$Net::EPP::Simple::Code\fR). .IP "\(bu" 4 \&\f(CW0\fR if the object is already provisioned. .IP "\(bu" 4 \&\f(CW1\fR if the object is available. .SH "Retrieving Object Information" .IX Header "Retrieving Object Information" You can retrieve information about an object by using one of the following: .PP .Vb 1 \& my $info = $epp\->domain_info($domain, $authInfo, $follow); \& \& my $info = $epp\->host_info($host); \& \& my $info = $epp\->contact_info($contact, $authInfo); .Ve .PP \&\f(CW\*(C`Net::EPP::Simple\*(C'\fR will construct an \f(CW\*(C`\*(C'\fR frame and send it to the server, then parse the response into a simple hash ref. The layout of the hash ref depends on the object in question. If there is an error, these methods will return \f(CW\*(C`undef\*(C'\fR, and you can then check \&\f(CW$Net::EPP::Simple::Error\fR and \f(CW$Net::EPP::Simple::Code\fR. .PP If \f(CW$authInfo\fR is defined, it will be sent to the server as per \s-1RFC 5731,\s0 Section 3.1.2 and \s-1RFC 5733,\s0 Section 3.1.2. If the supplied authInfo code is validated by the registry, additional information will appear in the response. If it is invalid, you should get an error. .PP If the \f(CW$follow\fR parameter is true, then \f(CW\*(C`Net::EPP::Simple\*(C'\fR will also retrieve the relevant host and contact details for a domain: instead of returning an object name or \s-1ID\s0 for the domain's registrant, contact associations, \s-1DNS\s0 servers or subordinate hosts, the values will be replaced with the return value from the appropriate \f(CW\*(C`host_info()\*(C'\fR or \&\f(CW\*(C`contact_info()\*(C'\fR command (unless there was an error, in which case the original object \s-1ID\s0 will be used instead). .SS "Domain Information" .IX Subsection "Domain Information" The hash ref returned by \f(CW\*(C`domain_info()\*(C'\fR will usually look something like this: .PP .Vb 10 \& $info = { \& \*(Aqcontacts\*(Aq => { \& \*(Aqadmin\*(Aq => \*(Aqcontact\-id\*(Aq \& \*(Aqtech\*(Aq => \*(Aqcontact\-id\*(Aq \& \*(Aqbilling\*(Aq => \*(Aqcontact\-id\*(Aq \& }, \& \*(Aqregistrant\*(Aq => \*(Aqcontact\-id\*(Aq, \& \*(AqclID\*(Aq => \*(Aqregistrar\-id\*(Aq, \& \*(Aqroid\*(Aq => \*(Aqtld\-12345\*(Aq, \& \*(Aqstatus\*(Aq => [ \& \*(Aqok\*(Aq \& ], \& \*(AqauthInfo\*(Aq => \*(Aqabc\-12345\*(Aq, \& \*(Aqname\*(Aq => \*(Aqexample.tld\*(Aq, \& \*(AqtrDate\*(Aq => \*(Aq2011\-01\-18T11:08:03.0Z\*(Aq, \& \*(Aqns\*(Aq => [ \& \*(Aqns0.example.com\*(Aq, \& \*(Aqns1.example.com\*(Aq, \& ], \& \*(AqcrDate\*(Aq => \*(Aq2011\-02\-16T12:06:31.0Z\*(Aq, \& \*(AqexDate\*(Aq => \*(Aq2011\-02\-16T12:06:31.0Z\*(Aq, \& \*(AqcrID\*(Aq => \*(Aqregistrar\-id\*(Aq, \& \*(AqupDate\*(Aq => \*(Aq2011\-08\-29T04:02:12.0Z\*(Aq, \& hosts => [ \& \*(Aqns0.example.tld\*(Aq, \& \*(Aqns1.example.tld\*(Aq, \& ], \& }; .Ve .PP Members of the \f(CW\*(C`contacts\*(C'\fR hash ref may be strings or, if there are multiple associations of the same type, an anonymous array of strings. If the server uses the \*(L"hostAttr\*(R" model instead of \*(L"hostObj\*(R", then the \&\f(CW\*(C`ns\*(C'\fR member will look like this: .PP .Vb 10 \& $info\->{ns} = [ \& { \& name => \*(Aqns0.example.com\*(Aq, \& addrs => [ \& type => \*(Aqv4\*(Aq, \& addr => \*(Aq10.0.0.1\*(Aq, \& ], \& }, \& { \& name => \*(Aqns1.example.com\*(Aq, \& addrs => [ \& type => \*(Aqv4\*(Aq, \& addr => \*(Aq10.0.0.2\*(Aq, \& ], \& }, \& ]; .Ve .PP Note that there may be multiple members in the \f(CW\*(C`addrs\*(C'\fR section and that the \f(CW\*(C`type\*(C'\fR attribute is optional. .SS "Host Information" .IX Subsection "Host Information" The hash ref returned by \f(CW\*(C`host_info()\*(C'\fR will usually look something like this: .PP .Vb 10 \& $info = { \& \*(AqcrDate\*(Aq => \*(Aq2011\-09\-17T15:38:56.0Z\*(Aq, \& \*(AqclID\*(Aq => \*(Aqregistrar\-id\*(Aq, \& \*(AqcrID\*(Aq => \*(Aqregistrar\-id\*(Aq, \& \*(Aqroid\*(Aq => \*(Aqtld\-12345\*(Aq, \& \*(Aqstatus\*(Aq => [ \& \*(Aqlinked\*(Aq, \& \*(AqserverDeleteProhibited\*(Aq, \& ], \& \*(Aqname\*(Aq => \*(Aqns0.example.tld\*(Aq, \& \*(Aqaddrs\*(Aq => [ \& { \& \*(Aqversion\*(Aq => \*(Aqv4\*(Aq, \& \*(Aqaddr\*(Aq => \*(Aq10.0.0.1\*(Aq \& } \& ] \& }; .Ve .PP Note that hosts may have multiple addresses, and that \f(CW\*(C`version\*(C'\fR is optional. .SS "Contact Information" .IX Subsection "Contact Information" The hash ref returned by \f(CW\*(C`contact_info()\*(C'\fR will usually look something like this: .PP .Vb 10 \& $VAR1 = { \& \*(Aqid\*(Aq => \*(Aqcontact\-id\*(Aq, \& \*(AqpostalInfo\*(Aq => { \& \*(Aqint\*(Aq => { \& \*(Aqname\*(Aq => \*(AqJohn Doe\*(Aq, \& \*(Aqorg\*(Aq => \*(AqExample Inc.\*(Aq, \& \*(Aqaddr\*(Aq => { \& \*(Aqstreet\*(Aq => [ \& \*(Aq123 Example Dr.\*(Aq \& \*(AqSuite 100\*(Aq \& ], \& \*(Aqcity\*(Aq => \*(AqDulles\*(Aq, \& \*(Aqsp\*(Aq => \*(AqVA\*(Aq, \& \*(Aqpc\*(Aq => \*(Aq20116\-6503\*(Aq \& \*(Aqcc\*(Aq => \*(AqUS\*(Aq, \& } \& } \& }, \& \*(AqclID\*(Aq => \*(Aqregistrar\-id\*(Aq, \& \*(Aqroid\*(Aq => \*(AqCNIC\-HA321983\*(Aq, \& \*(Aqstatus\*(Aq => [ \& \*(Aqlinked\*(Aq, \& \*(AqserverDeleteProhibited\*(Aq \& ], \& \*(Aqvoice\*(Aq => \*(Aq+1.7035555555x1234\*(Aq, \& \*(Aqfax\*(Aq => \*(Aq+1.7035555556\*(Aq, \& \*(Aqemail\*(Aq => \*(Aqjdoe@example.com\*(Aq, \& \*(AqcrDate\*(Aq => \*(Aq2011\-09\-23T03:51:29.0Z\*(Aq, \& \*(AqupDate\*(Aq => \*(Aq1999\-11\-30T00:00:00.0Z\*(Aq \& }; .Ve .PP There may be up to two members of the \f(CW\*(C`postalInfo\*(C'\fR hash, corresponding to the \f(CW\*(C`int\*(C'\fR and \f(CW\*(C`loc\*(C'\fR internationalised and localised types. .SH "Object Transfers" .IX Header "Object Transfers" The \s-1EPP\s0 \f(CW\*(C`\*(C'\fR command suppots five different operations: query, request, cancel, approve, and reject. \f(CW\*(C`Net::EPP::Simple\*(C'\fR makes these available using the following methods: .PP .Vb 1 \& # For domain objects: \& \& $epp\->domain_transfer_query($domain); \& $epp\->domain_transfer_cancel($domain); \& $epp\->domain_transfer_request($domain, $authInfo, $period); \& $epp\->domain_transfer_approve($domain); \& $epp\->domain_transfer_reject($domain); \& \& # For contact objects: \& \& $epp\->contact_transfer_query($contact); \& $epp\->contact_transfer_cancel($contact); \& $epp\->contact_transfer_request($contact, $authInfo); \& $epp\->contact_transfer_approve($contact); \& $epp\->contact_transfer_reject($contact); .Ve .PP Most of these methods will just set the value of \f(CW$Net::EPP::Simple::Code\fR and return either true or false. However, the \f(CW\*(C`domain_transfer_request()\*(C'\fR, \&\f(CW\*(C`domain_transfer_query()\*(C'\fR, \f(CW\*(C`contact_transfer_request()\*(C'\fR and \f(CW\*(C`contact_transfer_query()\*(C'\fR methods will return a hash ref that looks like this: .PP .Vb 8 \& my $trnData = { \& \*(Aqname\*(Aq => \*(Aqexample.tld\*(Aq, \& \*(AqreID\*(Aq => \*(Aqlosing\-registrar\*(Aq, \& \*(AqacDate\*(Aq => \*(Aq2011\-12\-04T12:24:53.0Z\*(Aq, \& \*(AqacID\*(Aq => \*(Aqgaining\-registrar\*(Aq, \& \*(AqreDate\*(Aq => \*(Aq2011\-11\-29T12:24:53.0Z\*(Aq, \& \*(AqtrStatus\*(Aq => \*(Aqpending\*(Aq \& }; .Ve .SH "Creating Objects" .IX Header "Creating Objects" The following methods can be used to create a new object at the server: .PP .Vb 3 \& $epp\->create_domain($domain); \& $epp\->create_host($host); \& $epp\->create_contact($contact); .Ve .PP The argument for these methods is a hash ref of the same format as that returned by the info methods above. As a result, cloning an existing object is as simple as the following: .PP .Vb 1 \& my $info = $epp\->contact_info($contact); \& \& # set a new contact ID to avoid clashing with the existing object \& $info\->{id} = $new_contact; \& \& # randomize authInfo: \& $info\->{authInfo} = $random_string; \& \& $epp\->create_contact($info); .Ve .PP \&\f(CW\*(C`Net::EPP::Simple\*(C'\fR will ignore object properties that it does not recognise, and those properties (such as server-managed status codes) that clients are not permitted to set. .SS "Creating New Domains" .IX Subsection "Creating New Domains" When creating a new domain object, you may also specify a \f(CW\*(C`period\*(C'\fR key, like so: .PP .Vb 10 \& my $domain = { \& \*(Aqname\*(Aq => \*(Aqexample.tld\*(Aq, \& \*(Aqperiod\*(Aq => 2, \& \*(Aqregistrant\*(Aq => \*(Aqcontact\-id\*(Aq, \& \*(Aqcontacts\*(Aq => { \& \*(Aqtech\*(Aq => \*(Aqcontact\-id\*(Aq, \& \*(Aqadmin\*(Aq => \*(Aqcontact\-id\*(Aq, \& \*(Aqbilling\*(Aq => \*(Aqcontact\-id\*(Aq, \& }, \& \*(Aqstatus\*(Aq => [ \& \*(AqclientTransferProhibited\*(Aq, \& ], \& \*(Aqns\*(Aq => { \& \*(Aqns0.example.com\*(Aq, \& \*(Aqns1.example.com\*(Aq, \& }, \& }; \& \& $epp\->create_domain($domain); .Ve .PP The \f(CW\*(C`period\*(C'\fR key is assumed to be in years rather than months. \f(CW\*(C`Net::EPP::Simple\*(C'\fR assumes the registry uses the host object model rather than the host attribute model. .SS "Creating Hosts" .IX Subsection "Creating Hosts" .Vb 8 \& my $host = { \& name => \*(Aqns1.example.tld\*(Aq, \& addrs => [ \& { ip => \*(Aq123.45.67.89\*(Aq, version => \*(Aqv4\*(Aq }, \& { ip => \*(Aq98.76.54.32\*(Aq, version => \*(Aqv4\*(Aq }, \& ], \& }; \& $epp\->create_host($host); .Ve .SH "Updating Objects" .IX Header "Updating Objects" The following methods can be used to update an object at the server: .PP .Vb 3 \& $epp\->update_domain($domain); \& $epp\->update_host($host); \& $epp\->update_contact($contact); .Ve .PP Each of these methods has the same profile. They will return one of the following: .IP "\(bu" 4 undef in the case of an error (check \f(CW$Net::EPP::Simple::Error\fR and \f(CW$Net::EPP::Simple::Code\fR). .IP "\(bu" 4 1 if the update request was accepted. .PP You may wish to check the value of \f(CW$Net::EPP::Simple::Code\fR to determine whether the response code was 1000 (\s-1OK\s0) or 1001 (action pending). .SS "Updating Domains" .IX Subsection "Updating Domains" Use \fBupdate_domain()\fR method to update domains' data. .PP The update info parameter may look like: \&\f(CW$update_info\fR = { name => \f(CW$domain\fR, chg => { registrant => \f(CW$new_registrant_id\fR, authInfo => \f(CW$new_domain_password\fR, }, add => { # \s-1DNS\s0 info with \*(L"hostObj\*(R" or \*(L"hostAttr\*(R" model, see \fBcreate_domain()\fR ns => [ ns1.example.com ns2.example.com ], contacts => { tech => 'contact\-id', billing => 'contact\-id', admin => 'contact\-id', }, .PP .Vb 2 \& # Status info, simple form: \& status => [ qw/ clientUpdateProhibited clientHold / ], \& \& # Status info may be in more detailed form: \& # status => { \& # clientUpdateProbhibited => \*(AqAvoid accidental change\*(Aq, \& # clientHold => \*(AqThis domain is not delegated\*(Aq, \& # }, \& }, \& rem => { \& ns => [ ... ], \& contacts => { \& tech => \*(Aqold_tech_id\*(Aq, \& billing => \*(Aqold_billing_id\*(Aq, \& admin => \*(Aqold_admin_id\*(Aq, \& }, \& status => [ qw/ clientTransferProhibited ... / ], \& }, \&} .Ve .PP All fields except 'name' in \f(CW$update_info\fR hash are optional. .SS "Updating Contacts" .IX Subsection "Updating Contacts" Use \fBupdate_contact()\fR method to update contact's data. .PP The \f(CW$update_info\fR for contacts may look like this: .PP \&\f(CW$update_info\fR = { id => \f(CW$contact_id\fR, add => { status => [ qw/ clientDeleteProhibited / ], # \s-1OR\s0 # status => { # clientDeleteProhibited => 'Avoid accidental removal', # }, }, rem => { status => [ qw/ clientUpdateProhibited / ], }, chg => { postalInfo => { int => { name => 'John Doe', org => 'Example Inc.', addr => { street => [ '123 Example Dr.' 'Suite 100' ], city => 'Dulles', sp => '\s-1VA\s0', pc => '20116\-6503' cc => '\s-1US\s0', }, }, }, voice => '+1.7035555555x1234', fax => '+1.7035555556', email => 'jdoe@example.com', authInfo => 'new\-contact\-password', }, } .PP All fields except 'id' in \f(CW$update_info\fR hash are optional. .SS "Updating Hosts" .IX Subsection "Updating Hosts" Use \fBupdate_host()\fR method to update \s-1EPP\s0 hosts. .PP The \f(CW$update_info\fR for hosts may look like this: .PP \&\f(CW$update_info\fR = { name => 'ns1.example.com', add => { status => [ qw/ clientDeleteProhibited / ], # \s-1OR\s0 # status => { # clientDeleteProhibited => 'Avoid accidental removal', # }, .PP .Vb 10 \& addrs => [ \& { ip => \*(Aq123.45.67.89\*(Aq, version => \*(Aqv4\*(Aq }, \& { ip => \*(Aq98.76.54.32\*(Aq, version => \*(Aqv4\*(Aq }, \& ], \& }, \& rem => { \& status => [ qw/ clientUpdateProhibited / ], \& addrs => [ \& { ip => \*(Aq1.2.3.4\*(Aq, version => \*(Aqv4\*(Aq }, \& { ip => \*(Aq5.6.7.8\*(Aq, version => \*(Aqv4\*(Aq }, \& ], \& }, \& chg => { \& name => \*(Aqns2.example.com\*(Aq, \& }, \&} .Ve .PP All fields except first 'name' in \f(CW$update_info\fR hash are optional. .SH "Deleting Objects" .IX Header "Deleting Objects" The following methods can be used to delete an object at the server: .PP .Vb 3 \& $epp\->delete_domain($domain); \& $epp\->delete_host($host); \& $epp\->delete_contact($contact); .Ve .PP Each of these methods has the same profile. They will return one of the following: .IP "\(bu" 4 undef in the case of an error (check \f(CW$Net::EPP::Simple::Error\fR and \f(CW$Net::EPP::Simple::Code\fR). .IP "\(bu" 4 1 if the deletion request was accepted. .PP You may wish to check the value of \f(CW$Net::EPP::Simple::Code\fR to determine whether the response code was 1000 (\s-1OK\s0) or 1001 (action pending). .SH "Domain Renewal" .IX Header "Domain Renewal" You can extend the validity period of the domain object by issuing a \&\fBrenew_domain()\fR command. .PP .Vb 5 \& my $result = $epp\->renew_domain({ \& name => \*(Aqexample.com\*(Aq, \& cur_exp_date => \*(Aq2011\-02\-05\*(Aq, # current expiration date \& period => 2, # prolongation period in years \& }); .Ve .PP Return value is \f(CW1\fR on success and \f(CW\*(C`undef\*(C'\fR on error. In the case of error \f(CW$Net::EPP::Simple::Error\fR contains the appropriate error message. .SH "Miscellaneous Methods" .IX Header "Miscellaneous Methods" .Vb 1 \& my $greeting = $epp\->greeting; .Ve .PP Returns the a \f(CW\*(C`Net::EPP::Frame::Greeting\*(C'\fR object representing the greeting returned by the server. .PP .Vb 1 \& $epp\->ping; .Ve .PP Checks that the connection is up by sending a \f(CW\*(C`\*(C'\fR to the server. Returns false if no response is received. .ie n .SH "Overridden Methods From ""Net::EPP::Client""" .el .SH "Overridden Methods From \f(CWNet::EPP::Client\fP" .IX Header "Overridden Methods From Net::EPP::Client" \&\f(CW\*(C`Net::EPP::Simple\*(C'\fR overrides some methods inherited from \&\f(CW\*(C`Net::EPP::Client\*(C'\fR. These are described below: .ie n .SS "The ""request()"" Method" .el .SS "The \f(CWrequest()\fP Method" .IX Subsection "The request() Method" \&\f(CW\*(C`Net::EPP::Simple\*(C'\fR overrides this method so it can automatically populate the \f(CW\*(C`\*(C'\fR element with a unique string. It then passes the frame back up to \f(CW\*(C`Net::EPP::Client\*(C'\fR. .ie n .SS "The ""get_frame()"" Method" .el .SS "The \f(CWget_frame()\fP Method" .IX Subsection "The get_frame() Method" \&\f(CW\*(C`Net::EPP::Simple\*(C'\fR overrides this method so it can catch timeouts and network errors. If such an error occurs it will return \f(CW\*(C`undef\*(C'\fR. .SH "Package Variables" .IX Header "Package Variables" .ie n .SS "$Net::EPP::Simple::Error" .el .SS "\f(CW$Net::EPP::Simple::Error\fP" .IX Subsection "$Net::EPP::Simple::Error" This variable contains an english text message explaining the last error to occur. This is may be due to invalid parameters being passed to a method, a network error, or an error response being returned by the server. .ie n .SS "$Net::EPP::Simple::Message" .el .SS "\f(CW$Net::EPP::Simple::Message\fP" .IX Subsection "$Net::EPP::Simple::Message" This variable contains the contains the text content of the \&\f(CW\*(C`\*(C'\fR element in the response frame for the last transaction. .ie n .SS "$Net::EPP::Simple::Code" .el .SS "\f(CW$Net::EPP::Simple::Code\fP" .IX Subsection "$Net::EPP::Simple::Code" This variable contains the integer result code returned by the server for the last transaction. A successful transaction will always return an error code of 1999 or lower, for an unsuccessful transaction it will be 2011 or more. If there is an internal client error (due to invalid parameters being passed to a method, or a network error) then this will be set to 2400 (\f(CW\*(C`COMMAND_FAILED\*(C'\fR). See Net::EPP::ResponseCodes for more information about thes codes. .SH "Author" .IX Header "Author" CentralNic Ltd (). .SH "Copyright" .IX Header "Copyright" This module is (c) 2016 CentralNic Ltd. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "SEE ALSO" .IX Header "SEE ALSO" .IP "\(bu" 4 Net::EPP::Client .IP "\(bu" 4 Net::EPP::Frame .IP "\(bu" 4 Net::EPP::Proxy .IP "\(bu" 4 RFCs 5730 and \s-1RFC 4934,\s0 available from . .IP "\(bu" 4 The CentralNic \s-1EPP\s0 site at .