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,79 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :put
5
+ uri: http://user:pass@www.example.com:80/settings/hypervisors/3.json?hypervisor[label]=Old%20Gregg
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
+ - Fri, 15 Apr 2011 22:05:39 GMT
27
+ server:
28
+ - Apache/2.2.3 (CentOS)
29
+ x-runtime:
30
+ - "0.023556"
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: :put
44
+ uri: http://user:pass@www.example.com:80/settings/hypervisors/3.json?hypervisor[ip_address]=120.120.120.120
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
+ - "\"99914b932bd37a50b983c5e7c90ae93b\""
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.033513"
66
+ server:
67
+ - Apache/2.2.3 (CentOS)
68
+ date:
69
+ - Fri, 15 Apr 2011 22:06:52 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: "{}"
79
+ 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/settings/hypervisors.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
+ - "\"501ab62ca56e94d4b25a035485ceb5a1\""
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.022919"
27
+ server:
28
+ - Apache/2.2.3 (CentOS)
29
+ date:
30
+ - Fri, 15 Apr 2011 20:28:58 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: "[{\"hypervisor\":{\"called_in_at\":null,\"label\":\"Testing\",\"created_at\":\"2011-04-15T20:28:23Z\",\"spare\":false,\"hypervisor_type\":\"xen\",\"updated_at\":\"2011-04-15T20:28:56Z\",\"enabled\":true,\"hypervisor_group_id\":null,\"id\":1,\"xen_info\":null,\"failure_count\":7,\"health\":null,\"memory_overhead\":100,\"ip_address\":\"123.123.123.123\",\"locked\":false,\"online\":false}},{\"hypervisor\":{\"called_in_at\":null,\"label\":\"Testing2\",\"created_at\":\"2011-04-15T20:28:52Z\",\"spare\":false,\"hypervisor_type\":\"kvm\",\"updated_at\":\"2011-04-15T20:28:56Z\",\"enabled\":false,\"hypervisor_group_id\":null,\"id\":2,\"xen_info\":null,\"failure_count\":1,\"health\":null,\"memory_overhead\":200,\"ip_address\":\"111.111.111.111\",\"locked\":false,\"online\":false}}]"
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/settings/hypervisors/404/rebooting.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
+ - Mon, 18 Apr 2011 16:58:40 GMT
25
+ server:
26
+ - Apache/2.2.3 (CentOS)
27
+ x-runtime:
28
+ - "0.180613"
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/settings/hypervisors/1/rebooting.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
+ - "\"c5e4582e0122e638e7fe91192362dc7a\""
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.028808"
64
+ server:
65
+ - Apache/2.2.3 (CentOS)
66
+ date:
67
+ - Mon, 18 Apr 2011 16:58:41 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: "{\"hypervisor\":{\"called_in_at\":null,\"label\":\"Testing\",\"created_at\":\"2011-04-15T20:28:23Z\",\"spare\":false,\"hypervisor_type\":\"xen\",\"updated_at\":\"2011-04-18T16:58:40Z\",\"enabled\":true,\"hypervisor_group_id\":null,\"id\":1,\"xen_info\":null,\"failure_count\":49241,\"health\":null,\"memory_overhead\":100,\"ip_address\":\"123.123.123.123\",\"locked\":false,\"online\":false}}"
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/settings/hypervisors/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
+ - Fri, 15 Apr 2011 20:38:27 GMT
25
+ server:
26
+ - Apache/2.2.3 (CentOS)
27
+ x-runtime:
28
+ - "0.035425"
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/settings/hypervisors/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
+ - "\"fff427916ba4ac78f933253362fa4f2a\""
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.008563"
64
+ server:
65
+ - Apache/2.2.3 (CentOS)
66
+ date:
67
+ - Fri, 15 Apr 2011 20:38: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: "{\"hypervisor\":{\"called_in_at\":null,\"label\":\"Testing\",\"created_at\":\"2011-04-15T20:28:23Z\",\"spare\":false,\"hypervisor_type\":\"xen\",\"updated_at\":\"2011-04-15T20:38:24Z\",\"enabled\":true,\"hypervisor_group_id\":null,\"id\":1,\"xen_info\":null,\"failure_count\":120,\"health\":null,\"memory_overhead\":100,\"ip_address\":\"123.123.123.123\",\"locked\":false,\"online\":false}}"
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/settings/networks/404/ip_addresses.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
+ - Mon, 18 Apr 2011 19:28:17 GMT
25
+ server:
26
+ - Apache/2.2.3 (CentOS)
27
+ x-runtime:
28
+ - "0.007811"
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/settings/networks/1/ip_addresses.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
+ - "\"c2540c217e141c34f2f3e026bba3512a\""
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.008447"
64
+ server:
65
+ - Apache/2.2.3 (CentOS)
66
+ date:
67
+ - Mon, 18 Apr 2011 19:28:18 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: "[{\"ip_address\":{\"address\":\"127.2.2.2\",\"disallowed_primary\":false,\"netmask\":\"255.255.255.0\",\"created_at\":\"2011-04-18T19:22:06Z\",\"broadcast\":\"127.2.2.255\",\"network_address\":\"127.2.2.0\",\"network_id\":1,\"updated_at\":\"2011-04-18T19:22:06Z\",\"id\":1,\"gateway\":\"127.0.0.2\"}},{\"ip_address\":{\"address\":\"127.2.2.3\",\"disallowed_primary\":false,\"netmask\":\"255.255.255.0\",\"created_at\":\"2011-04-18T19:28:07Z\",\"broadcast\":\"127.2.2.255\",\"network_address\":\"127.2.2.0\",\"network_id\":1,\"updated_at\":\"2011-04-18T19:28:07Z\",\"id\":2,\"gateway\":\"127.0.0.2\"}}]"
77
+ http_version: "1.1"
@@ -0,0 +1,196 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: http://user:pass@www.example.com:80/settings/networks.json?network[label]=networktaken
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
+ - http://www.example.com/settings/networks/12
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.011776"
27
+ server:
28
+ - Apache/2.2.3 (CentOS)
29
+ date:
30
+ - Tue, 19 Apr 2011 15:54:47 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: "{\"network\":{\"label\":\"networktaken\",\"created_at\":\"2011-04-19T15:54:47Z\",\"network_group_id\":null,\"updated_at\":\"2011-04-19T15:54:47Z\",\"id\":12,\"vlan\":null,\"identifier\":\"58rrg0s87dhmut\"}}"
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/settings/networks.json?network[identifier]=newnetworkid&network[label]=newnetwork&network[vlan]=1
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: 201
54
+ message: Created
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
+ location:
61
+ - http://www.example.com/settings/networks/13
62
+ content-type:
63
+ - application/json; charset=utf-8
64
+ date:
65
+ - Tue, 19 Apr 2011 15:54:47 GMT
66
+ server:
67
+ - Apache/2.2.3 (CentOS)
68
+ x-runtime:
69
+ - "0.009338"
70
+ set-cookie:
71
+ - _onapp_session=WHAT; path=/; HttpOnly
72
+ cache-control:
73
+ - no-cache
74
+ status:
75
+ - "201"
76
+ transfer-encoding:
77
+ - chunked
78
+ body: "{\"network\":{\"label\":\"newnetwork\",\"created_at\":\"2011-04-19T15:54:47Z\",\"network_group_id\":null,\"updated_at\":\"2011-04-19T15:54:47Z\",\"id\":13,\"vlan\":1,\"identifier\":\"newnetworkid\"}}"
79
+ http_version: "1.1"
80
+ - !ruby/struct:VCR::HTTPInteraction
81
+ request: !ruby/struct:VCR::Request
82
+ method: :post
83
+ uri: http://user:pass@www.example.com:80/settings/networks.json?network[label]=newnetwork
84
+ body:
85
+ headers:
86
+ content-type:
87
+ - application/json
88
+ authorization:
89
+ - Basic WHAT
90
+ response: !ruby/struct:VCR::Response
91
+ status: !ruby/struct:VCR::ResponseStatus
92
+ code: 201
93
+ message: Created
94
+ headers:
95
+ x-ua-compatible:
96
+ - IE=Edge,chrome=1
97
+ x-powered-by:
98
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
99
+ location:
100
+ - http://www.example.com/settings/networks/14
101
+ content-type:
102
+ - application/json; charset=utf-8
103
+ date:
104
+ - Tue, 19 Apr 2011 15:54:47 GMT
105
+ server:
106
+ - Apache/2.2.3 (CentOS)
107
+ x-runtime:
108
+ - "0.009260"
109
+ set-cookie:
110
+ - _onapp_session=WHAT; path=/; HttpOnly
111
+ cache-control:
112
+ - no-cache
113
+ status:
114
+ - "201"
115
+ transfer-encoding:
116
+ - chunked
117
+ body: "{\"network\":{\"label\":\"newnetwork\",\"created_at\":\"2011-04-19T15:54:47Z\",\"network_group_id\":null,\"updated_at\":\"2011-04-19T15:54:47Z\",\"id\":14,\"vlan\":null,\"identifier\":\"4appjk9ifgj9un\"}}"
118
+ http_version: "1.1"
119
+ - !ruby/struct:VCR::HTTPInteraction
120
+ request: !ruby/struct:VCR::Request
121
+ method: :post
122
+ uri: http://user:pass@www.example.com:80/settings/networks.json?network[label]=newnetwork&network[vlan]=2
123
+ body:
124
+ headers:
125
+ content-type:
126
+ - application/json
127
+ authorization:
128
+ - Basic WHAT
129
+ response: !ruby/struct:VCR::Response
130
+ status: !ruby/struct:VCR::ResponseStatus
131
+ code: 201
132
+ message: Created
133
+ headers:
134
+ x-ua-compatible:
135
+ - IE=Edge,chrome=1
136
+ location:
137
+ - http://www.example.com/settings/networks/15
138
+ x-powered-by:
139
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
140
+ content-type:
141
+ - application/json; charset=utf-8
142
+ x-runtime:
143
+ - "0.011726"
144
+ server:
145
+ - Apache/2.2.3 (CentOS)
146
+ date:
147
+ - Tue, 19 Apr 2011 15:55:03 GMT
148
+ set-cookie:
149
+ - _onapp_session=WHAT; path=/; HttpOnly
150
+ status:
151
+ - "201"
152
+ cache-control:
153
+ - no-cache
154
+ transfer-encoding:
155
+ - chunked
156
+ body: "{\"network\":{\"label\":\"newnetwork\",\"created_at\":\"2011-04-19T15:55:03Z\",\"network_group_id\":null,\"updated_at\":\"2011-04-19T15:55:03Z\",\"id\":15,\"vlan\":2,\"identifier\":\"0m1c8zrhpln93g\"}}"
157
+ http_version: "1.1"
158
+ - !ruby/struct:VCR::HTTPInteraction
159
+ request: !ruby/struct:VCR::Request
160
+ method: :post
161
+ uri: http://user:pass@www.example.com:80/settings/networks.json?network[identifier]=something&network[label]=newnetwork
162
+ body:
163
+ headers:
164
+ content-type:
165
+ - application/json
166
+ authorization:
167
+ - Basic WHAT
168
+ response: !ruby/struct:VCR::Response
169
+ status: !ruby/struct:VCR::ResponseStatus
170
+ code: 201
171
+ message: Created
172
+ headers:
173
+ x-ua-compatible:
174
+ - IE=Edge,chrome=1
175
+ location:
176
+ - http://www.example.com/settings/networks/16
177
+ x-powered-by:
178
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
179
+ content-type:
180
+ - application/json; charset=utf-8
181
+ x-runtime:
182
+ - "0.009214"
183
+ server:
184
+ - Apache/2.2.3 (CentOS)
185
+ date:
186
+ - Tue, 19 Apr 2011 15:55:03 GMT
187
+ set-cookie:
188
+ - _onapp_session=WHAT; path=/; HttpOnly
189
+ status:
190
+ - "201"
191
+ cache-control:
192
+ - no-cache
193
+ transfer-encoding:
194
+ - chunked
195
+ body: "{\"network\":{\"label\":\"newnetwork\",\"created_at\":\"2011-04-19T15:55:03Z\",\"network_group_id\":null,\"updated_at\":\"2011-04-19T15:55:03Z\",\"id\":16,\"vlan\":null,\"identifier\":\"something\"}}"
196
+ 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/settings/networks/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 15:57:52 GMT
25
+ server:
26
+ - Apache/2.2.3 (CentOS)
27
+ x-runtime:
28
+ - "0.106262"
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/settings/networks/16.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.024894"
64
+ server:
65
+ - Apache/2.2.3 (CentOS)
66
+ date:
67
+ - Tue, 19 Apr 2011 15:58:48 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"