Class: MooMoo::Lookup

Inherits:
BaseCommand show all
Defined in:
lib/moo_moo/services/lookup.rb

Constant Summary collapse

TLDS_FILE =
File.expand_path("../../../../config/tlds.yml", __FILE__)

Instance Attribute Summary

Attributes inherited from BaseCommand

#host, #key, #port, #response, #username

Instance Method Summary collapse

Methods inherited from BaseCommand

#attributes, #initialize, #message, register_service, #successful?

Constructor Details

This class inherits a constructor from MooMoo::BaseCommand

Instance Method Details

#belongs_to_rspObject

Determines whether the domain belongs to the RSP who issued the command.

www.opensrs.com/docs/apidomains/belongs_to_rsp.htm



11
# File 'lib/moo_moo/services/lookup.rb', line 11

register_service :belongs_to_rsp, :domain

#domain_contacts(domain) ⇒ Object

Queries contact information for a domain using get_domains_contacts.

  • :domain - the domain to query for. E.g.: “domain1.com”

Returns an array like:

[
  {
    :type =>       "type", # admin, billing, etc
    :first_name => "first_name",
    :last_name =>  "last_name"
    ... other attributes ...
  }
]


113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/moo_moo/services/lookup.rb', line 113

def domain_contacts(domain)
  api_get_domains_contacts({ :attributes => { :domain_list => [domain] }})

  attributes[domain]["contact_set"].map do |(type, attributes)|
     {
      :type =>       type,
      :first_name => attributes["first_name"],
      :last_name =>  attributes["last_name"],
      :org_name =>   attributes["org_name"],
      :address1 =>   attributes["address1"],
      :address2 =>   attributes["address2"],
      :address3 =>   attributes["address3"],
      :city =>       attributes["city"],
      :state =>      attributes["state"],
      :country =>    attributes["country"],
      :postal_code =>attributes["postal_code"],
      :phone =>      attributes["phone"],
      :fax =>        attributes["fax"],
      :email =>      attributes["email"]
    }
  end
end

#getObject

Queries various types of data regarding the user’s domain. For example, the all_info type allows you to retrieve all data for the domain linked to the current cookie. The list type queries the list of domains associated with the user’s profile. The list type can also be used to return a list of domains that expire within a specified range. The nameservers type returns the nameservers currently acting as DNS servers for the domain.

www.opensrs.com/docs/apidomains/get_domain.htm



36
# File 'lib/moo_moo/services/lookup.rb', line 36

register_service :get, :domain

#get_balanceObject

Queries the requester’s account, and returns the total amount of money in the account and the amount that is allocated to pending transactions.

www.opensrs.com/docs/apidomains/get_balance.htm



18
# File 'lib/moo_moo/services/lookup.rb', line 18

register_service :get_balance, :balance

#get_deleted_domainsObject

Lists domains that have been deleted due to expiration or deleted by request (revoked). This command applies to all domains in a Reseller’s profile. Results include the domain, status, and deleted date.

www.opensrs.com/docs/apidomains/get_deleted_domains.htm



26
# File 'lib/moo_moo/services/lookup.rb', line 26

register_service :get_deleted_domains, :domain

#get_domains_by_expiredateObject

Retrieves domains that expire within a specified date range.

www.opensrs.com/docs/apidomains/get_domains_by_expiredate.htm



47
# File 'lib/moo_moo/services/lookup.rb', line 47

register_service :get_domains_by_expiredate, :domain

#get_notesObject

Retrieves the domain notes that detail the history of the domain, for example, renewals and transfers.

www.opensrs.com/docs/apidomains/get_notes.htm



54
# File 'lib/moo_moo/services/lookup.rb', line 54

register_service :get_notes, :domain

#get_order_infoObject

Queries all the information for an order, but does not return sensitive information such as username, password, and Authcode.

www.opensrs.com/docs/apidomains/get_order_info.htm



61
# File 'lib/moo_moo/services/lookup.rb', line 61

register_service :get_order_info, :domain

#get_orders_by_domainObject

Retrieves information about orders placed for a specific domain.

www.opensrs.com/docs/apidomains/get_orders_by_domain.htm



67
# File 'lib/moo_moo/services/lookup.rb', line 67

register_service :get_orders_by_domain, :domain

#get_priceObject

Queries the price of a domain, and can be used to determine the cost of a billable transaction for any TLD. A returned price for a given domain does not guarantee the availability of the domain, but indicates that the requested action is supported by the system and calculates the cost to register the domain (if available).

www.opensrs.com/docs/apidomains/get_price.htm



76
# File 'lib/moo_moo/services/lookup.rb', line 76

register_service :get_price, :domain

#get_product_infoObject

Queries the properties of the specified Trust Service product

Required

* <tt>:product_id</tt> - ID of the product


83
# File 'lib/moo_moo/services/lookup.rb', line 83

register_service :get_product_info, :trust_service

#lookupObject

Determines the availability of a specified domain name.

www.opensrs.com/docs/apidomains/lookup_domain.htm



89
# File 'lib/moo_moo/services/lookup.rb', line 89

register_service :lookup, :domain

#name_suggestObject

Checks whether a specified name, word, or phrase is available for registration in gTLDs and ccTLDs, suggests other similar domain names for .COM, .NET, .ORG, .INFO, .BIZ, .US, and .MOBI domains, and checks whether they are available. Reseller must be enabled for the specified TLDs.

www.opensrs.com/docs/apidomains/name_suggest_domain.htm



97
# File 'lib/moo_moo/services/lookup.rb', line 97

register_service :name_suggest, :domain

#tldsObject

Public: Lists top level domain OpenSRS supports. At this point, OpenSRS does not have an api call to do that, so we keep our own list of supported top level domains.



139
140
141
# File 'lib/moo_moo/services/lookup.rb', line 139

def tlds
  @tlds ||= YAML.load_file(TLDS_FILE)
end