cozaepp 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -35,6 +35,56 @@ apply_clienthold(domainName)
35
35
 
36
36
  create_contact(contactId, contactName, contactOrg, contactStreet1, contactStreet2, contactStreet3, contactCity, contactProvince, contactPostalcode, contactCountry, contactTel, contactFax, contactEmail, contactPassword )
37
37
 
38
+ #### create_domain(domainName,registrant,hosts,domainSecret)
39
+
40
+ "hosts" as a array of hashes.
41
+
42
+ ```
43
+ {
44
+ "hostname" => 'hostname',
45
+ "ip_v4_address" => 'IPv4 Address',
46
+ "ip_v6_address" => 'IPv6 Address'
47
+ }
48
+ ```
49
+
50
+ Using an external NS you need only the hostname
51
+
52
+ ```
53
+ create_domain(
54
+ "testing.test.dnservices.co.za",
55
+ "1234567891234567",
56
+ [
57
+ {
58
+ "hostname" => 'ns1.domain.co.za'
59
+ },
60
+ {
61
+ "hostname" => 'ns2..domain.co.za'
62
+ }
63
+ ],
64
+ "coza"
65
+ )
66
+ ```
67
+
68
+ Using a NS that's hostname falls part of the domain being registered, IP details are required
69
+
70
+ ```
71
+ create_domain(
72
+ "testing.test.dnservices.co.za",
73
+ "1234567891234567",
74
+ [
75
+ {
76
+ "hostname" => 'ns1.testing.test.dnservices.co.za',
77
+ "ip_v4_address" => '1.1.1.1'
78
+ },
79
+ {
80
+ "hostname" => 'ns2.testing.test.dnservices.co.za',
81
+ "ip_v4_address" => '2.2.2.2'
82
+ }
83
+ ],
84
+ "coza"
85
+ )
86
+ ```
87
+
38
88
  create_domain_with_host(domainName, registrant, nsHostname1, nsipv4Address1, nsipv6Address1, nsHostname2, nsipv4Address2, nsipv6Address2, domainSecret )
39
89
 
40
90
  create_domain_with_ns(domainName, registrant, nsHostname1, nsHostname2, domainSecret )
data/erb/check.erb CHANGED
File without changes
@@ -5,8 +5,13 @@
5
5
  <domain:create xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" xsi:schemaLocation="urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd">
6
6
  <domain:name><%= domainName %></domain:name>
7
7
  <domain:ns>
8
- <domain:hostObj><%= nsHostname1 %></domain:hostObj>
9
- <domain:hostObj><%= nsHostname2 %></domain:hostObj>
8
+ <% hosts.each do |host| %>
9
+ <domain:hostAttr>
10
+ <domain:hostName><%= host["hostname"] %></domain:hostName>
11
+ <% if host["ip_v4_address"] %><domain:hostAddr ip="v4"><%= host["ip_v4_address"] %></domain:hostAddr><% end %>
12
+ <% if host["ip_v6_address"] %><domain:hostAddr ip="v6"><%= host["ip_v6_address"] %></domain:hostAddr><% end %>
13
+ </domain:hostAttr>
14
+ <% end %>
10
15
  </domain:ns>
11
16
  <domain:registrant><%= registrant %></domain:registrant>
12
17
  <domain:authInfo>
@@ -17,4 +22,3 @@
17
22
  <clTRID><%= cltrid %></clTRID>
18
23
  </command>
19
24
  </epp>
20
-
data/erb/epp_metadata.erb CHANGED
File without changes
data/erb/info.erb CHANGED
File without changes
data/erb/login.erb CHANGED
File without changes
data/erb/logout.erb CHANGED
File without changes
data/erb/poll.erb CHANGED
File without changes
data/erb/renew.erb CHANGED
File without changes
@@ -1,3 +1,3 @@
1
1
  module Cozaepp
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/cozaepp.rb CHANGED
@@ -278,6 +278,21 @@ module CozaEPP
278
278
  return {:status => statusCode, :text => statusMsg, :cltrid => cltrid, :svtrid => svtrid }
279
279
  end
280
280
 
281
+ def create_domain(domainName,
282
+ registrant,
283
+ hosts=[],
284
+ domainSecret
285
+ )
286
+
287
+ cltrid = gen_cltrid
288
+ xml = ERB.new(File.read(@gemRoot + "/erb/create_domain.erb")).result(binding)
289
+ result = @epp.send_request(xml)
290
+ statusCode = Hpricot::XML(result).at("//epp:epp//epp:response//epp:result")[:code]
291
+ statusMsg = Hpricot::XML(result).at("//epp:epp//epp:response//epp:result//epp:msg/")
292
+ svtrid = Hpricot::XML(result).at("//epp:epp//epp:response//epp:trID//epp:svTRID/")
293
+ return {:status => statusCode, :text => statusMsg, :cltrid => cltrid, :svtrid => svtrid }
294
+ end
295
+
281
296
  def create_domain_with_ns(domainName,
282
297
  registrant,
283
298
  nsHostname1,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cozaepp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-28 00:00:00.000000000 Z
12
+ date: 2012-12-02 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: API to Uniforum's EPP service
15
15
  email: