squall 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +1 -1
  3. data/README.md +64 -41
  4. data/Rakefile +3 -9
  5. data/lib/squall/data_store_zone.rb +20 -26
  6. data/lib/squall/disk.rb +174 -0
  7. data/lib/squall/firewall_rule.rb +34 -41
  8. data/lib/squall/hypervisor.rb +40 -38
  9. data/lib/squall/hypervisor_zone.rb +51 -63
  10. data/lib/squall/ip_address.rb +32 -37
  11. data/lib/squall/ip_address_join.rb +13 -22
  12. data/lib/squall/network.rb +36 -33
  13. data/lib/squall/network_zone.rb +27 -29
  14. data/lib/squall/payment.rb +22 -32
  15. data/lib/squall/role.rb +30 -37
  16. data/lib/squall/statistic.rb +3 -1
  17. data/lib/squall/support/base.rb +35 -31
  18. data/lib/squall/support/config.rb +25 -1
  19. data/lib/squall/support/version.rb +1 -1
  20. data/lib/squall/template.rb +7 -5
  21. data/lib/squall/transaction.rb +6 -4
  22. data/lib/squall/user.rb +84 -83
  23. data/lib/squall/user_group.rb +17 -30
  24. data/lib/squall/virtual_machine.rb +154 -178
  25. data/lib/squall/whitelist.rb +29 -40
  26. data/lib/squall.rb +27 -25
  27. data/spec/spec_helper.rb +6 -11
  28. data/spec/squall/data_store_zone_spec.rb +2 -20
  29. data/spec/squall/disk_spec.rb +189 -0
  30. data/spec/squall/firewall_rule_spec.rb +2 -32
  31. data/spec/squall/hypervisor_spec.rb +3 -47
  32. data/spec/squall/hypervisor_zone_spec.rb +3 -28
  33. data/spec/squall/ip_address_join_spec.rb +1 -15
  34. data/spec/squall/ip_address_spec.rb +10 -35
  35. data/spec/squall/network_spec.rb +20 -31
  36. data/spec/squall/network_zone_spec.rb +2 -36
  37. data/spec/squall/payment_spec.rb +2 -21
  38. data/spec/squall/role_spec.rb +4 -16
  39. data/spec/squall/support/base_spec.rb +10 -16
  40. data/spec/squall/template_spec.rb +0 -4
  41. data/spec/squall/transaction_spec.rb +1 -3
  42. data/spec/squall/user_group_spec.rb +1 -17
  43. data/spec/squall/user_spec.rb +4 -92
  44. data/spec/squall/virtual_machine_spec.rb +8 -242
  45. data/spec/squall/whitelist_spec.rb +2 -40
  46. data/spec/squall_spec.rb +2 -2
  47. data/spec/vcr_cassettes/disk/add_schedule.yml +40 -0
  48. data/spec/vcr_cassettes/disk/auto_backup_off.yml +40 -0
  49. data/spec/vcr_cassettes/disk/auto_backup_on.yml +40 -0
  50. data/spec/vcr_cassettes/disk/backups.yml +40 -0
  51. data/spec/vcr_cassettes/disk/build.yml +40 -0
  52. data/spec/vcr_cassettes/disk/create.yml +40 -0
  53. data/spec/vcr_cassettes/disk/delete.yml +38 -0
  54. data/spec/vcr_cassettes/disk/edit.yml +40 -0
  55. data/spec/vcr_cassettes/disk/iops_usage.yml +40 -0
  56. data/spec/vcr_cassettes/disk/list.yml +40 -0
  57. data/spec/vcr_cassettes/disk/migrate.yml +38 -0
  58. data/spec/vcr_cassettes/disk/schedules.yml +40 -0
  59. data/spec/vcr_cassettes/disk/unlock.yml +40 -0
  60. data/spec/vcr_cassettes/disk/vm_disk_list.yml +40 -0
  61. data/spec/vcr_cassettes/network/rebuild.yml +41 -0
  62. metadata +217 -66
  63. data/.gitignore +0 -13
  64. data/.rspec +0 -2
  65. data/.rvmrc +0 -41
  66. data/.travis.yml +0 -17
  67. data/lib/squall/support/params.rb +0 -50
  68. data/lib/squall/support/yaml.rb +0 -5
  69. data/spec/squall/support/params_spec.rb +0 -195
  70. data/squall.gemspec +0 -32
data/spec/squall_spec.rb CHANGED
@@ -42,10 +42,10 @@ describe Squall do
42
42
 
43
43
  describe "#config_file" do
44
44
  it "defaults to ~/.squall" do
45
- File.should_receive(:join).with(ENV['HOME'], '.squall.yml').and_return("/path/to/file")
46
45
  File.stub(:exists?).and_return(true)
47
46
  YAML.stub(:load_file).and_return({})
48
47
  Squall.config_file
48
+ Squall.configuration_file.should == "#{ENV['HOME']}/.squall.yml"
49
49
  end
50
50
 
51
51
  it "returns an error if the file doesn't exist" do
@@ -57,7 +57,7 @@ describe Squall do
57
57
  config = {'username' => 'test', 'password' => 'pass', 'base_uri' => 'http://example.com'}
58
58
  YAML.should_receive(:load_file).with('/tmp/exists.yml').and_return(config)
59
59
  Squall.config_file '/tmp/exists.yml'
60
- Squall.config.should include(:username => config['username'], :password => config['password'], :base_uri => config['base_uri'])
60
+ Squall.config.should include(username: config['username'], password: config['password'], base_uri: config['base_uri'])
61
61
  end
62
62
  end
63
63
  end
@@ -0,0 +1,40 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: http://<USER>:<PASS>@<URL>:80/settings/disks/78/schedules.json?disk%5Baction%5D=autobackup&disk%5Bduration%5D=1&disk%5Bperiod%5D=days
6
+ body:
7
+ headers:
8
+ authorization:
9
+ - Basic <REDACTED>
10
+ content-length:
11
+ - '0'
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 201
15
+ message: Created
16
+ headers:
17
+ date:
18
+ - Sun, 03 Feb 2013 22:49:52 GMT
19
+ server:
20
+ - Apache/2.2.3 (CentOS)
21
+ x-powered-by:
22
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
23
+ x-runtime:
24
+ - '0.030222'
25
+ x-ua-compatible:
26
+ - IE=Edge,chrome=1
27
+ cache-control:
28
+ - no-cache
29
+ set-cookie:
30
+ - <REDACTED>
31
+ location:
32
+ - http://<URL>/settings/disks/78/schedules
33
+ status:
34
+ - '201'
35
+ transfer-encoding:
36
+ - chunked
37
+ content-type:
38
+ - application/json; charset=utf-8
39
+ body: ! '[{"disk":{"locked":false,"disk_vm_number":2,"has_autobackups":false,"disk_size":3,"is_swap":false,"primary":false,"identifier":"auga35lagbqjjg","updated_at":"2013-02-03T21:47:38Z","add_to_linux_fstab":false,"mount_point":"/disk2","data_store_id":1,"built":true,"created_at":"2013-02-03T21:28:41Z","virtual_machine_id":58,"id":78}}]'
40
+ 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>@<URL>:80/settings/disks/78/autobackup_disable.json
6
+ body:
7
+ headers:
8
+ authorization:
9
+ - Basic <REDACTED>
10
+ content-length:
11
+ - '0'
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 201
15
+ message: Created
16
+ headers:
17
+ date:
18
+ - Sun, 03 Feb 2013 22:33:42 GMT
19
+ server:
20
+ - Apache/2.2.3 (CentOS)
21
+ x-powered-by:
22
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
23
+ x-runtime:
24
+ - '0.029775'
25
+ x-ua-compatible:
26
+ - IE=Edge,chrome=1
27
+ cache-control:
28
+ - no-cache
29
+ set-cookie:
30
+ - <REDACTED>
31
+ location:
32
+ - http://<URL>/virtual_machines/d22pmhpwi0twfo/disks/78
33
+ status:
34
+ - '201'
35
+ transfer-encoding:
36
+ - chunked
37
+ content-type:
38
+ - application/json; charset=utf-8
39
+ body: ! '{"disk":{"locked":false,"disk_vm_number":2,"has_autobackups":false,"disk_size":3,"is_swap":false,"primary":false,"identifier":"auga35lagbqjjg","updated_at":"2013-02-03T21:47:38Z","add_to_linux_fstab":false,"mount_point":"/disk2","data_store_id":1,"built":true,"created_at":"2013-02-03T21:28:41Z","virtual_machine_id":58,"id":78}}'
40
+ 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>@<URL>:80/settings/disks/78/autobackup_enable.json
6
+ body:
7
+ headers:
8
+ authorization:
9
+ - Basic <REDACTED>
10
+ content-length:
11
+ - '0'
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 201
15
+ message: Created
16
+ headers:
17
+ date:
18
+ - Sun, 03 Feb 2013 22:31:36 GMT
19
+ server:
20
+ - Apache/2.2.3 (CentOS)
21
+ x-powered-by:
22
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
23
+ x-runtime:
24
+ - '0.067040'
25
+ x-ua-compatible:
26
+ - IE=Edge,chrome=1
27
+ cache-control:
28
+ - no-cache
29
+ set-cookie:
30
+ - <REDACTED>
31
+ location:
32
+ - http://<URL>/virtual_machines/d22pmhpwi0twfo/disks/78
33
+ status:
34
+ - '201'
35
+ transfer-encoding:
36
+ - chunked
37
+ content-type:
38
+ - application/json; charset=utf-8
39
+ body: ! '{"disk":{"locked":false,"disk_vm_number":2,"has_autobackups":true,"disk_size":3,"is_swap":false,"primary":false,"identifier":"auga35lagbqjjg","updated_at":"2013-02-03T21:47:38Z","add_to_linux_fstab":false,"mount_point":"/disk2","data_store_id":1,"built":true,"created_at":"2013-02-03T21:28:41Z","virtual_machine_id":58,"id":78}}'
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>@<URL>:80/settings/disks/78/backups.json
6
+ body:
7
+ headers:
8
+ authorization:
9
+ - Basic <REDACTED>
10
+ accept-encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ date:
18
+ - Sun, 03 Feb 2013 22:56:19 GMT
19
+ server:
20
+ - Apache/2.2.3 (CentOS)
21
+ x-powered-by:
22
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
23
+ x-runtime:
24
+ - '0.181057'
25
+ etag:
26
+ - ! '"5df41d1c5711c1a66a1ef2398522fe78"'
27
+ x-ua-compatible:
28
+ - IE=Edge,chrome=1
29
+ cache-control:
30
+ - max-age=0, private, must-revalidate
31
+ set-cookie:
32
+ - <REDACTED>
33
+ status:
34
+ - '200'
35
+ transfer-encoding:
36
+ - chunked
37
+ content-type:
38
+ - application/json; charset=utf-8
39
+ body: ! '[{"backup":{"allow_resize_without_reboot":false,"min_memory_size":384,"allowed_hot_migrate":true,"locked":false,"backup_size":"8","disk_id":78,"operating_system":"linux","operating_system_distro":"rhel","allowed_swap":true,"backup_server_id":null,"identifier":"azbygzz6zjui4k","min_disk_size":5,"updated_at":"2013-02-03T22:31:48Z","backup_type":"days-autobackup","built_at":"2013-02-03T22:31:48Z","built":true,"created_at":"2013-02-03T22:31:41Z","template_id":1,"marked_for_delete":false,"id":68}},{"backup":{"allow_resize_without_reboot":false,"min_memory_size":384,"allowed_hot_migrate":true,"locked":false,"backup_size":"8","disk_id":78,"operating_system":"linux","operating_system_distro":"rhel","allowed_swap":true,"backup_server_id":null,"identifier":"bms29egtk7x0ka","min_disk_size":5,"updated_at":"2013-02-03T22:31:53Z","backup_type":"weeks-autobackup","built_at":"2013-02-03T22:31:53Z","built":true,"created_at":"2013-02-03T22:31:46Z","template_id":1,"marked_for_delete":false,"id":69}},{"backup":{"allow_resize_without_reboot":false,"min_memory_size":384,"allowed_hot_migrate":true,"locked":false,"backup_size":"8","disk_id":78,"operating_system":"linux","operating_system_distro":"rhel","allowed_swap":true,"backup_server_id":null,"identifier":"x4x2qozp8gust2","min_disk_size":5,"updated_at":"2013-02-03T22:31:58Z","backup_type":"months-autobackup","built_at":"2013-02-03T22:31:58Z","built":true,"created_at":"2013-02-03T22:31:51Z","template_id":1,"marked_for_delete":false,"id":70}},{"backup":{"allow_resize_without_reboot":false,"min_memory_size":384,"allowed_hot_migrate":true,"locked":false,"backup_size":"8","disk_id":78,"operating_system":"linux","operating_system_distro":"rhel","allowed_swap":true,"backup_server_id":null,"identifier":"c5djejrrxxvj7s","min_disk_size":5,"updated_at":"2013-02-03T22:32:03Z","backup_type":"years-autobackup","built_at":"2013-02-03T22:32:03Z","built":true,"created_at":"2013-02-03T22:31:56Z","template_id":1,"marked_for_delete":false,"id":71}}]'
40
+ 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>@<URL>:80/settings/disks/78/build.json
6
+ body:
7
+ headers:
8
+ authorization:
9
+ - Basic <REDACTED>
10
+ content-length:
11
+ - '0'
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 201
15
+ message: Created
16
+ headers:
17
+ date:
18
+ - Sun, 03 Feb 2013 22:20:00 GMT
19
+ server:
20
+ - Apache/2.2.3 (CentOS)
21
+ x-powered-by:
22
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
23
+ x-runtime:
24
+ - '0.025972'
25
+ x-ua-compatible:
26
+ - IE=Edge,chrome=1
27
+ cache-control:
28
+ - no-cache
29
+ set-cookie:
30
+ - <REDACTED>
31
+ location:
32
+ - http://<URL>/virtual_machines/d22pmhpwi0twfo/disks/78
33
+ status:
34
+ - '201'
35
+ transfer-encoding:
36
+ - chunked
37
+ content-type:
38
+ - application/json; charset=utf-8
39
+ body: ! '{"disk":{"locked":false,"disk_vm_number":2,"has_autobackups":false,"disk_size":3,"is_swap":false,"primary":false,"identifier":"auga35lagbqjjg","updated_at":"2013-02-03T21:47:38Z","add_to_linux_fstab":false,"mount_point":"/disk2","data_store_id":1,"built":true,"created_at":"2013-02-03T21:28:41Z","virtual_machine_id":58,"id":78}}'
40
+ 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>@<URL>:80/virtual_machines/58/disks.json?disk%5Bdata_store_id%5D=1&disk%5Bdisk_size%5D=2&disk%5Bis_swap%5D=0&disk%5Bmount_point%5D=%2Fdisk2&disk%5Badd_to_linux_fstab%5D=0&disk%5Brequire_format_disk%5D=1
6
+ body:
7
+ headers:
8
+ authorization:
9
+ - Basic <REDACTED>
10
+ content-length:
11
+ - '0'
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 201
15
+ message: Created
16
+ headers:
17
+ date:
18
+ - Sun, 03 Feb 2013 21:28:41 GMT
19
+ server:
20
+ - Apache/2.2.3 (CentOS)
21
+ x-powered-by:
22
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
23
+ x-runtime:
24
+ - '0.190713'
25
+ x-ua-compatible:
26
+ - IE=Edge,chrome=1
27
+ cache-control:
28
+ - no-cache
29
+ set-cookie:
30
+ - <REDACTED>
31
+ location:
32
+ - http://<URL>/virtual_machines/d22pmhpwi0twfo/disks/78
33
+ status:
34
+ - '201'
35
+ transfer-encoding:
36
+ - chunked
37
+ content-type:
38
+ - application/json; charset=utf-8
39
+ body: ! '{"disk":{"locked":true,"disk_vm_number":2,"has_autobackups":false,"disk_size":2,"is_swap":false,"primary":false,"identifier":"auga35lagbqjjg","updated_at":"2013-02-03T21:28:41Z","add_to_linux_fstab":false,"mount_point":"/disk2","data_store_id":1,"built":false,"created_at":"2013-02-03T21:28:41Z","virtual_machine_id":58,"id":78}}'
40
+ http_version: '1.1'
@@ -0,0 +1,38 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :delete
5
+ uri: http://<USER>:<PASS>@<URL>:80/settings/disks/78.json
6
+ body:
7
+ headers:
8
+ authorization:
9
+ - Basic <REDACTED>
10
+ response: !ruby/struct:VCR::Response
11
+ status: !ruby/struct:VCR::ResponseStatus
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ date:
16
+ - Sun, 03 Feb 2013 22:58:59 GMT
17
+ server:
18
+ - Apache/2.2.3 (CentOS)
19
+ x-powered-by:
20
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
21
+ x-runtime:
22
+ - '0.088773'
23
+ etag:
24
+ - ! '"99914b932bd37a50b983c5e7c90ae93b"'
25
+ x-ua-compatible:
26
+ - IE=Edge,chrome=1
27
+ cache-control:
28
+ - max-age=0, private, must-revalidate
29
+ set-cookie:
30
+ - <REDACTED>
31
+ status:
32
+ - '200'
33
+ transfer-encoding:
34
+ - chunked
35
+ content-type:
36
+ - application/json; charset=utf-8
37
+ body: ! '{}'
38
+ http_version: '1.1'
@@ -0,0 +1,40 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :put
5
+ uri: http://<USER>:<PASS>@<URL>:80/settings/disks/78.json?disk%5Bdisk_size%5D=3
6
+ body:
7
+ headers:
8
+ authorization:
9
+ - Basic <REDACTED>
10
+ content-length:
11
+ - '0'
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ date:
18
+ - Sun, 03 Feb 2013 21:46:59 GMT
19
+ server:
20
+ - Apache/2.2.3 (CentOS)
21
+ x-powered-by:
22
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
23
+ x-runtime:
24
+ - '0.072102'
25
+ etag:
26
+ - ! '"99914b932bd37a50b983c5e7c90ae93b"'
27
+ x-ua-compatible:
28
+ - IE=Edge,chrome=1
29
+ cache-control:
30
+ - max-age=0, private, must-revalidate
31
+ set-cookie:
32
+ - <REDACTED>
33
+ status:
34
+ - '200'
35
+ transfer-encoding:
36
+ - chunked
37
+ content-type:
38
+ - application/json; charset=utf-8
39
+ body: ! '{}'
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>@<URL>:80/settings/disks/77/usage.json
6
+ body:
7
+ headers:
8
+ authorization:
9
+ - Basic <REDACTED>
10
+ accept-encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ date:
18
+ - Sun, 03 Feb 2013 22:07:47 GMT
19
+ server:
20
+ - Apache/2.2.3 (CentOS)
21
+ x-powered-by:
22
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
23
+ x-runtime:
24
+ - '0.031756'
25
+ etag:
26
+ - ! '"e360508aa8f0b9b7533af5722b8ca972"'
27
+ x-ua-compatible:
28
+ - IE=Edge,chrome=1
29
+ cache-control:
30
+ - max-age=0, private, must-revalidate
31
+ set-cookie:
32
+ - <REDACTED>
33
+ status:
34
+ - '200'
35
+ transfer-encoding:
36
+ - chunked
37
+ content-type:
38
+ - application/json; charset=utf-8
39
+ body: ! '[{"disk_hourly_stat":{"stat_time":"2013-02-03T02:00:00Z","disk_id":77,"updated_at":"2013-02-03T02:00:06Z","data_written":4,"user_id":17,"writes_completed":1,"data_read":4,"created_at":"2013-02-03T02:00:06Z","virtual_machine_id":58,"id":2496,"reads_completed":1}},{"disk_hourly_stat":{"stat_time":"2013-02-03T14:00:00Z","disk_id":77,"updated_at":"2013-02-03T14:00:05Z","data_written":3644,"user_id":17,"writes_completed":884,"data_read":210976,"created_at":"2013-02-03T14:00:05Z","virtual_machine_id":58,"id":2605,"reads_completed":25374}},{"disk_hourly_stat":{"stat_time":"2013-02-03T15:00:00Z","disk_id":77,"updated_at":"2013-02-03T15:00:06Z","data_written":1540,"user_id":17,"writes_completed":380,"data_read":52241,"created_at":"2013-02-03T15:00:06Z","virtual_machine_id":58,"id":2615,"reads_completed":6313}},{"disk_hourly_stat":{"stat_time":"2013-02-03T16:00:00Z","disk_id":77,"updated_at":"2013-02-03T16:00:05Z","data_written":1180,"user_id":17,"writes_completed":295,"data_read":748,"created_at":"2013-02-03T16:00:05Z","virtual_machine_id":58,"id":2625,"reads_completed":119}},{"disk_hourly_stat":{"stat_time":"2013-02-03T17:00:00Z","disk_id":77,"updated_at":"2013-02-03T17:00:06Z","data_written":2272,"user_id":17,"writes_completed":558,"data_read":104474,"created_at":"2013-02-03T17:00:06Z","virtual_machine_id":58,"id":2635,"reads_completed":12617}},{"disk_hourly_stat":{"stat_time":"2013-02-03T18:00:00Z","disk_id":77,"updated_at":"2013-02-03T18:00:05Z","data_written":1028,"user_id":17,"writes_completed":257,"data_read":332,"created_at":"2013-02-03T18:00:05Z","virtual_machine_id":58,"id":2645,"reads_completed":39}},{"disk_hourly_stat":{"stat_time":"2013-02-03T19:00:00Z","disk_id":77,"updated_at":"2013-02-03T19:00:05Z","data_written":2944,"user_id":17,"writes_completed":720,"data_read":1065574,"created_at":"2013-02-03T19:00:05Z","virtual_machine_id":58,"id":2655,"reads_completed":174350}},{"disk_hourly_stat":{"stat_time":"2013-02-03T20:00:00Z","disk_id":77,"updated_at":"2013-02-03T20:00:06Z","data_written":1112,"user_id":17,"writes_completed":278,"data_read":424,"created_at":"2013-02-03T20:00:06Z","virtual_machine_id":58,"id":2666,"reads_completed":89}},{"disk_hourly_stat":{"stat_time":"2013-02-03T21:00:00Z","disk_id":77,"updated_at":"2013-02-03T21:00:05Z","data_written":1144,"user_id":17,"writes_completed":286,"data_read":100,"created_at":"2013-02-03T21:00:05Z","virtual_machine_id":58,"id":2676,"reads_completed":23}},{"disk_hourly_stat":{"stat_time":"2013-02-03T22:00:00Z","disk_id":77,"updated_at":"2013-02-03T22:00:06Z","data_written":2092,"user_id":17,"writes_completed":509,"data_read":51877,"created_at":"2013-02-03T22:00:06Z","virtual_machine_id":58,"id":2686,"reads_completed":6281}}]'
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>@<URL>:80/settings/disks.json
6
+ body:
7
+ headers:
8
+ authorization:
9
+ - Basic <REDACTED>
10
+ accept-encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ date:
18
+ - Sun, 03 Feb 2013 20:46:47 GMT
19
+ server:
20
+ - Apache/2.2.3 (CentOS)
21
+ x-powered-by:
22
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
23
+ x-runtime:
24
+ - '0.024210'
25
+ etag:
26
+ - ! '"72bf7f9ce408634c3ec472549c91a92d"'
27
+ x-ua-compatible:
28
+ - IE=Edge,chrome=1
29
+ cache-control:
30
+ - max-age=0, private, must-revalidate
31
+ set-cookie:
32
+ - <REDACTED>
33
+ status:
34
+ - '200'
35
+ transfer-encoding:
36
+ - chunked
37
+ content-type:
38
+ - application/json; charset=utf-8
39
+ body: ! '[{"disk":{"locked":false,"disk_vm_number":1,"has_autobackups":false,"disk_size":50,"is_swap":false,"primary":true,"identifier":"wkod7eou2q6xua","updated_at":"2013-02-03T01:10:54Z","add_to_linux_fstab":null,"mount_point":null,"data_store_id":1,"built":true,"created_at":"2013-02-03T01:10:51Z","virtual_machine_id":58,"id":77}}]'
40
+ http_version: '1.1'
@@ -0,0 +1,38 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: http://<USER>:<PASS>@<URL>:80/virtual_machines/58/disks/78/migrate.json?disk%5Bdata_store_id%5D=2
6
+ body:
7
+ headers:
8
+ authorization:
9
+ - Basic <REDACTED>
10
+ content-length:
11
+ - '0'
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 422
15
+ message: Unprocessable Entity
16
+ headers:
17
+ date:
18
+ - Sun, 03 Feb 2013 21:59:11 GMT
19
+ server:
20
+ - Apache/2.2.3 (CentOS)
21
+ x-powered-by:
22
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
23
+ x-runtime:
24
+ - '0.028626'
25
+ x-ua-compatible:
26
+ - IE=Edge,chrome=1
27
+ cache-control:
28
+ - no-cache
29
+ set-cookie:
30
+ - <REDACTED>
31
+ status:
32
+ - '422'
33
+ transfer-encoding:
34
+ - chunked
35
+ content-type:
36
+ - application/json; charset=utf-8
37
+ body: ! '{"errors":["Data store cannot be associated with this virtual machine."]}'
38
+ 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>@<URL>:80/settings/disks/78/schedules.json
6
+ body:
7
+ headers:
8
+ authorization:
9
+ - Basic <REDACTED>
10
+ accept-encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ date:
18
+ - Sun, 03 Feb 2013 22:39:08 GMT
19
+ server:
20
+ - Apache/2.2.3 (CentOS)
21
+ x-powered-by:
22
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
23
+ x-runtime:
24
+ - '0.170110'
25
+ etag:
26
+ - ! '"2c59b110ae7d525eabb4b879132f5612"'
27
+ x-ua-compatible:
28
+ - IE=Edge,chrome=1
29
+ cache-control:
30
+ - max-age=0, private, must-revalidate
31
+ set-cookie:
32
+ - <REDACTED>
33
+ status:
34
+ - '200'
35
+ transfer-encoding:
36
+ - chunked
37
+ content-type:
38
+ - application/json; charset=utf-8
39
+ body: ! '[{"schedule":{"target_id":78,"action":"autobackup","updated_at":"2013-02-03T22:33:42Z","schedule_logs":[{"schedule_log":{"updated_at":"2013-02-03T22:31:41Z","status":"complete","log_output":"","created_at":"2013-02-03T22:31:41Z","schedule_id":13,"id":68}}],"duration":1,"start_at":"2013-02-04T22:31:36Z","user_id":17,"period":"days","failure_count":0,"status":"disabled","target_type":"Disk","created_at":"2013-02-03T22:31:36Z","id":13,"params":null}},{"schedule":{"target_id":78,"action":"autobackup","updated_at":"2013-02-03T22:33:42Z","schedule_logs":[{"schedule_log":{"updated_at":"2013-02-03T22:31:46Z","status":"complete","log_output":"","created_at":"2013-02-03T22:31:46Z","schedule_id":14,"id":69}}],"duration":1,"start_at":"2013-02-10T22:31:36Z","user_id":17,"period":"weeks","failure_count":0,"status":"disabled","target_type":"Disk","created_at":"2013-02-03T22:31:36Z","id":14,"params":null}},{"schedule":{"target_id":78,"action":"autobackup","updated_at":"2013-02-03T22:33:42Z","schedule_logs":[{"schedule_log":{"updated_at":"2013-02-03T22:31:51Z","status":"complete","log_output":"","created_at":"2013-02-03T22:31:51Z","schedule_id":15,"id":70}}],"duration":1,"start_at":"2013-03-03T22:31:36Z","user_id":17,"period":"months","failure_count":0,"status":"disabled","target_type":"Disk","created_at":"2013-02-03T22:31:36Z","id":15,"params":null}},{"schedule":{"target_id":78,"action":"autobackup","updated_at":"2013-02-03T22:33:42Z","schedule_logs":[{"schedule_log":{"updated_at":"2013-02-03T22:31:56Z","status":"complete","log_output":"","created_at":"2013-02-03T22:31:56Z","schedule_id":16,"id":71}}],"duration":1,"start_at":"2014-02-03T22:31:36Z","user_id":17,"period":"years","failure_count":0,"status":"disabled","target_type":"Disk","created_at":"2013-02-03T22:31:36Z","id":16,"params":null}}]'
40
+ 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>@<URL>:80/settings/disks/78/unlock.json
6
+ body:
7
+ headers:
8
+ authorization:
9
+ - Basic <REDACTED>
10
+ content-length:
11
+ - '0'
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 201
15
+ message: Created
16
+ headers:
17
+ date:
18
+ - Sun, 03 Feb 2013 22:22:03 GMT
19
+ server:
20
+ - Apache/2.2.3 (CentOS)
21
+ x-powered-by:
22
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
23
+ x-runtime:
24
+ - '0.025621'
25
+ x-ua-compatible:
26
+ - IE=Edge,chrome=1
27
+ cache-control:
28
+ - no-cache
29
+ set-cookie:
30
+ - <REDACTED>
31
+ location:
32
+ - http://<URL>/settings/disks/78
33
+ status:
34
+ - '201'
35
+ transfer-encoding:
36
+ - chunked
37
+ content-type:
38
+ - application/json; charset=utf-8
39
+ body: ! '{"disk":{"locked":false,"disk_vm_number":2,"has_autobackups":false,"disk_size":3,"is_swap":false,"primary":false,"identifier":"auga35lagbqjjg","updated_at":"2013-02-03T21:47:38Z","add_to_linux_fstab":false,"mount_point":"/disk2","data_store_id":1,"built":true,"created_at":"2013-02-03T21:28:41Z","virtual_machine_id":58,"id":78}}'
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>@<URL>:80/virtual_machines/58/disks.json
6
+ body:
7
+ headers:
8
+ authorization:
9
+ - Basic <REDACTED>
10
+ accept-encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ date:
18
+ - Sun, 03 Feb 2013 21:04:12 GMT
19
+ server:
20
+ - Apache/2.2.3 (CentOS)
21
+ x-powered-by:
22
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
23
+ x-runtime:
24
+ - '0.013695'
25
+ etag:
26
+ - ! '"47ab64fe3e540d04350851dbb5be2f93"'
27
+ x-ua-compatible:
28
+ - IE=Edge,chrome=1
29
+ cache-control:
30
+ - max-age=0, private, must-revalidate
31
+ set-cookie:
32
+ - <REDACTED>
33
+ status:
34
+ - '200'
35
+ transfer-encoding:
36
+ - chunked
37
+ content-type:
38
+ - application/json; charset=utf-8
39
+ body: ! '[{"disk":{"locked":false,"disk_vm_number":1,"has_autobackups":false,"disk_size":50,"is_swap":false,"primary":true,"identifier":"wkod7eou2q6xua","updated_at":"2013-02-03T01:10:54Z","add_to_linux_fstab":null,"mount_point":null,"data_store_id":1,"built":true,"created_at":"2013-02-03T01:10:51Z","virtual_machine_id":58,"id":77}}]'
40
+ http_version: '1.1'
@@ -0,0 +1,41 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: http://<USER>:<PASS>@<URL>:80/virtual_machines/58/rebuild_network.json
6
+ body:
7
+ headers:
8
+ authorization:
9
+ - Basic <REDACTED>
10
+ content-length:
11
+ - '0'
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 201
15
+ message: Created
16
+ headers:
17
+ date:
18
+ - Sun, 03 Feb 2013 18:04:14 GMT
19
+ server:
20
+ - Apache/2.2.3 (CentOS)
21
+ x-powered-by:
22
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.1
23
+ x-runtime:
24
+ - '0.072265'
25
+ x-ua-compatible:
26
+ - IE=Edge,chrome=1
27
+ cache-control:
28
+ - no-cache
29
+ set-cookie:
30
+ - <REDACTED>
31
+ location:
32
+ - http://<URL>/virtual_machines/d22pmhpwi0twfo
33
+ status:
34
+ - '201'
35
+ transfer-encoding:
36
+ - chunked
37
+ content-type:
38
+ - application/json; charset=utf-8
39
+ body: ! '{"virtual_machine":{"add_to_marketplace":null,"admin_note":null,"allow_resize_without_reboot":false,"remote_access_password":"password","suspended":false,"allowed_hot_migrate":true,"hostname":"testhostname.com","locked":false,"state":"new","enable_autoscale":null,"hypervisor_id":1,"operating_system":"linux","operating_system_distro":"rhel","allowed_swap":true,"identifier":"ident12","min_disk_size":5,"updated_at":"2013-02-03T16:16:28Z","ip_addresses":[{"ip_address":{"netmask":"255.255.255.192","network_id":2,"address":"192.168.1.98","updated_at":"2012-12-21T10:37:24Z","disallowed_primary":false,"gateway":"192.168.1.65","created_at":"2012-12-21T10:37:24Z","free":false,"broadcast":"192.168.1.127","network_address":"192.168.1.64","id":95}},{"ip_address":{"netmask":"255.255.255.192","network_id":2,"address":"192.168.1.99","updated_at":"2012-12-21T10:37:24Z","disallowed_primary":false,"gateway":"192.168.1.65","created_at":"2012-12-21T10:37:24Z","free":false,"broadcast":"192.168.1.127","network_address":"192.168.1.64","id":96}}],"label":"testlabel","user_id":17,"update_billing_stat":false,"vip":null,"xen_id":22,"monthly_bandwidth_used":0,"total_disk_size":50,"enable_monitis":null,"initial_root_password":"root_pass","strict_virtual_machine_id":null,"built":true,"created_at":"2013-02-03T01:10:51Z","recovery_mode":false,"template_id":1,"booted":true,"cpu_shares":10,"local_remote_access_port":5906,"memory":1024,"note":null,"cpus":1,"id":58,"template_label":"CentOS
40
+ 6.3 x64"}}'
41
+ http_version: '1.1'