Module: EPPClient::RGP
- Defined in:
- lib/epp-client/rgp.rb
Overview
Domain Registry Grace Period Mapping for the Extensible Provisioning Protocol (EPP)
Has to be included after the initialize, domain_info and domain_update definitions.
Instance Method Summary collapse
-
#domain_info_process(xml) ⇒ Object
:nodoc:.
-
#domain_restore(args) ⇒ Object
Restores a domain.
-
#domain_restore_process(xml) ⇒ Object
:nodoc:.
-
#domain_restore_xml(args) ⇒ Object
:nodoc:.
-
#initialize(args) ⇒ Object
:nodoc:.
Instance Method Details
#domain_info_process(xml) ⇒ Object
:nodoc:
15 16 17 18 19 20 21 |
# File 'lib/epp-client/rgp.rb', line 15 def domain_info_process(xml) #:nodoc: ret = super(xml) if (rgp_status = xml.xpath('epp:extension/rgp:infData/rgp:rgpStatus', EPPClient::SCHEMAS_URL)).size > 0 ret[:rgpStatus] = rgp_status.map {|s| s.attr('s')} end ret end |
#domain_restore(args) ⇒ Object
Restores a domain.
takes a hash as arguments, with the following keys :
:name
-
the fully qualified name of the domain object to be updated.
:report
-
the optional report with the following fields :
:preData
-
a copy of the registration data that existed for the domain name prior to the domain name being deleted.
:postData
-
a copy of the registration data that exists for the domain name at the time the restore report is submitted.
:delTime
-
the date and time when the domain name delete request was sent to the server.
:resTime
-
the date and time when the original <rgp:restore> command was sent to the server.
:resReason
-
a brief explanation of the reason for restoring the domain name.
:statements
-
an array of two statements :
-
a text statement that the client has not restored the domain name in order to assume the rights to use or sell the domain name for itself or for any third party. Supporting information related to this statement MAY be supplied in the
:other
element described below. -
a text statement that the information in the restore report is factual to the best of the client’s knowledge.
-
:other
-
an optional element that contains any information needed to support the statements provided by the client.
Returns an array of rgpStatus.
86 87 88 89 90 |
# File 'lib/epp-client/rgp.rb', line 86 def domain_restore(args) response = send_request(domain_restore_xml(args)) get_result(:xml => response, :callback => :domain_restore_process) end |
#domain_restore_process(xml) ⇒ Object
:nodoc:
92 93 94 |
# File 'lib/epp-client/rgp.rb', line 92 def domain_restore_process(xml) #:nodoc: xml.xpath('epp:extension/rgp:upData/rgp:rgpStatus', EPPClient::SCHEMAS_URL).map {|s| s.attr('s')} end |
#domain_restore_xml(args) ⇒ Object
:nodoc:
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 |
# File 'lib/epp-client/rgp.rb', line 23 def domain_restore_xml(args) #:nodoc: command(lambda do |xml| xml.update do xml.update('xmlns' => EPPClient::SCHEMAS_URL['domain-1.0']) do xml.name args[:name] end end end, lambda do |xml| xml.update('xmlns' => EPPClient::SCHEMAS_URL['rgp-1.0']) do if args.key?(:report) xml.restore(:op => 'report') do [:preData, :postData, :delTime, :resTime, :resReason].each do |v| xml.__send__(v, args[:report][v]) end args[:report][:statements].each do |s| xml.statement s end if args[:report].key?(:other) xml.other args[:report][:other] end end else xml.restore(:op => 'request') end end end) end |
#initialize(args) ⇒ Object
:nodoc:
10 11 12 13 |
# File 'lib/epp-client/rgp.rb', line 10 def initialize(args) #:nodoc: super @extensions << EPPClient::SCHEMAS_URL['rgp'] end |