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,116 @@
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/migrate.json?destination=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.009243"
25
+ server:
26
+ - Apache/2.2.3 (CentOS)
27
+ date:
28
+ - Thu, 28 Apr 2011 15:46:14 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/migrate.json?destination=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: 201
52
+ message: Created
53
+ headers:
54
+ x-ua-compatible:
55
+ - IE=Edge,chrome=1
56
+ x-powered-by:
57
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
58
+ location:
59
+ - http://www.example.com/virtual_machines/7z2gzavnrhmmt3
60
+ content-type:
61
+ - application/json; charset=utf-8
62
+ date:
63
+ - Thu, 28 Apr 2011 15:46:14 GMT
64
+ server:
65
+ - Apache/2.2.3 (CentOS)
66
+ x-runtime:
67
+ - "0.324360"
68
+ set-cookie:
69
+ - _onapp_session=WHAT; path=/; HttpOnly
70
+ cache-control:
71
+ - no-cache
72
+ status:
73
+ - "201"
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:31:27Z\",\"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\":\"ip8pwfqj60y6\",\"min_disk_size\":null,\"remote_access_password\":null,\"built\":false,\"locked\":false,\"ip_addresses\":[]}}"
77
+ http_version: "1.1"
78
+ - !ruby/struct:VCR::HTTPInteraction
79
+ request: !ruby/struct:VCR::Request
80
+ method: :post
81
+ uri: http://user:pass@www.example.com:80/virtual_machines/1/migrate.json?destination=2
82
+ body:
83
+ headers:
84
+ content-type:
85
+ - application/json
86
+ authorization:
87
+ - Basic WHAT
88
+ response: !ruby/struct:VCR::Response
89
+ status: !ruby/struct:VCR::ResponseStatus
90
+ code: 201
91
+ message: Created
92
+ headers:
93
+ x-ua-compatible:
94
+ - IE=Edge,chrome=1
95
+ location:
96
+ - http://www.example.com/virtual_machines/7z2gzavnrhmmt3
97
+ x-powered-by:
98
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
99
+ content-type:
100
+ - application/json; charset=utf-8
101
+ x-runtime:
102
+ - "0.027207"
103
+ server:
104
+ - Apache/2.2.3 (CentOS)
105
+ date:
106
+ - Thu, 28 Apr 2011 15:51:06 GMT
107
+ set-cookie:
108
+ - _onapp_session=WHAT; path=/; HttpOnly
109
+ status:
110
+ - "201"
111
+ cache-control:
112
+ - no-cache
113
+ transfer-encoding:
114
+ - chunked
115
+ 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:31:27Z\",\"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\":\"ip8pwfqj60y6\",\"min_disk_size\":null,\"remote_access_password\":null,\"built\":false,\"locked\":false,\"ip_addresses\":[]}}"
116
+ 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/reboot.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
+ x-runtime:
24
+ - "3.096855"
25
+ server:
26
+ - Apache/2.2.3 (CentOS)
27
+ date:
28
+ - Tue, 03 May 2011 14:38:07 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/reboot.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
+ x-powered-by:
57
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
58
+ location:
59
+ - http://www.example.com/virtual_machines/1
60
+ content-type:
61
+ - application/json; charset=utf-8
62
+ date:
63
+ - Tue, 03 May 2011 14:39:57 GMT
64
+ server:
65
+ - Apache/2.2.3 (CentOS)
66
+ x-runtime:
67
+ - "0.028059"
68
+ set-cookie:
69
+ - _onapp_session=WHAT; path=/; HttpOnly
70
+ cache-control:
71
+ - no-cache
72
+ status:
73
+ - "201"
74
+ transfer-encoding:
75
+ - chunked
76
+ body: "{\"virtual_machine\":{\"label\":\"testbye\",\"cpus\":1,\"operating_system_distro\":\"rhel\",\"created_at\":\"2011-05-03T14:02:02Z\",\"template_id\":1,\"operating_system\":\"linux\",\"cpu_shares\":1,\"updated_at\":\"2011-05-03T14:39:57Z\",\"memory\":256,\"local_remote_access_port\":5907,\"allowed_swap\":true,\"recovery_mode\":false,\"allow_resize_without_reboot\":true,\"xen_id\":17,\"id\":1,\"hypervisor_id\":6,\"user_id\":4,\"template_label\":\"CentOS 5.5 x64\",\"hostname\":\"testbye\",\"booted\":true,\"remote_access_password\":\"asdfsdf\",\"min_disk_size\":5,\"initial_root_password\":\"asdfasdf\",\"identifier\":\"safsadf\",\"locked\":true,\"built\":true}}"
77
+ 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/resize.json?virtual_machine[memory]=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
+ - Fri, 29 Apr 2011 16:24:21 GMT
25
+ server:
26
+ - Apache/2.2.3 (CentOS)
27
+ x-runtime:
28
+ - "0.007480"
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/2/resize.json?virtual_machine[memory]=1000
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/asdfasdfdas
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.174989"
64
+ server:
65
+ - Apache/2.2.3 (CentOS)
66
+ date:
67
+ - Fri, 29 Apr 2011 16:24:21 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 2\",\"created_at\":\"2011-04-29T11:51:25Z\",\"operating_system_distro\":null,\"cpu_shares\":1,\"operating_system\":null,\"template_id\":null,\"allowed_swap\":true,\"local_remote_access_port\":null,\"memory\":1000,\"updated_at\":\"2011-04-29T16:24:21Z\",\"allow_resize_without_reboot\":null,\"recovery_mode\":null,\"hypervisor_id\":1,\"id\":2,\"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\":\"hostname\",\"template_label\":null,\"identifier\":\"asdfasdfdas\",\"initial_root_password\":\"asdfdsafasd\",\"min_disk_size\":null,\"remote_access_password\":null,\"built\":false,\"locked\":true,\"ip_addresses\":[]}}"
77
+ http_version: "1.1"
@@ -0,0 +1,77 @@
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/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
+ - Tue, 19 Apr 2011 18:32:30 GMT
25
+ server:
26
+ - Apache/2.2.3 (CentOS)
27
+ x-runtime:
28
+ - "2.822767"
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: :get
42
+ uri: http://user:pass@www.example.com:80/virtual_machines/1.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
+ - "\"f428364a09b3da75e09faf9a1769c29e\""
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.528365"
64
+ server:
65
+ - Apache/2.2.3 (CentOS)
66
+ date:
67
+ - Tue, 19 Apr 2011 18:32:58 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: "{\"virtual_machine\":{\"monthly_bandwidth_used\":0,\"cpus\":1,\"label\":\"bob\",\"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-19T18:30:33Z\",\"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\":1,\"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,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/shutdown.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
+ - Tue, 03 May 2011 13:59:24 GMT
25
+ server:
26
+ - Apache/2.2.3 (CentOS)
27
+ x-runtime:
28
+ - "0.062045"
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/shutdown.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
+ x-powered-by:
57
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
58
+ location:
59
+ - http://www.example.com/virtual_machines/88
60
+ content-type:
61
+ - application/json; charset=utf-8
62
+ date:
63
+ - Tue, 03 May 2011 14:08:01 GMT
64
+ server:
65
+ - Apache/2.2.3 (CentOS)
66
+ x-runtime:
67
+ - "0.033748"
68
+ set-cookie:
69
+ - _onapp_session=WHAT; path=/; HttpOnly
70
+ cache-control:
71
+ - no-cache
72
+ status:
73
+ - "201"
74
+ transfer-encoding:
75
+ - chunked
76
+ body: "{\"virtual_machine\":{\"label\":\"testbye\",\"cpus\":1,\"operating_system_distro\":\"rhel\",\"created_at\":\"2011-05-03T14:02:02Z\",\"template_id\":1,\"operating_system\":\"linux\",\"cpu_shares\":1,\"updated_at\":\"2011-05-03T14:08:01Z\",\"memory\":256,\"local_remote_access_port\":5907,\"allowed_swap\":true,\"recovery_mode\":false,\"allow_resize_without_reboot\":true,\"xen_id\":15,\"id\":1,\"hypervisor_id\":6,\"user_id\":4,\"template_label\":\"CentOS 5.5 x64\",\"hostname\":\"testbye\",\"booted\":true,\"remote_access_password\":\"asfsdfsd\",\"min_disk_size\":5,\"initial_root_password\":\"23fsdafasd\",\"identifier\":\"asdfsadf\",\"locked\":true,\"built\":true}}"
77
+ 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/startup.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
+ - Tue, 03 May 2011 13:55:47 GMT
25
+ server:
26
+ - Apache/2.2.3 (CentOS)
27
+ x-runtime:
28
+ - "1.803755"
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/startup.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
+ - 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
+ - "46.448747"
64
+ server:
65
+ - Apache/2.2.3 (CentOS)
66
+ date:
67
+ - Tue, 03 May 2011 13:55:56 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\":10,\"operating_system\":null,\"template_id\":null,\"allowed_swap\":true,\"local_remote_access_port\":null,\"memory\":100,\"updated_at\":\"2011-05-03T13:56:42Z\",\"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\":\"ip8pwfqj60y6\",\"min_disk_size\":null,\"remote_access_password\":null,\"built\":false,\"locked\":true,\"ip_addresses\":[]}}"
77
+ 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/stop.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
+ x-runtime:
24
+ - "0.554329"
25
+ server:
26
+ - Apache/2.2.3 (CentOS)
27
+ date:
28
+ - Tue, 03 May 2011 14:15:26 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/stop.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
+ x-powered-by:
57
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
58
+ location:
59
+ - http://www.example.com/virtual_machines/1
60
+ content-type:
61
+ - application/json; charset=utf-8
62
+ date:
63
+ - Tue, 03 May 2011 14:24:51 GMT
64
+ server:
65
+ - Apache/2.2.3 (CentOS)
66
+ x-runtime:
67
+ - "0.029755"
68
+ set-cookie:
69
+ - _onapp_session=WHAT; path=/; HttpOnly
70
+ cache-control:
71
+ - no-cache
72
+ status:
73
+ - "201"
74
+ transfer-encoding:
75
+ - chunked
76
+ body: "{\"virtual_machine\":{\"label\":\"testbye\",\"cpus\":1,\"operating_system_distro\":\"rhel\",\"created_at\":\"2011-05-03T14:02:02Z\",\"template_id\":1,\"operating_system\":\"linux\",\"cpu_shares\":1,\"updated_at\":\"2011-05-03T14:24:51Z\",\"memory\":256,\"local_remote_access_port\":5907,\"allowed_swap\":true,\"recovery_mode\":false,\"allow_resize_without_reboot\":true,\"xen_id\":16,\"id\":1,\"hypervisor_id\":6,\"user_id\":4,\"template_label\":\"CentOS 5.5 x64\",\"hostname\":\"testbye\",\"booted\":true,\"remote_access_password\":\"9mmpej\",\"min_disk_size\":5,\"initial_root_password\":\"asfsadf\",\"identifier\":\"2rfsdfsdfs\",\"locked\":true,\"built\":true}}"
77
+ 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/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: 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 18:53:06 GMT
25
+ server:
26
+ - Apache/2.2.3 (CentOS)
27
+ x-runtime:
28
+ - "1.160170"
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/suspend.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
+ - 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
+ - "1.584053"
64
+ server:
65
+ - Apache/2.2.3 (CentOS)
66
+ date:
67
+ - Fri, 29 Apr 2011 18:53:08 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\":10,\"operating_system\":null,\"template_id\":null,\"allowed_swap\":true,\"local_remote_access_port\":null,\"memory\":100,\"updated_at\":\"2011-04-29T18:53:09Z\",\"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\":true,\"total_disk_size\":0,\"booted\":false,\"hostname\":\"bob\",\"template_label\":null,\"identifier\":\"7z2gzavnrhmmt3\",\"initial_root_password\":\"ip8pwfqj60y6\",\"min_disk_size\":null,\"remote_access_password\":null,\"built\":false,\"locked\":false,\"ip_addresses\":[]}}"
77
+ http_version: "1.1"