= Solusvm Solusvm allows for easy interaction with the SolusVM Admin::API. This library was first created for internal use at {Site5 LLC}[http://www.site5.com]. == Basic Examples Solusvm.config('api_id', 'api_password', :url => 'http://www.example.com/api') server = Solusvm::Server.new # 200 is the id of the virtual server server.shutdown(200) # => true server.boot(200) # => true server.reboot(200) # => true server.suspend(200) # => true server.resume(200) # => true == Server creation options = {:type => 'xen', :username => 'bob', :node => 'node1', :plan => 'plan1', :template => 'mytpl', :ips => 1} result = sever.create('server.hostname.com', 'password', options} p server.successful? => true p result => {"mainipaddress"=>"127.0.0.1", "consoleuser"=>"console-user", "vserverid"=>"10", "statusmsg"=>"Virtual server created", "virtid"=>"vm10", "consolepassword"=>"myPassisL33t", "extraipaddress"=>{}, "hostname"=>"server.hostname", "rootpassword"=>"password", "status"=>"success"} == Command Line Usage USAGE: solusvm [options] -I, --api-login [id] API ID -K, --api-key [key] API KEY -N, --node [node] Node to provision on -U, --api-url [URL] URL to the API -u, --username [username] The client to put the VPS under -k, --kind [kind] Type of VPS (openvz,xen,xen hvm) -t, --template [template] VPS template to boot from -p, --plan [plan] Plan to use -i, --ips [number] Number of ips to add to the VPS -h, --help Show help documentation Commands: server-check-exists server-shutdown server-changeplan server-resume server-reboot server-status server-boot server-create -t myimag -k xen -p myplan -i 1 server-suspend server-addip == Default Config for Command Line The command line utility, solusvm, will look for a .solusvm.yml file in ~/. You can specify some defaults. ~/.solusvm.yml id: api_id key: api_key # URL to the API endpoint url: https://portal.yoursite.com/api/admin/command.php # Default client to put servers under username: bob == REQUIREMENTS: * xml-simple == DOCUMENTATION * http://solusvm.rubyforge.org/solusvm/ == INSTALL: * gem install solusvm == 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 Site5. See LICENSE for details.