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/transactions.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
+ - "\"1b05f8bc579a80d7fee0591936ab4ae4\""
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
+ - "26.181226"
27
+ server:
28
+ - Apache/2.2.3 (CentOS)
29
+ date:
30
+ - Tue, 03 May 2011 18:03:40 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: "[{\"transaction\":{\"pid\":2180,\"created_at\":\"2011-05-03T13:56:42Z\",\"actor\":null,\"updated_at\":\"2011-05-03T13:56:57Z\",\"action\":\"startup_virtual_machine\",\"parent_type\":\"VirtualMachine\",\"priority\":10,\"id\":3,\"allowed_cancel\":true,\"dependent_transaction_id\":null,\"user_id\":2,\"parent_id\":1,\"log_output\":\"System Error ('undefined method `ip_addresses' for nil:NilClass')\\n./lib/transactions/startup_virtual_machine.rb:42:in `execute'\\n./lib/transactions/base.rb:35:in `run!'\\n/onapp/interface/app/models/transaction.rb:131:in `run'\\n./lib/servers/transaction_runner.rb:7:in `run'\\n/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.5/lib/active_record/relation.rb:13:in `each'\\n/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.5/lib/active_record/relation.rb:13:in `__send__'\\n/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.5/lib/active_record/relation.rb:13:in `each'\\n./lib/servers/transaction_runner.rb:5:in `run'\\n./lib/servers/loopable_runner.rb:48:in `execute!'\\n./lib/servers/loopable_runner.rb:47:in `loop'\\n./lib/servers/loopable_runner.rb:47:in `execute!'\\n/onapp/interface/lib/tasks/servers.rake:37\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'\\n/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31\\n/usr/bin/rake:19:in `load'\\n/usr/bin/rake:19\",\"params\":{},\"identifier\":\"7z2gzavnrhmmt3\",\"status\":\"failed\"}},{\"transaction\":{\"pid\":2178,\"created_at\":\"2011-04-29T15:54:28Z\",\"actor\":null,\"updated_at\":\"2011-04-29T15:54:39Z\",\"action\":\"destroy_virtual_machine\",\"parent_type\":\"VirtualMachine\",\"priority\":10,\"id\":2,\"allowed_cancel\":true,\"dependent_transaction_id\":null,\"user_id\":2,\"parent_id\":2,\"log_output\":\"System Error ('undefined method `*' for nil:NilClass')\\n/onapp/interface/app/models/resource/cpu_share.rb:79:in `store_billing_stat!'\\n/onapp/interface/app/models/user/billing_stats.rb:16:in `store_vm_billing_stats!'\\n/onapp/interface/app/models/user/billing_stats.rb:12:in `each'\\n/onapp/interface/app/models/user/billing_stats.rb:12:in `store_vm_billing_stats!'\\n/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.5/lib/active_record/associations/association_proxy.rb:218:in `send'\\n/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.5/lib/active_record/associations/association_proxy.rb:218:in `method_missing'\\n/onapp/interface/app/models/virtual_machine.rb:533:in `store_vm_billing_stats'\\n/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/callbacks.rb:484:in `_run_destroy_callbacks'\\n/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.5/lib/active_record/callbacks.rb:260:in `destroy'\\n/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.5/lib/active_record/transactions.rb:235:in `destroy'\\n/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.5/lib/active_record/transactions.rb:292:in `with_transaction_returning_status'\\n/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'\\n/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.5/lib/active_record/transactions.rb:207:in `transaction'\\n/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.5/lib/active_record/transactions.rb:290:in `with_transaction_returning_status'\\n/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.5/lib/active_record/transactions.rb:235:in `destroy'\\n/onapp/interface/app/models/virtual_machine.rb:462:in `destroy'\\n/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.5/lib/active_record/associations/association_proxy.rb:218:in `send'\\n/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.5/lib/active_record/associations/association_proxy.rb:218:in `method_missing'\\n./lib/transactions/destroy_virtual_machine.rb:63:in `execute'\\n./lib/transactions/base.rb:35:in `run!'\\n/onapp/interface/app/models/transaction.rb:131:in `run'\\n./lib/servers/transaction_runner.rb:7:in `run'\\n/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.5/lib/active_record/relation.rb:13:in `each'\\n/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.5/lib/active_record/relation.rb:13:in `__send__'\\n/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.5/lib/active_record/relation.rb:13:in `each'\\n./lib/servers/transaction_runner.rb:5:in `run'\\n./lib/servers/loopable_runner.rb:48:in `execute!'\\n./lib/servers/loopable_runner.rb:47:in `loop'\\n./lib/servers/loopable_runner.rb:47:in `execute!'\\n/onapp/interface/lib/tasks/servers.rake:37\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'\\n/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'\\n/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31\\n/usr/bin/rake:19:in `load'\\n/usr/bin/rake:19\",\"params\":{},\"identifier\":\"asdfasdfdas\",\"status\":\"failed\"}},{\"transaction\":{\"pid\":2180,\"created_at\":\"2011-04-28T15:31:22Z\",\"actor\":null,\"updated_at\":\"2011-04-28T15:31:27Z\",\"action\":\"reset_root_password\",\"parent_type\":\"VirtualMachine\",\"priority\":10,\"id\":1,\"allowed_cancel\":true,\"dependent_transaction_id\":null,\"user_id\":2,\"parent_id\":1,\"log_output\":\"\",\"params\":{\"new_password\":null},\"identifier\":\"7z2gzavnrhmmt3\",\"status\":\"complete\"}}]"
40
+ 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/transactions/5.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 18:09:32 GMT
25
+ server:
26
+ - Apache/2.2.3 (CentOS)
27
+ x-runtime:
28
+ - "0.039852"
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/transactions/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
+ - "\"a6ff1a2063d2158cdfe8d5dab5dc5cc8\""
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.040787"
64
+ server:
65
+ - Apache/2.2.3 (CentOS)
66
+ date:
67
+ - Tue, 03 May 2011 18:09:33 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: "{\"transaction\":{\"pid\":2180,\"created_at\":\"2011-04-28T15:31:22Z\",\"actor\":null,\"updated_at\":\"2011-04-28T15:31:27Z\",\"action\":\"reset_root_password\",\"parent_type\":\"VirtualMachine\",\"priority\":10,\"id\":1,\"allowed_cancel\":true,\"dependent_transaction_id\":null,\"user_id\":2,\"parent_id\":1,\"log_output\":\"\",\"params\":{\"new_password\":null},\"identifier\":\"7z2gzavnrhmmt3\",\"status\":\"complete\"}}"
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/users/2/activate_user.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
+ - "\"987d2e12a61f98ffd52a2cc89a1b7251\""
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.390312"
27
+ server:
28
+ - Apache/2.2.3 (CentOS)
29
+ date:
30
+ - Wed, 13 Apr 2011 21:05:37 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-13T21:05:37Z\",\"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:05:37Z\",\"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\":\"active\",\"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,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/users.json?user[email]=me%40example.com&user[password]=CD2480A3413F&user[login]=user&user[first_name]=John&user[last_name]=Doe
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
+ x-powered-by:
20
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
21
+ location:
22
+ - http://www.example.com/users/4
23
+ content-type:
24
+ - application/json; charset=utf-8
25
+ date:
26
+ - Wed, 13 Apr 2011 16:21:16 GMT
27
+ server:
28
+ - Apache/2.2.3 (CentOS)
29
+ x-runtime:
30
+ - "0.037750"
31
+ set-cookie:
32
+ - _onapp_session=WHAT; path=/; HttpOnly
33
+ cache-control:
34
+ - no-cache
35
+ status:
36
+ - "201"
37
+ transfer-encoding:
38
+ - chunked
39
+ body: "{\"user\":{\"activated_at\":\"2011-04-13T16:21:16Z\",\"created_at\":\"2011-04-13T16:21:16Z\",\"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-13T16:21:16Z\",\"used_disk_size\":0,\"used_cpus\":0,\"used_cpu_shares\":0,\"activation_code\":null,\"billing_plan_id\":1,\"group_id\":null,\"id\":4,\"used_memory\":0,\"payment_amount\":\"0.0\",\"last_name\":\"Doe\",\"remember_token\":null,\"disk_space_available\":null,\"time_zone\":null,\"login\":\"user\",\"status\":\"active\",\"roles\":[],\"outstanding_amount\":0.0,\"email\":\"me@example.com\",\"first_name\":\"John\"}}"
40
+ http_version: "1.1"
41
+ - !ruby/struct:VCR::HTTPInteraction
42
+ request: !ruby/struct:VCR::Request
43
+ method: :post
44
+ uri: http://user:pass@www.example.com:80/users.json?user[email]=metaken%40example.com&user[first_name]=John&user[password]=CD2480A3413F&user[last_name]=Doe&user[group_id]=10&user[login]=usertaken
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: 422
54
+ message: Unprocessable Entity
55
+ headers:
56
+ x-ua-compatible:
57
+ - IE=Edge,chrome=1
58
+ x-powered-by:
59
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
60
+ content-type:
61
+ - application/json; charset=utf-8
62
+ date:
63
+ - Wed, 13 Apr 2011 19:38:41 GMT
64
+ server:
65
+ - Apache/2.2.3 (CentOS)
66
+ x-runtime:
67
+ - "2.828053"
68
+ set-cookie:
69
+ - _onapp_session=WHAT; path=/; HttpOnly
70
+ cache-control:
71
+ - no-cache
72
+ status:
73
+ - "422"
74
+ transfer-encoding:
75
+ - chunked
76
+ body: "{\"login\":[\"has already been taken\"],\"email\":[\"has already been taken\"]}"
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/users.json?user[email]=me%40example.com&user[password]=CD2480A3413F&user[login]=user&user[first_name]=John&user[last_name]=Doe&user[group_id]=10
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/users/5
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.053550"
103
+ server:
104
+ - Apache/2.2.3 (CentOS)
105
+ date:
106
+ - Wed, 13 Apr 2011 20:03:56 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: "{\"user\":{\"activated_at\":\"2011-04-13T20:03:56Z\",\"created_at\":\"2011-04-13T20:03:56Z\",\"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-13T20:03:56Z\",\"used_disk_size\":0,\"used_cpus\":0,\"used_cpu_shares\":0,\"activation_code\":null,\"billing_plan_id\":1,\"group_id\":null,\"id\":5,\"used_memory\":0,\"payment_amount\":\"0.0\",\"last_name\":\"Doe\",\"remember_token\":null,\"disk_space_available\":null,\"time_zone\":null,\"login\":\"user\",\"status\":\"active\",\"roles\":[],\"outstanding_amount\":0.0,\"email\":\"me@example.com\",\"first_name\":\"John\"}}"
116
+ 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/users/6.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
+ - "\"99914b932bd37a50b983c5e7c90ae93b\""
23
+ content-type:
24
+ - application/json; charset=utf-8
25
+ date:
26
+ - Wed, 13 Apr 2011 21:21:49 GMT
27
+ server:
28
+ - Apache/2.2.3 (CentOS)
29
+ x-runtime:
30
+ - "0.165735"
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: :delete
44
+ uri: http://user:pass@www.example.com:80/users/22222.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: 404
54
+ message: Not Found
55
+ headers:
56
+ x-ua-compatible:
57
+ - IE=Edge,chrome=1
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.032186"
64
+ server:
65
+ - Apache/2.2.3 (CentOS)
66
+ date:
67
+ - Wed, 13 Apr 2011 21:21:49 GMT
68
+ set-cookie:
69
+ - _onapp_session=WHAT; path=/; HttpOnly
70
+ status:
71
+ - "404"
72
+ cache-control:
73
+ - no-cache
74
+ transfer-encoding:
75
+ - chunked
76
+ body: "{\"error\":\"Resource not found\"}"
77
+ http_version: "1.1"
@@ -0,0 +1,116 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :put
5
+ uri: http://user:pass@www.example.com:80/users/500.json?user[role_ids][]=
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.013631"
25
+ server:
26
+ - Apache/2.2.3 (CentOS)
27
+ date:
28
+ - Fri, 15 Apr 2011 18:19:38 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: :put
42
+ uri: http://user:pass@www.example.com:80/users/7.json?user[role_ids][]=4
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
+ x-powered-by:
57
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
58
+ etag:
59
+ - "\"99914b932bd37a50b983c5e7c90ae93b\""
60
+ content-type:
61
+ - application/json; charset=utf-8
62
+ date:
63
+ - Fri, 15 Apr 2011 18:19:38 GMT
64
+ server:
65
+ - Apache/2.2.3 (CentOS)
66
+ x-runtime:
67
+ - "0.088967"
68
+ set-cookie:
69
+ - _onapp_session=WHAT; path=/; HttpOnly
70
+ cache-control:
71
+ - max-age=0, private, must-revalidate
72
+ status:
73
+ - "200"
74
+ transfer-encoding:
75
+ - chunked
76
+ body: "{}"
77
+ http_version: "1.1"
78
+ - !ruby/struct:VCR::HTTPInteraction
79
+ request: !ruby/struct:VCR::Request
80
+ method: :put
81
+ uri: http://user:pass@www.example.com:80/users/7.json?user[role_ids][]=4&user[role_ids][]=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: 200
91
+ message: OK
92
+ headers:
93
+ x-ua-compatible:
94
+ - IE=Edge,chrome=1
95
+ etag:
96
+ - "\"99914b932bd37a50b983c5e7c90ae93b\""
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.020897"
103
+ server:
104
+ - Apache/2.2.3 (CentOS)
105
+ date:
106
+ - Fri, 15 Apr 2011 18:21:23 GMT
107
+ set-cookie:
108
+ - _onapp_session=WHAT; path=/; HttpOnly
109
+ status:
110
+ - "200"
111
+ cache-control:
112
+ - max-age=0, private, must-revalidate
113
+ transfer-encoding:
114
+ - chunked
115
+ body: "{}"
116
+ 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/users/1/make_new_api_key.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
+ - "\"772e04001d7b7775406057b2925279e8\""
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.725365"
27
+ server:
28
+ - Apache/2.2.3 (CentOS)
29
+ date:
30
+ - Wed, 13 Apr 2011 20:28:24 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: $("#api_key").text("f234994e26e59ea3f112c5296d54ef88b080df9c");
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.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
+ - "\"050e82b7c087f67fcfcaa715d0ba87d5\""
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.400365"
27
+ server:
28
+ - Apache/2.2.3 (CentOS)
29
+ date:
30
+ - Wed, 13 Apr 2011 15:27:06 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-13T14:37:45Z\",\"created_at\":\"2011-04-13T14:37:45Z\",\"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-13T15:07:38Z\",\"used_disk_size\":0,\"used_cpus\":0,\"used_cpu_shares\":0,\"activation_code\":null,\"billing_plan_id\":1,\"group_id\":null,\"id\":1,\"used_memory\":0,\"payment_amount\":\"0.0\",\"last_name\":\"Smith\",\"remember_token\":null,\"disk_space_available\":null,\"time_zone\":\"\",\"login\":\"user\",\"status\":\"active\",\"roles\":[{\"role\":{\"label\":\"Administrator\",\"created_at\":\"2011-04-13T14:37:38Z\",\"updated_at\":\"2011-04-13T14:37:38Z\",\"id\":1,\"identifier\":\"user\"}}],\"outstanding_amount\":0.0,\"email\":\"user@example.com\",\"first_name\":\"John\"}},{\"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-13T15:13:35Z\",\"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\":\"active\",\"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,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/users/1.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
+ - "\"e070c525dba5f3f3833a25156e988def\""
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.030011"
27
+ server:
28
+ - Apache/2.2.3 (CentOS)
29
+ date:
30
+ - Wed, 13 Apr 2011 15:44:38 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-13T14:37:45Z\",\"created_at\":\"2011-04-13T14:37:45Z\",\"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-13T15:07:38Z\",\"used_disk_size\":0,\"used_cpus\":0,\"used_cpu_shares\":0,\"activation_code\":null,\"billing_plan_id\":1,\"group_id\":null,\"id\":1,\"used_memory\":0,\"payment_amount\":\"0.0\",\"last_name\":\"Smith\",\"remember_token\":null,\"disk_space_available\":null,\"time_zone\":\"\",\"login\":\"user\",\"status\":\"active\",\"roles\":[{\"role\":{\"label\":\"Administrator\",\"created_at\":\"2011-04-13T14:37:38Z\",\"updated_at\":\"2011-04-13T14:37:38Z\",\"id\":1,\"identifier\":\"user\"}}],\"outstanding_amount\":0.0,\"email\":\"user@example.com\",\"first_name\":\"John\"}}"
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/5.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: 404
54
+ message: Not Found
55
+ headers:
56
+ x-ua-compatible:
57
+ - IE=Edge,chrome=1
58
+ x-powered-by:
59
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
60
+ content-type:
61
+ - application/json; charset=utf-8
62
+ date:
63
+ - Wed, 13 Apr 2011 15:49:35 GMT
64
+ server:
65
+ - Apache/2.2.3 (CentOS)
66
+ x-runtime:
67
+ - "0.029841"
68
+ set-cookie:
69
+ - _onapp_session=WHAT; path=/; HttpOnly
70
+ cache-control:
71
+ - no-cache
72
+ status:
73
+ - "404"
74
+ transfer-encoding:
75
+ - chunked
76
+ body: "{\"error\":\"Resource not found\"}"
77
+ http_version: "1.1"