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
metadata CHANGED
@@ -1,125 +1,125 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-profitbricks
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan Devenport
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-10 00:00:00.000000000 Z
11
+ date: 2017-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.42'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.42'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: fog-json
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: '10.4'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '10.4'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: minitest
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: '4'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: '4'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: shindo
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0.3'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0.3'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: turn
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ~>
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0.9'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ~>
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0.9'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: pry
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ~>
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0.10'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ~>
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0.10'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rubocop
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
115
+ - - '>='
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">="
122
+ - - '>='
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  description: |-
@@ -131,11 +131,11 @@ executables: []
131
131
  extensions: []
132
132
  extra_rdoc_files: []
133
133
  files:
134
- - ".gitignore"
135
- - ".rubocop.yml"
136
- - ".ruby-gemset"
137
- - ".ruby-version"
138
- - ".travis.yml"
134
+ - .gitignore
135
+ - .rubocop.yml
136
+ - .ruby-gemset
137
+ - .ruby-version
138
+ - .travis.yml
139
139
  - CONTRIBUTING.md
140
140
  - CONTRIBUTORS.md
141
141
  - Gemfile
@@ -144,7 +144,6 @@ files:
144
144
  - Rakefile
145
145
  - examples/pb_demo.rb
146
146
  - fog-profitbricks.gemspec
147
- - gemfiles/Gemfile.1.8.7
148
147
  - gemfiles/Gemfile.1.9.2+
149
148
  - lib/fog/bin/profitbricks.rb
150
149
  - lib/fog/profitbricks.rb
@@ -289,12 +288,6 @@ files:
289
288
  - tests/helpers/formats_helper.rb
290
289
  - tests/helpers/mock_helper.rb
291
290
  - tests/profitbricks/models/compute/compute_tests.rb
292
- - tests/profitbricks/requests/compute/composite_create_tests.rb
293
- - tests/profitbricks/requests/compute/flavor_tests.rb
294
- - tests/profitbricks/requests/compute/location_tests.rb
295
- - tests/profitbricks/requests/compute/nic_tests.rb
296
- - tests/profitbricks/requests/compute/request_tests.rb
297
- - tests/profitbricks/requests/compute/server_tests.rb
298
291
  homepage: https://github.com/fog/fog-profitbricks
299
292
  licenses:
300
293
  - MIT
@@ -305,17 +298,17 @@ require_paths:
305
298
  - lib
306
299
  required_ruby_version: !ruby/object:Gem::Requirement
307
300
  requirements:
308
- - - ">="
301
+ - - '>='
309
302
  - !ruby/object:Gem::Version
310
303
  version: '0'
311
304
  required_rubygems_version: !ruby/object:Gem::Requirement
312
305
  requirements:
313
- - - ">="
306
+ - - '>='
314
307
  - !ruby/object:Gem::Version
315
308
  version: '0'
316
309
  requirements: []
317
310
  rubyforge_project:
318
- rubygems_version: 2.6.12
311
+ rubygems_version: 2.0.14
319
312
  signing_key:
320
313
  specification_version: 4
321
314
  summary: Module for the 'fog' gem to support ProfitBricks.
@@ -1,6 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'mime-types', '< 2.0'
4
- gem 'rest-client', '~> 1.6.8'
5
-
6
- gemspec :path => '../'
@@ -1,174 +0,0 @@
1
- Shindo.tests('Fog::Compute[:profitbricks] | composite create server request', %w(profitbricks compute)) do
2
- @resource_schema = {
3
- 'id' => String,
4
- 'type' => String,
5
- 'href' => String,
6
- 'metadata' => Hash,
7
- 'properties' => Hash
8
- }
9
-
10
- @minimal_schema_with_items = {
11
- 'id' => String,
12
- 'type' => String,
13
- 'href' => String,
14
- 'items' => Array
15
- }
16
-
17
- service = Fog::Compute[:profitbricks]
18
-
19
- tests('success') do
20
- Excon.defaults[:connection_timeout] = 500
21
-
22
- tests('#create_datacenter').data_matches_schema(@resource_schema) do
23
- options = {}
24
- options[:name] = 'FogTestDataCenter2'
25
- options[:location] = 'us/las'
26
- options[:description] = 'Part of server tests suite'
27
-
28
- createDatacenterResponse = service.create_datacenter(options)
29
- @datacenter_id = createDatacenterResponse.body['id']
30
-
31
- sleep(60) if ENV["FOG_MOCK"] != "true"
32
-
33
- createDatacenterResponse.body
34
- end
35
-
36
- tests('#get_datacenter').data_matches_schema(@resource_schema) do
37
- getDatacenterResponse = service.get_datacenter(@datacenter_id)
38
- getDatacenterResponse.body
39
- end
40
-
41
- tests('#get_all_datacenters').data_matches_schema(@minimal_schema_with_items) do
42
- getAllDatacentersResponse = service.get_all_datacenters
43
- getAllDatacentersResponse.body
44
- end
45
-
46
- tests('#update_datacenter').data_matches_schema(@resource_schema) do
47
- options = {}
48
- options[:name] = 'FogTestDataCenter2Rename'
49
- options[:description] = 'FogDataCenterDescriptionUpdated'
50
-
51
- updateDatacenterResponse = service.update_datacenter(
52
- @datacenter_id, options
53
- )
54
-
55
- updateDatacenterResponse.body
56
- end
57
-
58
- tests('#create_lan').data_matches_schema(@resource_schema) do
59
- options = {}
60
- options[:name] = 'FogTestLan_3'
61
- options[:public] = 'true'
62
-
63
- createLanResponse = service.create_lan(@datacenter_id, options)
64
- @lan_id = createLanResponse.body['id']
65
-
66
- sleep(60) if ENV["FOG_MOCK"] != "true"
67
-
68
- createLanResponse.body
69
- end
70
-
71
- tests('#create_server').data_matches_schema(@resource_schema) do
72
- nic = {}
73
- nic[:name] = 'FogTestNic_2'
74
- nic[:lan] = @lan_id
75
-
76
- properties = {}
77
- properties[:name] = 'FogTestServer_2'
78
- properties[:cores] = 1
79
- properties[:ram] = 1024
80
- properties[:availabilityZone] = 'ZONE_1'
81
- properties[:cpuFamily] = 'INTEL_XEON'
82
-
83
- entities = {}
84
- entities[:volumes] = {}
85
- entities[:volumes]['items'] = [
86
- {
87
- :properties => {
88
- :name => 'FogRestTestVolume',
89
- :size => 5,
90
- :licenceType => 'LINUX',
91
- :type => 'HDD'
92
- }
93
- }
94
- ]
95
-
96
- entities[:nics] = {}
97
- entities[:nics]['items'] = [
98
- {
99
- :properties => {
100
- :name => 'FogTestNic_2',
101
- :lan => @lan_id
102
- },
103
-
104
- :entities => {
105
- :firewallrules => {
106
- :items => [
107
- {
108
- :properties => {
109
- :name => 'Fog test Firewall Rule 3',
110
- :protocol => 'TCP',
111
- :portRangeStart => '80',
112
- :portRangeEnd => '80'
113
- }
114
- }
115
- ]
116
- }
117
- }
118
- }
119
- ]
120
-
121
- createServerResponse = service.create_server(@datacenter_id, properties, entities)
122
- @server_id = createServerResponse.body['id']
123
-
124
- sleep(60) if ENV["FOG_MOCK"] != "true"
125
-
126
- createServerResponse.body
127
- end
128
-
129
- tests('#get_server').data_matches_schema(@resource_schema) do
130
- getServerResponse = service.get_server(@datacenter_id, @server_id)
131
- getServerResponse.body
132
- end
133
-
134
- tests('#update_server').data_matches_schema(@resource_schema) do
135
- updateServerResponse = service.update_server(@datacenter_id, @server_id, 'name' => 'FogTestServer_2_Rename')
136
-
137
- updateServerResponse.body
138
- end
139
-
140
- tests('#get_all_servers').data_matches_schema(@minimal_schema_with_items) do
141
- getAllServersResponse = service.get_all_servers(@datacenter_id)
142
-
143
- getAllServersResponse.body
144
- end
145
-
146
- tests('#stop_server').succeeds do
147
- stopServerResponse = service.stop_server(@datacenter_id, @server_id)
148
-
149
- stopServerResponse.status == 202
150
- end
151
-
152
- tests('#start_server').succeeds do
153
- startServerResponse = service.start_server(@datacenter_id, @server_id)
154
-
155
- startServerResponse.status == 202
156
- end
157
-
158
- tests('#reboot_server').succeeds do
159
- rebootServerResponse = service.reboot_server(@datacenter_id, @server_id)
160
-
161
- rebootServerResponse.status == 202
162
- end
163
-
164
- tests('#delete_server').succeeds do
165
- deleteServerResponse = service.delete_server(@datacenter_id, @server_id)
166
- deleteServerResponse.status == 202
167
- end
168
-
169
- tests('#delete_datacenter').succeeds do
170
- deleteDatacenterResponse = service.delete_datacenter(@datacenter_id)
171
- deleteDatacenterResponse.status == 202
172
- end
173
- end
174
- end
@@ -1,40 +0,0 @@
1
- Shindo.tests('Fog::Compute[:profitbricks] | flavor request', %w(profitbricks compute)) do
2
- @flavor_format = {
3
- 'flavorId' => String,
4
- 'flavorName' => String,
5
- 'ram' => Integer,
6
- 'cores' => Integer
7
- }
8
-
9
- service = Fog::Compute[:profitbricks]
10
-
11
- tests('success') do
12
- # Not yet implemented
13
- # tests('#create_flavor').formats(@flavor_format) do
14
- # puts '#create_flavor'
15
- # data = service.create_flavor('FogFlavorTest', 4096, 2)
16
- # data.body['createFlavorResponse']
17
- # end
18
-
19
- tests('#get_all_flavors').formats(@flavor_format) do
20
- # puts '#get_all_flavors'
21
- data = service.get_all_flavors
22
- @flavor_id = data.body['getAllFlavorsResponse'][0]['flavorId']
23
- data.body['getAllFlavorsResponse'][0]
24
- end
25
-
26
- tests('#get_flavor').formats(@flavor_format) do
27
- # puts '#get_flavor'
28
- data = service.get_flavor(@flavor_id)
29
- data.body['getFlavorResponse']
30
- end
31
- end
32
-
33
- tests('failure') do
34
- tests('#get_flavor').raises(Fog::Errors::NotFound) do
35
- # puts '#get_flavor'
36
- data = service.get_flavor('00000000-0000-0000-0000-000000000000')
37
- data.body['getRegionResponse']
38
- end
39
- end
40
- end
@@ -1,42 +0,0 @@
1
- Shindo.tests('Fog::Compute[:profitbricks] | location request', %w(profitbricks compute)) do
2
- @locations_schema = {
3
- 'id' => String,
4
- 'type' => String,
5
- 'href' => String,
6
- 'items' => Array
7
- }
8
-
9
- @location_schema = {
10
- 'id' => String,
11
- 'type' => String,
12
- 'href' => String,
13
- 'properties' => {
14
- 'name' => String,
15
- 'features' => Array
16
- }
17
- }
18
-
19
- service = Fog::Compute[:profitbricks]
20
-
21
- tests('success') do
22
- Excon.defaults[:connection_timeout] = 500
23
-
24
- tests('#get_all_locations').data_matches_schema(@locations_schema) do
25
- data = service.get_all_locations
26
- @location_id = data.body['items'][0]['id']
27
-
28
- data.body
29
- end
30
-
31
- tests('#get_location').data_matches_schema(@location_schema) do
32
- data = service.get_location("us/las")
33
- data.body
34
- end
35
- end
36
-
37
- tests('failure') do
38
- tests('#get_location').raises(Excon::Error::HTTPStatus) do
39
- data = service.get_location('oo/ooo')
40
- end
41
- end
42
- end