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
@@ -1,4 +1,22 @@
|
|
1
|
+
$:.unshift("#{File.dirname(__FILE__)}/../lib")
|
2
|
+
|
1
3
|
require 'test/unit'
|
4
|
+
require 'solusvm'
|
5
|
+
require 'fake_web'
|
6
|
+
require 'mocha'
|
7
|
+
require 'vcr'
|
8
|
+
require 'set'
|
9
|
+
|
10
|
+
VCR.configure do |c|
|
11
|
+
c.cassette_library_dir = 'test/vcr_cassettes'
|
12
|
+
c.hook_into :fakeweb
|
13
|
+
c.register_request_matcher :uri_with_unordered_params do |request1, request2|
|
14
|
+
path1, params1 = request1.uri.split('?')
|
15
|
+
path2, params2 = request2.uri.split('?')
|
16
|
+
path1 == path2 && Set.new(params1.to_s.split('&')) == Set.new(params2.to_s.split('&'))
|
17
|
+
end
|
18
|
+
c.default_cassette_options = { :record => :none, :match_requests_on => [:method, :uri_with_unordered_params] }
|
19
|
+
end
|
2
20
|
|
3
21
|
# Use TURN if available
|
4
22
|
begin
|
@@ -6,11 +24,8 @@ begin
|
|
6
24
|
rescue LoadError
|
7
25
|
end
|
8
26
|
|
9
|
-
require 'solusvm'
|
10
|
-
require 'fake_web'
|
11
|
-
require 'mocha'
|
12
|
-
|
13
27
|
class Test::Unit::TestCase
|
28
|
+
|
14
29
|
def load_response(name)
|
15
30
|
File.read(File.join(File.dirname(__FILE__), "fixtures/#{name}.txt"))
|
16
31
|
end
|
data/test/test_solusvm.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://www.example.com/api?action=badkey&id=api_id&key=api_key
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ""
|
9
|
+
headers: {}
|
10
|
+
response:
|
11
|
+
status:
|
12
|
+
code: 200
|
13
|
+
message: OK
|
14
|
+
body:
|
15
|
+
encoding: UTF-8
|
16
|
+
string: Invalid id or key
|
17
|
+
http_version: "1.1"
|
18
|
+
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
|
19
|
+
recorded_with: VCR 2.0.0
|
@@ -0,0 +1,19 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://www.example.com/api?action=httperror&id=api_id&key=api_key
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ""
|
9
|
+
headers: {}
|
10
|
+
response:
|
11
|
+
status:
|
12
|
+
code: 404
|
13
|
+
message: OK
|
14
|
+
body:
|
15
|
+
encoding: UTF-8
|
16
|
+
string: Not Found
|
17
|
+
http_version: "1.1"
|
18
|
+
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
|
19
|
+
recorded_with: VCR 2.0.0
|
@@ -0,0 +1,19 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://www.example.com/api?action=nodeexist&id=api_id&key=api_key
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ""
|
9
|
+
headers: {}
|
10
|
+
response:
|
11
|
+
status:
|
12
|
+
code: 200
|
13
|
+
message: OK
|
14
|
+
body:
|
15
|
+
encoding: UTF-8
|
16
|
+
string: Node not found
|
17
|
+
http_version: "1.1"
|
18
|
+
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
|
19
|
+
recorded_with: VCR 2.0.0
|
@@ -0,0 +1,28 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://www.example.com/api?action=test&vserverid=1&id=api_id&key=api_key
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ""
|
9
|
+
headers: {}
|
10
|
+
response:
|
11
|
+
status:
|
12
|
+
code: 200
|
13
|
+
message: OK
|
14
|
+
body:
|
15
|
+
encoding: UTF-8
|
16
|
+
string: <status>success</status>
|
17
|
+
<statusmsg>Virtual server created</statusmsg>
|
18
|
+
<mainipaddress>123.123.123.123</mainipaddress>
|
19
|
+
<extraipaddress>122.122.122.122,111.111.111.111</extraipaddress>
|
20
|
+
<rootpassword>123456</rootpassword>
|
21
|
+
<vserverid>100</vserverid>
|
22
|
+
<consoleuser>console-123</consoleuser>
|
23
|
+
<consolepassword>123456</consolepassword>
|
24
|
+
<hostname>server.hostname.com</hostname>
|
25
|
+
<virtid>vm101|101</virtid>
|
26
|
+
http_version: "1.1"
|
27
|
+
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
|
28
|
+
recorded_with: VCR 2.0.0
|
@@ -0,0 +1,28 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://www.example.com/api?action=testsuccess&vserverid=1&id=api_id&key=api_key
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ""
|
9
|
+
headers: {}
|
10
|
+
response:
|
11
|
+
status:
|
12
|
+
code: 200
|
13
|
+
message: OK
|
14
|
+
body:
|
15
|
+
encoding: UTF-8
|
16
|
+
string: <status>success</status>
|
17
|
+
<statusmsg>Virtual server created</statusmsg>
|
18
|
+
<mainipaddress>123.123.123.123</mainipaddress>
|
19
|
+
<extraipaddress>122.122.122.122,111.111.111.111</extraipaddress>
|
20
|
+
<rootpassword>123456</rootpassword>
|
21
|
+
<vserverid>100</vserverid>
|
22
|
+
<consoleuser>console-123</consoleuser>
|
23
|
+
<consolepassword>123456</consolepassword>
|
24
|
+
<hostname>server.hostname.com</hostname>
|
25
|
+
<virtid>vm101|101</virtid>
|
26
|
+
http_version: "1.1"
|
27
|
+
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
|
28
|
+
recorded_with: VCR 2.0.0
|
@@ -0,0 +1,45 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://www.example.com/api?action=testsuccess&vserverid=1&id=api_id&key=api_key
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ""
|
9
|
+
headers: {}
|
10
|
+
response:
|
11
|
+
status:
|
12
|
+
code: 200
|
13
|
+
message: OK
|
14
|
+
body:
|
15
|
+
encoding: UTF-8
|
16
|
+
string: <status>success</status>
|
17
|
+
<statusmsg>Virtual server created</statusmsg>
|
18
|
+
<mainipaddress>123.123.123.123</mainipaddress>
|
19
|
+
<extraipaddress>122.122.122.122,111.111.111.111</extraipaddress>
|
20
|
+
<rootpassword>123456</rootpassword>
|
21
|
+
<vserverid>100</vserverid>
|
22
|
+
<consoleuser>console-123</consoleuser>
|
23
|
+
<consolepassword>123456</consolepassword>
|
24
|
+
<hostname>server.hostname.com</hostname>
|
25
|
+
<virtid>vm101|101</virtid>
|
26
|
+
http_version: "1.1"
|
27
|
+
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
|
28
|
+
- request:
|
29
|
+
method: get
|
30
|
+
uri: http://www.example.com/api?action=testfail&vserverid=1&id=api_id&key=api_key
|
31
|
+
body:
|
32
|
+
encoding: UTF-8
|
33
|
+
string: ""
|
34
|
+
headers: {}
|
35
|
+
response:
|
36
|
+
status:
|
37
|
+
code: 200
|
38
|
+
message: OK
|
39
|
+
body:
|
40
|
+
encoding: UTF-8
|
41
|
+
string: <status>error</status>
|
42
|
+
<statusmsg>error message</statusmsg>
|
43
|
+
http_version: "1.1"
|
44
|
+
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
|
45
|
+
recorded_with: VCR 2.0.0
|
@@ -0,0 +1,19 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://www.example.com/api?action=unauthorized&id=api_id&key=api_key
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ""
|
9
|
+
headers: {}
|
10
|
+
response:
|
11
|
+
status:
|
12
|
+
code: 200
|
13
|
+
message: OK
|
14
|
+
body:
|
15
|
+
encoding: UTF-8
|
16
|
+
string: Invalid ipaddress
|
17
|
+
http_version: "1.1"
|
18
|
+
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
|
19
|
+
recorded_with: VCR 2.0.0
|
@@ -0,0 +1,37 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://www.example.com/api?action=client-authenticate&username=u&password=p&id=api_id&key=api_key
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ""
|
9
|
+
headers: {}
|
10
|
+
response:
|
11
|
+
status:
|
12
|
+
code: 200
|
13
|
+
message: OK
|
14
|
+
body:
|
15
|
+
encoding: UTF-8
|
16
|
+
string: <status>success</status>
|
17
|
+
<statusmsg>validated</statusmsg>
|
18
|
+
http_version: "1.1"
|
19
|
+
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
|
20
|
+
- request:
|
21
|
+
method: get
|
22
|
+
uri: http://www.example.com/api?action=client-authenticate&username=u&password=notp&id=api_id&key=api_key
|
23
|
+
body:
|
24
|
+
encoding: UTF-8
|
25
|
+
string: ""
|
26
|
+
headers: {}
|
27
|
+
response:
|
28
|
+
status:
|
29
|
+
code: 200
|
30
|
+
message: OK
|
31
|
+
body:
|
32
|
+
encoding: UTF-8
|
33
|
+
string: <status>error</status>
|
34
|
+
<statusmsg>invalid username or password</statusmsg>
|
35
|
+
http_version: "1.1"
|
36
|
+
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
|
37
|
+
recorded_with: VCR 2.0.0
|
@@ -0,0 +1,39 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://www.example.com/api?action=client-updatepassword&username=vps123&password=123456&id=api_id&key=api_key
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ""
|
9
|
+
headers: {}
|
10
|
+
response:
|
11
|
+
status:
|
12
|
+
code: 200
|
13
|
+
message: OK
|
14
|
+
body:
|
15
|
+
encoding: UTF-8
|
16
|
+
string: <status>success</status>
|
17
|
+
<statusmsg>Successfully updated client password</statusmsg>
|
18
|
+
<username>vps123</username>
|
19
|
+
<password>123456</password>
|
20
|
+
http_version: "1.1"
|
21
|
+
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
|
22
|
+
- request:
|
23
|
+
method: get
|
24
|
+
uri: http://www.example.com/api?action=client-updatepassword&username=vps13&password=thecake&id=api_id&key=api_key
|
25
|
+
body:
|
26
|
+
encoding: UTF-8
|
27
|
+
string: ""
|
28
|
+
headers: {}
|
29
|
+
response:
|
30
|
+
status:
|
31
|
+
code: 200
|
32
|
+
message: OK
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: <status>error</status>
|
36
|
+
<statusmsg>error message</statusmsg>
|
37
|
+
http_version: "1.1"
|
38
|
+
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
|
39
|
+
recorded_with: VCR 2.0.0
|
@@ -0,0 +1,42 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://www.example.com/api?username=vps123&password=123456&email=email%40address.com&firstname=phill&lastname=smith&action=client-create&id=api_id&key=api_key
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ""
|
9
|
+
headers: {}
|
10
|
+
response:
|
11
|
+
status:
|
12
|
+
code: 200
|
13
|
+
message: OK
|
14
|
+
body:
|
15
|
+
encoding: UTF-8
|
16
|
+
string: <status>success</status>
|
17
|
+
<statusmsg>Successfully added client</statusmsg>
|
18
|
+
<username>vps123</username>
|
19
|
+
<password>123456</password>
|
20
|
+
<email>email@address.com</email>
|
21
|
+
<firstname>phill</firstname>
|
22
|
+
<lastname>smith</lastname>
|
23
|
+
http_version: "1.1"
|
24
|
+
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
|
25
|
+
- request:
|
26
|
+
method: get
|
27
|
+
uri: http://www.example.com/api?action=client-create&id=api_id&key=api_key
|
28
|
+
body:
|
29
|
+
encoding: UTF-8
|
30
|
+
string: ""
|
31
|
+
headers: {}
|
32
|
+
response:
|
33
|
+
status:
|
34
|
+
code: 200
|
35
|
+
message: OK
|
36
|
+
body:
|
37
|
+
encoding: UTF-8
|
38
|
+
string: <status>error</status>
|
39
|
+
<statusmsg>Empty username field</statusmsg>
|
40
|
+
http_version: "1.1"
|
41
|
+
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
|
42
|
+
recorded_with: VCR 2.0.0
|
@@ -0,0 +1,37 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://www.example.com/api?action=client-delete&username=vps123&id=api_id&key=api_key
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ""
|
9
|
+
headers: {}
|
10
|
+
response:
|
11
|
+
status:
|
12
|
+
code: 200
|
13
|
+
message: OK
|
14
|
+
body:
|
15
|
+
encoding: UTF-8
|
16
|
+
string: <status>success</status>
|
17
|
+
<statusmsg>Client deleted</statusmsg>
|
18
|
+
http_version: "1.1"
|
19
|
+
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
|
20
|
+
- request:
|
21
|
+
method: get
|
22
|
+
uri: http://www.example.com/api?action=client-delete&username=novps&id=api_id&key=api_key
|
23
|
+
body:
|
24
|
+
encoding: UTF-8
|
25
|
+
string: ""
|
26
|
+
headers: {}
|
27
|
+
response:
|
28
|
+
status:
|
29
|
+
code: 200
|
30
|
+
message: OK
|
31
|
+
body:
|
32
|
+
encoding: UTF-8
|
33
|
+
string: <status>error</status>
|
34
|
+
<statusmsg>error message</statusmsg>
|
35
|
+
http_version: "1.1"
|
36
|
+
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
|
37
|
+
recorded_with: VCR 2.0.0
|
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://www.example.com/api?action=client-checkexists&username=vps123&id=api_id&key=api_key
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ""
|
9
|
+
headers: {}
|
10
|
+
response:
|
11
|
+
status:
|
12
|
+
code: 200
|
13
|
+
message: OK
|
14
|
+
body:
|
15
|
+
encoding: UTF-8
|
16
|
+
string: <status>success</status>
|
17
|
+
<statusmsg>Client exists</statusmsg>
|
18
|
+
http_version: "1.1"
|
19
|
+
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
|
20
|
+
recorded_with: VCR 2.0.0
|
@@ -0,0 +1,66 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://www.example.com/api?action=client-list&id=api_id1&key=api_key
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ""
|
9
|
+
headers: {}
|
10
|
+
response:
|
11
|
+
status:
|
12
|
+
code: 200
|
13
|
+
message: OK
|
14
|
+
body:
|
15
|
+
encoding: UTF-8
|
16
|
+
string: <clients>
|
17
|
+
<client>
|
18
|
+
<id>1</id>
|
19
|
+
<username>vps123</username>
|
20
|
+
<email>vps123@email.com</email>
|
21
|
+
<firstname>phill</firstname>
|
22
|
+
<lastname>smith</lastname>
|
23
|
+
<company>VPS Co</company>
|
24
|
+
<level>Client</level>
|
25
|
+
<status>Active</status>
|
26
|
+
<created>2009-01-01</created>
|
27
|
+
<lastlogin>2010-04-23</lastlogin>
|
28
|
+
</client>
|
29
|
+
</clients>
|
30
|
+
http_version: "1.1"
|
31
|
+
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
|
32
|
+
- request:
|
33
|
+
method: get
|
34
|
+
uri: http://www.example.com/api?action=client-list&id=api_id2&key=api_key
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: ""
|
38
|
+
headers: {}
|
39
|
+
response:
|
40
|
+
status:
|
41
|
+
code: 200
|
42
|
+
message: OK
|
43
|
+
body:
|
44
|
+
encoding: UTF-8
|
45
|
+
string: <clients>
|
46
|
+
</clients>
|
47
|
+
http_version: "1.1"
|
48
|
+
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
|
49
|
+
- request:
|
50
|
+
method: get
|
51
|
+
uri: http://www.example.com/api?action=client-list&id=api_id3&key=api_key
|
52
|
+
body:
|
53
|
+
encoding: UTF-8
|
54
|
+
string: ""
|
55
|
+
headers: {}
|
56
|
+
response:
|
57
|
+
status:
|
58
|
+
code: 200
|
59
|
+
message: OK
|
60
|
+
body:
|
61
|
+
encoding: UTF-8
|
62
|
+
string: <status>error</status>
|
63
|
+
<statusmsg>error message</statusmsg>
|
64
|
+
http_version: "1.1"
|
65
|
+
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
|
66
|
+
recorded_with: VCR 2.0.0
|