Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/voxxit/cpanel

cPanel connection wrapper for Ruby
https://github.com/voxxit/cpanel

Last synced: 4 days ago
JSON representation

cPanel connection wrapper for Ruby

Awesome Lists containing this project

README

        

= cpanel

{Join the chat at https://gitter.im/voxxit/cpanel}[https://gitter.im/voxxit/cpanel?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge]

cPanel connection wrapper for Ruby.

== Example Usage

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:

http://docs.cpanel.net/twiki/bin/view/AllDocumentation/AutomationIntegration/XmlApi

== Bug/feature requests

Please insert all bug and feature requests into the GitHub Issues tracker:

http://github.com/voxxit/cpanel/issues

== Note on Patches/Pull Requests

* 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

Copyright (c) 2010 Josh Delsman. See LICENSE for details.