fog-brightbox 1.4.2 → 1.6.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +31 -0
- data/lib/fog/brightbox/compute/shared.rb +26 -10
- data/lib/fog/brightbox/compute.rb +17 -0
- data/lib/fog/brightbox/config.rb +12 -0
- data/lib/fog/brightbox/models/compute/server.rb +9 -1
- data/lib/fog/brightbox/models/compute/volume.rb +152 -0
- data/lib/fog/brightbox/models/compute/volumes.rb +23 -0
- data/lib/fog/brightbox/oauth2.rb +47 -7
- data/lib/fog/brightbox/requests/compute/attach_volume.rb +23 -0
- data/lib/fog/brightbox/requests/compute/copy_volume.rb +25 -0
- data/lib/fog/brightbox/requests/compute/create_volume.rb +25 -0
- data/lib/fog/brightbox/requests/compute/delete_volume.rb +20 -0
- data/lib/fog/brightbox/requests/compute/detach_volume.rb +21 -0
- data/lib/fog/brightbox/requests/compute/get_volume.rb +20 -0
- data/lib/fog/brightbox/requests/compute/list_volumes.rb +18 -0
- data/lib/fog/brightbox/requests/compute/lock_resource_volume.rb +18 -0
- data/lib/fog/brightbox/requests/compute/resize_volume.rb +26 -0
- data/lib/fog/brightbox/requests/compute/unlock_resource_volume.rb +18 -0
- data/lib/fog/brightbox/requests/compute/update_volume.rb +26 -0
- data/lib/fog/brightbox/version.rb +1 -1
- data/spec/fog/brightbox/compute/credentials_spec.rb +41 -0
- data/spec/fog/brightbox/compute/get_access_token_spec.rb +305 -0
- data/spec/fog/brightbox/compute/two_factor_spec.rb +53 -0
- data/spec/fog/brightbox/oauth2/user_credentials_strategy_spec.rb +20 -0
- data/spec/fog/compute/brightbox/volume_spec.rb +348 -0
- data/tests/brightbox/compute/schema.rb +74 -0
- data/tests/brightbox/requests/compute/volume_tests.rb +57 -0
- metadata +23 -1
@@ -0,0 +1,348 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "fog/brightbox/models/compute/volume"
|
3
|
+
|
4
|
+
describe Fog::Brightbox::Compute::Volume do
|
5
|
+
include ModelSetup
|
6
|
+
include SupportsResourceLocking
|
7
|
+
|
8
|
+
subject { service.volumes.new }
|
9
|
+
|
10
|
+
describe "when state is 'creating'" do
|
11
|
+
it do
|
12
|
+
subject.state = "creating"
|
13
|
+
|
14
|
+
assert subject.creating?
|
15
|
+
refute subject.attached?
|
16
|
+
refute subject.detached?
|
17
|
+
refute subject.deleting?
|
18
|
+
refute subject.deleted?
|
19
|
+
refute subject.failed?
|
20
|
+
|
21
|
+
refute subject.ready?
|
22
|
+
refute subject.finished?
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe "when state is 'attached'" do
|
27
|
+
it do
|
28
|
+
subject.state = "attached"
|
29
|
+
|
30
|
+
refute subject.creating?
|
31
|
+
assert subject.attached?
|
32
|
+
refute subject.detached?
|
33
|
+
refute subject.deleting?
|
34
|
+
refute subject.deleted?
|
35
|
+
refute subject.failed?
|
36
|
+
|
37
|
+
assert subject.ready?
|
38
|
+
refute subject.finished?
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
describe "when state is 'detached'" do
|
43
|
+
it do
|
44
|
+
subject.state = "detached"
|
45
|
+
|
46
|
+
refute subject.creating?
|
47
|
+
refute subject.attached?
|
48
|
+
assert subject.detached?
|
49
|
+
refute subject.deleting?
|
50
|
+
refute subject.deleted?
|
51
|
+
refute subject.failed?
|
52
|
+
|
53
|
+
assert subject.ready?
|
54
|
+
refute subject.finished?
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
describe "when state is 'deleting'" do
|
59
|
+
it do
|
60
|
+
subject.state = "deleting"
|
61
|
+
|
62
|
+
refute subject.creating?
|
63
|
+
refute subject.attached?
|
64
|
+
refute subject.detached?
|
65
|
+
assert subject.deleting?
|
66
|
+
refute subject.deleted?
|
67
|
+
refute subject.failed?
|
68
|
+
|
69
|
+
refute subject.ready?
|
70
|
+
refute subject.finished?
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
describe "when state is 'deleted'" do
|
75
|
+
it do
|
76
|
+
subject.state = "deleted"
|
77
|
+
|
78
|
+
refute subject.creating?
|
79
|
+
refute subject.attached?
|
80
|
+
refute subject.detached?
|
81
|
+
refute subject.deleting?
|
82
|
+
assert subject.deleted?
|
83
|
+
refute subject.failed?
|
84
|
+
|
85
|
+
refute subject.ready?
|
86
|
+
assert subject.finished?
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
describe "when state is 'failed'" do
|
91
|
+
it do
|
92
|
+
subject.state = "failed"
|
93
|
+
|
94
|
+
refute subject.creating?
|
95
|
+
refute subject.attached?
|
96
|
+
refute subject.detached?
|
97
|
+
refute subject.deleting?
|
98
|
+
refute subject.deleted?
|
99
|
+
assert subject.failed?
|
100
|
+
|
101
|
+
refute subject.ready?
|
102
|
+
assert subject.finished?
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
describe "#attach" do
|
107
|
+
it do
|
108
|
+
subject.id = "vol-12345"
|
109
|
+
assert subject.persisted?
|
110
|
+
|
111
|
+
server = service.servers.new
|
112
|
+
server.id = "srv-12345"
|
113
|
+
|
114
|
+
stub_request(:post, "http://localhost/1.0/volumes/vol-12345/attach").
|
115
|
+
with(:query => hash_including(:account_id),
|
116
|
+
:headers => { "Authorization" => "Bearer FAKECACHEDTOKEN",
|
117
|
+
"Content-Type" => "application/json" },
|
118
|
+
:body => hash_including(:server => "srv-12345")).
|
119
|
+
to_return(:status => 202,
|
120
|
+
:body => %q({"id":"vol-12345","status":"attached"}),
|
121
|
+
:headers => {})
|
122
|
+
|
123
|
+
subject.attach(server)
|
124
|
+
|
125
|
+
assert subject.attached?
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
describe "#collection_name" do
|
130
|
+
it "responds 'volumes'" do
|
131
|
+
assert_equal "volumes", subject.collection_name
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
describe "#copy" do
|
136
|
+
it do
|
137
|
+
subject.id = "vol-12345"
|
138
|
+
subject.state = "attached"
|
139
|
+
subject.delete_with_server = false
|
140
|
+
|
141
|
+
refute subject.delete_with_server
|
142
|
+
assert subject.persisted?
|
143
|
+
|
144
|
+
stub_request(:post, "http://localhost/1.0/volumes/vol-12345/copy").
|
145
|
+
with(:query => hash_including(:account_id),
|
146
|
+
:headers => { "Authorization" => "Bearer FAKECACHEDTOKEN",
|
147
|
+
"Content-Type" => "application/json" },
|
148
|
+
:body => hash_including(:delete_with_server => true)).
|
149
|
+
to_return(:status => 202,
|
150
|
+
:body => %q({"id":"vol-abcde","delete_with_server":true,"name":"Copy of vol-12345 (Impish Image)","status":"detached"}),
|
151
|
+
:headers => {})
|
152
|
+
|
153
|
+
copy = subject.copy(delete_with_server: true)
|
154
|
+
|
155
|
+
assert copy.persisted?
|
156
|
+
assert_equal "vol-abcde", copy.id
|
157
|
+
assert copy.delete_with_server
|
158
|
+
assert copy.detached?
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
describe "#detach" do
|
163
|
+
it do
|
164
|
+
subject.id = "vol-12345"
|
165
|
+
subject.state = "attached"
|
166
|
+
|
167
|
+
assert subject.persisted?
|
168
|
+
|
169
|
+
stub_request(:post, "http://localhost/1.0/volumes/vol-12345/detach").
|
170
|
+
with(:query => hash_including(:account_id),
|
171
|
+
:headers => { "Authorization" => "Bearer FAKECACHEDTOKEN",
|
172
|
+
"Content-Type" => "application/json" }).
|
173
|
+
to_return(:status => 202,
|
174
|
+
:body => %q({"id":"vol-12345","status":"detached"}),
|
175
|
+
:headers => {})
|
176
|
+
|
177
|
+
subject.detach
|
178
|
+
|
179
|
+
assert subject.detached?
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
describe "#destroy" do
|
184
|
+
it do
|
185
|
+
subject.id = "vol-12345"
|
186
|
+
assert subject.persisted?
|
187
|
+
|
188
|
+
stub_request(:delete, "http://localhost/1.0/volumes/vol-12345").
|
189
|
+
with(:query => hash_including(:account_id),
|
190
|
+
:headers => { "Authorization" => "Bearer FAKECACHEDTOKEN",
|
191
|
+
"Content-Type" => "application/json" }).
|
192
|
+
to_return(:status => 202,
|
193
|
+
:body => %q({"id":"vol-12345","status":"deleting"}),
|
194
|
+
:headers => {})
|
195
|
+
|
196
|
+
subject.destroy
|
197
|
+
assert_equal "deleting", subject.state
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
describe "#ready?" do
|
202
|
+
describe "when state is 'creating'" do
|
203
|
+
it do
|
204
|
+
subject.state = "creating"
|
205
|
+
|
206
|
+
refute subject.ready?
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
describe "when state is 'attached'" do
|
211
|
+
it do
|
212
|
+
subject.state = "attached"
|
213
|
+
|
214
|
+
assert subject.ready?
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
describe "when state is 'detached'" do
|
219
|
+
it do
|
220
|
+
subject.state = "detached"
|
221
|
+
|
222
|
+
assert subject.ready?
|
223
|
+
end
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
describe "#resize" do
|
228
|
+
it do
|
229
|
+
subject.id = "vol-12345"
|
230
|
+
subject.size = 40_000
|
231
|
+
|
232
|
+
assert subject.persisted?
|
233
|
+
|
234
|
+
stub_request(:post, "http://localhost/1.0/volumes/vol-12345/resize").
|
235
|
+
with(:query => hash_including(:account_id),
|
236
|
+
:headers => { "Authorization" => "Bearer FAKECACHEDTOKEN",
|
237
|
+
"Content-Type" => "application/json" },
|
238
|
+
:body => hash_including(:from => 40_000, :to => 50_000)).
|
239
|
+
to_return(:status => 202,
|
240
|
+
:body => %q({"id":"vol-12345","size": 50000}),
|
241
|
+
:headers => {})
|
242
|
+
|
243
|
+
subject.resize(to: 50_000)
|
244
|
+
|
245
|
+
assert 50_000, subject.size
|
246
|
+
end
|
247
|
+
end
|
248
|
+
|
249
|
+
describe "#resource_name" do
|
250
|
+
it "responds 'volume'" do
|
251
|
+
assert_equal "volume", subject.resource_name
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
describe "#save" do
|
256
|
+
describe "when creating" do
|
257
|
+
describe "with mutually exclusive arguments" do
|
258
|
+
it "raises Fog::Errors::Error" do
|
259
|
+
options = {
|
260
|
+
filesystem_type: "ext4",
|
261
|
+
image_id: "img-12345"
|
262
|
+
}
|
263
|
+
|
264
|
+
@volume = Fog::Brightbox::Compute::Volume.new({ :service => service }.merge(options))
|
265
|
+
|
266
|
+
assert_raises Fog::Errors::Error do
|
267
|
+
@volume.save
|
268
|
+
end
|
269
|
+
end
|
270
|
+
end
|
271
|
+
|
272
|
+
describe "with filesytem type" do
|
273
|
+
it "sends correct JSON" do
|
274
|
+
options = {
|
275
|
+
description: "An ext4 volume",
|
276
|
+
filesystem_type: "ext4"
|
277
|
+
}
|
278
|
+
|
279
|
+
stub_request(:post, "http://localhost/1.0/volumes").
|
280
|
+
with(:query => hash_including(:account_id),
|
281
|
+
:headers => { "Authorization" => "Bearer FAKECACHEDTOKEN",
|
282
|
+
"Content-Type" => "application/json" },
|
283
|
+
:body => hash_including(:filesystem_type => "ext4")).
|
284
|
+
to_return(:status => 202,
|
285
|
+
:body => %q({"id":"vol-12345","image":{"id":"img-blank"}}),
|
286
|
+
:headers => {})
|
287
|
+
|
288
|
+
@volume = Fog::Brightbox::Compute::Volume.new({ :service => service }.merge(options))
|
289
|
+
assert @volume.save
|
290
|
+
assert_equal @volume.filesystem_type, "ext4"
|
291
|
+
assert_equal @volume.image_id, "img-blank"
|
292
|
+
assert_equal @volume.description, "An ext4 volume"
|
293
|
+
end
|
294
|
+
end
|
295
|
+
|
296
|
+
describe "with image" do
|
297
|
+
it "sends correct JSON" do
|
298
|
+
options = {
|
299
|
+
image_id: "img-12345",
|
300
|
+
name: "My Volume"
|
301
|
+
}
|
302
|
+
|
303
|
+
stub_request(:post, "http://localhost/1.0/volumes").
|
304
|
+
with(:query => hash_including(:account_id),
|
305
|
+
:headers => { "Authorization" => "Bearer FAKECACHEDTOKEN",
|
306
|
+
"Content-Type" => "application/json" },
|
307
|
+
:body => hash_including(:image => "img-12345")).
|
308
|
+
to_return(:status => 202,
|
309
|
+
:body => %q({"id":"vol-12345","image":{"id":"img-12345"}}),
|
310
|
+
:headers => {})
|
311
|
+
|
312
|
+
|
313
|
+
@volume = Fog::Brightbox::Compute::Volume.new({ :service => service }.merge(options))
|
314
|
+
assert @volume.save
|
315
|
+
assert_equal @volume.image_id, "img-12345"
|
316
|
+
assert_equal @volume.name, "My Volume"
|
317
|
+
end
|
318
|
+
end
|
319
|
+
end
|
320
|
+
|
321
|
+
describe "when updating" do
|
322
|
+
it do
|
323
|
+
subject.id = "vol-12345"
|
324
|
+
|
325
|
+
assert subject.persisted?
|
326
|
+
|
327
|
+
subject.delete_with_server = true
|
328
|
+
subject.description = "Updated description"
|
329
|
+
subject.name = "New name"
|
330
|
+
subject.serial = "NewSerial"
|
331
|
+
|
332
|
+
stub_request(:put, "http://localhost/1.0/volumes/vol-12345").
|
333
|
+
with(:query => hash_including(:account_id),
|
334
|
+
:headers => { "Authorization" => "Bearer FAKECACHEDTOKEN",
|
335
|
+
"Content-Type" => "application/json" },
|
336
|
+
:body => hash_including(:delete_with_server => true,
|
337
|
+
:description => "Updated description",
|
338
|
+
:name => "New name",
|
339
|
+
:serial => "NewSerial")).
|
340
|
+
to_return(:status => 202,
|
341
|
+
:body => %q({"id":"vol-12345"}),
|
342
|
+
:headers => {})
|
343
|
+
|
344
|
+
subject.save
|
345
|
+
end
|
346
|
+
end
|
347
|
+
end
|
348
|
+
end
|
@@ -252,6 +252,29 @@ class Brightbox
|
|
252
252
|
"inviter" => Brightbox::Compute::Formats::Nested::USER
|
253
253
|
}
|
254
254
|
|
255
|
+
VOLUME = {
|
256
|
+
"id" => String,
|
257
|
+
"resource_type" => String,
|
258
|
+
"url" => String,
|
259
|
+
"status" => String,
|
260
|
+
"name" => Fog::Nullable::String,
|
261
|
+
"delete_with_server" => Fog::Boolean,
|
262
|
+
"description" => Fog::Nullable::String,
|
263
|
+
"boot" => Fog::Boolean,
|
264
|
+
"encrypted" => Fog::Boolean,
|
265
|
+
"filesystem_label" => Fog::Nullable::String,
|
266
|
+
"filesystem_type" => Fog::Nullable::String,
|
267
|
+
"locked" => Fog::Boolean,
|
268
|
+
"serial" => String,
|
269
|
+
"size" => Integer,
|
270
|
+
"source" => Fog::Nullable::String,
|
271
|
+
"source_type" => String,
|
272
|
+
"storage_type" => String,
|
273
|
+
"created_at" => String,
|
274
|
+
"updated_at" => String,
|
275
|
+
"deleted_at" => Fog::Nullable::String
|
276
|
+
}
|
277
|
+
|
255
278
|
ZONE = {
|
256
279
|
"id" => String,
|
257
280
|
"resource_type" => String,
|
@@ -482,6 +505,29 @@ class Brightbox
|
|
482
505
|
"inviter" => Brightbox::Compute::Formats::Nested::USER
|
483
506
|
}
|
484
507
|
|
508
|
+
VOLUME = {
|
509
|
+
"id" => String,
|
510
|
+
"resource_type" => String,
|
511
|
+
"url" => String,
|
512
|
+
"status" => String,
|
513
|
+
"name" => Fog::Nullable::String,
|
514
|
+
"delete_with_server" => Fog::Boolean,
|
515
|
+
"description" => Fog::Nullable::String,
|
516
|
+
"boot" => Fog::Boolean,
|
517
|
+
"encrypted" => Fog::Boolean,
|
518
|
+
"filesystem_label" => Fog::Nullable::String,
|
519
|
+
"filesystem_type" => Fog::Nullable::String,
|
520
|
+
"locked" => Fog::Boolean,
|
521
|
+
"serial" => String,
|
522
|
+
"size" => Integer,
|
523
|
+
"source" => Fog::Nullable::String,
|
524
|
+
"source_type" => String,
|
525
|
+
"storage_type" => String,
|
526
|
+
"created_at" => String,
|
527
|
+
"updated_at" => String,
|
528
|
+
"deleted_at" => Fog::Nullable::String
|
529
|
+
}
|
530
|
+
|
485
531
|
ZONE = {
|
486
532
|
"id" => String,
|
487
533
|
"resource_type" => String,
|
@@ -706,6 +752,7 @@ class Brightbox
|
|
706
752
|
"snapshots" => [Brightbox::Compute::Formats::Nested::IMAGE],
|
707
753
|
"server_groups" => [Brightbox::Compute::Formats::Nested::SERVER_GROUP],
|
708
754
|
"interfaces" => [Brightbox::Compute::Formats::Nested::INTERFACE],
|
755
|
+
"volumes" => [Brightbox::Compute::Formats::Nested::VOLUME],
|
709
756
|
"zone" => Fog::Brightbox::Nullable::Zone,
|
710
757
|
"licence_name" => Fog::Nullable::String,
|
711
758
|
"username" => Fog::Nullable::String,
|
@@ -763,6 +810,32 @@ class Brightbox
|
|
763
810
|
"inviter" => Brightbox::Compute::Formats::Nested::USER
|
764
811
|
}
|
765
812
|
|
813
|
+
VOLUME = {
|
814
|
+
"id" => String,
|
815
|
+
"resource_type" => String,
|
816
|
+
"url" => String,
|
817
|
+
"status" => String,
|
818
|
+
"name" => Fog::Nullable::String,
|
819
|
+
"delete_with_server" => Fog::Boolean,
|
820
|
+
"description" => Fog::Nullable::String,
|
821
|
+
"boot" => Fog::Boolean,
|
822
|
+
"encrypted" => Fog::Boolean,
|
823
|
+
"filesystem_label" => Fog::Nullable::String,
|
824
|
+
"filesystem_type" => Fog::Nullable::String,
|
825
|
+
"locked" => Fog::Boolean,
|
826
|
+
"serial" => String,
|
827
|
+
"size" => Integer,
|
828
|
+
"source" => Fog::Nullable::String,
|
829
|
+
"source_type" => String,
|
830
|
+
"storage_type" => String,
|
831
|
+
"created_at" => String,
|
832
|
+
"updated_at" => String,
|
833
|
+
"deleted_at" => Fog::Nullable::String,
|
834
|
+
"account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
|
835
|
+
"image" => Fog::Brightbox::Nullable::Image,
|
836
|
+
"server" => Fog::Brightbox::Nullable::Server
|
837
|
+
}
|
838
|
+
|
766
839
|
ZONE = {
|
767
840
|
"id" => String,
|
768
841
|
"resource_type" => String,
|
@@ -787,6 +860,7 @@ class Brightbox
|
|
787
860
|
SERVER_GROUPS = [Brightbox::Compute::Formats::Collected::SERVER_GROUP]
|
788
861
|
SERVER_TYPES = [Brightbox::Compute::Formats::Collected::SERVER_TYPE]
|
789
862
|
USERS = [Brightbox::Compute::Formats::Collected::USER]
|
863
|
+
VOLUMES = [Brightbox::Compute::Formats::Collected::VOLUME]
|
790
864
|
ZONES = [Brightbox::Compute::Formats::Collected::ZONE]
|
791
865
|
end
|
792
866
|
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
Shindo.tests("Fog::Compute[:brightbox] | volume requests", ["brightbox"]) do
|
2
|
+
pending if Fog.mocking?
|
3
|
+
image_id = Brightbox::Compute::TestSupport.image_id
|
4
|
+
|
5
|
+
tests("success") do
|
6
|
+
create_options = { image: image_id }
|
7
|
+
|
8
|
+
tests("#create_volume(#{create_options.inspect})") do
|
9
|
+
result = Fog::Compute[:brightbox].create_volume(create_options)
|
10
|
+
@volume_id = result["id"]
|
11
|
+
data_matches_schema(Brightbox::Compute::Formats::Full::VOLUME, :allow_extra_keys => true) { result }
|
12
|
+
end
|
13
|
+
|
14
|
+
tests("#list_volumes") do
|
15
|
+
result = Fog::Compute[:brightbox].list_volumes
|
16
|
+
data_matches_schema(Brightbox::Compute::Formats::Collection::VOLUMES, :allow_extra_keys => true) { result }
|
17
|
+
|
18
|
+
test("#{@volume_id} is listed") do
|
19
|
+
result.any? do |volume|
|
20
|
+
volume["id"] == @volume_id
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
tests("#get_volume('#{@volume_id}')") do
|
26
|
+
result = Fog::Compute[:brightbox].get_volume(@volume_id)
|
27
|
+
data_matches_schema(Brightbox::Compute::Formats::Full::VOLUME, :allow_extra_keys => true) { result }
|
28
|
+
end
|
29
|
+
|
30
|
+
update_options = {
|
31
|
+
name: "New name"
|
32
|
+
}
|
33
|
+
tests("#update_volume('#{@volume_id}', ...)") do
|
34
|
+
result = Fog::Compute[:brightbox].update_volume(@volume_id, update_options)
|
35
|
+
data_matches_schema(Brightbox::Compute::Formats::Full::VOLUME, :allow_extra_keys => true) { result }
|
36
|
+
|
37
|
+
test("name has updated") { result["name"] == "New name" }
|
38
|
+
end
|
39
|
+
|
40
|
+
Fog::Compute[:brightbox].volumes.get(@volume_id).wait_for { ready? }
|
41
|
+
|
42
|
+
tests("#delete_volume('#{@volume_id}')") do
|
43
|
+
result = Fog::Compute[:brightbox].delete_volume(@volume_id)
|
44
|
+
data_matches_schema(Brightbox::Compute::Formats::Full::VOLUME, :allow_extra_keys => true) { result }
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
tests("failure") do
|
49
|
+
tests("create_volume without options").raises(ArgumentError) do
|
50
|
+
Fog::Compute[:brightbox].create_volume
|
51
|
+
end
|
52
|
+
|
53
|
+
tests("get_volume with invalid ID").raises(Excon::Errors::NotFound) do
|
54
|
+
Fog::Compute[:brightbox].get_volume("vol-00000")
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-brightbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Thornthwaite
|
@@ -219,6 +219,8 @@ files:
|
|
219
219
|
- lib/fog/brightbox/models/compute/user_collaboration.rb
|
220
220
|
- lib/fog/brightbox/models/compute/user_collaborations.rb
|
221
221
|
- lib/fog/brightbox/models/compute/users.rb
|
222
|
+
- lib/fog/brightbox/models/compute/volume.rb
|
223
|
+
- lib/fog/brightbox/models/compute/volumes.rb
|
222
224
|
- lib/fog/brightbox/models/compute/zone.rb
|
223
225
|
- lib/fog/brightbox/models/compute/zones.rb
|
224
226
|
- lib/fog/brightbox/models/storage/directories.rb
|
@@ -232,6 +234,8 @@ files:
|
|
232
234
|
- lib/fog/brightbox/requests/compute/add_nodes_load_balancer.rb
|
233
235
|
- lib/fog/brightbox/requests/compute/add_servers_server_group.rb
|
234
236
|
- lib/fog/brightbox/requests/compute/apply_to_firewall_policy.rb
|
237
|
+
- lib/fog/brightbox/requests/compute/attach_volume.rb
|
238
|
+
- lib/fog/brightbox/requests/compute/copy_volume.rb
|
235
239
|
- lib/fog/brightbox/requests/compute/create_api_client.rb
|
236
240
|
- lib/fog/brightbox/requests/compute/create_application.rb
|
237
241
|
- lib/fog/brightbox/requests/compute/create_cloud_ip.rb
|
@@ -243,6 +247,7 @@ files:
|
|
243
247
|
- lib/fog/brightbox/requests/compute/create_load_balancer.rb
|
244
248
|
- lib/fog/brightbox/requests/compute/create_server.rb
|
245
249
|
- lib/fog/brightbox/requests/compute/create_server_group.rb
|
250
|
+
- lib/fog/brightbox/requests/compute/create_volume.rb
|
246
251
|
- lib/fog/brightbox/requests/compute/delete_api_client.rb
|
247
252
|
- lib/fog/brightbox/requests/compute/delete_application.rb
|
248
253
|
- lib/fog/brightbox/requests/compute/delete_cloud_ip.rb
|
@@ -256,6 +261,8 @@ files:
|
|
256
261
|
- lib/fog/brightbox/requests/compute/delete_server.rb
|
257
262
|
- lib/fog/brightbox/requests/compute/delete_server_group.rb
|
258
263
|
- lib/fog/brightbox/requests/compute/delete_user_collaboration.rb
|
264
|
+
- lib/fog/brightbox/requests/compute/delete_volume.rb
|
265
|
+
- lib/fog/brightbox/requests/compute/detach_volume.rb
|
259
266
|
- lib/fog/brightbox/requests/compute/get_account.rb
|
260
267
|
- lib/fog/brightbox/requests/compute/get_api_client.rb
|
261
268
|
- lib/fog/brightbox/requests/compute/get_application.rb
|
@@ -276,6 +283,7 @@ files:
|
|
276
283
|
- lib/fog/brightbox/requests/compute/get_server_type.rb
|
277
284
|
- lib/fog/brightbox/requests/compute/get_user.rb
|
278
285
|
- lib/fog/brightbox/requests/compute/get_user_collaboration.rb
|
286
|
+
- lib/fog/brightbox/requests/compute/get_volume.rb
|
279
287
|
- lib/fog/brightbox/requests/compute/get_zone.rb
|
280
288
|
- lib/fog/brightbox/requests/compute/list_accounts.rb
|
281
289
|
- lib/fog/brightbox/requests/compute/list_api_clients.rb
|
@@ -294,12 +302,14 @@ files:
|
|
294
302
|
- lib/fog/brightbox/requests/compute/list_servers.rb
|
295
303
|
- lib/fog/brightbox/requests/compute/list_user_collaborations.rb
|
296
304
|
- lib/fog/brightbox/requests/compute/list_users.rb
|
305
|
+
- lib/fog/brightbox/requests/compute/list_volumes.rb
|
297
306
|
- lib/fog/brightbox/requests/compute/list_zones.rb
|
298
307
|
- lib/fog/brightbox/requests/compute/lock_resource_database_server.rb
|
299
308
|
- lib/fog/brightbox/requests/compute/lock_resource_database_snapshot.rb
|
300
309
|
- lib/fog/brightbox/requests/compute/lock_resource_image.rb
|
301
310
|
- lib/fog/brightbox/requests/compute/lock_resource_load_balancer.rb
|
302
311
|
- lib/fog/brightbox/requests/compute/lock_resource_server.rb
|
312
|
+
- lib/fog/brightbox/requests/compute/lock_resource_volume.rb
|
303
313
|
- lib/fog/brightbox/requests/compute/map_cloud_ip.rb
|
304
314
|
- lib/fog/brightbox/requests/compute/move_servers_server_group.rb
|
305
315
|
- lib/fog/brightbox/requests/compute/reboot_server.rb
|
@@ -315,6 +325,7 @@ files:
|
|
315
325
|
- lib/fog/brightbox/requests/compute/reset_secret_api_client.rb
|
316
326
|
- lib/fog/brightbox/requests/compute/reset_secret_application.rb
|
317
327
|
- lib/fog/brightbox/requests/compute/reset_server.rb
|
328
|
+
- lib/fog/brightbox/requests/compute/resize_volume.rb
|
318
329
|
- lib/fog/brightbox/requests/compute/shutdown_server.rb
|
319
330
|
- lib/fog/brightbox/requests/compute/snapshot_database_server.rb
|
320
331
|
- lib/fog/brightbox/requests/compute/snapshot_server.rb
|
@@ -325,6 +336,7 @@ files:
|
|
325
336
|
- lib/fog/brightbox/requests/compute/unlock_resource_image.rb
|
326
337
|
- lib/fog/brightbox/requests/compute/unlock_resource_load_balancer.rb
|
327
338
|
- lib/fog/brightbox/requests/compute/unlock_resource_server.rb
|
339
|
+
- lib/fog/brightbox/requests/compute/unlock_resource_volume.rb
|
328
340
|
- lib/fog/brightbox/requests/compute/unmap_cloud_ip.rb
|
329
341
|
- lib/fog/brightbox/requests/compute/update_account.rb
|
330
342
|
- lib/fog/brightbox/requests/compute/update_api_client.rb
|
@@ -340,6 +352,7 @@ files:
|
|
340
352
|
- lib/fog/brightbox/requests/compute/update_server.rb
|
341
353
|
- lib/fog/brightbox/requests/compute/update_server_group.rb
|
342
354
|
- lib/fog/brightbox/requests/compute/update_user.rb
|
355
|
+
- lib/fog/brightbox/requests/compute/update_volume.rb
|
343
356
|
- lib/fog/brightbox/requests/storage/copy_object.rb
|
344
357
|
- lib/fog/brightbox/requests/storage/delete_container.rb
|
345
358
|
- lib/fog/brightbox/requests/storage/delete_multiple_objects.rb
|
@@ -368,6 +381,9 @@ files:
|
|
368
381
|
- lib/fog/brightbox/storage/not_found.rb
|
369
382
|
- lib/fog/brightbox/version.rb
|
370
383
|
- spec/fog/brightbox/compute/config_spec.rb
|
384
|
+
- spec/fog/brightbox/compute/credentials_spec.rb
|
385
|
+
- spec/fog/brightbox/compute/get_access_token_spec.rb
|
386
|
+
- spec/fog/brightbox/compute/two_factor_spec.rb
|
371
387
|
- spec/fog/brightbox/compute/wrapped_request_spec.rb
|
372
388
|
- spec/fog/brightbox/config_spec.rb
|
373
389
|
- spec/fog/brightbox/link_helper_spec.rb
|
@@ -398,6 +414,7 @@ files:
|
|
398
414
|
- spec/fog/compute/brightbox/server_spec.rb
|
399
415
|
- spec/fog/compute/brightbox/user_collaboration_spec.rb
|
400
416
|
- spec/fog/compute/brightbox/user_spec.rb
|
417
|
+
- spec/fog/compute/brightbox/volume_spec.rb
|
401
418
|
- spec/fog/compute/brightbox/zone_spec.rb
|
402
419
|
- spec/fog/compute/brightbox_spec.rb
|
403
420
|
- spec/fog/storage/brightbox_spec.rb
|
@@ -434,6 +451,7 @@ files:
|
|
434
451
|
- tests/brightbox/requests/compute/server_type_tests.rb
|
435
452
|
- tests/brightbox/requests/compute/user_collaboration_tests.rb
|
436
453
|
- tests/brightbox/requests/compute/user_tests.rb
|
454
|
+
- tests/brightbox/requests/compute/volume_tests.rb
|
437
455
|
- tests/brightbox/requests/compute/zone_tests.rb
|
438
456
|
- tests/helper.rb
|
439
457
|
- tests/helpers/collection_helper.rb
|
@@ -473,6 +491,9 @@ summary: This library can be used as a module for `fog` or as standalone provide
|
|
473
491
|
to use the Brightbox Cloud in applications
|
474
492
|
test_files:
|
475
493
|
- spec/fog/brightbox/compute/config_spec.rb
|
494
|
+
- spec/fog/brightbox/compute/credentials_spec.rb
|
495
|
+
- spec/fog/brightbox/compute/get_access_token_spec.rb
|
496
|
+
- spec/fog/brightbox/compute/two_factor_spec.rb
|
476
497
|
- spec/fog/brightbox/compute/wrapped_request_spec.rb
|
477
498
|
- spec/fog/brightbox/config_spec.rb
|
478
499
|
- spec/fog/brightbox/link_helper_spec.rb
|
@@ -503,6 +524,7 @@ test_files:
|
|
503
524
|
- spec/fog/compute/brightbox/server_spec.rb
|
504
525
|
- spec/fog/compute/brightbox/user_collaboration_spec.rb
|
505
526
|
- spec/fog/compute/brightbox/user_spec.rb
|
527
|
+
- spec/fog/compute/brightbox/volume_spec.rb
|
506
528
|
- spec/fog/compute/brightbox/zone_spec.rb
|
507
529
|
- spec/fog/compute/brightbox_spec.rb
|
508
530
|
- spec/fog/storage/brightbox_spec.rb
|