Giter Site home page Giter Site logo

epp-client's Introduction

EPP Client

Build Status

Client for communicating with EPP services

Installation

Add this line to your application's Gemfile:

gem 'epp-client'

And then execute:

$ bundle

Or install it yourself as:

$ gem install epp-client

Version 2.0.0

The version has been bumped to 2.0.0 due to the introduction of a backwards incompatible change.

  • EPP::Domain::InfoResponse#status now returns an array of statuses as part of m247#7.

Usage

client = EPP::Client.new('username', 'password', 'epp.server.com')
client.hello
puts client.last_request.to_s(:indent => 2)
puts client.last_response.to_s(:indent => 2)

The old method_missing behaviour has been removed and replaced with defined methods for handling each of the distinct EPP commands.

  • check
  • create
  • delete
  • info
  • renew
  • transfer
  • update
  • poll
  • ack

each of these methods, with the exception of poll and ack, accept two arguments. Those arguments are a payload and an optional extension. The majority of the common domain, contact and host payloads have been defined already.

Domain Check Example

resp  = client.check EPP::Domain::Check.new('example.com', 'example.net', 'example.org')
check = EPP::Domain::CheckResponse.new(resp)
check.available?('example.com') #=> true
check.available?('example.net') #=> false
check.available?('example.org') #=> false

Domain Information Example

resp = client.info EPP::Domain::Info.new('example.com')
info = EPP::Domain::InfoResponse.new(resp)
info.name #=> "example.com"
info.nameservers #=> [{"name"=>"ns1.example.net"},{"name"=>"ns2.example.net"}]

Payload an Extension API

The objects which are passed to the client methods need to adhere to the following API in order to be successfully marshalled by the client into the required XML document.

  • name to specify the EPP command name. Required.
  • to_xml returns an XML::Document. Required.
  • set_namespaces to receive XML::Namespace objects from the parent. Optional.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

epp-client's People

Contributors

geoffgarside avatar jacegu avatar aeden avatar

Watchers

James Cloos avatar Bartosz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.