line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::EPP::Frame::Command::Create::Host; |
2
|
1
|
|
|
1
|
|
6
|
use base qw(Net::EPP::Frame::Command::Create); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
93
|
|
3
|
1
|
|
|
1
|
|
6
|
use Net::EPP::Frame::ObjectSpec; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
17
|
|
4
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
251
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=pod |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Net::EPP::Frame::Command::Create::Host - an instance of L |
11
|
|
|
|
|
|
|
for host objects. |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 SYNOPSIS |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
use Net::EPP::Frame::Command::Create::Host; |
16
|
|
|
|
|
|
|
use strict; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my $create = Net::EPP::Frame::Command::Create::Host->new; |
19
|
|
|
|
|
|
|
$create->setHost('ns1.example.uk.com); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
print $create->toString(1); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
This results in an XML document like this: |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
28
|
|
|
|
|
|
|
xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 |
29
|
|
|
|
|
|
|
epp-1.0.xsd"> |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
xmlns:contact="urn:ietf:params:xml:ns:host-1.0" |
34
|
|
|
|
|
|
|
xsi:schemaLocation="urn:ietf:params:xml:ns:host-1.0 |
35
|
|
|
|
|
|
|
host-1.0.xsd"> |
36
|
|
|
|
|
|
|
ns1.example.uk.com |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
0cf1b8f7e14547d26f03b7641660c641d9e79f45 |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 OBJECT HIERARCHY |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
L |
47
|
|
|
|
|
|
|
+----L |
48
|
|
|
|
|
|
|
+----L |
49
|
|
|
|
|
|
|
+----L |
50
|
|
|
|
|
|
|
+----L |
51
|
|
|
|
|
|
|
+----L |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub new { |
56
|
0
|
|
|
0
|
1
|
|
my $package = shift; |
57
|
0
|
|
|
|
|
|
my $self = bless($package->SUPER::new('create'), $package); |
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
$self->addObject(Net::EPP::Frame::ObjectSpec->spec('host')); |
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
return $self; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=pod |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 METHODS |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
my $element = $frame->setHost($host_name); |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
This sets the name of the object to be created. Returns the |
71
|
|
|
|
|
|
|
host:nameE> element. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=cut |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub setHost { |
77
|
0
|
|
|
0
|
0
|
|
my ($self, $host) = @_; |
78
|
|
|
|
|
|
|
|
79
|
0
|
|
|
|
|
|
my $name = $self->createElement('host:name'); |
80
|
0
|
|
|
|
|
|
$name->appendText($host); |
81
|
|
|
|
|
|
|
|
82
|
0
|
|
|
|
|
|
$self->getNode('create')->getChildNodes->shift->appendChild($name); |
83
|
|
|
|
|
|
|
|
84
|
0
|
|
|
|
|
|
return 1; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=pod |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
$frame->setAddr({ 'ip' => '10.0.0.1', 'version' => 'v4' }); |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
This adds an IP address to the host object. EPP supports multiple |
92
|
|
|
|
|
|
|
addresses of different versions. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=cut |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub setAddr { |
97
|
0
|
|
|
0
|
0
|
|
my ($self, @addr) = @_; |
98
|
|
|
|
|
|
|
|
99
|
0
|
|
|
|
|
|
foreach my $ip (@addr) { |
100
|
0
|
|
|
|
|
|
my $hostAttr = $self->createElement('host:addr'); |
101
|
0
|
|
|
|
|
|
$hostAttr->appendText($ip->{ip}); |
102
|
0
|
|
|
|
|
|
$hostAttr->setAttribute('ip', $ip->{version}); |
103
|
0
|
|
|
|
|
|
$self->getNode('create')->getChildNodes->shift->appendChild($hostAttr); |
104
|
|
|
|
|
|
|
} |
105
|
0
|
|
|
|
|
|
return 1; |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
1; |