fog-profitbricks 4.0.0 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -3
  3. data/Rakefile +1 -1
  4. data/examples/pb_demo.rb +2 -8
  5. data/lib/fog/profitbricks/compute.rb +249 -105
  6. data/lib/fog/profitbricks/models/compute/datacenter.rb +63 -9
  7. data/lib/fog/profitbricks/models/compute/firewall_rule.rb +3 -1
  8. data/lib/fog/profitbricks/models/compute/group.rb +7 -4
  9. data/lib/fog/profitbricks/models/compute/image.rb +3 -0
  10. data/lib/fog/profitbricks/models/compute/ip_block.rb +2 -0
  11. data/lib/fog/profitbricks/models/compute/lan.rb +2 -1
  12. data/lib/fog/profitbricks/models/compute/load_balancer.rb +2 -0
  13. data/lib/fog/profitbricks/models/compute/location.rb +1 -0
  14. data/lib/fog/profitbricks/models/compute/nic.rb +2 -0
  15. data/lib/fog/profitbricks/models/compute/request.rb +1 -0
  16. data/lib/fog/profitbricks/models/compute/resource.rb +1 -0
  17. data/lib/fog/profitbricks/models/compute/server.rb +5 -1
  18. data/lib/fog/profitbricks/models/compute/share.rb +4 -2
  19. data/lib/fog/profitbricks/models/compute/snapshot.rb +2 -0
  20. data/lib/fog/profitbricks/models/compute/user.rb +4 -1
  21. data/lib/fog/profitbricks/requests/compute/add_share.rb +2 -2
  22. data/lib/fog/profitbricks/requests/compute/add_user_to_group.rb +4 -4
  23. data/lib/fog/profitbricks/requests/compute/associate_nic_to_load_balancer.rb +1 -3
  24. data/lib/fog/profitbricks/requests/compute/attach_cdrom.rb +18 -17
  25. data/lib/fog/profitbricks/requests/compute/attach_volume.rb +9 -2
  26. data/lib/fog/profitbricks/requests/compute/create_datacenter.rb +71 -25
  27. data/lib/fog/profitbricks/requests/compute/create_firewall_rule.rb +11 -4
  28. data/lib/fog/profitbricks/requests/compute/create_group.rb +22 -4
  29. data/lib/fog/profitbricks/requests/compute/create_ip_block.rb +1 -1
  30. data/lib/fog/profitbricks/requests/compute/create_lan.rb +1 -1
  31. data/lib/fog/profitbricks/requests/compute/create_load_balancer.rb +4 -43
  32. data/lib/fog/profitbricks/requests/compute/create_nic.rb +4 -0
  33. data/lib/fog/profitbricks/requests/compute/create_server.rb +6 -1
  34. data/lib/fog/profitbricks/requests/compute/create_user.rb +20 -1
  35. data/lib/fog/profitbricks/requests/compute/create_volume.rb +5 -1
  36. data/lib/fog/profitbricks/requests/compute/create_volume_snapshot.rb +1 -1
  37. data/lib/fog/profitbricks/requests/compute/delete_group.rb +1 -1
  38. data/lib/fog/profitbricks/requests/compute/delete_share.rb +1 -1
  39. data/lib/fog/profitbricks/requests/compute/delete_user.rb +1 -1
  40. data/lib/fog/profitbricks/requests/compute/detach_cdrom.rb +3 -3
  41. data/lib/fog/profitbricks/requests/compute/get_attached_cdrom.rb +3 -3
  42. data/lib/fog/profitbricks/requests/compute/get_datacenter.rb +1 -1
  43. data/lib/fog/profitbricks/requests/compute/get_firewall_rule.rb +1 -1
  44. data/lib/fog/profitbricks/requests/compute/get_group.rb +1 -1
  45. data/lib/fog/profitbricks/requests/compute/get_image.rb +1 -1
  46. data/lib/fog/profitbricks/requests/compute/get_ip_block.rb +1 -1
  47. data/lib/fog/profitbricks/requests/compute/get_lan.rb +1 -1
  48. data/lib/fog/profitbricks/requests/compute/get_load_balanced_nic.rb +7 -1
  49. data/lib/fog/profitbricks/requests/compute/get_load_balancer.rb +1 -1
  50. data/lib/fog/profitbricks/requests/compute/get_location.rb +1 -1
  51. data/lib/fog/profitbricks/requests/compute/get_nic.rb +2 -2
  52. data/lib/fog/profitbricks/requests/compute/get_request.rb +8 -1
  53. data/lib/fog/profitbricks/requests/compute/get_resource_by_type.rb +8 -1
  54. data/lib/fog/profitbricks/requests/compute/get_resources_by_type.rb +9 -3
  55. data/lib/fog/profitbricks/requests/compute/get_server.rb +1 -1
  56. data/lib/fog/profitbricks/requests/compute/get_share.rb +1 -1
  57. data/lib/fog/profitbricks/requests/compute/get_snapshot.rb +1 -1
  58. data/lib/fog/profitbricks/requests/compute/get_user.rb +1 -1
  59. data/lib/fog/profitbricks/requests/compute/get_volume.rb +1 -1
  60. data/lib/fog/profitbricks/requests/compute/list_attached_cdroms.rb +3 -1
  61. data/lib/fog/profitbricks/requests/compute/list_attached_volumes.rb +3 -3
  62. data/lib/fog/profitbricks/requests/compute/remove_user_from_group.rb +2 -2
  63. data/lib/fog/profitbricks/requests/compute/update_datacenter.rb +3 -8
  64. data/lib/fog/profitbricks/requests/compute/update_firewall_rule.rb +1 -1
  65. data/lib/fog/profitbricks/requests/compute/update_group.rb +5 -5
  66. data/lib/fog/profitbricks/requests/compute/update_nic.rb +2 -4
  67. data/lib/fog/profitbricks/requests/compute/update_server.rb +3 -4
  68. data/lib/fog/profitbricks/requests/compute/update_share.rb +3 -3
  69. data/lib/fog/profitbricks/requests/compute/update_user.rb +2 -2
  70. data/lib/fog/profitbricks/version.rb +1 -1
  71. data/tests/profitbricks/models/compute/compute_tests.rb +1071 -267
  72. metadata +26 -33
  73. data/gemfiles/Gemfile.1.8.7 +0 -6
  74. data/tests/profitbricks/requests/compute/composite_create_tests.rb +0 -174
  75. data/tests/profitbricks/requests/compute/flavor_tests.rb +0 -40
  76. data/tests/profitbricks/requests/compute/location_tests.rb +0 -42
  77. data/tests/profitbricks/requests/compute/nic_tests.rb +0 -268
  78. data/tests/profitbricks/requests/compute/request_tests.rb +0 -50
  79. data/tests/profitbricks/requests/compute/server_tests.rb +0 -462
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f5debfdaf3a325763e5c2bbab6cfe3579ba9b59
4
- data.tar.gz: d393b090eb06d77179d0e0ee328fe1fefa58b5b7
3
+ metadata.gz: 6123ec4b71596d36e147a4df95374deaaea32d2a
4
+ data.tar.gz: c60c12fd9550e860665bbe65a548240a39adcb38
5
5
  SHA512:
6
- metadata.gz: 9686e4a271e84a6ce971cbb061d3b14c865da0b226d1aa9de2848dc3f49215a5d01cb2aae37b4961a22fef957a0d1f1d28251162c6aa96a31cd45f7875238365
7
- data.tar.gz: 8fb85e43f65b3ae9a78b7521270e6e9ce5d1382f61ac2881c639a57d03ba73d3d2c6050a4ecb88e416cfde902f82a985bafcda98b888cddbad65394dace447e5
6
+ metadata.gz: 79023d8d754c7420f9a16ce8f72c05042abec768f5e0dae76888994e48e0f96d9b518046642168e9437f763e6cff060afb7ecd1891670083ffb0cfcbad821e62
7
+ data.tar.gz: 3eb2578a46b7521ca18f5c17227f0d99d90a8222f5da3a497da588c698b09ab5a75d8436c1a8d0cc30476aea57a955795a715bf695359045f149d247f36b7113
@@ -7,8 +7,6 @@ script: bundle exec rake travis
7
7
 
8
8
  matrix:
9
9
  include:
10
- - rvm: 1.8.7
11
- gemfile: gemfiles/Gemfile.1.8.7
12
10
  - rvm: 1.9.3
13
11
  gemfile: gemfiles/Gemfile.1.9.2+
14
12
  env: COVERAGE=true
@@ -24,6 +22,6 @@ matrix:
24
22
  - rvm: 2.3.0
25
23
  gemfile: Gemfile
26
24
  env: COVERAGE=true
27
- - rvm: jruby
25
+ - rvm: jruby-head
28
26
  gemfile: gemfiles/Gemfile.1.9.2+
29
27
  env: COVERAGE=true
data/Rakefile CHANGED
@@ -16,7 +16,7 @@ end
16
16
  namespace :test do
17
17
  mock = ENV["FOG_MOCK"] || "true"
18
18
  task :travis do
19
- sh("export FOG_MOCK=#{mock} && bundle exec shindont")
19
+ sh("export PROFITBRICKS_USERNAME=username && export PROFITBRICKS_PASSWORD=abc123xyz && export FOG_MOCK=#{mock} && bundle exec shindont")
20
20
  end
21
21
  end
22
22
 
@@ -2,13 +2,7 @@ require 'fog/profitbricks'
2
2
 
3
3
  Excon.defaults[:connection_timeout] = 200
4
4
 
5
- compute = Fog::Compute.new(:provider => 'ProfitBricks')
6
-
7
- # Find the Ubuntu 16 image in North America.
8
- image = compute.images.all.find do |image|
9
- image.name =~ /Ubuntu-16/ &&
10
- image.location == 'us/las'
11
- end
5
+ compute = Fog::Compute.new(:provider => 'ProfitBricks', :profitbricks_username => ENV['PROFITBRICKS_USERNAME'], :profitbricks_password => ENV['PROFITBRICKS_PASSWORD'])
12
6
 
13
7
  # Create datacenter.
14
8
  datacenter = compute.datacenters.create(:name => 'fog-demo',
@@ -29,7 +23,7 @@ lan = compute.lans.create(:datacenter_id => datacenter.id,
29
23
  system_volume = {
30
24
  :name => 'system',
31
25
  :size => 5,
32
- :image => image.id,
26
+ :image_alias => "ubuntu:latest",
33
27
  :image_password => 'volume2016',
34
28
  :ssh_keys => ['ssh-rsa AAAAB3NzaC1yc2EAAAADA=='],
35
29
  :type => 'HDD'
@@ -6,7 +6,7 @@ module Fog
6
6
  autoload :Base, File.expand_path('../models/base', __FILE__)
7
7
 
8
8
  requires :profitbricks_username, :profitbricks_password
9
- recognizes :profitbricks_url
9
+ recognizes :profitbricks_url, :profitbricks_user_agent
10
10
 
11
11
  # Models
12
12
  model_path 'fog/profitbricks/models/compute'
@@ -51,127 +51,128 @@ module Fog
51
51
 
52
52
  # Requests
53
53
  request_path 'fog/profitbricks/requests/compute'
54
- request :create_server # createServer
55
- request :delete_server # deleteServer
56
- request :update_server # updateServer
57
- request :get_all_servers # getAllServers
58
- request :get_server # getServer
59
- request :list_attached_volumes # listAttachedVolumes
60
- request :attach_volume # attachVolume
61
- request :get_attached_volume # getAttachedVolume
62
- request :detach_volume # detachVolume
63
- request :list_attached_cdroms # listAttachedCdroms
64
- request :attach_cdrom # attachCdrom
65
- request :get_attached_cdrom # getAttachedCdrom
66
- request :detach_cdrom # detachCdrom
67
- request :reboot_server # rebootServer
68
- request :start_server # startServer
69
- request :stop_server # stopServer
54
+ request :create_server # createServer
55
+ request :delete_server # deleteServer
56
+ request :update_server # updateServer
57
+ request :get_all_servers # getAllServers
58
+ request :get_server # getServer
59
+ request :list_attached_volumes # listAttachedVolumes
60
+ request :attach_volume # attachVolume
61
+ request :get_attached_volume # getAttachedVolume
62
+ request :detach_volume # detachVolume
63
+ request :list_attached_cdroms # listAttachedCdroms
64
+ request :attach_cdrom # attachCdrom
65
+ request :get_attached_cdrom # getAttachedCdrom
66
+ request :detach_cdrom # detachCdrom
67
+ request :reboot_server # rebootServer
68
+ request :start_server # startServer
69
+ request :stop_server # stopServer
70
70
 
71
- request :create_datacenter # createDataCenter
72
- request :delete_datacenter # deleteDataCenter
73
- request :update_datacenter # updateDataCenter
74
- request :get_all_datacenters # getAllDataCenters
75
- request :get_datacenter # getDataCenter
71
+ request :create_datacenter # createDataCenter
72
+ request :delete_datacenter # deleteDataCenter
73
+ request :update_datacenter # updateDataCenter
74
+ request :get_all_datacenters # getAllDataCenters
75
+ request :get_datacenter # getDataCenter
76
76
 
77
- request :get_all_locations # getAllLocations
78
- request :get_location # getLocation
77
+ request :get_all_locations # getAllLocations
78
+ request :get_location # getLocation
79
79
 
80
- request :get_all_images # getAllImages
81
- request :get_image # getImage
82
- request :update_image # updateImage
83
- request :delete_image # deleteImage
80
+ request :get_all_images # getAllImages
81
+ request :get_image # getImage
82
+ request :update_image # updateImage
83
+ request :delete_image # deleteImage
84
84
 
85
- request :get_all_flavors # getAllFlavors
86
- request :get_flavor # getFlavor
87
- request :create_flavor # createFlavor
85
+ request :get_all_flavors # getAllFlavors
86
+ request :get_flavor # getFlavor
87
+ request :create_flavor # createFlavor
88
88
 
89
- request :create_volume # createVolume
90
- request :delete_volume # deleteVolume
91
- request :update_volume # updateVolume
92
- request :get_all_volumes # getAllVolumes
93
- request :get_volume # getVolume
94
- request :create_volume_snapshot # createVolumeSnapshot
95
- request :restore_volume_snapshot # restoreVolumeSnapshot
89
+ request :create_volume # createVolume
90
+ request :delete_volume # deleteVolume
91
+ request :update_volume # updateVolume
92
+ request :get_all_volumes # getAllVolumes
93
+ request :get_volume # getVolume
94
+ request :create_volume_snapshot # createVolumeSnapshot
95
+ request :restore_volume_snapshot # restoreVolumeSnapshot
96
96
 
97
- request :get_all_lans # getAllLans
98
- request :get_lan # getLans
99
- request :create_lan # createLan
100
- request :update_lan # updateLan
101
- request :delete_lan # deleteLan
97
+ request :get_all_lans # getAllLans
98
+ request :get_lan # getLans
99
+ request :create_lan # createLan
100
+ request :update_lan # updateLan
101
+ request :delete_lan # deleteLan
102
102
 
103
- request :create_nic # createNic
104
- request :delete_nic # deleteNic
105
- request :update_nic # updateNic
106
- request :get_all_nic # getAllNic
107
- request :get_nic # getNic
103
+ request :create_nic # createNic
104
+ request :delete_nic # deleteNic
105
+ request :update_nic # updateNic
106
+ request :get_all_nic # getAllNic
107
+ request :get_nic # getNic
108
108
 
109
- request :delete_snapshot # deleteSnapshot
110
- request :update_snapshot # updateSnapshot
111
- request :get_all_snapshots # getAllSnapshots
112
- request :get_snapshot # getSnapshot
109
+ request :delete_snapshot # deleteSnapshot
110
+ request :update_snapshot # updateSnapshot
111
+ request :get_all_snapshots # getAllSnapshots
112
+ request :get_snapshot # getSnapshot
113
113
 
114
- request :get_all_requests # getAllRequests
115
- request :get_request # getRequest
116
- request :get_request_status # getRequestStatus
114
+ request :get_all_requests # getAllRequests
115
+ request :get_request # getRequest
116
+ request :get_request_status # getRequestStatus
117
117
 
118
- request :get_all_ip_blocks # getAllIpBlocks
119
- request :get_ip_block # getIpBlock
120
- request :create_ip_block # createIpBlock
121
- request :delete_ip_block # deleteIpBlock
118
+ request :get_all_ip_blocks # getAllIpBlocks
119
+ request :get_ip_block # getIpBlock
120
+ request :create_ip_block # createIpBlock
121
+ request :delete_ip_block # deleteIpBlock
122
122
 
123
- request :get_all_firewall_rules # getAllFireWallRules
124
- request :get_firewall_rule # getFirewallRule
125
- request :create_firewall_rule # createFirewallRule
126
- request :update_firewall_rule # updateFirewallRule
127
- request :delete_firewall_rule # deleteFirewallRule
123
+ request :get_all_firewall_rules # getAllFireWallRules
124
+ request :get_firewall_rule # getFirewallRule
125
+ request :create_firewall_rule # createFirewallRule
126
+ request :update_firewall_rule # updateFirewallRule
127
+ request :delete_firewall_rule # deleteFirewallRule
128
128
 
129
- request :get_all_load_balancers # getAllLoadBalancers
130
- request :get_load_balancer # getLoadBalancer
131
- request :create_load_balancer # createLoadBalancer
132
- request :delete_load_balancer # deleteLoadBalancer
133
- request :update_load_balancer # deleteLoadBalancer
134
- request :get_all_load_balanced_nics # getAllLoadBalancedNics
135
- request :get_load_balanced_nic # getLoadBalancedNic
136
- request :associate_nic_to_load_balancer # associateNicToLoadBalancer
137
- request :remove_nic_association # removeNicAssociation
129
+ request :get_all_load_balancers # getAllLoadBalancers
130
+ request :get_load_balancer # getLoadBalancer
131
+ request :create_load_balancer # createLoadBalancer
132
+ request :delete_load_balancer # deleteLoadBalancer
133
+ request :update_load_balancer # deleteLoadBalancer
134
+ request :get_all_load_balanced_nics # getAllLoadBalancedNics
135
+ request :get_load_balanced_nic # getLoadBalancedNic
136
+ request :associate_nic_to_load_balancer # associateNicToLoadBalancer
137
+ request :remove_nic_association # removeNicAssociation
138
138
 
139
- request :get_all_contract_resources # getAllContractResources
139
+ request :get_all_contract_resources # getAllContractResources
140
140
 
141
- request :get_all_groups # getAllGroups
142
- request :get_group # getGroup
143
- request :create_group # createGroup
144
- request :update_group # updateGroup
145
- request :delete_group # deleteGroup
141
+ request :get_all_groups # getAllGroups
142
+ request :get_group # getGroup
143
+ request :create_group # createGroup
144
+ request :update_group # updateGroup
145
+ request :delete_group # deleteGroup
146
146
 
147
- request :get_all_shares # getAllShares
148
- request :get_share # getShare
149
- request :add_share # addShare
150
- request :update_share # updateShare
151
- request :delete_share # deleteShare
147
+ request :get_all_shares # getAllShares
148
+ request :get_share # getShare
149
+ request :add_share # addShare
150
+ request :update_share # updateShare
151
+ request :delete_share # deleteShare
152
152
 
153
- request :get_all_users # getAllUsers
154
- request :get_user # getUser
155
- request :create_user # createUser
156
- request :update_user # updateUser
157
- request :delete_user # deleteUser
158
- request :get_group_users # getGroupUsers
159
- request :add_user_to_group # addUserToGroup
160
- request :remove_user_from_group # removeUserFromGroup
153
+ request :get_all_users # getAllUsers
154
+ request :get_user # getUser
155
+ request :create_user # createUser
156
+ request :update_user # updateUser
157
+ request :delete_user # deleteUser
158
+ request :get_group_users # getGroupUsers
159
+ request :add_user_to_group # addUserToGroup
160
+ request :remove_user_from_group # removeUserFromGroup
161
161
 
162
- request :get_all_resources # getAllResources
163
- request :get_resources_by_type # getResourcesByType
164
- request :get_resource_by_type # getResourcesByType
162
+ request :get_all_resources # getAllResources
163
+ request :get_resources_by_type # getResourcesByType
164
+ request :get_resource_by_type # getResourcesByType
165
165
 
166
166
  class Real
167
167
  def initialize(options = {})
168
168
  @profitbricks_username = options[:profitbricks_username]
169
169
  @profitbricks_password = options[:profitbricks_password]
170
170
  @profitbricks_url = options[:profitbricks_url] || "https://api.profitbricks.com"
171
+ @user_agent = options[:profitbricks_user_agent] || ""
171
172
 
172
173
  connection_options = options[:connection_options] || {}
173
174
  connection_options[:headers] ||= {}
174
- connection_options[:headers]["User-Agent"] = Fog::Core::Connection.user_agents.to_s
175
+ connection_options[:headers]["User-Agent"] = @user_agent != "" ? @user_agent + " " + Fog::Core::Connection.user_agents.to_s : Fog::Core::Connection.user_agents.to_s
175
176
  connection_options[:omit_default_port] = true
176
177
  connection_options[:path_prefix] = "/cloudapi/#{API_VERSION}"
177
178
 
@@ -185,6 +186,7 @@ module Fog
185
186
 
186
187
  begin
187
188
  response = @connection.request(params)
189
+
188
190
  rescue Excon::Errors::Unauthorized => error
189
191
  Logger.warning('Unauthorized error')
190
192
  raise error, Fog::JSON.decode(error.response.body)['messages']
@@ -263,7 +265,7 @@ module Fog
263
265
  'description' => 'testing fog rest implementation',
264
266
  'location' => 'us/las',
265
267
  'version' => 1,
266
- 'features' => %w[SSD MULTIPLE_CPU]
268
+ 'features' => %w(SSD MULTIPLE_CPU)
267
269
  }
268
270
  },
269
271
  {
@@ -283,7 +285,7 @@ module Fog
283
285
  'description' => 'testing fog rest implementation',
284
286
  'location' => 'de/fkb',
285
287
  'version' => 1,
286
- 'features' => %w[SSD MULTIPLE_CPU]
288
+ 'features' => %w(SSD MULTIPLE_CPU)
287
289
  }
288
290
  }
289
291
  ]
@@ -477,7 +479,7 @@ module Fog
477
479
  'href' => 'https://api.profitbricks.com/rest/v2/locations/de/fkb',
478
480
  'properties' => {
479
481
  'name' => 'karlsruhe',
480
- 'features' => %w[SSD MULTIPLE_CPU]
482
+ 'features' => %w(SSD MULTIPLE_CPU)
481
483
  }
482
484
  },
483
485
  {
@@ -486,7 +488,7 @@ module Fog
486
488
  'href' => 'https://api.profitbricks.com/rest/v2/locations/de/fra',
487
489
  'properties' => {
488
490
  'name' => 'frankfurt',
489
- 'features' => %w[SSD MULTIPLE_CPU]
491
+ 'features' => %w(SSD MULTIPLE_CPU)
490
492
  }
491
493
  },
492
494
  {
@@ -495,7 +497,7 @@ module Fog
495
497
  'href' => 'https://api.profitbricks.com/rest/v2/locations/us/las',
496
498
  'properties' => {
497
499
  'name' => 'lasvegas',
498
- 'features' => %w[SSD MULTIPLE_CPU]
500
+ 'features' => %w(SSD MULTIPLE_CPU)
499
501
  }
500
502
  }
501
503
  ]
@@ -539,6 +541,38 @@ module Fog
539
541
  'public' => 'true'
540
542
  }
541
543
  },
544
+ {
545
+ 'id' => 'dfcb40db-28b5-11e6-9336-52540005ab80',
546
+ 'type' => 'image',
547
+ 'href' => 'https=>//api.profitbricks.com/rest/v2/images/dfcb40db-28b5-11e6-9336-52540005ab80',
548
+ 'metadata' => {
549
+ 'createdDate' => '2016-06-02T11:33:49Z',
550
+ 'createdBy' => 'System',
551
+ 'etag' => '9909709d99655c6f31aca789998d7d89',
552
+ 'lastModifiedDate' => '2016-06-02T11:33:49Z',
553
+ 'lastModifiedBy' => 'System',
554
+ 'state' => 'AVAILABLE'
555
+ },
556
+ 'properties' => {
557
+ 'name' => 'CentOS-6.8-x86_64-netinstall.iso',
558
+ 'description' => '',
559
+ 'location' => 'us/las',
560
+ 'size' => 0.23,
561
+ 'cpuHotPlug' => 'true',
562
+ 'cpuHotUnplug' => 'false',
563
+ 'ramHotPlug' => 'true',
564
+ 'ramHotUnplug' => 'false',
565
+ 'nicHotPlug' => 'true',
566
+ 'nicHotUnplug' => 'true',
567
+ 'discVirtioHotPlug' => 'true',
568
+ 'discVirtioHotUnplug' => 'true',
569
+ 'discScsiHotPlug' => 'false',
570
+ 'discScsiHotUnplug' => 'false',
571
+ 'licenceType' => 'LINUX',
572
+ 'imageType' => 'HDD',
573
+ 'public' => 'true'
574
+ }
575
+ },
542
576
  {
543
577
  'id' => '05cadf29-6c12-11e4-beeb-52540066fee9',
544
578
  'type' => 'image',
@@ -1098,9 +1132,10 @@ module Fog
1098
1132
  ]
1099
1133
  },
1100
1134
  :contracts => {
1101
- 'contractNumber' => '12345678',
1102
- 'owner' => 'test@domain.com',
1103
- 'status' => 'BILLABLE',
1135
+ 'type' => 'contract',
1136
+ 'contractNumber' => '12345678',
1137
+ 'owner' => 'test@domain.com',
1138
+ 'status' => 'BILLABLE',
1104
1139
  'resourceLimits' => {
1105
1140
  'coresPerServer' => '20',
1106
1141
  'coresPerContract' => '30',
@@ -1116,8 +1151,117 @@ module Fog
1116
1151
  'ssdVolumeProvisioned' => '0',
1117
1152
  'reservableIps' => '3',
1118
1153
  'reservedIpsOnContract' => '0',
1119
- 'reservedIpsInUse' => '0'
1154
+ 'reservedIpsInUse' => '0',
1120
1155
  }
1156
+ },
1157
+ :groups => {
1158
+ 'id' => "groups",
1159
+ 'type' => 'collection',
1160
+ 'href' => "https://api.profitbricks.com/cloudapi/v4/um/groups",
1161
+ 'items' => []
1162
+ },
1163
+ :shares => {
1164
+ 'id' => "059c4d71-f97a-4bfd-b3a5-XXXXXXXXXXXX/shares",
1165
+ 'type' => 'collection',
1166
+ 'href' => "https://api.profitbricks.com/cloudapi/v4/um/groups/059c4d71-f97a-4bfd-b3a5-XXXXXXXXXXXX/shares",
1167
+ 'items' => []
1168
+ },
1169
+ :users => {
1170
+ 'id' => "users",
1171
+ 'type' => 'collection',
1172
+ 'href' => "https://api.profitbricks.com/cloudapi/v4/users",
1173
+ 'items' => []
1174
+ },
1175
+ :resources => {
1176
+ 'id' => "resources",
1177
+ 'type' => 'collection',
1178
+ 'href' => "https://api.profitbricks.com/cloudapi/v4/um/resources",
1179
+ 'items' => [
1180
+ {
1181
+ 'id' => dc1_id,
1182
+ 'type' => 'datacenter',
1183
+ 'href' => "https://api.profitbricks.com/cloudapi/v4/um/resources/datacenter/#{dc1_id}",
1184
+ 'metadata' => {
1185
+ 'createdDate' => '2016-07-31T15:41:27Z',
1186
+ 'createdBy' => 'test@stackpointcloud.com',
1187
+ 'etag' => '5b91832ee85a758568d4523a86bd8702',
1188
+ 'lastModifiedDate' => '2016-07-31T15:41:27Z',
1189
+ 'lastModifiedBy' => 'test@stackpointcloud.com',
1190
+ 'state' => 'AVAILABLE'
1191
+ },
1192
+ 'entities' => {
1193
+ 'groups' => {
1194
+ 'id' => "#{dc1_id}/groups",
1195
+ 'type' => 'collection',
1196
+ 'href' => "https://api.profitbricks.com/cloudapi/v4/um/groups",
1197
+ 'items' => []
1198
+ }
1199
+ }
1200
+ },
1201
+ {
1202
+ 'id' => 'dfcb40db-28b5-11e6-9336-52540005ab80',
1203
+ 'type' => 'image',
1204
+ 'href' => 'https://api.profitbricks.com/cloudapi/v4/um/resources/image/dfcb40db-28b5-11e6-9336-52540005ab80',
1205
+ 'metadata' => {
1206
+ 'createdDate' => '2016-06-02T11:33:49Z',
1207
+ 'createdBy' => 'System',
1208
+ 'etag' => '9909709d99655c6f31aca789998d7d89',
1209
+ 'lastModifiedDate' => '2016-06-02T11:33:49Z',
1210
+ 'lastModifiedBy' => 'System',
1211
+ 'state' => 'AVAILABLE'
1212
+ },
1213
+ 'entities' => {
1214
+ 'groups' => {
1215
+ 'id' => "dfcb40db-28b5-11e6-9336-52540005ab80/groups",
1216
+ 'type' => 'collection',
1217
+ 'href' => "https://api.profitbricks.com/cloudapi/v4/um/groups",
1218
+ 'items' => []
1219
+ }
1220
+ }
1221
+ },
1222
+ {
1223
+ 'id' => '3d52b13d-bec4-49de-ad05-fd2f8c687be6',
1224
+ 'type' => 'snapshot',
1225
+ 'href' => 'https://api.profitbricks.com/cloudapi/v4/um/resources/snapshot/3d52b13d-bec4-49de-ad05-fd2f8c687be6',
1226
+ 'metadata' => {
1227
+ 'createdDate' => '2016-08-07T22:28:38Z',
1228
+ 'createdBy' => 'test@stackpointcloud.com',
1229
+ 'etag' => '83ad78a4757ab0d9bdeaebc3a6485dcf',
1230
+ 'lastModifiedDate' => '2016-08-07T22:28:38Z',
1231
+ 'lastModifiedBy' => 'test@stackpointcloud.com',
1232
+ 'state' => 'AVAILABLE'
1233
+ },
1234
+ 'entities' => {
1235
+ 'groups' => {
1236
+ 'id' => "3d52b13d-bec4-49de-ad05-fd2f8c687be6/groups",
1237
+ 'type' => 'collection',
1238
+ 'href' => "https://api.profitbricks.com/cloudapi/v4/um/groups",
1239
+ 'items' => []
1240
+ }
1241
+ }
1242
+ },
1243
+ {
1244
+ 'id' => ipb1_id,
1245
+ 'type' => 'ipblock',
1246
+ 'href' => "https://api.profitbricks.com/cloudapi/v4/um/resources/ipblock/#{ipb1_id}",
1247
+ 'metadata' => {
1248
+ 'createdDate' => '2016-07-31T15:41:27Z',
1249
+ 'createdBy' => 'test@stackpointcloud.com',
1250
+ 'etag' => '5b91832ee85a758568d4523a86bd8702',
1251
+ 'lastModifiedDate' => '2016-07-31T15:41:27Z',
1252
+ 'lastModifiedBy' => 'test@stackpointcloud.com',
1253
+ 'state' => 'AVAILABLE'
1254
+ },
1255
+ 'entities' => {
1256
+ 'groups' => {
1257
+ 'id' => "#{ipb1_id}/groups",
1258
+ 'type' => 'collection',
1259
+ 'href' => "https://api.profitbricks.com/cloudapi/v4/um/groups",
1260
+ 'items' => []
1261
+ }
1262
+ }
1263
+ }
1264
+ ]
1121
1265
  }
1122
1266
  }
1123
1267
  end