Class: MooMoo::Provisioning

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

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

#cancel_orderObject

Cancels a Trust Service order



6
# File 'lib/moo_moo/services/provisioning.rb', line 6

register_service :cancel_order, :trust_service

#cancel_pending_ordersObject

Cancels orders with a status of pending or declined.

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



12
# File 'lib/moo_moo/services/provisioning.rb', line 12

register_service :cancel_pending_orders, :order

#modifyObject

Changes information associated with a domain, such as contact info. The action request message is different depending on the type of modification being made, and is shown separately for each type.

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



20
# File 'lib/moo_moo/services/provisioning.rb', line 20

register_service :modify, :domain

#process_pendingObject

Processes or cancels pending orders; also applicable to any order that is declined. The order is cancelled and a new order is created. Can also be used to process cancelled orders, provided the cancelled order was a new order or a transfer.

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



28
# File 'lib/moo_moo/services/provisioning.rb', line 28

register_service :process_pending, :domain

#register_trust_serviceObject

Submits a new registration request or transfer order



60
# File 'lib/moo_moo/services/provisioning.rb', line 60

register_service :register_trust_service, :trust_service

#renewObject

Renews a domain and allows you to set the auto-renewal flag on a domain.

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



34
# File 'lib/moo_moo/services/provisioning.rb', line 34

register_service :renew, :domain

#revokeObject

Removes the domain at the registry. Use this command to request a refund for a domain purchase. This call can refund/revoke only one domain at the time.

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



41
# File 'lib/moo_moo/services/provisioning.rb', line 41

register_service :revoke, :domain

#sw_registerObject

Submits a new domain registration or transfer order that obeys the Reseller's 'process immediately' flag setting.

www.opensrs.com/docs/apidomains/sw_register.htm Note: Requirements vary depending on TLD



56
# File 'lib/moo_moo/services/provisioning.rb', line 56

register_service :sw_register, :domain

#update_contact(domain, contact_attributes) ⇒ Object

Updates contact information for a domain using modify.

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

  • :attributes - a contact attributes hash like:

    {
      type:        "type", # admin, billing, etc
      first_name:  "first_name",
      last_name:   "last_name"
      ... other attributes ...
    }

In case of errors, an errors array like this will be returned:

["Error1", "Error2"]


77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/moo_moo/services/provisioning.rb', line 77

def update_contact(domain, contact_attributes)
  contact_set = {
    contact_attributes[:type] => contact_attributes
  }

  # Removes the type key from contact_attributes
  contact_set[contact_attributes[:type]].delete(:type)

  response = api_modify(params_with_domain(domain).merge({
    :attributes => {
      :affect_domains => "0",
      :data =>           "contact_info",
      :contact_set =>    contact_set
    }
  }))

  if successful?
    response
  else
    attributes["details"][domain]["response_text"].split("\n")
  end
end

#update_contactsObject

Submits a domain-contact information update to the OpenSRS system. Each contact object is submitted as a whole to OpenSRS, and changes are parsed against the existing information.

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



48
# File 'lib/moo_moo/services/provisioning.rb', line 48

register_service :update_contacts, :domain