fog-profitbricks 2.0.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +3 -0
  3. data/.travis.yml +11 -4
  4. data/README.md +8 -5
  5. data/Rakefile +1 -1
  6. data/examples/pb_demo.rb +49 -49
  7. data/fog-profitbricks.gemspec +4 -5
  8. data/gemfiles/Gemfile.1.9.2+ +1 -0
  9. data/lib/fog/bin/profitbricks.rb +5 -5
  10. data/lib/fog/profitbricks.rb +3 -3
  11. data/lib/fog/profitbricks/compute.rb +209 -204
  12. data/lib/fog/profitbricks/helpers/compute/data_helper.rb +1 -1
  13. data/lib/fog/profitbricks/models/compute/datacenter.rb +1 -1
  14. data/lib/fog/profitbricks/models/compute/datacenters.rb +6 -7
  15. data/lib/fog/profitbricks/models/compute/firewall_rule.rb +2 -2
  16. data/lib/fog/profitbricks/models/compute/firewall_rules.rb +5 -8
  17. data/lib/fog/profitbricks/models/compute/flavors.rb +1 -4
  18. data/lib/fog/profitbricks/models/compute/image.rb +4 -0
  19. data/lib/fog/profitbricks/models/compute/images.rb +2 -5
  20. data/lib/fog/profitbricks/models/compute/ip_block.rb +1 -1
  21. data/lib/fog/profitbricks/models/compute/ip_blocks.rb +3 -8
  22. data/lib/fog/profitbricks/models/compute/lan.rb +1 -1
  23. data/lib/fog/profitbricks/models/compute/lans.rb +4 -7
  24. data/lib/fog/profitbricks/models/compute/load_balancer.rb +6 -7
  25. data/lib/fog/profitbricks/models/compute/load_balancers.rb +5 -9
  26. data/lib/fog/profitbricks/models/compute/locations.rb +2 -5
  27. data/lib/fog/profitbricks/models/compute/nic.rb +6 -3
  28. data/lib/fog/profitbricks/models/compute/nics.rb +2 -5
  29. data/lib/fog/profitbricks/models/compute/regions.rb +1 -4
  30. data/lib/fog/profitbricks/models/compute/request.rb +0 -1
  31. data/lib/fog/profitbricks/models/compute/requests.rb +2 -4
  32. data/lib/fog/profitbricks/models/compute/server.rb +10 -13
  33. data/lib/fog/profitbricks/models/compute/servers.rb +3 -6
  34. data/lib/fog/profitbricks/models/compute/snapshot.rb +2 -2
  35. data/lib/fog/profitbricks/models/compute/snapshots.rb +3 -6
  36. data/lib/fog/profitbricks/models/compute/volume.rb +11 -9
  37. data/lib/fog/profitbricks/models/compute/volumes.rb +3 -6
  38. data/lib/fog/profitbricks/requests/compute/associate_nic_to_load_balancer.rb +26 -13
  39. data/lib/fog/profitbricks/requests/compute/attach_cdrom.rb +25 -16
  40. data/lib/fog/profitbricks/requests/compute/attach_volume.rb +25 -16
  41. data/lib/fog/profitbricks/requests/compute/create_datacenter.rb +22 -23
  42. data/lib/fog/profitbricks/requests/compute/create_firewall_rule.rb +24 -26
  43. data/lib/fog/profitbricks/requests/compute/create_flavor.rb +34 -34
  44. data/lib/fog/profitbricks/requests/compute/create_ip_block.rb +18 -20
  45. data/lib/fog/profitbricks/requests/compute/create_lan.rb +151 -150
  46. data/lib/fog/profitbricks/requests/compute/create_load_balancer.rb +67 -26
  47. data/lib/fog/profitbricks/requests/compute/create_nic.rb +24 -26
  48. data/lib/fog/profitbricks/requests/compute/create_server.rb +70 -61
  49. data/lib/fog/profitbricks/requests/compute/create_volume.rb +122 -122
  50. data/lib/fog/profitbricks/requests/compute/create_volume_snapshot.rb +42 -45
  51. data/lib/fog/profitbricks/requests/compute/delete_datacenter.rb +34 -36
  52. data/lib/fog/profitbricks/requests/compute/delete_firewall_rule.rb +8 -11
  53. data/lib/fog/profitbricks/requests/compute/delete_image.rb +7 -9
  54. data/lib/fog/profitbricks/requests/compute/delete_ip_block.rb +8 -10
  55. data/lib/fog/profitbricks/requests/compute/delete_lan.rb +7 -9
  56. data/lib/fog/profitbricks/requests/compute/delete_load_balancer.rb +8 -10
  57. data/lib/fog/profitbricks/requests/compute/delete_nic.rb +7 -10
  58. data/lib/fog/profitbricks/requests/compute/delete_server.rb +6 -10
  59. data/lib/fog/profitbricks/requests/compute/delete_snapshot.rb +7 -10
  60. data/lib/fog/profitbricks/requests/compute/delete_volume.rb +36 -38
  61. data/lib/fog/profitbricks/requests/compute/detach_cdrom.rb +11 -13
  62. data/lib/fog/profitbricks/requests/compute/detach_volume.rb +16 -13
  63. data/lib/fog/profitbricks/requests/compute/get_all_datacenters.rb +1 -1
  64. data/lib/fog/profitbricks/requests/compute/get_all_firewall_rules.rb +6 -7
  65. data/lib/fog/profitbricks/requests/compute/get_all_flavors.rb +72 -72
  66. data/lib/fog/profitbricks/requests/compute/get_all_images.rb +62 -62
  67. data/lib/fog/profitbricks/requests/compute/get_all_ip_blocks.rb +5 -5
  68. data/lib/fog/profitbricks/requests/compute/get_all_lans.rb +113 -113
  69. data/lib/fog/profitbricks/requests/compute/get_all_load_balanced_nics.rb +15 -9
  70. data/lib/fog/profitbricks/requests/compute/get_all_load_balancers.rb +9 -9
  71. data/lib/fog/profitbricks/requests/compute/get_all_locations.rb +6 -6
  72. data/lib/fog/profitbricks/requests/compute/get_all_nic.rb +94 -94
  73. data/lib/fog/profitbricks/requests/compute/get_all_requests.rb +38 -38
  74. data/lib/fog/profitbricks/requests/compute/get_all_servers.rb +8 -9
  75. data/lib/fog/profitbricks/requests/compute/get_all_snapshots.rb +4 -4
  76. data/lib/fog/profitbricks/requests/compute/get_all_volumes.rb +71 -71
  77. data/lib/fog/profitbricks/requests/compute/get_attached_cdrom.rb +11 -11
  78. data/lib/fog/profitbricks/requests/compute/get_attached_volume.rb +16 -11
  79. data/lib/fog/profitbricks/requests/compute/get_datacenter.rb +4 -6
  80. data/lib/fog/profitbricks/requests/compute/get_firewall_rule.rb +8 -11
  81. data/lib/fog/profitbricks/requests/compute/get_flavor.rb +9 -9
  82. data/lib/fog/profitbricks/requests/compute/get_image.rb +7 -9
  83. data/lib/fog/profitbricks/requests/compute/get_ip_block.rb +8 -10
  84. data/lib/fog/profitbricks/requests/compute/get_lan.rb +7 -10
  85. data/lib/fog/profitbricks/requests/compute/get_load_balanced_nic.rb +16 -12
  86. data/lib/fog/profitbricks/requests/compute/get_load_balancer.rb +7 -9
  87. data/lib/fog/profitbricks/requests/compute/get_location.rb +7 -9
  88. data/lib/fog/profitbricks/requests/compute/get_nic.rb +8 -11
  89. data/lib/fog/profitbricks/requests/compute/get_request.rb +55 -57
  90. data/lib/fog/profitbricks/requests/compute/get_request_status.rb +44 -46
  91. data/lib/fog/profitbricks/requests/compute/get_server.rb +7 -10
  92. data/lib/fog/profitbricks/requests/compute/get_snapshot.rb +7 -9
  93. data/lib/fog/profitbricks/requests/compute/get_volume.rb +7 -9
  94. data/lib/fog/profitbricks/requests/compute/list_attached_cdroms.rb +8 -8
  95. data/lib/fog/profitbricks/requests/compute/list_attached_volumes.rb +18 -8
  96. data/lib/fog/profitbricks/requests/compute/reboot_server.rb +7 -11
  97. data/lib/fog/profitbricks/requests/compute/remove_nic_association.rb +9 -11
  98. data/lib/fog/profitbricks/requests/compute/restore_volume_snapshot.rb +15 -17
  99. data/lib/fog/profitbricks/requests/compute/start_server.rb +7 -11
  100. data/lib/fog/profitbricks/requests/compute/stop_server.rb +7 -11
  101. data/lib/fog/profitbricks/requests/compute/update_datacenter.rb +20 -15
  102. data/lib/fog/profitbricks/requests/compute/update_firewall_rule.rb +9 -11
  103. data/lib/fog/profitbricks/requests/compute/update_image.rb +15 -15
  104. data/lib/fog/profitbricks/requests/compute/update_lan.rb +6 -8
  105. data/lib/fog/profitbricks/requests/compute/update_load_balancer.rb +10 -12
  106. data/lib/fog/profitbricks/requests/compute/update_nic.rb +10 -12
  107. data/lib/fog/profitbricks/requests/compute/update_server.rb +10 -13
  108. data/lib/fog/profitbricks/requests/compute/update_snapshot.rb +10 -13
  109. data/lib/fog/profitbricks/requests/compute/update_volume.rb +10 -13
  110. data/lib/fog/profitbricks/version.rb +1 -1
  111. data/spec/minitest_helper.rb +1 -3
  112. data/tests/helpers/formats_helper.rb +8 -8
  113. data/tests/profitbricks/models/compute/compute_tests.rb +529 -0
  114. data/tests/profitbricks/requests/compute/composite_create_tests.rb +16 -83
  115. data/tests/profitbricks/requests/compute/flavor_tests.rb +1 -4
  116. data/tests/profitbricks/requests/compute/location_tests.rb +14 -17
  117. data/tests/profitbricks/requests/compute/nic_tests.rb +60 -70
  118. data/tests/profitbricks/requests/compute/request_tests.rb +1 -3
  119. data/tests/profitbricks/requests/compute/server_tests.rb +163 -161
  120. metadata +5 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: da98864bbc8f591efae223f144a400046870c7fb
4
- data.tar.gz: 392b05d4ae791fc4f06ecd199a137f82e96824db
3
+ metadata.gz: 6db38014892bf2bdce49625f871aec559f4d8f24
4
+ data.tar.gz: 2fb1020757ff1989716c6542a579a84d7205dcd5
5
5
  SHA512:
6
- metadata.gz: 0fcb8d3b8754800884dc37c6fdea7a2dbef8ee8f37656f6e4441203ed1eb720435a0ef37f46af7ab5634c77c403b809f0eb4d6754686463c525c44b4f9bf7383
7
- data.tar.gz: 0506d6d67589b01003818ef527e14a7ae76d5ebcd792e33529349fdc7979c4da6f353e7f90b5e16d94424620198a48760bed58afcdea53d9cb71814ccb77b5bb
6
+ metadata.gz: 5d7a53c0ca044dffc906058619d7b107429aedee43fac6b178c3a5bf44ab5f93bf4380947fa2020820c77b912ce993caefdda090bb100c81720f0e0e477c335f
7
+ data.tar.gz: fdc7e4267399855ad2924c148edcc0a9aa695d82a7c025a9d3978034830b1cc00c1086fcd57fec180e81e9f03335e8348006a05600c149366b5222160318144f
@@ -19,3 +19,6 @@ Style/SignalException:
19
19
  Style/StringLiterals:
20
20
  Enabled: false
21
21
  # EnforcedStyle: double_quotes
22
+
23
+ Style/IndentationWidth:
24
+ Width: 2
@@ -1,5 +1,8 @@
1
1
  language: ruby
2
2
 
3
+ before_install:
4
+ - gem update bundler
5
+
3
6
  script: bundle exec rake travis
4
7
 
5
8
  matrix:
@@ -13,13 +16,17 @@ matrix:
13
16
  gemfile: gemfiles/Gemfile.1.9.2+
14
17
  env: COVERAGE=true
15
18
  - rvm: 2.0.0
16
- gemfile: gemfiles/Gemfile.1.9.2+
19
+ gemfile: Gemfile
17
20
  env: COVERAGE=true
18
21
  - rvm: 2.1.1
19
- gemfile: gemfiles/Gemfile.1.9.2+
22
+ gemfile: Gemfile
23
+ env: COVERAGE=true
24
+ - rvm: 2.2.0
25
+ gemfile: Gemfile
26
+ env: COVERAGE=true
27
+ - rvm: 2.3.0
28
+ gemfile: Gemfile
20
29
  env: COVERAGE=true
21
- - rvm: ree
22
- gemfile: gemfiles/Gemfile.1.8.7
23
30
  - rvm: jruby
24
31
  gemfile: gemfiles/Gemfile.1.9.2+
25
32
  env: COVERAGE=true
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Fog::profitbricks
2
2
 
3
- ![Gem Version](https://badge.fury.io/rb/fog-profitbricks.svg) [![Build Status](https://travis-ci.org/fog/fog-profitbricks.svg?branch=master)](https://travis-ci.org/fog/fog-profitbricks) [![Dependency Status](https://gemnasium.com/fog/fog-profitbricks.svg)](https://gemnasium.com/fog/fog-profitbricks) [![Coverage Status](https://img.shields.io/coveralls/fog/fog-profitbricks.svg)](https://coveralls.io/r/fog/fog-profitbricks?branch=master) [![Code Climate](https://codeclimate.com/github/fog/fog-profitbricks.png)](https://codeclimate.com/github/fog/fog-profitbricks)
3
+ ![Gem Version](https://badge.fury.io/rb/fog-profitbricks.svg) [![Build Status](https://travis-ci.org/fog/fog-profitbricks.svg?branch=master)](https://travis-ci.org/fog/fog-profitbricks) [![Dependency Status](https://gemnasium.com/fog/fog-profitbricks.svg)](https://gemnasium.com/fog/fog-profitbricks) [![Coverage Status](https://img.shields.io/coveralls/fog/fog-profitbricks.svg)](https://coveralls.io/r/fog/fog-profitbricks?branch=master) [![Code Climate](https://codeclimate.com/github/fog/fog-profitbricks/badges/gpa.svg)](https://codeclimate.com/github/fog/fog-profitbricks)
4
4
 
5
5
  Module for the 'fog' gem to support ProfitBricks Cloud API.
6
6
 
@@ -96,7 +96,7 @@ Module for the 'fog' gem to support ProfitBricks Cloud API.
96
96
 
97
97
  Before you begin, you will need to have signed up for a ProfitBricks account. The credentials you create during sign-up will be used to authenticate against the API.
98
98
 
99
- For more information on ProfitBricks REST API, visit the [API documentation](https://devops.profitbricks.com/api/cloud/v2/) page.
99
+ For more information on ProfitBricks REST API, visit the [API documentation](https://devops.profitbricks.com/api/cloud/v3/) page.
100
100
 
101
101
  ### Installation
102
102
 
@@ -638,10 +638,11 @@ The following table describes the request arguments:
638
638
  | image | string | The image or snapshot ID. | Yes* |
639
639
  | type | string | The volume type, HDD or SSD. | Yes |
640
640
  | licenceType | string | The licence type of the volume. Options: LINUX, WINDOWS, UNKNOWN, OTHER | Yes* |
641
- | imagePassword | string | One-time password is set on the Image for the appropriate account. This field may only be set in creation requests. When reading, it always returns null. Password has to contain 8-50 characters. Only these characters are allowed: [abcdefghjkmnpqrstuvxABCDEFGHJKLMNPQRSTUVX23456789] | No |
642
- | sshKeys | string | SSH keys to allow access to the volume via SSH | No |
641
+ | imagePassword | string | One-time password is set on the Image for the appropriate account. This field may only be set in creation requests. When reading, it always returns null. Password has to contain 8-50 characters. Only these characters are allowed: [abcdefghjkmnpqrstuvxABCDEFGHJKLMNPQRSTUVX23456789] | Yes* |
642
+ | sshKeys | string | SSH keys to allow access to the volume via SSH | Yes* |
643
+ | availabilityZone | string | The storage availability zone assigned to the volume. Valid values: AUTO, ZONE_1, ZONE_2, or ZONE_3. This only applies to HDD volumes. Leave blank or set to AUTO when provisioning SSD volumes. | No |
643
644
 
644
- *You will need to provide either the image or the licenceType parameters. licenceType is required, but if image is supplied, it will already have a licenceType set.
645
+ *You will need to provide either the `image` or the `licenceType` parameters. `licenceType` is required, but if `image` is supplied, it is already set and cannot be changed. Similarly either the `imagePassword` or `sshKeys` parameters need to be supplied when creating a volume. We recommend setting a valid value for `imagePassword` even when using `sshKeys` so that it is possible to authenticate using the remote console feature of the DCD.
645
646
 
646
647
  ```
647
648
  volume = compute.volumes.create(:datacenter_id => 'datacenter_id', :size => 5, :type => 'HDD', :licence_type => 'LINUX')
@@ -1212,6 +1213,7 @@ The following table describes the request arguments:
1212
1213
  | ips | string collection | IPs assigned to the NIC. This can be a collection. ||
1213
1214
  | dhcp | bool | Set to FALSE if you wish to disable DHCP on the NIC. Default: TRUE. ||
1214
1215
  | lan | int | The LAN ID the NIC will sit on. If the LAN ID does not exist it will be created. | Yes |
1216
+ | nat | bool | Indicates the private IP address has outbound access to the public internet. ||
1215
1217
  | firewallActive | bool | Once you add a firewall rule this will reflect a true value. ||
1216
1218
  | firewallrules | string collection | A list of firewall rules associated to the NIC represented as a collection. ||
1217
1219
 
@@ -1240,6 +1242,7 @@ The following table describes the request arguments:
1240
1242
  | ips | string collection | IPs assigned to the NIC represented as a collection. ||
1241
1243
  | dhcp | bool | Boolean value that indicates if the NIC is using DHCP or not. ||
1242
1244
  | lan | int | The LAN ID the NIC sits on. ||
1245
+ | nat | bool | Indicates the private IP address has outbound access to the public internet. ||
1243
1246
 
1244
1247
  After retrieving a NIC, either by getting it by id, or as a create response object, you can call the `update` method directly on the object:
1245
1248
 
data/Rakefile CHANGED
@@ -21,4 +21,4 @@ namespace :test do
21
21
  end
22
22
 
23
23
  desc "Default Task"
24
- task :default => [ :test ]
24
+ task :default => [:test]
@@ -7,13 +7,13 @@ compute = Fog::Compute.new(:provider => 'ProfitBricks')
7
7
  # Find the Ubuntu 16 image in North America.
8
8
  image = compute.images.all.find do |image|
9
9
  image.name =~ /Ubuntu-16/ &&
10
- image.location == 'us/las'
10
+ image.location == 'us/las'
11
11
  end
12
12
 
13
13
  # Create datacenter.
14
- datacenter = compute.datacenters.create(name: 'fog-demo',
15
- location: 'us/las',
16
- description: 'fog-profitbricks demo')
14
+ datacenter = compute.datacenters.create(:name => 'fog-demo',
15
+ :location => 'us/las',
16
+ :description => 'fog-profitbricks demo')
17
17
  datacenter.wait_for { ready? }
18
18
 
19
19
  # Rename datacenter.
@@ -21,41 +21,41 @@ datacenter.name = 'rename fog-demo'
21
21
  datacenter.update
22
22
 
23
23
  # Create public LAN.
24
- lan = compute.lans.create(datacenter_id: datacenter.id,
25
- name: 'public',
26
- public: true)
24
+ lan = compute.lans.create(:datacenter_id => datacenter.id,
25
+ :name => 'public',
26
+ :public => true)
27
27
 
28
28
  # Define system volume.
29
29
  system_volume = {
30
- name: 'system',
31
- size: 5,
32
- image: image.id,
33
- image_password: 'volume2016',
34
- ssh_keys: ['ssh-rsa AAAAB3NzaC1yc2EAAAADA=='],
35
- type: 'HDD'
30
+ :name => 'system',
31
+ :size => 5,
32
+ :image => image.id,
33
+ :image_password => 'volume2016',
34
+ :ssh_keys => ['ssh-rsa AAAAB3NzaC1yc2EAAAADA=='],
35
+ :type => 'HDD'
36
36
  }
37
37
 
38
38
  # Define public firewall rules.
39
- fw1 = { name: 'Allow SSH', protocol: 'TCP', port_range_start: 22, port_range_end: 22 }
40
- fw2 = { name: 'Allow Ping', protocol: 'ICMP', icmp_type: 8, icmp_code: 0 }
39
+ fw1 = { :name => 'Allow SSH', :protocol => 'TCP', :port_range_start => 22, :port_range_end => 22 }
40
+ fw2 = { :name => 'Allow Ping', :protocol => 'ICMP', :icmp_type => 8, :icmp_code => 0 }
41
41
 
42
42
  # Define public network interface.
43
43
  public_nic = {
44
- name: 'public',
45
- lan: lan.id,
46
- dhcp: true,
47
- firewall_active: true,
48
- firewall_rules: [fw1, fw2]
44
+ :name => 'public',
45
+ :lan => lan.id,
46
+ :dhcp => true,
47
+ :firewall_active => true,
48
+ :firewall_rules => [fw1, fw2]
49
49
  }
50
50
 
51
51
  # Create a server with the above system volume and public network interface.
52
- server1 = compute.servers.create(datacenter_id: datacenter.id,
53
- name: 'server1',
54
- cores: 1,
55
- cpu_family: 'AMD_OPTERON',
56
- ram: 2048,
57
- volumes: [system_volume],
58
- nics: [public_nic])
52
+ server1 = compute.servers.create(:datacenter_id => datacenter.id,
53
+ :name => 'server1',
54
+ :cores => 1,
55
+ :cpu_family => 'AMD_OPTERON',
56
+ :ram => 2048,
57
+ :volumes => [system_volume],
58
+ :nics => [public_nic])
59
59
  server1.wait_for { ready? }
60
60
 
61
61
  # Change CPU family from AMD_OPTERON to INTEL_XEON.
@@ -64,38 +64,38 @@ server1.cpu_family = 'INTEL_XEON'
64
64
  server1.update
65
65
 
66
66
  # Create data volume.
67
- data_volume = compute.volumes.create(datacenter_id: datacenter.id,
68
- name: 'data',
69
- size: 5,
70
- licence_type: 'OTHER',
71
- type: 'SSD')
67
+ data_volume = compute.volumes.create(:datacenter_id => datacenter.id,
68
+ :name => 'data',
69
+ :size => 5,
70
+ :licence_type => 'OTHER',
71
+ :type => 'SSD')
72
72
  data_volume.wait_for { ready? }
73
73
 
74
74
  # Attach data volume to server1.
75
75
  server1.attach_volume(data_volume.id)
76
76
 
77
77
  # Connect a second network interface to server1.
78
- private_nic = compute.nics.create(datacenter_id: datacenter.id,
79
- server_id: server1.id,
80
- name: 'private',
81
- dhcp: true,
82
- lan: 2)
78
+ private_nic = compute.nics.create(:datacenter_id => datacenter.id,
79
+ :server_id => server1.id,
80
+ :name => 'private',
81
+ :dhcp => true,
82
+ :lan => 2)
83
83
  private_nic.wait_for { ready? }
84
84
 
85
85
  # Create a second server.
86
- server2 = compute.servers.create(datacenter_id: datacenter.id,
87
- name: 'server2',
88
- cores: 1,
89
- cpu_family: 'AMD_OPTERON',
90
- ram: 2048,
91
- volumes: [system_volume])
86
+ server2 = compute.servers.create(:datacenter_id => datacenter.id,
87
+ :name => 'server2',
88
+ :cores => 1,
89
+ :cpu_family => 'AMD_OPTERON',
90
+ :ram => 2048,
91
+ :volumes => [system_volume])
92
92
  server2.wait_for { ready? }
93
93
 
94
94
  # Connect a private network interface to server2 with SSH access.
95
- private_nic = compute.nics.create(datacenter_id: datacenter.id,
96
- server_id: server2.id,
97
- name: 'private',
98
- dhcp: true,
99
- lan: 2,
100
- firewall_rules: [fw1])
95
+ private_nic = compute.nics.create(:datacenter_id => datacenter.id,
96
+ :server_id => server2.id,
97
+ :name => 'private',
98
+ :dhcp => true,
99
+ :lan => 2,
100
+ :firewall_rules => [fw1])
101
101
  private_nic.wait_for { ready? }
@@ -8,9 +8,9 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Fog::ProfitBricks::VERSION
9
9
  spec.authors = ["Ethan Devenport"]
10
10
  spec.email = ["ethand@stackpointcloud.com"]
11
- spec.summary = %q{Module for the 'fog' gem to support ProfitBricks.}
12
- spec.description = %q{This library can be used as a module for 'fog' or as
13
- standalone ProfitBricks provider.}
11
+ spec.summary = "Module for the 'fog' gem to support ProfitBricks."
12
+ spec.description = "This library can be used as a module for 'fog' or as
13
+ standalone ProfitBricks provider."
14
14
  spec.homepage = "https://github.com/fog/fog-profitbricks"
15
15
  spec.license = "MIT"
16
16
 
@@ -27,6 +27,5 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency "shindo", "~> 0.3"
28
28
  spec.add_development_dependency "turn", "~> 0.9"
29
29
  spec.add_development_dependency "pry", "~> 0.10"
30
- spec.add_development_dependency "rubocop", "~> 0" if RUBY_VERSION >= "1.9.3"
31
- spec.add_development_dependency "coveralls", "~> 0" if RUBY_VERSION.to_f >= 1.9
30
+ spec.add_development_dependency "rubocop" if RUBY_VERSION >= "2.0.0"
32
31
  end
@@ -1,5 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ gem 'json', '~> 1.8'
3
4
  gem 'activesupport', '>= 3.0', '< 4'
4
5
  gem 'mime-types', '< 2.0'
5
6
 
@@ -12,11 +12,11 @@ class ProfitBricks < Fog::Bin
12
12
  def [](service)
13
13
  @@connections ||= Hash.new do |hash, key|
14
14
  hash[key] = case key
15
- when :compute
16
- Fog::Logger.warning("ProfitBricks[:compute] is not recommended, use Fog::Compute[:profitbricks] for portability")
17
- Fog::Compute.new(:provider => 'ProfitBricks')
18
- else
19
- raise ArgumentError, "Unrecognized service: #{key.inspect}"
15
+ when :compute
16
+ Fog::Logger.warning("ProfitBricks[:compute] is not recommended, use Fog::Compute[:profitbricks] for portability")
17
+ Fog::Compute.new(:provider => 'ProfitBricks')
18
+ else
19
+ raise ArgumentError, "Unrecognized service: #{key.inspect}"
20
20
  end
21
21
  end
22
22
  @@connections[service]
@@ -1,16 +1,16 @@
1
1
  require "fog/core"
2
2
  require "fog/json"
3
3
 
4
- require File.expand_path('profitbricks/version', __dir__)
4
+ require File.expand_path('../profitbricks/version', __FILE__)
5
5
 
6
6
  module Fog
7
7
  module Compute
8
- autoload :ProfitBricks, File.expand_path('profitbricks/compute', __dir__)
8
+ autoload :ProfitBricks, File.expand_path('../profitbricks/compute', __FILE__)
9
9
  end
10
10
 
11
11
  module Models
12
12
  module ProfitBricks
13
- autoload :Base, File.expand_path('profitbricks/models/base', __dir__)
13
+ autoload :Base, File.expand_path('../profitbricks/models/base', __FILE__)
14
14
  end
15
15
  end
16
16
 
@@ -1,9 +1,9 @@
1
1
  module Fog
2
2
  module Compute
3
3
  class ProfitBricks < Fog::Service
4
- API_VERSION = 'v2'
4
+ API_VERSION = 'v3'.freeze
5
5
 
6
- autoload :Base, File.expand_path('models/base', __dir__)
6
+ autoload :Base, File.expand_path('../models/base', __FILE__)
7
7
 
8
8
  requires :profitbricks_username, :profitbricks_password
9
9
  recognizes :profitbricks_url
@@ -127,38 +127,43 @@ module Fog
127
127
  request :remove_nic_association # associateNicToLoadBalancer
128
128
 
129
129
  class Real
130
- def initialize(options={})
130
+ def initialize(options = {})
131
131
  @profitbricks_username = options[:profitbricks_username]
132
132
  @profitbricks_password = options[:profitbricks_password]
133
133
  @profitbricks_url = options[:profitbricks_url] || "https://api.profitbricks.com"
134
134
 
135
135
  connection_options = options[:connection_options] || {}
136
136
  connection_options[:headers] ||= {}
137
- connection_options[:headers]["User-Agent"] = "#{Fog::Core::Connection.user_agents}"
137
+ connection_options[:headers]["User-Agent"] = Fog::Core::Connection.user_agents.to_s
138
138
  connection_options[:omit_default_port] = true
139
- connection_options[:path_prefix] = "/rest/#{API_VERSION}"
139
+ connection_options[:path_prefix] = "/cloudapi/#{API_VERSION}"
140
140
 
141
141
  @connection = Fog::Core::Connection.new(@profitbricks_url, false, connection_options)
142
142
  end
143
143
 
144
144
  def request(params)
145
145
  params[:headers] ||= {}
146
- params[:headers].merge!("Authorization" => "Basic #{auth_header}")
146
+ params[:headers]["Authorization"] = "Basic #{auth_header}"
147
147
  params[:path_style] = false
148
148
 
149
149
  begin
150
150
  response = @connection.request(params)
151
+
151
152
  rescue Excon::Errors::Unauthorized => error
153
+ Logger.warning('Unauthorized error')
152
154
  raise error, Fog::JSON.decode(error.response.body)['messages']
153
155
  rescue Excon::Errors::HTTPStatusError => error
156
+ Logger.warning('HTTPStatusError error')
154
157
  raise error, Fog::JSON.decode(error.response.body)['messages']
155
158
  rescue Excon::Errors::InternalServerError => error
159
+ Logger.warning('InternalServerError error')
156
160
  raise error, Fog::JSON.decode(error.response.body)['messages']
157
161
  rescue Fog::Errors::NotFound => error
162
+ Logger.warning('NotFound error')
158
163
  raise error, Fog::JSON.decode(error.response.body)['messages']
159
164
  end
160
165
 
161
- unless response.body.empty?
166
+ if response && response.body && !response.body.empty?
162
167
  response.body = Fog::JSON.decode(response.body)
163
168
  response.body['requestId'] = get_request_id(response.headers)
164
169
  end
@@ -168,7 +173,7 @@ module Fog
168
173
  private
169
174
 
170
175
  def auth_header
171
- return Base64.strict_encode64(
176
+ Base64.strict_encode64(
172
177
  "#{@profitbricks_username}:#{@profitbricks_password}"
173
178
  )
174
179
  end
@@ -181,83 +186,83 @@ module Fog
181
186
 
182
187
  class Mock
183
188
  def self.data
184
- dc_1_id = Fog::UUID.uuid
185
- dc_2_id = Fog::UUID.uuid
186
- serv_1_id = Fog::UUID.uuid
187
- vol_1_id = Fog::UUID.uuid
188
- vol_2_id = Fog::UUID.uuid
189
- req_1_id = Fog::UUID.uuid
190
- req_2_id = Fog::UUID.uuid
191
- nic_1_id = Fog::UUID.uuid
192
- nic_2_id = Fog::UUID.uuid
193
- ipb_1_id = Fog::UUID.uuid
194
- ipb_2_id = Fog::UUID.uuid
195
- fwr_1_id = Fog::UUID.uuid
196
- fwr_2_id = Fog::UUID.uuid
197
- lb_1_id = Fog::UUID.uuid
198
- lb_2_id = Fog::UUID.uuid
189
+ dc1_id = Fog::UUID.uuid
190
+ dc2_id = Fog::UUID.uuid
191
+ serv1_id = Fog::UUID.uuid
192
+ vol1_id = Fog::UUID.uuid
193
+ vol2_id = Fog::UUID.uuid
194
+ req1_id = Fog::UUID.uuid
195
+ req2_id = Fog::UUID.uuid
196
+ nic1_id = Fog::UUID.uuid
197
+ nic2_id = Fog::UUID.uuid
198
+ ipb1_id = Fog::UUID.uuid
199
+ ipb2_id = Fog::UUID.uuid
200
+ fwr1_id = Fog::UUID.uuid
201
+ fwr2_id = Fog::UUID.uuid
202
+ lb1_id = Fog::UUID.uuid
203
+ lb2_id = Fog::UUID.uuid
199
204
 
200
205
  @data ||= Hash.new do |hash, key|
201
206
  hash[key] = {
202
- :datacenters => {
207
+ :datacenters => {
203
208
  "id" => "datacenters",
204
209
  "type" => "collection",
205
210
  "href" => "https://api.profitbricks.com/rest/v2/datacenters",
206
211
  "items" =>
207
212
  [
208
213
  {
209
- 'id' => dc_1_id,
214
+ 'id' => dc1_id,
210
215
  'type' => 'datacenter',
211
- 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}",
216
+ 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc1_id}",
212
217
  'metadata' => {
213
- 'createdDate' => '2016-07-31T15:41:27Z',
214
- 'createdBy' => 'test@stackpointcloud.com',
215
- 'etag' => '5b91832ee85a758568d4523a86bd8702',
216
- 'lastModifiedDate' => '2016-07-31T15:41:27Z',
217
- 'lastModifiedBy' => 'test@stackpointcloud.com',
218
- 'state' => 'AVAILABLE'
218
+ 'createdDate' => '2016-07-31T15:41:27Z',
219
+ 'createdBy' => 'test@stackpointcloud.com',
220
+ 'etag' => '5b91832ee85a758568d4523a86bd8702',
221
+ 'lastModifiedDate' => '2016-07-31T15:41:27Z',
222
+ 'lastModifiedBy' => 'test@stackpointcloud.com',
223
+ 'state' => 'AVAILABLE'
219
224
  },
220
225
  'properties' => {
221
- 'name' => 'dc_1',
222
- 'description' => 'testing fog rest implementation',
223
- 'location' => 'us/las',
224
- 'version' => 1,
225
- 'features' => ["SSD", "MULTIPLE_CPU"]
226
+ 'name' => 'dc_1',
227
+ 'description' => 'testing fog rest implementation',
228
+ 'location' => 'us/las',
229
+ 'version' => 1,
230
+ 'features' => %w(SSD MULTIPLE_CPU)
226
231
  }
227
232
  },
228
233
  {
229
- 'id' => dc_2_id,
234
+ 'id' => dc2_id,
230
235
  'type' => 'datacenter',
231
- 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc_2_id}",
236
+ 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc2_id}",
232
237
  'metadata' => {
233
- 'createdDate' => '2016-07-31T15:41:27Z',
234
- 'createdBy' => 'test@stackpointcloud.com',
235
- 'etag' => '5b91832ee85a758568d4523a86bd8702',
236
- 'lastModifiedDate' => '2016-07-31T15:41:27Z',
237
- 'lastModifiedBy' => 'test@stackpointcloud.com',
238
- 'state' => 'AVAILABLE'
238
+ 'createdDate' => '2016-07-31T15:41:27Z',
239
+ 'createdBy' => 'test@stackpointcloud.com',
240
+ 'etag' => '5b91832ee85a758568d4523a86bd8702',
241
+ 'lastModifiedDate' => '2016-07-31T15:41:27Z',
242
+ 'lastModifiedBy' => 'test@stackpointcloud.com',
243
+ 'state' => 'AVAILABLE'
239
244
  },
240
- 'properties' =>{
241
- 'name' => 'dc_2',
242
- 'description' => 'testing fog rest implementation',
243
- 'location' => 'de/fkb',
244
- 'version' => 1,
245
- 'features' => ["SSD", "MULTIPLE_CPU"]
245
+ 'properties' => {
246
+ 'name' => 'dc_2',
247
+ 'description' => 'testing fog rest implementation',
248
+ 'location' => 'de/fkb',
249
+ 'version' => 1,
250
+ 'features' => %w(SSD MULTIPLE_CPU)
246
251
  }
247
252
  }
248
253
  ]
249
254
  },
250
- :servers => {
255
+ :servers => {
251
256
  'id' => 'servers',
252
257
  'type' => 'collection',
253
- "href" => "https://api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/servers",
258
+ "href" => "https://api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/servers",
254
259
  'items' =>
255
260
  [
256
261
  {
257
- 'id' => serv_1_id,
262
+ 'id' => serv1_id,
258
263
  'type' => 'server',
259
- 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/servers/#{serv_1_id}",
260
- 'metadata' => {
264
+ 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/servers/#{serv1_id}",
265
+ 'metadata' => {
261
266
  'createdDate' => '2014-10-20T21:20:46Z',
262
267
  'createdBy' => 'test@stackpointcloud.com',
263
268
  'etag' => '0018832d7a7ba455db74ac41ae9f11fe',
@@ -265,7 +270,7 @@ module Fog
265
270
  'lastModifiedBy' => 'test@stackpointcloud.com',
266
271
  'state' => 'AVAILABLE'
267
272
  },
268
- 'properties' => {
273
+ 'properties' => {
269
274
  'name' => 'FogTestServer_1',
270
275
  'cores' => 1,
271
276
  'ram' => 1024,
@@ -274,7 +279,7 @@ module Fog
274
279
  'bootVolume' => {
275
280
  'id' => 'c04a2198-7e60-4bc0-b869-6e9c9dbcb8e1',
276
281
  'type' => 'volume',
277
- 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/volumes/c04a2198-7e60-4bc0-b869-6e9c9dbcb8e1",
282
+ 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/volumes/c04a2198-7e60-4bc0-b869-6e9c9dbcb8e1",
278
283
  'metadata' => {
279
284
  'createdDate' => '2014-10-20T21:20:46Z',
280
285
  'createdBy' => 'test@stackpointcloud.com',
@@ -283,7 +288,7 @@ module Fog
283
288
  'lastModifiedBy' => 'test@stackpointcloud.com',
284
289
  'state' => 'AVAILABLE'
285
290
  },
286
- 'properties' => {
291
+ 'properties' => {
287
292
  'name' => 'Storage',
288
293
  'type' => 'HDD',
289
294
  'size' => 50,
@@ -305,23 +310,23 @@ module Fog
305
310
  },
306
311
  'cpuFamily' => 'AMD_OPTERON'
307
312
  },
308
- 'entities' => {
313
+ 'entities' => {
309
314
  'cdroms' => {
310
- 'id' => "#{serv_1_id}/cdroms",
315
+ 'id' => "#{serv1_id}/cdroms",
311
316
  'type' => 'collection',
312
- 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/servers/#{serv_1_id}/cdroms",
313
- 'items' => [ ]
317
+ 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/servers/#{serv1_id}/cdroms",
318
+ 'items' => []
314
319
  },
315
320
  'volumes' => {
316
- 'id' => "#{serv_1_id}/volumes",
321
+ 'id' => "#{serv1_id}/volumes",
317
322
  'type' => 'collection',
318
- 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/servers/#{serv_1_id}/volumes",
323
+ 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/servers/#{serv1_id}/volumes",
319
324
  'items' =>
320
325
  [
321
326
  {
322
327
  'id' => 'c04a2198-7e60-4bc0-b869-6e9c9dbcb8e1',
323
328
  'type' => 'volume',
324
- 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/volumes/c04a2198-7e60-4bc0-b869-6e9c9dbcb8e1",
329
+ 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/volumes/c04a2198-7e60-4bc0-b869-6e9c9dbcb8e1",
325
330
  'metadata' => {
326
331
  'createdDate' => '2014-10-20T21:20:46Z',
327
332
  'createdBy' => 'test@stackpointcloud.com',
@@ -330,7 +335,7 @@ module Fog
330
335
  'lastModifiedBy' => 'test@stackpointcloud.com',
331
336
  'state' => 'AVAILABLE'
332
337
  },
333
- 'properties' => {
338
+ 'properties' => {
334
339
  'name' => 'Storage',
335
340
  'type' => 'HDD',
336
341
  'size' => 50,
@@ -353,7 +358,7 @@ module Fog
353
358
  {
354
359
  'id' => '5c4d37ca-d620-4546-8b24-f92e3c608c2c',
355
360
  'type' => 'volume',
356
- 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/volumes/5c4d37ca-d620-4546-8b24-f92e3c608c2c",
361
+ 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/volumes/5c4d37ca-d620-4546-8b24-f92e3c608c2c",
357
362
  'metadata' => {
358
363
  'createdDate' => '2015-03-18T21:31:10Z',
359
364
  'createdBy' => 'test@stackpointcloud.com',
@@ -362,7 +367,7 @@ module Fog
362
367
  'lastModifiedBy' => 'test@stackpointcloud.com',
363
368
  'state' => 'AVAILABLE'
364
369
  },
365
- 'properties' => {
370
+ 'properties' => {
366
371
  'name' => 'Docker Registry Volume',
367
372
  'type' => 'HDD',
368
373
  'size' => 50,
@@ -384,15 +389,15 @@ module Fog
384
389
  ]
385
390
  },
386
391
  'nics' => {
387
- 'id' => "#{serv_1_id}/nics",
392
+ 'id' => "#{serv1_id}/nics",
388
393
  'type' => 'collection',
389
- 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/servers/#{serv_1_id}/nics",
394
+ 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/servers/#{serv1_id}/nics",
390
395
  'items' =>
391
396
  [
392
397
  {
393
398
  'id' => '01ea3bd9-047c-4941-85cf-ed6b7a2d1d7d',
394
399
  'type' => 'nic',
395
- 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/servers/#{serv_1_id}/nics/01ea3bd9-047c-4941-85cf-ed6b7a2d1d7d",
400
+ 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/servers/#{serv1_id}/nics/01ea3bd9-047c-4941-85cf-ed6b7a2d1d7d",
396
401
  'metadata' => {
397
402
  'createdDate' => '2015-02-09T22:46:38Z',
398
403
  'createdBy' => 'test@stackpointcloud.com',
@@ -401,30 +406,30 @@ module Fog
401
406
  'lastModifiedBy' => 'test@stackpointcloud.com',
402
407
  'state' => 'AVAILABLE'
403
408
  },
404
- 'properties' => {
409
+ 'properties' => {
405
410
  'mac' => '00:02:94:9e:f4:b0',
406
- 'ips' => [ '210.94.35.77' ],
411
+ 'ips' => ['210.94.35.77'],
407
412
  'dhcp' => 'true',
408
413
  'lan' => 1,
409
414
  'firewallActive' => 'false'
410
415
  },
411
- 'entities' => {
416
+ 'entities' => {
412
417
  'firewallrules' => {
413
418
  'id' => '01ea3bd9-047c-4941-85cf-ed6b7a2d1d7d/firewallrules',
414
419
  'type' => 'collection',
415
- 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/servers/664f0f1c-7384-462b-8f0c-cfc4c3f6e2a3/nics/01ea3bd9-047c-4941-85cf-ed6b7a2d1d7d/firewallrules",
416
- 'items' => [ ]
420
+ 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/servers/664f0f1c-7384-462b-8f0c-cfc4c3f6e2a3/nics/01ea3bd9-047c-4941-85cf-ed6b7a2d1d7d/firewallrules",
421
+ 'items' => []
417
422
  }
418
423
  }
419
424
  }
420
425
  ]
421
426
  }
422
427
  },
423
- 'datacenter_id' => dc_1_id
428
+ 'datacenter_id' => dc1_id
424
429
  }
425
430
  ]
426
431
  },
427
- :locations => {
432
+ :locations => {
428
433
  "id" => "locations",
429
434
  "type" => "collection",
430
435
  "href" => "https://api.profitbricks.com/rest/v2/locations",
@@ -436,7 +441,7 @@ module Fog
436
441
  'href' => 'https://api.profitbricks.com/rest/v2/locations/de/fkb',
437
442
  'properties' => {
438
443
  'name' => 'karlsruhe',
439
- 'features' => [ "SSD", "MULTIPLE_CPU" ]
444
+ 'features' => %w(SSD MULTIPLE_CPU)
440
445
  }
441
446
  },
442
447
  {
@@ -445,7 +450,7 @@ module Fog
445
450
  'href' => 'https://api.profitbricks.com/rest/v2/locations/de/fra',
446
451
  'properties' => {
447
452
  'name' => 'frankfurt',
448
- 'features' => [ "SSD", "MULTIPLE_CPU" ]
453
+ 'features' => %w(SSD MULTIPLE_CPU)
449
454
  }
450
455
  },
451
456
  {
@@ -454,7 +459,7 @@ module Fog
454
459
  'href' => 'https://api.profitbricks.com/rest/v2/locations/us/las',
455
460
  'properties' => {
456
461
  'name' => 'lasvegas',
457
- 'features' => [ "SSD", "MULTIPLE_CPU" ]
462
+ 'features' => %w(SSD MULTIPLE_CPU)
458
463
  }
459
464
  }
460
465
  ]
@@ -478,7 +483,7 @@ module Fog
478
483
  'lastModifiedBy' => 'System',
479
484
  'state' => 'AVAILABLE'
480
485
  },
481
- 'properties' => {
486
+ 'properties' => {
482
487
  'name' => 'CentOS-6.8-x86_64-netinstall.iso',
483
488
  'description' => '',
484
489
  'location' => 'us/las',
@@ -510,7 +515,7 @@ module Fog
510
515
  'lastModifiedBy' => 'System',
511
516
  'state' => 'AVAILABLE'
512
517
  },
513
- 'properties' => {
518
+ 'properties' => {
514
519
  'name' => 'Microsoft-SQL-2012-Full-trial-english.iso',
515
520
  'description' => '',
516
521
  'location' => 'us/las',
@@ -535,30 +540,30 @@ module Fog
535
540
  :flavors =>
536
541
  [
537
542
  {
538
- 'flavorId' => Fog::UUID.uuid,
539
- 'flavorName' => 'Micro',
540
- 'ram' => 1024,
541
- 'disk' => 50,
542
- 'cores' => 1
543
+ 'flavorId' => Fog::UUID.uuid,
544
+ 'flavorName' => 'Micro',
545
+ 'ram' => 1024,
546
+ 'disk' => 50,
547
+ 'cores' => 1
543
548
  },
544
549
  {
545
- 'flavorId' => Fog::UUID.uuid,
546
- 'flavorName' => 'Small',
547
- 'ram' => 2048,
548
- 'disk' => 50,
549
- 'cores' => 1
550
+ 'flavorId' => Fog::UUID.uuid,
551
+ 'flavorName' => 'Small',
552
+ 'ram' => 2048,
553
+ 'disk' => 50,
554
+ 'cores' => 1
550
555
  }
551
556
  ],
552
557
  :volumes => {
553
- "id" => "#{dc_1_id}/volumes",
558
+ "id" => "#{dc1_id}/volumes",
554
559
  "type" => 'collection',
555
- "href" => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/volumes",
560
+ "href" => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/volumes",
556
561
  "items" =>
557
562
  [
558
563
  {
559
- 'id' => vol_1_id,
564
+ 'id' => vol1_id,
560
565
  'type' => 'volume',
561
- 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/volumes/#{vol_1_id}",
566
+ 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/volumes/#{vol1_id}",
562
567
  'metadata' => {
563
568
  'createdDate' => '2015-03-18T19:00:51Z',
564
569
  'createdBy' => 'test@stackpointcloud.com',
@@ -586,12 +591,12 @@ module Fog
586
591
  'discScsiHotUnplug' => 'false',
587
592
  'deviceNumber' => 1
588
593
  },
589
- 'datacenter_id' => dc_1_id
594
+ 'datacenter_id' => dc1_id
590
595
  },
591
596
  {
592
- 'id' => vol_2_id,
597
+ 'id' => vol2_id,
593
598
  'type' => 'volume',
594
- 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/volumes/#{vol_2_id}",
599
+ 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/volumes/#{vol2_id}",
595
600
  'metadata' => {
596
601
  'createdDate' => '2015-03-18T21:31:10Z',
597
602
  'createdBy' => 'test@stackpointcloud.com',
@@ -600,7 +605,7 @@ module Fog
600
605
  'lastModifiedBy' => 'test@stackpointcloud.com',
601
606
  'state' => 'AVAILABLE'
602
607
  },
603
- 'properties' => {
608
+ 'properties' => {
604
609
  'name' => 'Docker Registry Volume',
605
610
  'type' => 'HDD',
606
611
  'size' => 50,
@@ -618,20 +623,20 @@ module Fog
618
623
  'discScsiHotUnplug' => 'false',
619
624
  'deviceNumber' => 2
620
625
  },
621
- 'datacenter_id' => dc_1_id
626
+ 'datacenter_id' => dc1_id
622
627
  }
623
628
  ]
624
629
  },
625
630
  :lans => {
626
- 'id' => "#{dc_1_id}/lans",
631
+ 'id' => "#{dc1_id}/lans",
627
632
  'type' => 'collection',
628
- 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/lans",
633
+ 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/lans",
629
634
  'items' =>
630
635
  [
631
636
  {
632
637
  'id' => '9',
633
638
  'type' => 'nic',
634
- 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/lans/9",
639
+ 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/lans/9",
635
640
  'metadata' => {
636
641
  'createdDate' => '2015-03-18T19:00:51Z',
637
642
  'createdBy' => 'test@stackpointcloud.com',
@@ -640,32 +645,32 @@ module Fog
640
645
  'lastModifiedBy' => 'test@stackpointcloud.com',
641
646
  'state' => 'AVAILABLE'
642
647
  },
643
- 'properties' => {
648
+ 'properties' => {
644
649
  'name' => 'FogTestLAN_1',
645
650
  'public' => 'true'
646
651
  },
647
- 'entities' => {
652
+ 'entities' => {
648
653
  'nics' => {
649
654
  'id' => '9/nics',
650
655
  'type' => 'collection',
651
- 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/lans/9/nics",
652
- 'items' => [ ]
656
+ 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/lans/9/nics",
657
+ 'items' => []
653
658
  }
654
659
  },
655
- 'datacenter_id' => dc_1_id
660
+ 'datacenter_id' => dc1_id
656
661
  }
657
662
  ]
658
663
  },
659
664
  :nics => {
660
- 'id' => "#{serv_1_id}/nics",
665
+ 'id' => "#{serv1_id}/nics",
661
666
  'type' => 'collection',
662
- 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/servers/#{serv_1_id}/nics",
667
+ 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/servers/#{serv1_id}/nics",
663
668
  'items' =>
664
669
  [
665
670
  {
666
- 'id' => nic_1_id,
671
+ 'id' => nic1_id,
667
672
  'type' => 'nic',
668
- 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/servers/#{serv_1_id}/nics/#{nic_1_id}",
673
+ 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/servers/#{serv1_id}/nics/#{nic1_id}",
669
674
  'metadata' => {
670
675
  'createdDate' => '2015-03-18T19:00:51Z',
671
676
  'createdBy' => 'test@stackpointcloud.com',
@@ -674,28 +679,28 @@ module Fog
674
679
  'lastModifiedBy' => 'test@stackpointcloud.com',
675
680
  'state' => 'AVAILABLE'
676
681
  },
677
- 'properties' => {
682
+ 'properties' => {
678
683
  'name' => 'FogTestNIC_1',
679
684
  'mac' => '02:01:36:5f:09:da',
680
- 'ips' => [ '10.9.194.12'],
685
+ 'ips' => ['10.9.194.12'],
681
686
  'dhcp' => 'true',
682
687
  'lan' => 2,
683
688
  'firewallActive' => 'false'
684
689
  },
685
- 'entities' => {
690
+ 'entities' => {
686
691
  'firewallrules' => {
687
- 'id' => "#{nic_1_id}/firewallrules",
692
+ 'id' => "#{nic1_id}/firewallrules",
688
693
  'type' => 'collection',
689
- 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/servers/#{serv_1_id}/nics/#{nic_1_id}/firewallrules",
690
- 'items' => [ ]
694
+ 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/servers/#{serv1_id}/nics/#{nic1_id}/firewallrules",
695
+ 'items' => []
691
696
  }
692
697
  },
693
- 'datacenter_id' => dc_1_id
698
+ 'datacenter_id' => dc1_id
694
699
  },
695
700
  {
696
- 'id' => nic_2_id,
701
+ 'id' => nic2_id,
697
702
  'type' => 'nic',
698
- 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/servers/#{serv_1_id}/nics/#{nic_2_id}",
703
+ 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/servers/#{serv1_id}/nics/#{nic2_id}",
699
704
  'metadata' => {
700
705
  'createdDate' => '2015-03-18T19:00:51Z',
701
706
  'createdBy' => 'test@stackpointcloud.com',
@@ -704,23 +709,23 @@ module Fog
704
709
  'lastModifiedBy' => 'test@stackpointcloud.com',
705
710
  'state' => 'AVAILABLE'
706
711
  },
707
- 'properties' => {
712
+ 'properties' => {
708
713
  'name' => 'FogTestNIC_2',
709
714
  'mac' => '03:01:60:bf:d4:8a',
710
- 'ips' => [ '192.96.159.188' ],
715
+ 'ips' => ['192.96.159.188'],
711
716
  'dhcp' => 'true',
712
717
  'lan' => 1,
713
718
  'firewallActive' => 'false'
714
719
  },
715
- 'entities'=> {
716
- 'firewallrules'=> {
717
- 'id'=> 'cf6d01d3-295d-48bd-8d07-568cce63cbbc/firewallrules',
718
- 'type'=> 'collection',
719
- 'href'=> "https://api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/servers/#{serv_1_id}/nics/#{nic_2_id}/firewallrules",
720
- 'items'=> [ ]
720
+ 'entities' => {
721
+ 'firewallrules' => {
722
+ 'id' => 'cf6d01d3-295d-48bd-8d07-568cce63cbbc/firewallrules',
723
+ 'type' => 'collection',
724
+ 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/servers/#{serv1_id}/nics/#{nic2_id}/firewallrules",
725
+ 'items' => []
721
726
  }
722
727
  },
723
- 'datacenter_id' => dc_1_id
728
+ 'datacenter_id' => dc1_id
724
729
  }
725
730
  ]
726
731
  },
@@ -762,24 +767,24 @@ module Fog
762
767
  }
763
768
  ]
764
769
  },
765
- :requests => {
770
+ :requests => {
766
771
  'id' => 'requests',
767
772
  'type' => 'collection',
768
773
  'href' => 'https=>//api.profitbricks.com/rest/v2/requests',
769
774
  'items' =>
770
775
  [
771
776
  {
772
- 'id' => req_1_id,
777
+ 'id' => req1_id,
773
778
  'type' => 'request',
774
- 'href' => "https=>//api.profitbricks.com/rest/v2/requests/#{req_1_id}",
779
+ 'href' => "https=>//api.profitbricks.com/rest/v2/requests/#{req1_id}",
775
780
  'metadata' => {
776
781
  'createdDate' => '2016-08-07T23:32:17Z',
777
782
  'createdBy' => 'test@stackpointcloud.com',
778
783
  'etag' => '37a6259cc0c1dae299a7866489dff0bd',
779
784
  'requestStatus' => {
780
- 'id' => "#{req_1_id}/status",
785
+ 'id' => "#{req1_id}/status",
781
786
  'type' => 'request-status',
782
- 'href' => "https://api.profitbricks.com/rest/v2/requests/#{req_1_id}/status"
787
+ 'href' => "https://api.profitbricks.com/rest/v2/requests/#{req1_id}/status"
783
788
  }
784
789
  },
785
790
  'properties' => {
@@ -796,21 +801,21 @@ module Fog
796
801
  'x-forwarded-server' => 'my.profitbricks.com'
797
802
  },
798
803
  'body' => '{\'snapshotId\': \'3d52b13d-bec4-49de-ad05-fd2f8c687be6\'}',
799
- 'url' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/volumes/#{vol_1_id}/restore-snapshot"
804
+ 'url' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/volumes/#{vol1_id}/restore-snapshot"
800
805
  }
801
806
  },
802
807
  {
803
- 'id' => req_2_id,
808
+ 'id' => req2_id,
804
809
  'type' => 'request',
805
- 'href' => "https=>//api.profitbricks.com/rest/v2/requests/#{req_2_id}",
810
+ 'href' => "https=>//api.profitbricks.com/rest/v2/requests/#{req2_id}",
806
811
  'metadata' => {
807
812
  'createdDate' => '2016-08-07T23:32:17Z',
808
813
  'createdBy' => 'test@stackpointcloud.com',
809
814
  'etag' => '37a6259cc0c1dae299a7866489dff0bd',
810
815
  'requestStatus' => {
811
- 'id' => "#{req_2_id}/status",
816
+ 'id' => "#{req2_id}/status",
812
817
  'type' => 'request-status',
813
- 'href' => "https://api.profitbricks.com/rest/v2/requests/#{req_2_id}/status"
818
+ 'href' => "https://api.profitbricks.com/rest/v2/requests/#{req2_id}/status"
814
819
  }
815
820
  },
816
821
  'properties' => {
@@ -827,15 +832,15 @@ module Fog
827
832
  'x-forwarded-server' => 'my.profitbricks.com'
828
833
  },
829
834
  'body' => '{\'snapshotId\': \'3d52b13d-bec4-49de-ad05-fd2f8c687be6\'}',
830
- 'url' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/volumes/#{vol_2_id}/restore-snapshot"
835
+ 'url' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/volumes/#{vol2_id}/restore-snapshot"
831
836
  }
832
837
  }
833
838
  ]
834
839
  },
835
840
  :request_status => {
836
- 'id' => "#{req_1_id}/status",
841
+ 'id' => "#{req1_id}/status",
837
842
  'type' => 'request-status',
838
- 'href' => "https=>//api.profitbricks.com/rest/v2/requests/#{req_1_id}/status",
843
+ 'href' => "https=>//api.profitbricks.com/rest/v2/requests/#{req1_id}/status",
839
844
  'metadata' => {
840
845
  'status' => 'DONE',
841
846
  'message' => 'Request has been successfully executed',
@@ -860,10 +865,10 @@ module Fog
860
865
  'items' =>
861
866
  [
862
867
  {
863
- 'id' => ipb_1_id,
868
+ 'id' => ipb1_id,
864
869
  'type' => 'ipblock',
865
- 'href' => "https://api.profitbricks.com/rest/v2/ipblocks/#{ipb_1_id}",
866
- 'metadata' => {
870
+ 'href' => "https://api.profitbricks.com/rest/v2/ipblocks/#{ipb1_id}",
871
+ 'metadata' => {
867
872
  'createdDate' => '2016-07-31T15:41:27Z',
868
873
  'createdBy' => 'test@stackpointcloud.com',
869
874
  'etag' => '5b91832ee85a758568d4523a86bd8702',
@@ -875,14 +880,14 @@ module Fog
875
880
  'ips' => ["111.111.111.111", "222.222.222.222"],
876
881
  'location' => 'us/las',
877
882
  'size' => 2,
878
- 'name' => 'Fog test IP Block 1'
883
+ 'name' => 'Fog test IP Block 1'
879
884
  }
880
885
  },
881
886
  {
882
- 'id' => ipb_2_id,
887
+ 'id' => ipb2_id,
883
888
  'type' => 'ipblock',
884
- 'href' => "https://api.profitbricks.com/rest/v2/ipblocks/#{ipb_2_id}",
885
- 'metadata' => {
889
+ 'href' => "https://api.profitbricks.com/rest/v2/ipblocks/#{ipb2_id}",
890
+ 'metadata' => {
886
891
  'createdDate' => '2016-07-31T15:41:27Z',
887
892
  'createdBy' => 'test@stackpointcloud.com',
888
893
  'etag' => '5b91832ee85a758568d4523a86bd8702',
@@ -894,22 +899,22 @@ module Fog
894
899
  'ips' => ["333.333.333.333"],
895
900
  'location' => 'us/las',
896
901
  'size' => 1,
897
- 'name' => 'Fog test IP Block 2'
902
+ 'name' => 'Fog test IP Block 2'
898
903
  }
899
904
  }
900
905
  ]
901
906
  },
902
907
  :firewall_rules => {
903
- 'id' => "#{nic_1_id}/firewallrules",
908
+ 'id' => "#{nic1_id}/firewallrules",
904
909
  'type' => 'collection',
905
- 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/servers/#{serv_1_id}/nics/#{nic_1_id}/firewallrules",
910
+ 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/servers/#{serv1_id}/nics/#{nic1_id}/firewallrules",
906
911
  'items' =>
907
912
  [
908
913
  {
909
- 'id' => fwr_1_id,
914
+ 'id' => fwr1_id,
910
915
  'type' => 'firewall-rule',
911
- 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/servers/#{serv_1_id}/nics/#{nic_1_id}/firewallrules/#{fwr_1_id}",
912
- 'metadata' => {
916
+ 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/servers/#{serv1_id}/nics/#{nic1_id}/firewallrules/#{fwr1_id}",
917
+ 'metadata' => {
913
918
  'createdDate' => '2016-07-31T15:41:27Z',
914
919
  'createdBy' => 'test@stackpointcloud.com',
915
920
  'etag' => '5b91832ee85a758568d4523a86bd8703',
@@ -917,7 +922,7 @@ module Fog
917
922
  'lastModifiedBy' => 'test@stackpointcloud.com',
918
923
  'state' => 'AVAILABLE'
919
924
  },
920
- 'properties' => {
925
+ 'properties' => {
921
926
  'name' => 'Fog test Firewall Rule 1',
922
927
  'protocol' => 'TCP',
923
928
  'sourceMac' => 'null',
@@ -928,15 +933,15 @@ module Fog
928
933
  'portRangeStart' => 22,
929
934
  'portRangeEnd' => 22
930
935
  },
931
- 'datacenter_id' => dc_1_id,
932
- 'server_id' => serv_1_id,
933
- 'nic_id' => nic_1_id
936
+ 'datacenter_id' => dc1_id,
937
+ 'server_id' => serv1_id,
938
+ 'nic_id' => nic1_id
934
939
  },
935
940
  {
936
- 'id' => fwr_2_id,
941
+ 'id' => fwr2_id,
937
942
  'type' => 'firewall-rule',
938
- 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/servers/#{serv_1_id}/nics/#{nic_1_id}/firewallrules/#{fwr_2_id}",
939
- 'metadata' => {
943
+ 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/servers/#{serv1_id}/nics/#{nic1_id}/firewallrules/#{fwr2_id}",
944
+ 'metadata' => {
940
945
  'createdDate' => '2016-07-31T15:41:27Z',
941
946
  'createdBy' => 'test@stackpointcloud.com',
942
947
  'etag' => '5b91832ee85a758568d4523a86bd8701',
@@ -944,7 +949,7 @@ module Fog
944
949
  'lastModifiedBy' => 'test@stackpointcloud.com',
945
950
  'state' => 'AVAILABLE'
946
951
  },
947
- 'properties' => {
952
+ 'properties' => {
948
953
  'name' => 'Fog test Firewall Rule 2',
949
954
  'protocol' => 'TCP',
950
955
  'sourceMac' => 'null',
@@ -955,23 +960,23 @@ module Fog
955
960
  'portRangeStart' => 24,
956
961
  'portRangeEnd' => 25
957
962
  },
958
- 'datacenter_id' => dc_1_id,
959
- 'server_id' => serv_1_id,
960
- 'nic_id' => nic_1_id
963
+ 'datacenter_id' => dc1_id,
964
+ 'server_id' => serv1_id,
965
+ 'nic_id' => nic1_id
961
966
  }
962
967
  ]
963
968
  },
964
969
  :load_balancers => {
965
- 'id' => "#{dc_1_id}/loadbalancers",
970
+ 'id' => "#{dc1_id}/loadbalancers",
966
971
  'type' => 'collection',
967
- 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/loadbalancers",
972
+ 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/loadbalancers",
968
973
  'items' =>
969
974
  [
970
975
  {
971
- 'id' => lb_1_id,
976
+ 'id' => lb1_id,
972
977
  'type' => 'loadbalancer',
973
- 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/loadbalancers/#{lb_1_id}",
974
- 'metadata' => {
978
+ 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/loadbalancers/#{lb1_id}",
979
+ 'metadata' => {
975
980
  'createdDate' => '2016-07-31T15:41:27Z',
976
981
  'createdBy' => 'test@stackpointcloud.com',
977
982
  'etag' => '5b91832ee85a758568d4523a86bd8723',
@@ -979,22 +984,22 @@ module Fog
979
984
  'lastModifiedBy' => 'test@stackpointcloud.com',
980
985
  'state' => 'AVAILABLE'
981
986
  },
982
- 'properties' => {
987
+ 'properties' => {
983
988
  'name' => 'Fog test Load Balancer 1',
984
989
  'ip' => 'null',
985
990
  'dhcp' => 'true'
986
991
  },
987
- 'entities' => {
988
- 'balancednics' => {
989
- 'id' => "#{lb_1_id}/balancednics",
992
+ 'entities' => {
993
+ 'balancednics' => {
994
+ 'id' => "#{lb1_id}/balancednics",
990
995
  'type' => 'collection',
991
- 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/loadbalancers/#{lb_1_id}/balancednics",
996
+ 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/loadbalancers/#{lb1_id}/balancednics",
992
997
  'items' =>
993
998
  [
994
999
  {
995
- 'id' => nic_1_id,
1000
+ 'id' => nic1_id,
996
1001
  'type' => 'nic',
997
- 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/servers/#{serv_1_id}/nics/#{nic_1_id}",
1002
+ 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/servers/#{serv1_id}/nics/#{nic1_id}",
998
1003
  'metadata' => {
999
1004
  'createdDate' => '2015-03-18T19:00:51Z',
1000
1005
  'createdBy' => 'test@stackpointcloud.com',
@@ -1003,35 +1008,35 @@ module Fog
1003
1008
  'lastModifiedBy' => 'test@stackpointcloud.com',
1004
1009
  'state' => 'AVAILABLE'
1005
1010
  },
1006
- 'properties' => {
1011
+ 'properties' => {
1007
1012
  'name' => 'FogTestLoadBalancedNIC_1',
1008
1013
  'mac' => '02:01:36:5f:09:da',
1009
- 'ips' => [ '10.9.194.12'],
1014
+ 'ips' => ['10.9.194.12'],
1010
1015
  'dhcp' => 'true',
1011
1016
  'lan' => 2,
1012
1017
  'firewallActive' => 'false'
1013
1018
  },
1014
- 'entities' => {
1019
+ 'entities' => {
1015
1020
  'firewallrules' => {
1016
- 'id' => "#{nic_1_id}/firewallrules",
1021
+ 'id' => "#{nic1_id}/firewallrules",
1017
1022
  'type' => 'collection',
1018
- 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/servers/#{serv_1_id}/nics/#{nic_1_id}/firewallrules",
1019
- 'items' => [ ]
1023
+ 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/servers/#{serv1_id}/nics/#{nic1_id}/firewallrules",
1024
+ 'items' => []
1020
1025
  }
1021
1026
  },
1022
- 'datacenter_id' => dc_1_id,
1023
- 'load_balancer_id' => lb_1_id
1027
+ 'datacenter_id' => dc1_id,
1028
+ 'load_balancer_id' => lb1_id
1024
1029
  }
1025
1030
  ]
1026
1031
  }
1027
1032
  },
1028
- 'datacenter_id' => dc_1_id
1033
+ 'datacenter_id' => dc1_id
1029
1034
  },
1030
1035
  {
1031
- 'id' => lb_2_id,
1036
+ 'id' => lb2_id,
1032
1037
  'type' => 'loadbalancer',
1033
- 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/loadbalancers/#{lb_2_id}",
1034
- 'metadata' => {
1038
+ 'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/loadbalancers/#{lb2_id}",
1039
+ 'metadata' => {
1035
1040
  'createdDate' => '2016-07-31T15:41:27Z',
1036
1041
  'createdBy' => 'test@stackpointcloud.com',
1037
1042
  'etag' => '5b91832ee85a758568d4523a86bd8721',
@@ -1039,20 +1044,20 @@ module Fog
1039
1044
  'lastModifiedBy' => 'test@stackpointcloud.com',
1040
1045
  'state' => 'INACTIVE'
1041
1046
  },
1042
- 'properties' => {
1047
+ 'properties' => {
1043
1048
  'name' => 'Fog test Load Balancer 2',
1044
1049
  'ip' => 'null',
1045
1050
  'dhcp' => 'false'
1046
1051
  },
1047
- 'entities' => {
1048
- 'balancednics' => {
1049
- 'id' => "#{lb_2_id}/balancednics",
1050
- 'type' => 'collection',
1051
- 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc_1_id}/loadbalancers/#{lb_2_id}/balancednics",
1052
- 'items' => [ ]
1053
- }
1052
+ 'entities' => {
1053
+ 'balancednics' => {
1054
+ 'id' => "#{lb2_id}/balancednics",
1055
+ 'type' => 'collection',
1056
+ 'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/loadbalancers/#{lb2_id}/balancednics",
1057
+ 'items' => []
1058
+ }
1054
1059
  },
1055
- 'datacenter_id' => dc_1_id
1060
+ 'datacenter_id' => dc1_id
1056
1061
  }
1057
1062
  ]
1058
1063
  }
@@ -1064,7 +1069,7 @@ module Fog
1064
1069
  @data = nil
1065
1070
  end
1066
1071
 
1067
- def initialize(options={})
1072
+ def initialize(options = {})
1068
1073
  @profitbricks_username = options[:profitbricks_username]
1069
1074
  @profitbricks_password = options[:profitbricks_password]
1070
1075
  end