cPanel connection wrapper for Ruby.
You will first need to build the basic class for the remote server calls you wish to implement. I wrote the plugin to be extremely barebones, so you could implement what you deemed necessary to stay lean:
require 'cpanel' class CpanelServer attr_reader :server def initialize(url, key, user = 'root') @server = Cpanel::Server.new({ :url => url, :key => key, :user => user }) end def change_password(user, new_password) server.request("passwd", { :user => user, :pass => new_password }) end end server = CpanelServer.new("https://server.com:2086", "API_KEY_HERE") server.change_password("myuser12", "s3cur3p@55")
All API calls can be performed using JSON or XML. You can set this in the initialization, if you’d like:
def initialize(url, key, connection_type = "json") @server = Cpanel::Server.new({ :url => url, :key => key, :api => connection_type }) end
For a list of current API commands, go here:
docs.cpanel.net/twiki/bin/view/AllDocumentation/AutomationIntegration/XmlApi
Please insert all bug and feature requests into the GitHub Issues tracker:
github.com/voxxit/cpanel/issues
-
Fork the project.
-
Make your feature addition or bug fix.
-
Add tests for it. This is important so I don’t break it in a future version unintentionally.
-
Commit, do not mess with rakefile, version, or history. If you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
-
Send me a pull request. Bonus points for topic branches.
Copyright © 2010 Josh Delsman. See LICENSE for details.