Plesk for Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
.gitignore
Gemfile
Gemfile.lock
MIT-LICENCE
README.md
plesk-ruby.gemspec

README.md

Plesk for Ruby

A library to help with accessing the Plesk API.

Installation

Add the gem to your Gemfile.

gem 'plesk-ruby', '~> 1.0', :require => 'plesk'

Usage

require 'plesk'

client = Plesk::Client.new('mypleskhost.atech.io', 'admin', 'password')

# If you're not running port 8443
client.options[:port] = 8123

# If you don't want to verify the SSL certificate
client.options[:verify_ssl] = false

# Make a request
xml = client.request('customer', 'get') do
  filter do
    id 1
  end

  dataset do
    gen_info
    stat
  end
end

# Do something with the result
puts xml.xpath('//result/data/gen_info/pname').first&.content

# Catch errrors by rescuing the following exceptions
Plesk::Client::Error              #=> All errors
Plesk::Client::RequestError       #=> Request errors (parser errors etc...)
Plesk::Client::ActionError        #=> Action errors (resource not found etc...)