solusvm 1.0.0.beta3 → 1.1.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/.travis.yml +10 -4
- data/LICENSE +1 -1
- data/README.markdown +1 -1
- data/lib/solusvm.rb +2 -2
- data/lib/solusvm/base.rb +10 -32
- data/lib/solusvm/cli/base_cli.rb +30 -5
- data/lib/solusvm/cli/client_cli.rb +9 -9
- data/lib/solusvm/cli/general_cli.rb +5 -5
- data/lib/solusvm/cli/node_cli.rb +8 -8
- data/lib/solusvm/cli/reseller_cli.rb +7 -7
- data/lib/solusvm/cli/server_cli.rb +31 -31
- data/lib/solusvm/solusvm_errors.rb +22 -0
- data/lib/solusvm/version.rb +1 -1
- data/solusvm.gemspec +2 -0
- data/test/cli/test_base_cli.rb +32 -0
- data/test/cli/test_client_cli.rb +38 -21
- data/test/cli/test_general_cli.rb +13 -4
- data/test/cli/test_node_cli.rb +28 -14
- data/test/cli/test_reseller_cli.rb +69 -58
- data/test/cli/test_server_cli.rb +128 -39
- data/test/solusvm/test_base.rb +103 -0
- data/test/{test_cli.rb → solusvm/test_cli.rb} +1 -1
- data/test/solusvm/test_client.rb +109 -0
- data/test/solusvm/test_general.rb +69 -0
- data/test/{test_hash.rb → solusvm/test_hash.rb} +1 -1
- data/test/solusvm/test_node.rb +120 -0
- data/test/solusvm/test_reseller.rb +93 -0
- data/test/solusvm/test_server.rb +253 -0
- data/test/{helper.rb → test_helper.rb} +19 -4
- data/test/test_solusvm.rb +1 -1
- data/test/vcr_cassettes/base/invalid_key.yml +19 -0
- data/test/vcr_cassettes/base/invalid_status.yml +19 -0
- data/test/vcr_cassettes/base/nonexistent_node.yml +19 -0
- data/test/vcr_cassettes/base/parse_response.yml +28 -0
- data/test/vcr_cassettes/base/statusmsg.yml +28 -0
- data/test/vcr_cassettes/base/successful.yml +45 -0
- data/test/vcr_cassettes/base/unauthorized_ip.yml +19 -0
- data/test/vcr_cassettes/client/authenticate.yml +37 -0
- data/test/vcr_cassettes/client/change_password.yml +39 -0
- data/test/vcr_cassettes/client/create.yml +42 -0
- data/test/vcr_cassettes/client/delete.yml +37 -0
- data/test/vcr_cassettes/client/exists.yml +20 -0
- data/test/vcr_cassettes/client/list.yml +66 -0
- data/test/vcr_cassettes/general/isos.yml +38 -0
- data/test/vcr_cassettes/general/plans.yml +38 -0
- data/test/vcr_cassettes/general/templates.yml +38 -0
- data/test/vcr_cassettes/node/available_ips.yml +41 -0
- data/test/vcr_cassettes/node/ids.yml +21 -0
- data/test/vcr_cassettes/node/list.yml +38 -0
- data/test/vcr_cassettes/node/statistics.yml +32 -0
- data/test/vcr_cassettes/node/virtualservers.yml +67 -0
- data/test/vcr_cassettes/node/xenresources.yml +22 -0
- data/test/vcr_cassettes/reseller/change_resources.yml +27 -0
- data/test/vcr_cassettes/reseller/create.yml +27 -0
- data/test/vcr_cassettes/reseller/delete.yml +15 -0
- data/test/vcr_cassettes/reseller/info.yml +27 -0
- data/test/vcr_cassettes/reseller/list.yml +27 -0
- data/test/vcr_cassettes/server/.yml +1017 -0
- data/test/vcr_cassettes/server/boot.yml +15 -0
- data/test/vcr_cassettes/server/change_bootorder.yml +15 -0
- data/test/vcr_cassettes/server/change_consolepass.yml +16 -0
- data/test/vcr_cassettes/server/change_hostname.yml +15 -0
- data/test/vcr_cassettes/server/change_owner.yml +15 -0
- data/test/vcr_cassettes/server/change_plan.yml +15 -0
- data/test/vcr_cassettes/server/change_rootpassword.yml +15 -0
- data/test/vcr_cassettes/server/change_vncpass.yml +15 -0
- data/test/vcr_cassettes/server/console.yml +15 -0
- data/test/vcr_cassettes/server/create.yml +27 -0
- data/test/vcr_cassettes/server/exists.yml +15 -0
- data/test/vcr_cassettes/server/info.yml +27 -0
- data/test/vcr_cassettes/server/info_all.yml +15 -0
- data/test/vcr_cassettes/server/mountiso.yml +15 -0
- data/test/vcr_cassettes/server/network_disable.yml +15 -0
- data/test/vcr_cassettes/server/network_enable.yml +15 -0
- data/test/vcr_cassettes/server/pae_disable.yml +15 -0
- data/test/vcr_cassettes/server/pae_enable.yml +15 -0
- data/test/vcr_cassettes/server/reboot.yml +15 -0
- data/test/vcr_cassettes/server/rebuild.yml +15 -0
- data/test/vcr_cassettes/server/resume.yml +15 -0
- data/test/vcr_cassettes/server/shutdown.yml +15 -0
- data/test/vcr_cassettes/server/status.yml +15 -0
- data/test/vcr_cassettes/server/suspend.yml +15 -0
- data/test/vcr_cassettes/server/terminate.yml +27 -0
- data/test/vcr_cassettes/server/tun_disable.yml +15 -0
- data/test/vcr_cassettes/server/tun_enable.yml +15 -0
- data/test/vcr_cassettes/server/unmountiso.yml +15 -0
- data/test/vcr_cassettes/server/vnc.yml +15 -0
- metadata +220 -156
- data/.rbenv-version +0 -1
- data/.rvmrc +0 -47
- data/test/fixtures/base_bad_key.txt +0 -1
- data/test/fixtures/base_node_does_not_exist.txt +0 -1
- data/test/fixtures/base_unauthorized_ip.txt +0 -1
- data/test/fixtures/client_authenticate_error.txt +0 -2
- data/test/fixtures/client_authenticate_success.txt +0 -2
- data/test/fixtures/client_change_password_error.txt +0 -2
- data/test/fixtures/client_change_password_success.txt +0 -4
- data/test/fixtures/client_create_error.txt +0 -2
- data/test/fixtures/client_create_success.txt +0 -7
- data/test/fixtures/client_delete_success.txt +0 -2
- data/test/fixtures/client_exists_success.txt +0 -2
- data/test/fixtures/client_list_success.txt +0 -14
- data/test/fixtures/client_list_success_empty.txt +0 -2
- data/test/fixtures/error.txt +0 -2
- data/test/fixtures/general_isos_success.txt +0 -3
- data/test/fixtures/general_plans_success.txt +0 -3
- data/test/fixtures/general_templates_success.txt +0 -3
- data/test/fixtures/node_list_all_ips_available.txt +0 -4
- data/test/fixtures/node_list_all_ips_not_available.txt +0 -4
- data/test/fixtures/node_statistics_success.txt +0 -14
- data/test/fixtures/node_virtualservers_success.txt +0 -15
- data/test/fixtures/node_virtualservers_success_empty.txt +0 -2
- data/test/fixtures/node_xenresources_success.txt +0 -4
- data/test/fixtures/nodes_ids_success.txt +0 -3
- data/test/fixtures/nodes_list_success.txt +0 -3
- data/test/fixtures/reseller_change_resources_success.txt +0 -16
- data/test/fixtures/reseller_create_success.txt +0 -23
- data/test/fixtures/reseller_delete_success.txt +0 -2
- data/test/fixtures/reseller_info_success.txt +0 -23
- data/test/fixtures/reseller_list_success.txt +0 -3
- data/test/fixtures/server_boot_success.txt +0 -2
- data/test/fixtures/server_bootorder_success.txt +0 -2
- data/test/fixtures/server_change_consolepass_success.txt +0 -3
- data/test/fixtures/server_change_owner_success.txt +0 -2
- data/test/fixtures/server_change_success.txt +0 -2
- data/test/fixtures/server_change_vncpass_success.txt +0 -3
- data/test/fixtures/server_console_success.txt +0 -7
- data/test/fixtures/server_create_success.txt +0 -10
- data/test/fixtures/server_exists_success.txt +0 -2
- data/test/fixtures/server_hostname_success.txt +0 -3
- data/test/fixtures/server_info_success.txt +0 -10
- data/test/fixtures/server_infoall_success.txt +0 -13
- data/test/fixtures/server_mountiso_success.txt +0 -2
- data/test/fixtures/server_network_disable_success.txt +0 -2
- data/test/fixtures/server_network_enable_success.txt +0 -2
- data/test/fixtures/server_pae_success.txt +0 -2
- data/test/fixtures/server_reboot_success.txt +0 -2
- data/test/fixtures/server_rebuild_success.txt +0 -2
- data/test/fixtures/server_resume_success.txt +0 -2
- data/test/fixtures/server_rootpassword_success.txt +0 -3
- data/test/fixtures/server_shutdown_success.txt +0 -2
- data/test/fixtures/server_status_success.txt +0 -2
- data/test/fixtures/server_suspend_success.txt +0 -2
- data/test/fixtures/server_terminate_success.txt +0 -2
- data/test/fixtures/server_tun_disable_success.txt +0 -2
- data/test/fixtures/server_tun_enable_success.txt +0 -2
- data/test/fixtures/server_unmountiso_success.txt +0 -2
- data/test/fixtures/server_vnc_success.txt +0 -6
- data/test/test_base.rb +0 -115
- data/test/test_client.rb +0 -98
- data/test/test_general.rb +0 -70
- data/test/test_node.rb +0 -112
- data/test/test_reseller.rb +0 -80
- data/test/test_server.rb +0 -227
data/.rbenv-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.9.2-p290
|
data/.rvmrc
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
|
3
|
-
# This is an RVM Project .rvmrc file, used to automatically load the ruby
|
4
|
-
# development environment upon cd'ing into the directory
|
5
|
-
|
6
|
-
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional.
|
7
|
-
environment_id="ruby-1.9.2-p290@solusvm"
|
8
|
-
|
9
|
-
#
|
10
|
-
# Uncomment following line if you want options to be set only for given project.
|
11
|
-
#
|
12
|
-
# PROJECT_JRUBY_OPTS=( --1.9 )
|
13
|
-
|
14
|
-
#
|
15
|
-
# First we attempt to load the desired environment directly from the environment
|
16
|
-
# file. This is very fast and efficient compared to running through the entire
|
17
|
-
# CLI and selector. If you want feedback on which environment was used then
|
18
|
-
# insert the word 'use' after --create as this triggers verbose mode.
|
19
|
-
#
|
20
|
-
if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
|
21
|
-
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
|
22
|
-
then
|
23
|
-
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
|
24
|
-
|
25
|
-
if [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]]
|
26
|
-
then
|
27
|
-
. "${rvm_path:-$HOME/.rvm}/hooks/after_use"
|
28
|
-
fi
|
29
|
-
else
|
30
|
-
# If the environment file has not yet been created, use the RVM CLI to select.
|
31
|
-
if ! rvm --create use "$environment_id"
|
32
|
-
then
|
33
|
-
echo "Failed to create RVM environment '${environment_id}'."
|
34
|
-
exit 1
|
35
|
-
fi
|
36
|
-
fi
|
37
|
-
|
38
|
-
#
|
39
|
-
# If you use an RVM gemset file to install a list of gems (*.gems), you can have
|
40
|
-
# it be automatically loaded. Uncomment the following and adjust the filename if
|
41
|
-
# necessary.
|
42
|
-
#
|
43
|
-
# filename=".gems"
|
44
|
-
# if [[ -s "$filename" ]] ; then
|
45
|
-
# rvm gemset import "$filename" | grep -v already | grep -v listed | grep -v complete | sed '/^$/d'
|
46
|
-
# fi
|
47
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
Invalid id or key
|
@@ -1 +0,0 @@
|
|
1
|
-
Node not found
|
@@ -1 +0,0 @@
|
|
1
|
-
Invalid ipaddress
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<clients>
|
2
|
-
<client>
|
3
|
-
<id>1</id>
|
4
|
-
<username>vps123</username>
|
5
|
-
<email>vps123@email.com</email>
|
6
|
-
<firstname>phill</firstname>
|
7
|
-
<lastname>smith</lastname>
|
8
|
-
<company>VPS Co</company>
|
9
|
-
<level>Client</level>
|
10
|
-
<status>Active</status>
|
11
|
-
<created>2009-01-01</created>
|
12
|
-
<lastlogin>2010-04-23</lastlogin>
|
13
|
-
</client>
|
14
|
-
</clients>
|
data/test/fixtures/error.txt
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
<status>success</status>
|
2
|
-
<statusmsg></statusmsg>
|
3
|
-
<id>1</id>
|
4
|
-
<name>name</name>
|
5
|
-
<ip>127.0.0.1</ip>
|
6
|
-
<hostname>hostname.com</hostname>
|
7
|
-
<country>country</country>
|
8
|
-
<city>city</city>
|
9
|
-
<sshport>22</sshport>
|
10
|
-
<arch>x86_64</arch>
|
11
|
-
<freememory>10</freememory>
|
12
|
-
<freedisk>1000</freedisk>
|
13
|
-
<virtualservers>2</virtualservers>
|
14
|
-
<freeips>0</freeips>
|
@@ -1,15 +0,0 @@
|
|
1
|
-
<virtualservers>
|
2
|
-
<virtualserver>
|
3
|
-
<vserverid>theid</vserverid>
|
4
|
-
<ctid-xid>thexid</ctid-xid>
|
5
|
-
<clientid>theclientid</clientid>
|
6
|
-
<ipaddress>theip</ipaddress>
|
7
|
-
<hostname>thehostname</hostname>
|
8
|
-
<template>thetemplate</template>
|
9
|
-
<hdd>thediskspace</hdd>
|
10
|
-
<memory>thememory</memory>
|
11
|
-
<swap-burst>theswap</swap-burst>
|
12
|
-
<type>thetype</type>
|
13
|
-
<mac>themac</mac>
|
14
|
-
</virtualserver>
|
15
|
-
</virtualservers>
|
@@ -1,16 +0,0 @@
|
|
1
|
-
<status>success</status>
|
2
|
-
<statusmsg>Successfully modified reseller resources</statusmsg>
|
3
|
-
<maxvps>10</maxvps>
|
4
|
-
<maxdisk>21474836480</maxdisk>
|
5
|
-
<maxmem>10737418240</maxmem>
|
6
|
-
<maxusers>20</maxusers>
|
7
|
-
<maxipv4>4</maxipv4>
|
8
|
-
<maxipv6>6</maxipv6>
|
9
|
-
<maxburst>10738466816</maxburst>
|
10
|
-
<maxbw>107374182400</maxbw>
|
11
|
-
<nodegroupids>14,11,9</nodegroupids>
|
12
|
-
<mediagroupids>14,11,9</mediagroupids>
|
13
|
-
<xenpv>1</xenpv>
|
14
|
-
<xenhvm>1</xenhvm>
|
15
|
-
<kvm>1</kvm>
|
16
|
-
<openvz>1</openvz>
|
@@ -1,23 +0,0 @@
|
|
1
|
-
<status>success</status>
|
2
|
-
<statusmsg>Successfully added reseller</statusmsg>
|
3
|
-
<username>reseller123</username>
|
4
|
-
<password>123456</password>
|
5
|
-
<email>reseller3@email.com</email>
|
6
|
-
<firstname>Phill</firstname>
|
7
|
-
<lastname>Smith</lastname>
|
8
|
-
<company>FastServers</company>
|
9
|
-
<usernameprefix>vpsuser</usernameprefix>
|
10
|
-
<maxvps>10</maxvps>
|
11
|
-
<maxdisk>21474836480</maxdisk>
|
12
|
-
<maxmem>10737418240</maxmem>
|
13
|
-
<maxusers>20</maxusers>
|
14
|
-
<maxipv4>4</maxipv4>
|
15
|
-
<maxipv6>6</maxipv6>
|
16
|
-
<maxburst>10738466816</maxburst>
|
17
|
-
<maxbw>107374182400</maxbw>
|
18
|
-
<nodegroupids>14,11,9</nodegroupids>
|
19
|
-
<mediagroupids>14,11,9</mediagroupids>
|
20
|
-
<xenpv>1</xenpv>
|
21
|
-
<xenhvm>1</xenhvm>
|
22
|
-
<kvm>1</kvm>
|
23
|
-
<openvz>1</openvz>
|
@@ -1,23 +0,0 @@
|
|
1
|
-
<status>success</status>
|
2
|
-
<statusmsg>Successfully added reseller</statusmsg>
|
3
|
-
<username>reseller123</username>
|
4
|
-
<password>123456</password>
|
5
|
-
<email>reseller3@email.com</email>
|
6
|
-
<firstname>Phill</firstname>
|
7
|
-
<lastname>Smith</lastname>
|
8
|
-
<company>FastServers</company>
|
9
|
-
<usernameprefix>vpsuser</usernameprefix>
|
10
|
-
<maxvps>10</maxvps>
|
11
|
-
<maxdisk>21474836480</maxdisk>
|
12
|
-
<maxmem>10737418240</maxmem>
|
13
|
-
<maxusers>20</maxusers>
|
14
|
-
<maxipv4>4</maxipv4>
|
15
|
-
<maxipv6>6</maxipv6>
|
16
|
-
<maxburst>10738466816</maxburst>
|
17
|
-
<maxbw>107374182400</maxbw>
|
18
|
-
<nodegroupids>14,11,9</nodegroupids>
|
19
|
-
<mediagroupids>14,11,9</mediagroupids>
|
20
|
-
<xenpv>1</xenpv>
|
21
|
-
<xenhvm>1</xenhvm>
|
22
|
-
<kvm>1</kvm>
|
23
|
-
<openvz>1</openvz>
|
@@ -1,10 +0,0 @@
|
|
1
|
-
<status>success</status>
|
2
|
-
<statusmsg>Virtual server created</statusmsg>
|
3
|
-
<mainipaddress>123.123.123.123</mainipaddress>
|
4
|
-
<extraipaddress>122.122.122.122,111.111.111.111</extraipaddress>
|
5
|
-
<rootpassword>123456</rootpassword>
|
6
|
-
<vserverid>100</vserverid>
|
7
|
-
<consoleuser>console-123</consoleuser>
|
8
|
-
<consolepassword>123456</consolepassword>
|
9
|
-
<hostname>server.hostname.com</hostname>
|
10
|
-
<virtid>vm101|101</virtid>
|
@@ -1,10 +0,0 @@
|
|
1
|
-
<vserverid>1</vserverid>
|
2
|
-
<ctid-xid>1</ctid-xid>
|
3
|
-
<clientid>1</clientid>
|
4
|
-
<ipaddress>123.123.123.123</ipaddress>
|
5
|
-
<hostname>host.example.com</hostname>
|
6
|
-
<template>vps1</template>
|
7
|
-
<hdd>123456</hdd>
|
8
|
-
<memory>123456</memory>
|
9
|
-
<swap-burst>swp</swap-burst>
|
10
|
-
<type>xenhvm</type>
|
@@ -1,13 +0,0 @@
|
|
1
|
-
<status>success</status>
|
2
|
-
<statusmsg></statusmsg>
|
3
|
-
<node>tydeus</node>
|
4
|
-
<state>online</state>
|
5
|
-
<mainipaddress>123.123.123.123</mainipaddress>
|
6
|
-
<ipaddresses>123.123.123.123</ipaddresses>
|
7
|
-
<type>openvz</type>
|
8
|
-
<bandwidth>16106127360000,5370261749139,10735865610861,33</bandwidth>.
|
9
|
-
<memory>1073741824,187097088,886644736,17</memory>.
|
10
|
-
<hdd>236223201280,103640707072,132582494208,44</hdd>.
|
11
|
-
<trafficgraph>/graphs/9/214/214-8f7daef90bc75037489af4217af674a67df545ba05c8a6bcd5341d5894f2f905bf23976f52c0104415c1694135d51f204ddfd7b11bbe87c195a5de4a-86400.png</trafficgraph>.
|
12
|
-
<loadgraph>/graphs/9/214/214-load-8f7daef90bc75037489af4217af674a67df545ba05c8a6bcd5341d5894f2f905bf23976f52c0104415c1694135d51f204ddfd7b11bbe87c195a5de4a-86400.png</loadgraph>.
|
13
|
-
<memorygraph>/graphs/9/214/214-mem-8f7daef90bc75037489af4217af674a67df545ba05c8a6bcd5341d5894f2f905bf23976f52c0104415c1694135d51f204ddfd7b11bbe87c195a5de4a-86400.png</memorygraph>
|