line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyright (c) 2016 CentralNic Ltd. All rights reserved. This program is |
2
|
|
|
|
|
|
|
# free software; you can redistribute it and/or modify it under the same |
3
|
|
|
|
|
|
|
# terms as Perl itself. |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# $Id$ |
6
|
|
|
|
|
|
|
package Net::EPP::Frame::Command::Create::Host; |
7
|
1
|
|
|
1
|
|
4
|
use base qw(Net::EPP::Frame::Command::Create); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
57
|
|
8
|
1
|
|
|
1
|
|
3
|
use Net::EPP::Frame::ObjectSpec; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
13
|
|
9
|
1
|
|
|
1
|
|
2
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
143
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=pod |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 NAME |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Net::EPP::Frame::Command::Create::Host - an instance of L |
16
|
|
|
|
|
|
|
for host objects. |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
use Net::EPP::Frame::Command::Create::Host; |
21
|
|
|
|
|
|
|
use strict; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my $create = Net::EPP::Frame::Command::Create::Host->new; |
24
|
|
|
|
|
|
|
$create->setHost('ns1.example.uk.com); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
print $create->toString(1); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
This results in an XML document like this: |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
33
|
|
|
|
|
|
|
xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 |
34
|
|
|
|
|
|
|
epp-1.0.xsd"> |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
xmlns:contact="urn:ietf:params:xml:ns:host-1.0" |
39
|
|
|
|
|
|
|
xsi:schemaLocation="urn:ietf:params:xml:ns:host-1.0 |
40
|
|
|
|
|
|
|
host-1.0.xsd"> |
41
|
|
|
|
|
|
|
ns1.example.uk.com |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
0cf1b8f7e14547d26f03b7641660c641d9e79f45 |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 OBJECT HIERARCHY |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
L |
52
|
|
|
|
|
|
|
+----L |
53
|
|
|
|
|
|
|
+----L |
54
|
|
|
|
|
|
|
+----L |
55
|
|
|
|
|
|
|
+----L |
56
|
|
|
|
|
|
|
+----L |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=cut |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub new { |
61
|
0
|
|
|
0
|
0
|
|
my $package = shift; |
62
|
0
|
|
|
|
|
|
my $self = bless($package->SUPER::new('create'), $package); |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
$self->addObject(Net::EPP::Frame::ObjectSpec->spec('host')); |
65
|
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
|
return $self; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=pod |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 METHODS |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
my $element = $frame->setHost($host_name); |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
This sets the name of the object to be created. Returns the |
76
|
|
|
|
|
|
|
host:nameE> element. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=cut |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub setHost { |
82
|
0
|
|
|
0
|
0
|
|
my ($self, $host) = @_; |
83
|
|
|
|
|
|
|
|
84
|
0
|
|
|
|
|
|
my $name = $self->createElement('host:name'); |
85
|
0
|
|
|
|
|
|
$name->appendText($host); |
86
|
|
|
|
|
|
|
|
87
|
0
|
|
|
|
|
|
$self->getNode('create')->getChildNodes->shift->appendChild($name); |
88
|
|
|
|
|
|
|
|
89
|
0
|
|
|
|
|
|
return 1; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=pod |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
$frame->setAddr({ 'ip' => '10.0.0.1', 'version' => 'v4' }); |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
This adds an IP address to the host object. EPP supports multiple |
97
|
|
|
|
|
|
|
addresses of different versions. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=cut |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
sub setAddr { |
102
|
0
|
|
|
0
|
0
|
|
my ($self, @addr) = @_; |
103
|
|
|
|
|
|
|
|
104
|
0
|
|
|
|
|
|
foreach my $ip (@addr) { |
105
|
0
|
|
|
|
|
|
my $hostAttr = $self->createElement('host:addr'); |
106
|
0
|
|
|
|
|
|
$hostAttr->appendText($ip->{ip}); |
107
|
0
|
|
|
|
|
|
$hostAttr->setAttribute('ip', $ip->{version}); |
108
|
0
|
|
|
|
|
|
$self->getNode('create')->getChildNodes->shift->appendChild($hostAttr); |
109
|
|
|
|
|
|
|
} |
110
|
0
|
|
|
|
|
|
return 1; |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=pod |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head1 AUTHOR |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
CentralNic Ltd (http://www.centralnic.com/). |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
United Domains AG (http://www.united-domains.de/) provided the original version of Net::EPP::Frame::Command::Create::Host. |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=head1 COPYRIGHT |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
This module is (c) 2016 CentralNic Ltd. This module is free software; you can |
124
|
|
|
|
|
|
|
redistribute it and/or modify it under the same terms as Perl itself. |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head1 SEE ALSO |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=over |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=item * L |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=back |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=cut |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
1; |