Skip to content

FusedHQ/cpanel-helper

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CPanelHelper is a Ruby library for interaction with External CPanel XML/JSON API and with CPanel Internal XML APIv2.

It also allows local cpanel information retrieval, such as finding user & domain by supplied query string.

Invoking the API helper

require 'cpanelhelper'

CPanelHelper.configure do |config|
	config.uri_host = 'https://remote.cpanel.host:2087'
	config.user = 'root'
	config.password = 'assword'
	config.logger = Logger.new($stderr)
	config.call_type = :json
	#config.access_hash = open('/root/.accesshash').read
end

# The call interface is as following:
#   CPanelHelper::API.*function_name*(*:parameter1* => *value1*, *:parameter2* => *value2*, ...)
# For "adjusted" functions, see their respective invokation documentation

# retrieve available funcs
resp = CPanelHelper::API.applist
available_funcs = resp['app']

# search accounts by domain. (This is an "adjusted" function)
accounts = CPanelHelper::API.listaccts('domain', 'somedomain.com')

Note that CPanelHelper::API functions raise CallError on any critical error.

Invoking “local” CPanel functions

Please note that CPanelHelper::Local functions require access to CPanel data files, thus these calls are invoked only locally.

About

Nasty CPanel ruby bindings

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%