Class: Lumberg::Whm::Cert

Inherits:
Base
  • Object
show all
Defined in:
lib/lumberg/whm/cert.rb

Instance Attribute Summary

Attributes inherited from Base

#server

Instance Method Summary collapse

Methods inherited from Base

#initialize, #setup_server

Constructor Details

This class inherits a constructor from Lumberg::Whm::Base

Instance Method Details

#fetch_ssl_vhostsObject

Public: Gets information about each vhost on the server and the SSL certificates that are installed on them.

Returs a Hash



79
80
81
82
83
84
85
# File 'lib/lumberg/whm/cert.rb', line 79

def fetch_ssl_vhosts
  server.perform_request(
    'fetch_ssl_vhosts', { 
      :"api.version" => 1,
      response_key:  "data"
    })
end

#fetchsslinfo(options = {}) ⇒ Object

Displays the SSL certificate, private key, and CA bundle/intermediate certificate associated with a specified domain. Alternatively, it can display the private key and CA bundle associated with a specified cert

Required

* <tt>:domain</tt> - PENDING
* <tt>:crtdata</tt> - PENDING

Optional

* <tt>none</tt> - PENDING


15
16
17
18
# File 'lib/lumberg/whm/cert.rb', line 15

def fetchsslinfo(options = {})
  server.force_response_type = :ssl
  result = server.perform_request('fetchsslinfo', options)
end

#generatessl(options = {}) ⇒ Object

Public: Generates a Certificate Signing Request

options - Hash options for API call params (default: {}):

:city     - The city in which your server resides.
:company  - The name of the company.
:company_division - The division of your company.
:country  - A two letter abbreviation for the country.
:email    - A valid email address that will correspond to
            the certificate signing request
:host     - The domain that corresponds to the csr.
:state    - A two letter abbreviation that corresponds to the
            state.
:pass     - The password of the csr.
:xemail   - Email address to which the certificate will be
            sent (String)
:noemail  - (Boolean) and dependent value. Set to "1" when
            :xemail is empty

Returns Hash API response.



39
40
41
42
43
44
45
# File 'lib/lumberg/whm/cert.rb', line 39

def generatessl(options = {})
  options[:co]  = options.delete(:company)
  options[:cod] = options.delete(:company_division)

  server.force_response_type = :ssl
  result = server.perform_request('generatessl', options)
end

#installssl(options = {}) ⇒ Object

Install an SSL certificate

Required

* <tt>:user</tt> - PENDING
* <tt>:domain</tt> - PENDING
* <tt>:cert</tt> - PENDING
* <tt>:key</tt> - PENDING
* <tt>:cab</tt> - PENDING
* <tt>:ip</tt> - PENDING

Optional

* <tt>none</tt> - PENDING


59
60
61
# File 'lib/lumberg/whm/cert.rb', line 59

def installssl(options = {})
  result = server.perform_request('installssl', options)
end

#listcrts(options = {}) ⇒ Object

List all the domains on the server that have SSL certificates installed

Required

* <tt>none</tt> - PENDING

Optional

* <tt>none</tt> - PENDING


70
71
72
73
# File 'lib/lumberg/whm/cert.rb', line 70

def listcrts(options = {})
  server.force_response_type = :ssl
  result = server.perform_request('listcrts', options.merge(response_key: 'crt'))
end