-
Notifications
You must be signed in to change notification settings - Fork 7
/
EXAMPLE.AFNIC
70 lines (65 loc) · 2.24 KB
/
EXAMPLE.AFNIC
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env ruby
require 'pp'
require 'rubygems'
require 'epp-client/afnic'
c = EPPClient::AFNIC.new(
:client_id => '-test-.fr',
:password => 'pass',
:ssl_cert => 'server.crt',
:ssl_key => 'server.key',
:test => true
)
begin
c.open_connection
c.login
if c.msgQ_count > 0
pp msg = c.poll_req
pp c.poll_ack if Hash === msg[:obj]
end
pp c.domain_check('mat.fr', 'nonexistantdomain.fr', 'paris.fr', 'trafiquants.fr', 'toto.wf')
pp c.domain_info('afnic.fr')
# pas de contact check
pp c.contact_info('A7534') # legal
pp c.contact_info('CT214') # particulier
pp contact = c.contact_create( {
:email=>"[email protected]",
:authInfo => "foobar",
:voice=>"+33.123456787",
:postalInfo=> { "loc"=> { :addr=> { :city=>"Paris", :cc=>"FR", :pc=>"75001", :street=>["BP 18", "1, rue Royale"] }, :name=>"Dupond", :org => 'FooBar Inc.' }, },
#:list => 'restrictedPublication',
#:individualInfos => {:birthDate => '1978-01-01', :birthCc => 'FR', :birthPc => '75013', :birthCity => 'Paris'},
#:firstName => 'Jean',
:legalEntityInfos=> {:siren=>"418565404", :legalStatus=>"company"},
#:legalEntityInfos=> {:siren=>"418565404", :legalStatus=>"association", :asso => { :decl => '2001-01-01', :publ => {:date => '2001-01-02', :announce => 5, :page => 3}}},
#:legalEntityInfos=> {:siren=>"418565404", :legalStatus=>"association", :asso => { :waldec => 2 }},
})
pp c.contact_info(contact[:id])
pp c.contact_update({
:id => contact[:id],
:chg => {
:email => '[email protected]',
}})
pp c.contact_info(contact[:id])
pp c.contact_info(contact[:id])
pp c.domain_create({
:registrant => "A7534",
:contacts => {:tech => ["ADM3"], :admin => ["ADM3"]},
:name => "truc-#{$$}.fr",
:authInfo => "PN16IZ0V"
})
pp c.domain_info(:name => "truc-#{$$}.fr")
pp c.domain_update({
:name => "truc-#{$$}.fr",
#:chg => { :authInfo => 'bazar' },
:add => {
:ns => %w(ns1.absolight.net ns2.absolight.net ns3.absolight.net ns4.absolight.net),
},
})
pp c.domain_info(:name => "truc-#{$$}.fr")
pp c.domain_delete("truc-#{$$}.fr")
pp c.domain_info(:name => "truc-#{$$}.fr")
pp c.domain_restore(:name => "truc-#{$$}.fr")
pp c.domain_info(:name => "truc-#{$$}.fr")
ensure
c.logout
end