Dreamhost API
August 27th, 2006
Because I’m sick of dealing with Dreamhost’s mediocre panel, and because I wanted to be able to script my creation of web hosts, databases and subversion repositiories so that all my projects share the same basic layouts, I’ve created a screen-scraping interface to the Dreamhost panel.
It’s a Ruby app and to use it you’ll need to have Ruby 1.8 (probably) as well as rake and the ‘mechanize’ gem which does all the heavy lifting.
The documentation is sparse, but hey, this is ruby
If you have any questions and especially suggestions for improvements, just fire me an email or leave a comment.
DOWNLOAD:
It’s available here:
Dreamhost Adapter - 0.1 Initial release
USAGE:
You should be able to do something like this:
rake create_repo USER=me PASS=secret SVN_HOST=https://svn.eyesopen.ca NAME=repo
other tasks are:
- destroy_repo USER=me PASS=secret NAME=repo
- create_host USER=me PASS=secret HOSTNAME= my.new.host DIRECTORY=/home/me/my.new.host
- destroy_host USER=me PASS=secret HOSTNAME=my.old.host
- create_db USER=me PASS=secret DB_NAME=database DB_HOST=db_server.foo.com
- destroy_db USER=me PASS=secret DB_NAME=database
These tasks, like capistrano, all assume that you will be using one username / password combination which is the same as your login for dreamhost.





5 comments on “Dreamhost API”
01
I agree, the lack of API sucks. Actually Dreamhost sucks period. The only reason i use it i because it’s dirt cheap.
02
Meh. I don’t think it’s that bad. It’s up most of the time
I don’t think I’d ever use it as a client host, but it’s fine to use as a subversion repo / staging area.
03
When I try to use this I get the error:
undefined method `find_node’ for #
#{RAILS_ROOT}/lib/dreamhost_adapter.rb:306:in `logged_in_already?’
#{RAILS_ROOT}/lib/dreamhost_adapter.rb:88:in `login’
04
Oh I see that mechanize has changed a lot since you created this great adapter. I modified it to work with the new mechanize and now its working great. I just wonder if there is a way to stay logged in. I’m afraid Dreamhost is going to lock my account if it sees too many logins.
I tried putting my @dreamhost in session but mongrel didn’t like that.
05
Really? I’m amazed its even *close* to working. Not only has mechanize been totally changed, but the Dreamhost panel was totally rewritten, so I assumed it would be totally dead by now! Are you still getting somewhere?
Leave a Reply