vpsFree-Client
vpsFree-Client is a Ruby CLI and client library for vpsFree.cz API. It is based on vpsadmin-client, which is in turn based on haveapi-client. Check haveapi-client for more extensive documentation.
Installation
Add this line to your application’s Gemfile:
gem 'vpsfree-client'
And then execute:
$ bundle
Or install it yourself as:
$ gem install vpsfree-client
Usage
### CLI
$ vpsfreectl -h
Usage: vpsfreectl [options]
Commands:
vps remote_console VPS_ID Open VPS remote console
Examples
Authenticate using token and save it to config for later use:
vpsfreectl --auth token --save user current
Note that the token will be stored in your home directory in plain text and anyone having access to it will be able to login as yourself into vpsAdmin.
Show action parameters:
vpsfreectl vps create -h
List VPS:
vpsfreectl vps list
List OS templates:
vpsfreectl os_template list
Create VPS:
vpsfreectl vps create -- --hostname myvps --os-template-id 26
Delete VPS #1000:
vpsfreectl vps delete 1000
List IP addresses:
vpsfreectl vps.ip_address list
Open remote VPS console:
vpsfreectl vps remote_console $vps_id
Client library
```ruby require ‘vpsfree/client’
api = VpsFree::Client.new api.login(:basic, user: ‘yourname’, password: ‘yourpassword’)
response = api.vps.index p response.ok? p response.response
p api.os_template.index
p api.vps.create({ hostname: ‘myvps’, os_template_id: 26 })
p api.vps(1000).delete p api.vps(1000).delete!
p api.vps.ip_address.index ```