Class: MooMoo::Lookup
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- MooMoo::Lookup
- Defined in:
- lib/moo_moo/services/lookup.rb
Constant Summary collapse
- TLDS_FILE =
File.("../../../../config/tlds.yml", __FILE__)
Instance Attribute Summary
Attributes inherited from BaseCommand
#host, #key, #port, #response, #username
Instance Method Summary collapse
-
#belongs_to_rsp ⇒ Object
Determines whether the domain belongs to the RSP who issued the command.
-
#domain_contacts(domain) ⇒ Object
Queries contact information for a domain using get_domains_contacts.
-
#get ⇒ Object
Queries various types of data regarding the user’s domain.
-
#get_balance ⇒ Object
Queries the requester’s account, and returns the total amount of money in the account and the amount that is allocated to pending transactions.
-
#get_deleted_domains ⇒ Object
Lists domains that have been deleted due to expiration or deleted by request (revoked).
-
#get_domains_by_expiredate ⇒ Object
Retrieves domains that expire within a specified date range.
-
#get_notes ⇒ Object
Retrieves the domain notes that detail the history of the domain, for example, renewals and transfers.
-
#get_order_info ⇒ Object
Queries all the information for an order, but does not return sensitive information such as username, password, and Authcode.
-
#get_orders_by_domain ⇒ Object
Retrieves information about orders placed for a specific domain.
-
#get_price ⇒ Object
Queries the price of a domain, and can be used to determine the cost of a billable transaction for any TLD.
-
#get_product_info ⇒ Object
Queries the properties of the specified Trust Service product.
-
#lookup ⇒ Object
Determines the availability of a specified domain name.
-
#name_suggest ⇒ Object
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.
-
#tlds ⇒ Object
Public: Lists top level domain OpenSRS supports.
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_rsp ⇒ Object
Determines whether the domain belongs to the RSP who issued the command.
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 |
#get ⇒ Object
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.
36 |
# File 'lib/moo_moo/services/lookup.rb', line 36 register_service :get, :domain |
#get_balance ⇒ Object
Queries the requester’s account, and returns the total amount of money in the account and the amount that is allocated to pending transactions.
18 |
# File 'lib/moo_moo/services/lookup.rb', line 18 register_service :get_balance, :balance |
#get_deleted_domains ⇒ Object
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.
26 |
# File 'lib/moo_moo/services/lookup.rb', line 26 register_service :get_deleted_domains, :domain |
#get_domains_by_expiredate ⇒ Object
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_notes ⇒ Object
Retrieves the domain notes that detail the history of the domain, for example, renewals and transfers.
54 |
# File 'lib/moo_moo/services/lookup.rb', line 54 register_service :get_notes, :domain |
#get_order_info ⇒ Object
Queries all the information for an order, but does not return sensitive information such as username, password, and Authcode.
61 |
# File 'lib/moo_moo/services/lookup.rb', line 61 register_service :get_order_info, :domain |
#get_orders_by_domain ⇒ Object
Retrieves information about orders placed for a specific domain.
67 |
# File 'lib/moo_moo/services/lookup.rb', line 67 register_service :get_orders_by_domain, :domain |
#get_price ⇒ Object
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).
76 |
# File 'lib/moo_moo/services/lookup.rb', line 76 register_service :get_price, :domain |
#get_product_info ⇒ Object
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 |
#lookup ⇒ Object
Determines the availability of a specified domain name.
89 |
# File 'lib/moo_moo/services/lookup.rb', line 89 register_service :lookup, :domain |
#name_suggest ⇒ Object
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.
97 |
# File 'lib/moo_moo/services/lookup.rb', line 97 register_service :name_suggest, :domain |
#tlds ⇒ Object
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 |