squall 0.0.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. data/.gitignore +10 -0
  2. data/.rspec +2 -0
  3. data/.rvmrc +1 -0
  4. data/.travis.yml +7 -0
  5. data/Gemfile +3 -0
  6. data/Gemfile.lock +100 -0
  7. data/LICENSE +1 -1
  8. data/README.md +69 -0
  9. data/Rakefile +48 -42
  10. data/lib/squall/base.rb +96 -0
  11. data/lib/squall/config.rb +26 -0
  12. data/lib/squall/exception.rb +13 -0
  13. data/lib/squall/hypervisor.rb +46 -16
  14. data/lib/squall/ip_address.rb +13 -0
  15. data/lib/squall/network.rb +42 -0
  16. data/lib/squall/params.rb +50 -0
  17. data/lib/squall/role.rb +56 -0
  18. data/lib/squall/statistic.rb +10 -0
  19. data/lib/squall/template.rb +22 -0
  20. data/lib/squall/transaction.rb +16 -0
  21. data/lib/squall/user.rb +87 -0
  22. data/lib/squall/version.rb +3 -0
  23. data/lib/squall/virtual_machine.rb +169 -41
  24. data/lib/squall.rb +76 -20
  25. data/spec/params_spec.rb +195 -0
  26. data/spec/spec_helper.rb +47 -0
  27. data/spec/squall/base_spec.rb +135 -0
  28. data/spec/squall/config_spec.rb +44 -0
  29. data/spec/squall/hypervisor_spec.rb +143 -0
  30. data/spec/squall/ip_address_spec.rb +32 -0
  31. data/spec/squall/network_spec.rb +121 -0
  32. data/spec/squall/role_spec.rb +123 -0
  33. data/spec/squall/statistic_spec.rb +23 -0
  34. data/spec/squall/template_spec.rb +59 -0
  35. data/spec/squall/transaction_spec.rb +42 -0
  36. data/spec/squall/user_spec.rb +195 -0
  37. data/spec/squall/virtual_machine_spec.rb +471 -0
  38. data/spec/squall_spec.rb +67 -0
  39. data/spec/vcr_cassettes/hypervisor/create.yml +77 -0
  40. data/spec/vcr_cassettes/hypervisor/delete.yml +77 -0
  41. data/spec/vcr_cassettes/hypervisor/edit.yml +79 -0
  42. data/spec/vcr_cassettes/hypervisor/list.yml +40 -0
  43. data/spec/vcr_cassettes/hypervisor/reboot.yml +77 -0
  44. data/spec/vcr_cassettes/hypervisor/show.yml +77 -0
  45. data/spec/vcr_cassettes/ipaddress/list.yml +77 -0
  46. data/spec/vcr_cassettes/network/create.yml +196 -0
  47. data/spec/vcr_cassettes/network/delete.yml +77 -0
  48. data/spec/vcr_cassettes/network/edit.yml +233 -0
  49. data/spec/vcr_cassettes/network/list.yml +40 -0
  50. data/spec/vcr_cassettes/role/create.yml +77 -0
  51. data/spec/vcr_cassettes/role/delete.yml +77 -0
  52. data/spec/vcr_cassettes/role/edit.yml +139 -0
  53. data/spec/vcr_cassettes/role/list.yml +40 -0
  54. data/spec/vcr_cassettes/role/permissions.yml +40 -0
  55. data/spec/vcr_cassettes/role/show.yml +77 -0
  56. data/spec/vcr_cassettes/statistic/usage_statistics.yml +40 -0
  57. data/spec/vcr_cassettes/template/download.yml +40 -0
  58. data/spec/vcr_cassettes/template/list.yml +40 -0
  59. data/spec/vcr_cassettes/template/make_public.yml +77 -0
  60. data/spec/vcr_cassettes/transaction/list.yml +40 -0
  61. data/spec/vcr_cassettes/transaction/show.yml +77 -0
  62. data/spec/vcr_cassettes/user/activate.yml +40 -0
  63. data/spec/vcr_cassettes/user/create.yml +116 -0
  64. data/spec/vcr_cassettes/user/delete.yml +77 -0
  65. data/spec/vcr_cassettes/user/edit_role.yml +116 -0
  66. data/spec/vcr_cassettes/user/generate_api_key.yml +40 -0
  67. data/spec/vcr_cassettes/user/list.yml +40 -0
  68. data/spec/vcr_cassettes/user/show.yml +77 -0
  69. data/spec/vcr_cassettes/user/stats.yml +40 -0
  70. data/spec/vcr_cassettes/user/suspend.yml +40 -0
  71. data/spec/vcr_cassettes/user/virtual_machines.yml +79 -0
  72. data/spec/vcr_cassettes/virtual_machine/build.yml +77 -0
  73. data/spec/vcr_cassettes/virtual_machine/change_owner.yml +108 -0
  74. data/spec/vcr_cassettes/virtual_machine/change_password.yml +77 -0
  75. data/spec/vcr_cassettes/virtual_machine/create.yml +40 -0
  76. data/spec/vcr_cassettes/virtual_machine/delete.yml +77 -0
  77. data/spec/vcr_cassettes/virtual_machine/edit.yml +77 -0
  78. data/spec/vcr_cassettes/virtual_machine/list.yml +40 -0
  79. data/spec/vcr_cassettes/virtual_machine/migrate.yml +116 -0
  80. data/spec/vcr_cassettes/virtual_machine/reboot.yml +77 -0
  81. data/spec/vcr_cassettes/virtual_machine/resize.yml +77 -0
  82. data/spec/vcr_cassettes/virtual_machine/show.yml +77 -0
  83. data/spec/vcr_cassettes/virtual_machine/shutdown.yml +77 -0
  84. data/spec/vcr_cassettes/virtual_machine/startup.yml +77 -0
  85. data/spec/vcr_cassettes/virtual_machine/stop.yml +77 -0
  86. data/spec/vcr_cassettes/virtual_machine/suspend.yml +77 -0
  87. data/spec/vcr_cassettes/virtual_machine/unlock.yml +77 -0
  88. data/spec/vcr_cassettes/virtual_machine/unsuspend.yml +77 -0
  89. data/squall.gemspec +25 -62
  90. metadata +224 -42
  91. data/.document +0 -5
  92. data/README.rdoc +0 -17
  93. data/VERSION.yml +0 -5
  94. data/lib/squall/client.rb +0 -87
  95. data/test/fixtures/virtual_machines.json +0 -1
  96. data/test/fixtures/virtual_machines_1.json +0 -1
  97. data/test/helper.rb +0 -31
  98. data/test/test_client.rb +0 -152
  99. data/test/test_squall.rb +0 -12
  100. data/test/test_virtual_machine.rb +0 -98
@@ -0,0 +1,40 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :get
5
+ uri: http://user:pass@www.example.com:80/users/1/vm_stats.json
6
+ body:
7
+ headers:
8
+ content-type:
9
+ - application/json
10
+ authorization:
11
+ - Basic WHAT
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ x-ua-compatible:
18
+ - IE=Edge,chrome=1
19
+ etag:
20
+ - "\"d751713988987e9331980363e24189ce\""
21
+ x-powered-by:
22
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
23
+ content-type:
24
+ - application/json; charset=utf-8
25
+ x-runtime:
26
+ - "2.803779"
27
+ server:
28
+ - Apache/2.2.3 (CentOS)
29
+ date:
30
+ - Thu, 14 Apr 2011 15:18:59 GMT
31
+ set-cookie:
32
+ - _onapp_session=WHAT; path=/; HttpOnly
33
+ status:
34
+ - "200"
35
+ cache-control:
36
+ - max-age=0, private, must-revalidate
37
+ transfer-encoding:
38
+ - chunked
39
+ body: "[{\"vm_stats\":{\"created_at\":\"2011-04-20T07:00:07Z\",\"cost\":0.0,\"updated_at\":\"2011-04-20T07:00:07Z\",\"stat_time\":\"2011-04-20T07:00:00Z\",\"id\":6673,\"vm_billing_stat_id\":863,\"user_id\":1,\"billing_stats\":{},\"virtual_machine_id\":55}},{\"vm_stats\":{\"created_at\":\"2011-04-20T08:00:07Z\",\"cost\":0.0,\"updated_at\":\"2011-04-20T08:00:07Z\",\"stat_time\":\"2011-04-20T08:00:00Z\",\"id\":6683,\"vm_billing_stat_id\":863,\"user_id\":1,\"billing_stats\":{},\"virtual_machine_id\":55}},{\"vm_stats\":{\"created_at\":\"2011-04-20T09:00:07Z\",\"cost\":0.0,\"updated_at\":\"2011-04-20T09:00:07Z\",\"stat_time\":\"2011-04-20T09:00:00Z\",\"id\":6693,\"vm_billing_stat_id\":863,\"user_id\":1,\"billing_stats\":{},\"virtual_machine_id\":55}},{\"vm_stats\":{\"created_at\":\"2011-04-20T10:00:07Z\",\"cost\":0.0,\"updated_at\":\"2011-04-20T10:00:07Z\",\"stat_time\":\"2011-04-20T10:00:00Z\",\"id\":6703,\"vm_billing_stat_id\":863,\"user_id\":1,\"billing_stats\":{},\"virtual_machine_id\":55}},{\"vm_stats\":{\"created_at\":\"2011-04-20T11:00:07Z\",\"cost\":0.0,\"updated_at\":\"2011-04-20T11:00:07Z\",\"stat_time\":\"2011-04-20T11:00:00Z\",\"id\":6713,\"vm_billing_stat_id\":863,\"user_id\":1,\"billing_stats\":{},\"virtual_machine_id\":55}}]"
40
+ http_version: "1.1"
@@ -0,0 +1,40 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :get
5
+ uri: http://user:pass@www.example.com:80/users/2/suspend.json
6
+ body:
7
+ headers:
8
+ content-type:
9
+ - application/json
10
+ authorization:
11
+ - Basic WHAT
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ x-ua-compatible:
18
+ - IE=Edge,chrome=1
19
+ etag:
20
+ - "\"a5c9922db044a7fe1d7e62c494b9c223\""
21
+ x-powered-by:
22
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
23
+ content-type:
24
+ - application/json; charset=utf-8
25
+ x-runtime:
26
+ - "2.092058"
27
+ server:
28
+ - Apache/2.2.3 (CentOS)
29
+ date:
30
+ - Wed, 13 Apr 2011 21:00:25 GMT
31
+ set-cookie:
32
+ - _onapp_session=WHAT; path=/; HttpOnly
33
+ status:
34
+ - "200"
35
+ cache-control:
36
+ - max-age=0, private, must-revalidate
37
+ transfer-encoding:
38
+ - chunked
39
+ body: "{\"user\":{\"activated_at\":\"2011-04-13T15:13:35Z\",\"created_at\":\"2011-04-13T15:13:35Z\",\"total_amount\":0.0,\"remember_token_expires_at\":null,\"suspend_at\":null,\"memory_available\":null,\"used_ip_addresses\":[],\"deleted_at\":null,\"updated_at\":\"2011-04-13T21:00:26Z\",\"used_disk_size\":0,\"used_cpus\":0,\"used_cpu_shares\":0,\"activation_code\":null,\"billing_plan_id\":1,\"group_id\":null,\"id\":2,\"used_memory\":0,\"payment_amount\":\"0.0\",\"last_name\":\"last\",\"remember_token\":null,\"disk_space_available\":null,\"time_zone\":null,\"login\":\"testing\",\"status\":\"suspended\",\"roles\":[{\"role\":{\"label\":\"User\",\"created_at\":\"2011-04-13T14:37:38Z\",\"updated_at\":\"2011-04-13T14:37:38Z\",\"id\":2,\"identifier\":\"user\"}}],\"outstanding_amount\":0.0,\"email\":\"test@example.com\",\"first_name\":\"first\"}}"
40
+ http_version: "1.1"
@@ -0,0 +1,79 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :get
5
+ uri: http://user:pass@www.example.com:80/users/500/virtual_machines.json
6
+ body:
7
+ headers:
8
+ content-type:
9
+ - application/json
10
+ authorization:
11
+ - Basic WHAT
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ x-ua-compatible:
18
+ - IE=Edge,chrome=1
19
+ x-powered-by:
20
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
21
+ etag:
22
+ - "\"d751713988987e9331980363e24189ce\""
23
+ content-type:
24
+ - application/json; charset=utf-8
25
+ date:
26
+ - Thu, 14 Apr 2011 16:10:46 GMT
27
+ server:
28
+ - Apache/2.2.3 (CentOS)
29
+ x-runtime:
30
+ - "0.013584"
31
+ set-cookie:
32
+ - _onapp_session=WHAT; path=/; HttpOnly
33
+ cache-control:
34
+ - max-age=0, private, must-revalidate
35
+ status:
36
+ - "200"
37
+ transfer-encoding:
38
+ - chunked
39
+ body: "[]"
40
+ http_version: "1.1"
41
+ - !ruby/struct:VCR::HTTPInteraction
42
+ request: !ruby/struct:VCR::Request
43
+ method: :get
44
+ uri: http://user:pass@www.example.com:80/users/1/virtual_machines.json
45
+ body:
46
+ headers:
47
+ content-type:
48
+ - application/json
49
+ authorization:
50
+ - Basic WHAT
51
+ response: !ruby/struct:VCR::Response
52
+ status: !ruby/struct:VCR::ResponseStatus
53
+ code: 200
54
+ message: OK
55
+ headers:
56
+ x-ua-compatible:
57
+ - IE=Edge,chrome=1
58
+ etag:
59
+ - "\"d751713988987e9331980363e24189ce\""
60
+ x-powered-by:
61
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
62
+ content-type:
63
+ - application/json; charset=utf-8
64
+ x-runtime:
65
+ - "0.016482"
66
+ server:
67
+ - Apache/2.2.3 (CentOS)
68
+ date:
69
+ - Thu, 14 Apr 2011 16:13:18 GMT
70
+ set-cookie:
71
+ - _onapp_session=WHAT; path=/; HttpOnly
72
+ status:
73
+ - "200"
74
+ cache-control:
75
+ - max-age=0, private, must-revalidate
76
+ transfer-encoding:
77
+ - chunked
78
+ body: "[{\"virtual_machine\":{\"label\":\"testing\",\"cpus\":1,\"operating_system_distro\":\"rhel\",\"created_at\":\"2011-04-14T16:24:24Z\",\"template_id\":1,\"operating_system\":\"linux\",\"cpu_shares\":1,\"monthly_bandwidth_used\":\"0.0\",\"updated_at\":\"2011-04-14T16:25:42Z\",\"memory\":256,\"local_remote_access_port\":null,\"allowed_swap\":true,\"recovery_mode\":null,\"allow_resize_without_reboot\":true,\"xen_id\":null,\"id\":61,\"hypervisor_id\":2,\"ip_addresses\":[{\"ip_address\":{\"netmask\":\"255.255.255.224\",\"disallowed_primary\":true,\"address\":\"123.123.108.226\",\"created_at\":\"2011-03-16T02:19:11Z\",\"updated_at\":\"2011-03-16T02:19:11Z\",\"network_id\":2,\"network_address\":\"123.123.108.224\",\"broadcast\":\"123.123.108.255\",\"id\":30,\"gateway\":\"123.123.108.225\"}}],\"user_id\":4,\"template_label\":\"CentOS 5.5 x64\",\"hostname\":\"delete-when-done.com\",\"booted\":false,\"total_disk_size\":\"5.0\",\"remote_access_password\":null,\"min_disk_size\":5,\"initial_root_password\":\"dffsdfssdffds\",\"identifier\":\"k4orgyjxzb6ks7\",\"locked\":false,\"built\":true}},{\"virtual_machine\":{\"label\":\"testing2\",\"cpus\":1,\"operating_system_distro\":\"rhel\",\"created_at\":\"2011-04-14T16:28:08Z\",\"template_id\":1,\"operating_system\":\"linux\",\"cpu_shares\":1,\"monthly_bandwidth_used\":\"0.0\",\"updated_at\":\"2011-04-14T16:28:08Z\",\"memory\":256,\"local_remote_access_port\":null,\"allowed_swap\":true,\"recovery_mode\":null,\"allow_resize_without_reboot\":true,\"xen_id\":null,\"id\":62,\"hypervisor_id\":2,\"ip_addresses\":[{\"ip_address\":{\"netmask\":\"255.255.255.224\",\"disallowed_primary\":false,\"address\":\"123.123.123.219\",\"created_at\":\"2011-03-16T02:17:47Z\",\"updated_at\":\"2011-03-16T02:17:47Z\",\"network_id\":1,\"network_address\":\"123.123.123.192\",\"broadcast\":\"123.123.123.223\",\"id\":26,\"gateway\":\"123.123.123.193\"}}],\"user_id\":4,\"template_label\":\"CentOS 5.5 x64\",\"hostname\":\"delete-when-done2.com\",\"booted\":false,\"total_disk_size\":\"5.0\",\"remote_access_password\":\"23fsdfsd\",\"min_disk_size\":5,\"initial_root_password\":\"sdfsdfdsfsd\",\"identifier\":\"i4zpd1kpng8da4\",\"locked\":true,\"built\":false}}]"
79
+ http_version: "1.1"
@@ -0,0 +1,77 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: http://user:pass@www.example.com:80/virtual_machines/404/build.json?
6
+ body:
7
+ headers:
8
+ content-type:
9
+ - application/json
10
+ authorization:
11
+ - Basic WHAT
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 404
15
+ message: Not Found
16
+ headers:
17
+ x-ua-compatible:
18
+ - IE=Edge,chrome=1
19
+ x-powered-by:
20
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
21
+ content-type:
22
+ - application/json; charset=utf-8
23
+ date:
24
+ - Wed, 20 Apr 2011 15:54:19 GMT
25
+ server:
26
+ - Apache/2.2.3 (CentOS)
27
+ x-runtime:
28
+ - "2.751480"
29
+ set-cookie:
30
+ - _onapp_session=WHAT; path=/; HttpOnly
31
+ cache-control:
32
+ - no-cache
33
+ status:
34
+ - "404"
35
+ transfer-encoding:
36
+ - chunked
37
+ body: "{\"error\":\"Resource not found\"}"
38
+ http_version: "1.1"
39
+ - !ruby/struct:VCR::HTTPInteraction
40
+ request: !ruby/struct:VCR::Request
41
+ method: :post
42
+ uri: http://user:pass@www.example.com:80/virtual_machines/72/build.json?
43
+ body:
44
+ headers:
45
+ content-type:
46
+ - application/json
47
+ authorization:
48
+ - Basic WHAT
49
+ response: !ruby/struct:VCR::Response
50
+ status: !ruby/struct:VCR::ResponseStatus
51
+ code: 201
52
+ message: Created
53
+ headers:
54
+ x-ua-compatible:
55
+ - IE=Edge,chrome=1
56
+ location:
57
+ - https://www.example.com/virtual_machines/72
58
+ x-powered-by:
59
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
60
+ content-type:
61
+ - application/json; charset=utf-8
62
+ x-runtime:
63
+ - "0.163372"
64
+ server:
65
+ - Apache/2.2.3 (CentOS)
66
+ date:
67
+ - Wed, 20 Apr 2011 16:02:18 GMT
68
+ set-cookie:
69
+ - _onapp_session=WHAT; path=/; HttpOnly
70
+ status:
71
+ - "201"
72
+ cache-control:
73
+ - no-cache
74
+ transfer-encoding:
75
+ - chunked
76
+ body: "{\"virtual_machine\":{\"label\":\"Testingagain\",\"cpus\":1,\"operating_system_distro\":\"rhel\",\"created_at\":\"2011-04-20T16:01:10Z\",\"template_id\":1,\"operating_system\":\"linux\",\"cpu_shares\":1,\"updated_at\":\"2011-04-20T16:02:18Z\",\"memory\":256,\"local_remote_access_port\":5901,\"allowed_swap\":true,\"recovery_mode\":false,\"allow_resize_without_reboot\":true,\"xen_id\":null,\"id\":72,\"hypervisor_id\":6,\"user_id\":4,\"template_label\":\"CentOS 5.5 x64\",\"hostname\":\"testingagain.com\",\"booted\":false,\"remote_access_password\":\"sadf234\",\"min_disk_size\":5,\"initial_root_password\":\"213fsdfsd\",\"identifier\":\"asdfdsfsdf\",\"locked\":true,\"built\":false}}"
77
+ http_version: "1.1"
@@ -0,0 +1,108 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: http://user:pass@www.example.com:80/virtual_machines/404/change_owner.json?user_id=1
6
+ body:
7
+ headers:
8
+ content-type:
9
+ - application/json
10
+ authorization:
11
+ - Basic WHAT
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 404
15
+ message: Not Found
16
+ headers:
17
+ x-ua-compatible:
18
+ - IE=Edge,chrome=1
19
+ x-powered-by:
20
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
21
+ content-type:
22
+ - application/json; charset=utf-8
23
+ x-runtime:
24
+ - "0.007364"
25
+ server:
26
+ - Apache/2.2.3 (CentOS)
27
+ date:
28
+ - Thu, 28 Apr 2011 15:16:51 GMT
29
+ set-cookie:
30
+ - _onapp_session=WHAT; path=/; HttpOnly
31
+ status:
32
+ - "404"
33
+ cache-control:
34
+ - no-cache
35
+ transfer-encoding:
36
+ - chunked
37
+ body: "{\"error\":\"Resource not found\"}"
38
+ http_version: "1.1"
39
+ - !ruby/struct:VCR::HTTPInteraction
40
+ request: !ruby/struct:VCR::Request
41
+ method: :post
42
+ uri: http://user:pass@www.example.com:80/virtual_machines/1/change_owner.json?user_id=404
43
+ body:
44
+ headers:
45
+ content-type:
46
+ - application/json
47
+ authorization:
48
+ - Basic WHAT
49
+ response: !ruby/struct:VCR::Response
50
+ status: !ruby/struct:VCR::ResponseStatus
51
+ code: 500
52
+ message: Internal Server Error
53
+ headers:
54
+ x-powered-by:
55
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
56
+ content-type:
57
+ - text/html; charset=UTF-8
58
+ date:
59
+ - Thu, 28 Apr 2011 15:16:51 GMT
60
+ server:
61
+ - Apache/2.2.3 (CentOS)
62
+ x-runtime:
63
+ - "35.003244"
64
+ status:
65
+ - "500"
66
+ transfer-encoding:
67
+ - chunked
68
+ body: <html><body><h1>500 Internal Server Error</h1>If you are the useristrator of this website, then please read this web application's log file and/or the web server's log file to find out what went wrong.</body></html>
69
+ http_version: "1.1"
70
+ - !ruby/struct:VCR::HTTPInteraction
71
+ request: !ruby/struct:VCR::Request
72
+ method: :post
73
+ uri: http://user:pass@www.example.com:80/virtual_machines/1/change_owner.json?user_id=2
74
+ body:
75
+ headers:
76
+ content-type:
77
+ - application/json
78
+ authorization:
79
+ - Basic WHAT
80
+ response: !ruby/struct:VCR::Response
81
+ status: !ruby/struct:VCR::ResponseStatus
82
+ code: 201
83
+ message: Created
84
+ headers:
85
+ x-ua-compatible:
86
+ - IE=Edge,chrome=1
87
+ location:
88
+ - http://www.example.com/virtual_machines/7z2gzavnrhmmt3
89
+ x-powered-by:
90
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
91
+ content-type:
92
+ - application/json; charset=utf-8
93
+ x-runtime:
94
+ - "0.297176"
95
+ server:
96
+ - Apache/2.2.3 (CentOS)
97
+ date:
98
+ - Thu, 28 Apr 2011 15:18:02 GMT
99
+ set-cookie:
100
+ - _onapp_session=WHAT; path=/; HttpOnly
101
+ status:
102
+ - "201"
103
+ cache-control:
104
+ - no-cache
105
+ transfer-encoding:
106
+ - chunked
107
+ body: "{\"virtual_machine\":{\"monthly_bandwidth_used\":0,\"cpus\":1,\"label\":\"testing\",\"created_at\":\"2011-04-19T18:30:33Z\",\"operating_system_distro\":null,\"cpu_shares\":1,\"operating_system\":null,\"template_id\":null,\"allowed_swap\":true,\"local_remote_access_port\":null,\"memory\":100,\"updated_at\":\"2011-04-28T15:18:02Z\",\"allow_resize_without_reboot\":null,\"recovery_mode\":null,\"hypervisor_id\":1,\"id\":1,\"xen_id\":null,\"user_note\":null,\"allowed_hot_migrate\":null,\"user_id\":2,\"note\":null,\"strict_virtual_machine_id\":null,\"suspended\":false,\"total_disk_size\":0,\"booted\":false,\"hostname\":\"bob\",\"template_label\":null,\"identifier\":\"7z2gzavnrhmmt3\",\"initial_root_password\":\"qb6xnpofw43k\",\"min_disk_size\":null,\"remote_access_password\":null,\"built\":false,\"locked\":false,\"ip_addresses\":[]}}"
108
+ http_version: "1.1"
@@ -0,0 +1,77 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: http://user:pass@www.example.com:80/virtual_machines/404/reset_password.json?new_password=password
6
+ body:
7
+ headers:
8
+ content-type:
9
+ - application/json
10
+ authorization:
11
+ - Basic WHAT
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 404
15
+ message: Not Found
16
+ headers:
17
+ x-ua-compatible:
18
+ - IE=Edge,chrome=1
19
+ x-powered-by:
20
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
21
+ content-type:
22
+ - application/json; charset=utf-8
23
+ date:
24
+ - Thu, 28 Apr 2011 15:31:22 GMT
25
+ server:
26
+ - Apache/2.2.3 (CentOS)
27
+ x-runtime:
28
+ - "0.112165"
29
+ set-cookie:
30
+ - _onapp_session=WHAT; path=/; HttpOnly
31
+ cache-control:
32
+ - no-cache
33
+ status:
34
+ - "404"
35
+ transfer-encoding:
36
+ - chunked
37
+ body: "{\"error\":\"Resource not found\"}"
38
+ http_version: "1.1"
39
+ - !ruby/struct:VCR::HTTPInteraction
40
+ request: !ruby/struct:VCR::Request
41
+ method: :post
42
+ uri: http://user:pass@www.example.com:80/virtual_machines/1/reset_password.json?new_password=passwordsareimportant
43
+ body:
44
+ headers:
45
+ content-type:
46
+ - application/json
47
+ authorization:
48
+ - Basic WHAT
49
+ response: !ruby/struct:VCR::Response
50
+ status: !ruby/struct:VCR::ResponseStatus
51
+ code: 201
52
+ message: Created
53
+ headers:
54
+ x-ua-compatible:
55
+ - IE=Edge,chrome=1
56
+ location:
57
+ - http://www.example.com/virtual_machines/7z2gzavnrhmmt3
58
+ x-powered-by:
59
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
60
+ content-type:
61
+ - application/json; charset=utf-8
62
+ x-runtime:
63
+ - "0.284168"
64
+ server:
65
+ - Apache/2.2.3 (CentOS)
66
+ date:
67
+ - Thu, 28 Apr 2011 15:31:22 GMT
68
+ set-cookie:
69
+ - _onapp_session=WHAT; path=/; HttpOnly
70
+ status:
71
+ - "201"
72
+ cache-control:
73
+ - no-cache
74
+ transfer-encoding:
75
+ - chunked
76
+ body: "{\"virtual_machine\":{\"monthly_bandwidth_used\":0,\"cpus\":1,\"label\":\"testing\",\"created_at\":\"2011-04-19T18:30:33Z\",\"operating_system_distro\":null,\"cpu_shares\":1,\"operating_system\":null,\"template_id\":null,\"allowed_swap\":true,\"local_remote_access_port\":null,\"memory\":100,\"updated_at\":\"2011-04-28T15:18:02Z\",\"allow_resize_without_reboot\":null,\"recovery_mode\":null,\"hypervisor_id\":1,\"id\":1,\"xen_id\":null,\"user_note\":null,\"allowed_hot_migrate\":null,\"user_id\":2,\"note\":null,\"strict_virtual_machine_id\":null,\"suspended\":false,\"total_disk_size\":0,\"booted\":false,\"hostname\":\"bob\",\"template_label\":null,\"identifier\":\"7z2gzavnrhmmt3\",\"initial_root_password\":\"qb6xnpofw43k\",\"min_disk_size\":null,\"remote_access_password\":null,\"built\":false,\"locked\":false,\"ip_addresses\":[]}}"
77
+ http_version: "1.1"
@@ -0,0 +1,40 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: http://user:pass@www.example.com:80/virtual_machines.json?virtual_machine[memory]=512&virtual_machine[cpus]=1&virtual_machine[label]=testmachine&virtual_machine[cpu_shares]=10&virtual_machine[hostname]=testmachine&virtual_machine[primary_disk_size]=10&virtual_machine[hypervisor_id]=5
6
+ body:
7
+ headers:
8
+ content-type:
9
+ - application/json
10
+ authorization:
11
+ - Basic WHAT
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 201
15
+ message: Created
16
+ headers:
17
+ x-ua-compatible:
18
+ - IE=Edge,chrome=1
19
+ location:
20
+ - https://www.example.com/virtual_machines/70
21
+ x-powered-by:
22
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
23
+ content-type:
24
+ - application/json; charset=utf-8
25
+ x-runtime:
26
+ - "0.057999"
27
+ server:
28
+ - Apache/2.2.3 (CentOS)
29
+ date:
30
+ - Tue, 19 Apr 2011 20:08:35 GMT
31
+ set-cookie:
32
+ - _onapp_session=WHAT; path=/; HttpOnly
33
+ status:
34
+ - "201"
35
+ cache-control:
36
+ - no-cache
37
+ transfer-encoding:
38
+ - chunked
39
+ body: "{\"virtual_machine\":{\"label\":\"testmachine\",\"cpus\":1,\"operating_system_distro\":null,\"created_at\":\"2011-04-19T20:08:35Z\",\"template_id\":null,\"operating_system\":null,\"cpu_shares\":10,\"updated_at\":\"2011-04-19T20:08:35Z\",\"memory\":512,\"local_remote_access_port\":null,\"allowed_swap\":true,\"recovery_mode\":null,\"allow_resize_without_reboot\":null,\"xen_id\":null,\"id\":70,\"hypervisor_id\":5,\"user_id\":4,\"template_label\":null,\"hostname\":\"testmachine\",\"booted\":false,\"remote_access_password\":null,\"min_disk_size\":null,\"initial_root_password\":\"nsdjsadfj2134\",\"identifier\":\"sadfs23\",\"locked\":false,\"built\":false}}"
40
+ http_version: "1.1"
@@ -0,0 +1,77 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :delete
5
+ uri: http://user:pass@www.example.com:80/virtual_machines/404.json
6
+ body:
7
+ headers:
8
+ content-type:
9
+ - application/json
10
+ authorization:
11
+ - Basic WHAT
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 404
15
+ message: Not Found
16
+ headers:
17
+ x-ua-compatible:
18
+ - IE=Edge,chrome=1
19
+ x-powered-by:
20
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
21
+ content-type:
22
+ - application/json; charset=utf-8
23
+ date:
24
+ - Fri, 29 Apr 2011 15:54:28 GMT
25
+ server:
26
+ - Apache/2.2.3 (CentOS)
27
+ x-runtime:
28
+ - "0.028585"
29
+ set-cookie:
30
+ - _onapp_session=WHAT; path=/; HttpOnly
31
+ cache-control:
32
+ - no-cache
33
+ status:
34
+ - "404"
35
+ transfer-encoding:
36
+ - chunked
37
+ body: "{\"error\":\"Resource not found\"}"
38
+ http_version: "1.1"
39
+ - !ruby/struct:VCR::HTTPInteraction
40
+ request: !ruby/struct:VCR::Request
41
+ method: :delete
42
+ uri: http://user:pass@www.example.com:80/virtual_machines/2.json
43
+ body:
44
+ headers:
45
+ content-type:
46
+ - application/json
47
+ authorization:
48
+ - Basic WHAT
49
+ response: !ruby/struct:VCR::Response
50
+ status: !ruby/struct:VCR::ResponseStatus
51
+ code: 200
52
+ message: OK
53
+ headers:
54
+ x-ua-compatible:
55
+ - IE=Edge,chrome=1
56
+ etag:
57
+ - "\"99914b932bd37a50b983c5e7c90ae93b\""
58
+ x-powered-by:
59
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
60
+ content-type:
61
+ - application/json; charset=utf-8
62
+ x-runtime:
63
+ - "0.052069"
64
+ server:
65
+ - Apache/2.2.3 (CentOS)
66
+ date:
67
+ - Fri, 29 Apr 2011 15:54:28 GMT
68
+ set-cookie:
69
+ - _onapp_session=WHAT; path=/; HttpOnly
70
+ status:
71
+ - "200"
72
+ cache-control:
73
+ - max-age=0, private, must-revalidate
74
+ transfer-encoding:
75
+ - chunked
76
+ body: "{}"
77
+ http_version: "1.1"
@@ -0,0 +1,77 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :put
5
+ uri: http://user:pass@www.example.com:80/virtual_machines/404.json?virtual_machine[label]=1
6
+ body:
7
+ headers:
8
+ content-type:
9
+ - application/json
10
+ authorization:
11
+ - Basic WHAT
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 404
15
+ message: Not Found
16
+ headers:
17
+ x-ua-compatible:
18
+ - IE=Edge,chrome=1
19
+ x-powered-by:
20
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
21
+ content-type:
22
+ - application/json; charset=utf-8
23
+ date:
24
+ - Tue, 26 Apr 2011 15:59:09 GMT
25
+ server:
26
+ - Apache/2.2.3 (CentOS)
27
+ x-runtime:
28
+ - "0.172782"
29
+ set-cookie:
30
+ - _onapp_session=WHAT; path=/; HttpOnly
31
+ cache-control:
32
+ - no-cache
33
+ status:
34
+ - "404"
35
+ transfer-encoding:
36
+ - chunked
37
+ body: "{\"error\":\"Resource not found\"}"
38
+ http_version: "1.1"
39
+ - !ruby/struct:VCR::HTTPInteraction
40
+ request: !ruby/struct:VCR::Request
41
+ method: :put
42
+ uri: http://user:pass@www.example.com:80/virtual_machines/1.json?virtual_machine[label]=testing
43
+ body:
44
+ headers:
45
+ content-type:
46
+ - application/json
47
+ authorization:
48
+ - Basic WHAT
49
+ response: !ruby/struct:VCR::Response
50
+ status: !ruby/struct:VCR::ResponseStatus
51
+ code: 200
52
+ message: OK
53
+ headers:
54
+ x-ua-compatible:
55
+ - IE=Edge,chrome=1
56
+ etag:
57
+ - "\"99914b932bd37a50b983c5e7c90ae93b\""
58
+ x-powered-by:
59
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
60
+ content-type:
61
+ - application/json; charset=utf-8
62
+ x-runtime:
63
+ - "0.030066"
64
+ server:
65
+ - Apache/2.2.3 (CentOS)
66
+ date:
67
+ - Tue, 26 Apr 2011 16:00:52 GMT
68
+ set-cookie:
69
+ - _onapp_session=WHAT; path=/; HttpOnly
70
+ status:
71
+ - "200"
72
+ cache-control:
73
+ - max-age=0, private, must-revalidate
74
+ transfer-encoding:
75
+ - chunked
76
+ body: "{}"
77
+ http_version: "1.1"
@@ -0,0 +1,40 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :get
5
+ uri: http://user:pass@www.example.com:80/virtual_machines.json
6
+ body:
7
+ headers:
8
+ content-type:
9
+ - application/json
10
+ authorization:
11
+ - Basic WHAT
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ x-ua-compatible:
18
+ - IE=Edge,chrome=1
19
+ etag:
20
+ - "\"d751713988987e9331980363e24189ce\""
21
+ x-powered-by:
22
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
23
+ content-type:
24
+ - application/json; charset=utf-8
25
+ x-runtime:
26
+ - "18.522050"
27
+ server:
28
+ - Apache/2.2.3 (CentOS)
29
+ date:
30
+ - Tue, 19 Apr 2011 16:56:19 GMT
31
+ set-cookie:
32
+ - _onapp_session=WHAT; path=/; HttpOnly
33
+ status:
34
+ - "200"
35
+ cache-control:
36
+ - max-age=0, private, must-revalidate
37
+ transfer-encoding:
38
+ - chunked
39
+ body: "[{\"virtual_machine\":{\"label\":\"ohhai.server.com\",\"cpus\":4,\"monthly_bandwidth_used\":\"52.0\",\"operating_system_distro\":\"rhel\",\"created_at\":\"2011-03-28T14:52:33Z\",\"template_id\":1,\"operating_system\":\"linux\",\"cpu_shares\":1000,\"updated_at\":\"2011-03-31T14:54:01Z\",\"memory\":2048,\"local_remote_access_port\":5900,\"allowed_swap\":true,\"recovery_mode\":false,\"allow_resize_without_reboot\":true,\"xen_id\":17,\"id\":12,\"hypervisor_id\":2,\"user_id\":1,\"template_label\":\"CentOS 5.5 x64\",\"hostname\":\"ohhai.server.com\",\"booted\":true,\"total_disk_size\":\"51.0\",\"remote_access_password\":\"lolz\",\"min_disk_size\":5,\"initial_root_password\":\"wut\",\"identifier\":\"geek\",\"ip_addresses\":[{\"ip_address\":{\"netmask\":\"255.255.255.224\",\"disallowed_primary\":false,\"address\":\"127.4.4.197\",\"created_at\":\"2011-03-16T02:17:47Z\",\"updated_at\":\"2011-03-16T02:17:47Z\",\"network_id\":1,\"network_address\":\"127.4.4.192\",\"broadcast\":\"127.4.4.223\",\"id\":4,\"gateway\":\"127.4.4.193\"}}],\"locked\":false,\"built\":true}},{\"virtual_machine\":{\"label\":\"something\",\"cpus\":4,\"monthly_bandwidth_used\":\"234.0\",\"operating_system_distro\":\"rhel\",\"created_at\":\"2011-03-28T17:34:35Z\",\"template_id\":1,\"operating_system\":\"linux\",\"cpu_shares\":10,\"updated_at\":\"2011-04-04T16:55:38Z\",\"memory\":3072,\"local_remote_access_port\":5901,\"allowed_swap\":true,\"recovery_mode\":false,\"allow_resize_without_reboot\":true,\"xen_id\":6,\"id\":13,\"hypervisor_id\":2,\"user_id\":1,\"template_label\":\"CentOS 5.5 x64\",\"hostname\":\"something.server.com\",\"booted\":true,\"total_disk_size\":\"61.0\",\"remote_access_password\":\"nosoupforyou\",\"min_disk_size\":5,\"initial_root_password\":\"newpass\",\"identifier\":\"madunique\",\"ip_addresses\":[{\"ip_address\":{\"netmask\":\"255.255.255.224\",\"disallowed_primary\":false,\"address\":\"127.4.4.198\",\"created_at\":\"2011-03-16T02:17:47Z\",\"updated_at\":\"2011-03-16T02:17:47Z\",\"network_id\":1,\"network_address\":\"127.4.4.192\",\"broadcast\":\"127.4.4.223\",\"id\":5,\"gateway\":\"127.4.4.193\"}},{\"ip_address\":{\"netmask\":\"255.255.255.224\",\"disallowed_primary\":false,\"address\":\"127.4.4.200\",\"created_at\":\"2011-03-16T02:17:47Z\",\"updated_at\":\"2011-03-16T02:17:47Z\",\"network_id\":1,\"network_address\":\"127.4.4.192\",\"broadcast\":\"127.4.4.223\",\"id\":7,\"gateway\":\"127.4.4.193\"}}],\"locked\":false,\"built\":true}}]"
40
+ http_version: "1.1"