fog-brightbox 1.10.0 → 1.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +20 -3
  3. data/.rubocop.yml +15 -10
  4. data/CHANGELOG.md +34 -0
  5. data/README.md +6 -0
  6. data/Rakefile +1 -1
  7. data/fog-brightbox.gemspec +9 -3
  8. data/lib/fog/brightbox/compute/shared.rb +11 -10
  9. data/lib/fog/brightbox/compute.rb +20 -21
  10. data/lib/fog/brightbox/config.rb +6 -9
  11. data/lib/fog/brightbox/models/compute/api_client.rb +4 -4
  12. data/lib/fog/brightbox/models/compute/application.rb +2 -2
  13. data/lib/fog/brightbox/models/compute/cloud_ip.rb +11 -11
  14. data/lib/fog/brightbox/models/compute/collaboration.rb +3 -3
  15. data/lib/fog/brightbox/models/compute/collaborations.rb +1 -1
  16. data/lib/fog/brightbox/models/compute/config_map.rb +2 -3
  17. data/lib/fog/brightbox/models/compute/database_server.rb +17 -5
  18. data/lib/fog/brightbox/models/compute/database_snapshot.rb +2 -2
  19. data/lib/fog/brightbox/models/compute/firewall_policy.rb +6 -6
  20. data/lib/fog/brightbox/models/compute/firewall_rule.rb +9 -9
  21. data/lib/fog/brightbox/models/compute/image.rb +9 -9
  22. data/lib/fog/brightbox/models/compute/load_balancer.rb +12 -12
  23. data/lib/fog/brightbox/models/compute/server.rb +21 -23
  24. data/lib/fog/brightbox/models/compute/server_group.rb +6 -6
  25. data/lib/fog/brightbox/models/compute/user.rb +3 -3
  26. data/lib/fog/brightbox/models/compute/volume.rb +16 -16
  27. data/lib/fog/brightbox/models/storage/directories.rb +2 -2
  28. data/lib/fog/brightbox/models/storage/directory.rb +7 -7
  29. data/lib/fog/brightbox/models/storage/file.rb +13 -13
  30. data/lib/fog/brightbox/models/storage/files.rb +9 -13
  31. data/lib/fog/brightbox/oauth2.rb +13 -11
  32. data/lib/fog/brightbox/requests/compute/list_accounts.rb +1 -1
  33. data/lib/fog/brightbox/requests/compute/reset_database_server.rb +21 -0
  34. data/lib/fog/brightbox/requests/compute/resize_database_server.rb +25 -0
  35. data/lib/fog/brightbox/requests/compute/snapshot_database_server.rb +1 -1
  36. data/lib/fog/brightbox/requests/compute/snapshot_server.rb +1 -1
  37. data/lib/fog/brightbox/requests/storage/copy_object.rb +5 -5
  38. data/lib/fog/brightbox/requests/storage/delete_container.rb +3 -3
  39. data/lib/fog/brightbox/requests/storage/delete_multiple_objects.rb +7 -7
  40. data/lib/fog/brightbox/requests/storage/delete_object.rb +3 -3
  41. data/lib/fog/brightbox/requests/storage/delete_static_large_object.rb +6 -6
  42. data/lib/fog/brightbox/requests/storage/get_container.rb +4 -4
  43. data/lib/fog/brightbox/requests/storage/get_containers.rb +4 -4
  44. data/lib/fog/brightbox/requests/storage/get_object.rb +4 -6
  45. data/lib/fog/brightbox/requests/storage/get_object_http_url.rb +1 -1
  46. data/lib/fog/brightbox/requests/storage/get_object_https_url.rb +1 -1
  47. data/lib/fog/brightbox/requests/storage/head_container.rb +4 -4
  48. data/lib/fog/brightbox/requests/storage/head_containers.rb +4 -4
  49. data/lib/fog/brightbox/requests/storage/head_object.rb +3 -3
  50. data/lib/fog/brightbox/requests/storage/post_set_meta_temp_url_key.rb +3 -3
  51. data/lib/fog/brightbox/requests/storage/put_container.rb +4 -4
  52. data/lib/fog/brightbox/requests/storage/put_dynamic_obj_manifest.rb +4 -4
  53. data/lib/fog/brightbox/requests/storage/put_object.rb +7 -7
  54. data/lib/fog/brightbox/requests/storage/put_static_obj_manifest.rb +6 -6
  55. data/lib/fog/brightbox/storage/authentication_request.rb +4 -4
  56. data/lib/fog/brightbox/storage/connection.rb +2 -2
  57. data/lib/fog/brightbox/storage.rb +13 -14
  58. data/lib/fog/brightbox/version.rb +1 -1
  59. data/spec/fog/brightbox/compute/config_spec.rb +4 -4
  60. data/spec/fog/brightbox/compute/get_access_token_spec.rb +28 -28
  61. data/spec/fog/brightbox/compute/wrapped_request_spec.rb +23 -23
  62. data/spec/fog/brightbox/config_spec.rb +23 -23
  63. data/spec/fog/brightbox/oauth2/client_credentials_strategy_spec.rb +2 -2
  64. data/spec/fog/brightbox/oauth2/credential_set_spec.rb +5 -5
  65. data/spec/fog/brightbox/oauth2/grant_type_strategy_spec.rb +2 -2
  66. data/spec/fog/brightbox/oauth2/refresh_token_strategy_spec.rb +3 -3
  67. data/spec/fog/brightbox/oauth2/user_credentials_strategy_spec.rb +4 -4
  68. data/spec/fog/brightbox/storage/authentication_request_spec.rb +41 -34
  69. data/spec/fog/brightbox/storage/config_spec.rb +4 -4
  70. data/spec/fog/brightbox/storage/connection_errors_spec.rb +6 -6
  71. data/spec/fog/brightbox/storage/connection_spec.rb +37 -37
  72. data/spec/fog/brightbox/storage/directory_spec.rb +6 -6
  73. data/spec/fog/brightbox/storage/files_spec.rb +5 -5
  74. data/spec/fog/brightbox/storage_spec.rb +5 -5
  75. data/spec/fog/compute/brightbox/database_server_spec.rb +19 -19
  76. data/spec/fog/compute/brightbox/image_selector_spec.rb +18 -18
  77. data/spec/fog/compute/brightbox/load_balancer_spec.rb +5 -5
  78. data/spec/fog/compute/brightbox/server_spec.rb +44 -44
  79. data/spec/fog/compute/brightbox/volume_spec.rb +68 -69
  80. data/spec/fog/compute/brightbox_spec.rb +16 -10
  81. data/spec/fog/storage/brightbox_spec.rb +83 -83
  82. data/spec/model_setup.rb +9 -9
  83. data/spec/stock_storage_responses.rb +9 -9
  84. data/spec/supports_resource_locking.rb +6 -6
  85. data/tests/brightbox/compute/schema.rb +74 -74
  86. data/tests/brightbox/compute_tests.rb +14 -14
  87. data/tests/brightbox/models/compute/account_tests.rb +0 -10
  88. data/tests/brightbox/models/compute/server_tests.rb +0 -1
  89. data/tests/brightbox/requests/compute/account_tests.rb +7 -21
  90. data/tests/brightbox/requests/compute/api_client_tests.rb +9 -9
  91. data/tests/brightbox/requests/compute/application_test.rb +8 -8
  92. data/tests/brightbox/requests/compute/cloud_ip_tests.rb +11 -13
  93. data/tests/brightbox/requests/compute/collaboration_tests.rb +1 -1
  94. data/tests/brightbox/requests/compute/database_server_tests.rb +7 -7
  95. data/tests/brightbox/requests/compute/database_snapsnot_tests.rb +5 -5
  96. data/tests/brightbox/requests/compute/database_type_tests.rb +1 -1
  97. data/tests/brightbox/requests/compute/firewall_policy_tests.rb +7 -7
  98. data/tests/brightbox/requests/compute/firewall_rule_tests.rb +8 -10
  99. data/tests/brightbox/requests/compute/helper.rb +1 -1
  100. data/tests/brightbox/requests/compute/image_tests.rb +2 -2
  101. data/tests/brightbox/requests/compute/interface_tests.rb +1 -1
  102. data/tests/brightbox/requests/compute/load_balancer_tests.rb +23 -23
  103. data/tests/brightbox/requests/compute/server_group_tests.rb +16 -18
  104. data/tests/brightbox/requests/compute/server_tests.rb +12 -12
  105. data/tests/brightbox/requests/compute/server_type_tests.rb +2 -2
  106. data/tests/brightbox/requests/compute/user_tests.rb +4 -4
  107. data/tests/brightbox/requests/compute/volume_tests.rb +5 -5
  108. data/tests/brightbox/requests/compute/zone_tests.rb +2 -2
  109. data/tests/helper.rb +1 -1
  110. data/tests/helpers/collection_helper.rb +16 -23
  111. data/tests/helpers/compute/server_helper.rb +4 -6
  112. data/tests/helpers/formats_helper.rb +5 -5
  113. data/tests/helpers/formats_helper_tests.rb +16 -16
  114. data/tests/helpers/mock_helper.rb +84 -86
  115. data/tests/helpers/model_helper.rb +1 -3
  116. data/tests/helpers/schema_validator_tests.rb +14 -14
  117. metadata +22 -7
  118. data/.rubocop_todo.yml +0 -81
@@ -53,13 +53,13 @@ class Brightbox
53
53
  "protocol" => String,
54
54
  "incoming" => Integer,
55
55
  "outgoing" => Integer
56
- }
56
+ }.freeze
57
57
  LB_LISTENER = {
58
58
  "in" => Integer,
59
59
  "out" => Integer,
60
60
  "protocol" => String,
61
61
  "timeout" => Integer
62
- }
62
+ }.freeze
63
63
  LB_HEALTHCHECK = {
64
64
  "type" => String,
65
65
  "request" => String,
@@ -68,7 +68,7 @@ class Brightbox
68
68
  "timeout" => Integer,
69
69
  "threshold_up" => Integer,
70
70
  "threshold_down" => Integer
71
- }
71
+ }.freeze
72
72
  end
73
73
 
74
74
  module Nested
@@ -78,7 +78,7 @@ class Brightbox
78
78
  "url" => String,
79
79
  "id" => String,
80
80
  "status" => String
81
- }
81
+ }.freeze
82
82
 
83
83
  API_CLIENT = {
84
84
  "id" => String,
@@ -87,7 +87,7 @@ class Brightbox
87
87
  "name" => String,
88
88
  "description" => String,
89
89
  "revoked_at" => Fog::Nullable::String
90
- }
90
+ }.freeze
91
91
 
92
92
  CLOUD_IP = {
93
93
  "id" => String,
@@ -97,7 +97,7 @@ class Brightbox
97
97
  "public_ip" => String,
98
98
  "status" => String,
99
99
  "reverse_dns" => String
100
- }
100
+ }.freeze
101
101
 
102
102
  DATABASE_SERVER = {
103
103
  "id" => String,
@@ -110,7 +110,7 @@ class Brightbox
110
110
  "status" => String,
111
111
  "created_at" => String,
112
112
  "deleted_at" => Fog::Nullable::String
113
- }
113
+ }.freeze
114
114
 
115
115
  DATABASE_SNAPSHOT = {
116
116
  "id" => String,
@@ -124,7 +124,7 @@ class Brightbox
124
124
  "created_at" => String,
125
125
  "deleted_at" => Fog::Nullable::String,
126
126
  "account" => Brightbox::Compute::Formats::Nested::ACCOUNT
127
- }
127
+ }.freeze
128
128
 
129
129
  DATABASE_SERVER_TYPE = {
130
130
  "id" => String,
@@ -134,7 +134,7 @@ class Brightbox
134
134
  "description" => String,
135
135
  "ram" => Integer,
136
136
  "disk_size" => Integer
137
- }
137
+ }.freeze
138
138
 
139
139
  FIREWALL_POLICY = {
140
140
  "id" => String,
@@ -144,7 +144,7 @@ class Brightbox
144
144
  "default" => Fog::Boolean,
145
145
  "created_at" => String,
146
146
  "description" => Fog::Nullable::String
147
- }
147
+ }.freeze
148
148
 
149
149
  FIREWALL_RULE = {
150
150
  "id" => String,
@@ -158,7 +158,7 @@ class Brightbox
158
158
  "protocol" => Fog::Nullable::String,
159
159
  "icmp_type_name" => Fog::Nullable::String,
160
160
  "description" => Fog::Nullable::String
161
- }
161
+ }.freeze
162
162
 
163
163
  IMAGE = {
164
164
  "name" => String,
@@ -174,7 +174,7 @@ class Brightbox
174
174
  "official" => Fog::Boolean,
175
175
  "owner" => String,
176
176
  "username" => Fog::Nullable::String
177
- }
177
+ }.freeze
178
178
 
179
179
  INTERFACE = {
180
180
  "resource_type" => String,
@@ -183,7 +183,7 @@ class Brightbox
183
183
  "ipv4_address" => String,
184
184
  "ipv6_address" => Fog::Nullable::String,
185
185
  "mac_address" => String
186
- }
186
+ }.freeze
187
187
 
188
188
  LOAD_BALANCER = {
189
189
  "id" => String,
@@ -193,7 +193,7 @@ class Brightbox
193
193
  "status" => String,
194
194
  "created_at" => String,
195
195
  "deleted_at" => Fog::Nullable::String
196
- }
196
+ }.freeze
197
197
 
198
198
  SERVER = {
199
199
  "id" => String,
@@ -207,7 +207,7 @@ class Brightbox
207
207
  "started_at" => Fog::Nullable::String,
208
208
  "deleted_at" => Fog::Nullable::String,
209
209
  "username" => Fog::Nullable::String
210
- }
210
+ }.freeze
211
211
 
212
212
  SERVER_GROUP = {
213
213
  "id" => String,
@@ -217,7 +217,7 @@ class Brightbox
217
217
  "created_at" => String,
218
218
  "default" => Fog::Boolean,
219
219
  "description" => Fog::Nullable::String
220
- }
220
+ }.freeze
221
221
 
222
222
  SERVER_TYPE = {
223
223
  "name" => String,
@@ -229,7 +229,7 @@ class Brightbox
229
229
  "id" => String,
230
230
  "ram" => Integer,
231
231
  "status" => String
232
- }
232
+ }.freeze
233
233
 
234
234
  USER = {
235
235
  "id" => String,
@@ -237,7 +237,7 @@ class Brightbox
237
237
  "url" => String,
238
238
  "name" => String,
239
239
  "email_address" => String
240
- }
240
+ }.freeze
241
241
 
242
242
  COLLABORATION = {
243
243
  "id" => String,
@@ -250,7 +250,7 @@ class Brightbox
250
250
  "user" => Fog::Brightbox::Nullable::User,
251
251
  "account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
252
252
  "inviter" => Brightbox::Compute::Formats::Nested::USER
253
- }
253
+ }.freeze
254
254
 
255
255
  VOLUME = {
256
256
  "id" => String,
@@ -273,14 +273,14 @@ class Brightbox
273
273
  "created_at" => String,
274
274
  "updated_at" => String,
275
275
  "deleted_at" => Fog::Nullable::String
276
- }
276
+ }.freeze
277
277
 
278
278
  ZONE = {
279
279
  "id" => String,
280
280
  "resource_type" => String,
281
281
  "url" => String,
282
282
  "handle" => Fog::Nullable::String
283
- }
283
+ }.freeze
284
284
  end
285
285
 
286
286
  module Collected
@@ -313,7 +313,7 @@ class Brightbox
313
313
  "firewall_policies" => [Brightbox::Compute::Formats::Nested::FIREWALL_POLICY],
314
314
  "images" => [Brightbox::Compute::Formats::Nested::IMAGE],
315
315
  "zones" => [Brightbox::Compute::Formats::Nested::ZONE]
316
- }
316
+ }.freeze
317
317
 
318
318
  API_CLIENT = {
319
319
  "id" => String,
@@ -323,14 +323,14 @@ class Brightbox
323
323
  "description" => String,
324
324
  "revoked_at" => Fog::Nullable::String,
325
325
  "account" => Brightbox::Compute::Formats::Nested::ACCOUNT
326
- }
326
+ }.freeze
327
327
 
328
328
  APPLICATION = {
329
329
  "id" => String,
330
330
  "resource_type" => String,
331
331
  "url" => String,
332
332
  "name" => Fog::Nullable::String
333
- }
333
+ }.freeze
334
334
 
335
335
  CLOUD_IP = {
336
336
  "id" => String,
@@ -346,7 +346,7 @@ class Brightbox
346
346
  "load_balancer" => Fog::Brightbox::Nullable::LoadBalancer,
347
347
  "server" => Fog::Brightbox::Nullable::Server,
348
348
  "server_group" => Fog::Brightbox::Nullable::ServerGroup
349
- }
349
+ }.freeze
350
350
 
351
351
  DATABASE_SERVER = {
352
352
  "id" => String,
@@ -359,7 +359,7 @@ class Brightbox
359
359
  "status" => String,
360
360
  "created_at" => String,
361
361
  "deleted_at" => Fog::Nullable::String
362
- }
362
+ }.freeze
363
363
 
364
364
  DATABASE_SNAPSHOT = {
365
365
  "id" => String,
@@ -373,7 +373,7 @@ class Brightbox
373
373
  "created_at" => String,
374
374
  "deleted_at" => Fog::Nullable::String,
375
375
  "account" => Brightbox::Compute::Formats::Nested::ACCOUNT
376
- }
376
+ }.freeze
377
377
 
378
378
  DATABASE_SERVER_TYPE = {
379
379
  "id" => String,
@@ -383,7 +383,7 @@ class Brightbox
383
383
  "description" => String,
384
384
  "ram" => Integer,
385
385
  "disk_size" => Integer
386
- }
386
+ }.freeze
387
387
 
388
388
  FIREWALL_POLICY = {
389
389
  "id" => String,
@@ -395,7 +395,7 @@ class Brightbox
395
395
  "created_at" => String,
396
396
  "server_group" => Fog::Brightbox::Nullable::ServerGroup,
397
397
  "rules" => [Brightbox::Compute::Formats::Nested::FIREWALL_RULE]
398
- }
398
+ }.freeze
399
399
 
400
400
  IMAGE = {
401
401
  "name" => String,
@@ -417,7 +417,7 @@ class Brightbox
417
417
  "disk_size" => Integer,
418
418
  "min_ram" => Fog::Nullable::Integer,
419
419
  "ancestor" => Fog::Brightbox::Nullable::Image
420
- }
420
+ }.freeze
421
421
 
422
422
  LOAD_BALANCER = {
423
423
  "id" => String,
@@ -431,7 +431,7 @@ class Brightbox
431
431
  "account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
432
432
  "listeners" => [Brightbox::Compute::Formats::Struct::LB_LISTENER],
433
433
  "nodes" => [Brightbox::Compute::Formats::Nested::SERVER]
434
- }
434
+ }.freeze
435
435
 
436
436
  SERVER = {
437
437
  "id" => String,
@@ -454,7 +454,7 @@ class Brightbox
454
454
  "zone" => Fog::Brightbox::Nullable::Zone,
455
455
  "username" => Fog::Nullable::String,
456
456
  "compatibility_mode" => Fog::Boolean
457
- }
457
+ }.freeze
458
458
 
459
459
  SERVER_GROUP = {
460
460
  "created_at" => String,
@@ -467,7 +467,7 @@ class Brightbox
467
467
  "account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
468
468
  "servers" => [Brightbox::Compute::Formats::Nested::SERVER],
469
469
  "firewall_policy" => Fog::Brightbox::Nullable::FirewallPolicy
470
- }
470
+ }.freeze
471
471
 
472
472
  SERVER_TYPE = {
473
473
  "id" => String,
@@ -479,7 +479,7 @@ class Brightbox
479
479
  "cores" => Integer,
480
480
  "ram" => Integer,
481
481
  "disk_size" => Integer
482
- }
482
+ }.freeze
483
483
 
484
484
  USER = {
485
485
  "id" => String,
@@ -490,7 +490,7 @@ class Brightbox
490
490
  "email_verified" => Fog::Boolean,
491
491
  "accounts" => [Brightbox::Compute::Formats::Nested::ACCOUNT],
492
492
  "default_account" => NilClass
493
- }
493
+ }.freeze
494
494
 
495
495
  COLLABORATION = {
496
496
  "id" => String,
@@ -503,7 +503,7 @@ class Brightbox
503
503
  "user" => Fog::Brightbox::Nullable::User,
504
504
  "account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
505
505
  "inviter" => Brightbox::Compute::Formats::Nested::USER
506
- }
506
+ }.freeze
507
507
 
508
508
  VOLUME = {
509
509
  "id" => String,
@@ -526,14 +526,14 @@ class Brightbox
526
526
  "created_at" => String,
527
527
  "updated_at" => String,
528
528
  "deleted_at" => Fog::Nullable::String
529
- }
529
+ }.freeze
530
530
 
531
531
  ZONE = {
532
532
  "id" => String,
533
533
  "resource_type" => String,
534
534
  "url" => String,
535
535
  "handle" => Fog::Nullable::String
536
- }
536
+ }.freeze
537
537
  end
538
538
 
539
539
  module Full
@@ -577,7 +577,7 @@ class Brightbox
577
577
  "firewall_policies" => [Brightbox::Compute::Formats::Nested::FIREWALL_POLICY],
578
578
  "images" => [Brightbox::Compute::Formats::Nested::IMAGE],
579
579
  "zones" => [Brightbox::Compute::Formats::Nested::ZONE]
580
- }
580
+ }.freeze
581
581
 
582
582
  API_CLIENT = {
583
583
  "id" => String,
@@ -588,7 +588,7 @@ class Brightbox
588
588
  "revoked_at" => Fog::Nullable::String,
589
589
  "secret" => Fog::Nullable::String,
590
590
  "account" => Brightbox::Compute::Formats::Nested::ACCOUNT
591
- }
591
+ }.freeze
592
592
 
593
593
  APPLICATION = {
594
594
  "id" => String,
@@ -596,7 +596,7 @@ class Brightbox
596
596
  "url" => String,
597
597
  "name" => Fog::Nullable::String,
598
598
  "secret" => Fog::Nullable::String
599
- }
599
+ }.freeze
600
600
 
601
601
  CLOUD_IP = {
602
602
  "id" => String,
@@ -612,7 +612,7 @@ class Brightbox
612
612
  "load_balancer" => Fog::Brightbox::Nullable::LoadBalancer,
613
613
  "server" => Fog::Brightbox::Nullable::Server,
614
614
  "server_group" => Fog::Brightbox::Nullable::ServerGroup
615
- }
615
+ }.freeze
616
616
 
617
617
  DATABASE_SERVER = {
618
618
  "id" => String,
@@ -627,7 +627,7 @@ class Brightbox
627
627
  "status" => String,
628
628
  "created_at" => String,
629
629
  "deleted_at" => Fog::Nullable::String
630
- }
630
+ }.freeze
631
631
 
632
632
  DATABASE_SNAPSHOT = {
633
633
  "id" => String,
@@ -641,7 +641,7 @@ class Brightbox
641
641
  "created_at" => String,
642
642
  "deleted_at" => Fog::Nullable::String,
643
643
  "account" => Brightbox::Compute::Formats::Nested::ACCOUNT
644
- }
644
+ }.freeze
645
645
 
646
646
  DATABASE_SERVER_TYPE = {
647
647
  "id" => String,
@@ -651,7 +651,7 @@ class Brightbox
651
651
  "description" => String,
652
652
  "ram" => Integer,
653
653
  "disk_size" => Integer
654
- }
654
+ }.freeze
655
655
 
656
656
  FIREWALL_POLICY = {
657
657
  "id" => String,
@@ -663,7 +663,7 @@ class Brightbox
663
663
  "created_at" => String,
664
664
  "server_group" => Fog::Brightbox::Nullable::ServerGroup,
665
665
  "rules" => [Brightbox::Compute::Formats::Nested::FIREWALL_RULE]
666
- }
666
+ }.freeze
667
667
 
668
668
  FIREWALL_RULE = {
669
669
  "id" => String,
@@ -678,7 +678,7 @@ class Brightbox
678
678
  "icmp_type_name" => Fog::Nullable::String,
679
679
  "description" => Fog::Nullable::String,
680
680
  "firewall_policy" => Brightbox::Compute::Formats::Nested::FIREWALL_POLICY
681
- }
681
+ }.freeze
682
682
 
683
683
  IMAGE = {
684
684
  "name" => String,
@@ -701,7 +701,7 @@ class Brightbox
701
701
  "min_ram" => Fog::Nullable::Integer,
702
702
  "ancestor" => Fog::Brightbox::Nullable::Image,
703
703
  "licence_name" => Fog::Nullable::String
704
- }
704
+ }.freeze
705
705
 
706
706
  INTERFACE = {
707
707
  "resource_type" => String,
@@ -711,7 +711,7 @@ class Brightbox
711
711
  "ipv6_address" => Fog::Nullable::String,
712
712
  "mac_address" => String,
713
713
  "server" => Brightbox::Compute::Formats::Nested::SERVER
714
- }
714
+ }.freeze
715
715
 
716
716
  LOAD_BALANCER = {
717
717
  "id" => String,
@@ -728,7 +728,7 @@ class Brightbox
728
728
  "account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
729
729
  "nodes" => [Brightbox::Compute::Formats::Nested::SERVER],
730
730
  "cloud_ips" => [Brightbox::Compute::Formats::Nested::CLOUD_IP]
731
- }
731
+ }.freeze
732
732
 
733
733
  SERVER = {
734
734
  "id" => String,
@@ -757,7 +757,7 @@ class Brightbox
757
757
  "licence_name" => Fog::Nullable::String,
758
758
  "username" => Fog::Nullable::String,
759
759
  "compatibility_mode" => Fog::Boolean
760
- }
760
+ }.freeze
761
761
 
762
762
  SERVER_GROUP = {
763
763
  "created_at" => String,
@@ -770,7 +770,7 @@ class Brightbox
770
770
  "account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
771
771
  "servers" => [Brightbox::Compute::Formats::Nested::SERVER],
772
772
  "firewall_policy" => Fog::Brightbox::Nullable::FirewallPolicy
773
- }
773
+ }.freeze
774
774
 
775
775
  SERVER_TYPE = {
776
776
  "id" => String,
@@ -782,7 +782,7 @@ class Brightbox
782
782
  "cores" => Integer,
783
783
  "ram" => Integer,
784
784
  "disk_size" => Integer
785
- }
785
+ }.freeze
786
786
 
787
787
  USER = {
788
788
  "id" => String,
@@ -795,7 +795,7 @@ class Brightbox
795
795
  "default_account" => Fog::Brightbox::Nullable::Account,
796
796
  "ssh_key" => Fog::Nullable::String,
797
797
  "messaging_pref" => Fog::Boolean
798
- }
798
+ }.freeze
799
799
 
800
800
  COLLABORATION = {
801
801
  "id" => String,
@@ -808,7 +808,7 @@ class Brightbox
808
808
  "user" => Fog::Brightbox::Nullable::User,
809
809
  "account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
810
810
  "inviter" => Brightbox::Compute::Formats::Nested::USER
811
- }
811
+ }.freeze
812
812
 
813
813
  VOLUME = {
814
814
  "id" => String,
@@ -834,34 +834,34 @@ class Brightbox
834
834
  "account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
835
835
  "image" => Fog::Brightbox::Nullable::Image,
836
836
  "server" => Fog::Brightbox::Nullable::Server
837
- }
837
+ }.freeze
838
838
 
839
839
  ZONE = {
840
840
  "id" => String,
841
841
  "resource_type" => String,
842
842
  "url" => String,
843
843
  "handle" => String
844
- }
844
+ }.freeze
845
845
  end
846
846
 
847
847
  module Collection
848
- ACCOUNTS = [Brightbox::Compute::Formats::Collected::ACCOUNT]
849
- API_CLIENTS = [Brightbox::Compute::Formats::Collected::API_CLIENT]
850
- APPLICATION = [Brightbox::Compute::Formats::Collected::APPLICATION]
851
- CLOUD_IPS = [Brightbox::Compute::Formats::Collected::CLOUD_IP]
852
- COLLABORATIONS = [Brightbox::Compute::Formats::Collected::COLLABORATION]
853
- DATABASE_SERVERS = [Brightbox::Compute::Formats::Collected::DATABASE_SERVER]
854
- DATABASE_SERVER_TYPES = [Brightbox::Compute::Formats::Collected::DATABASE_SERVER_TYPE]
855
- DATABASE_SNAPSHOTS = [Brightbox::Compute::Formats::Collected::DATABASE_SNAPSHOT]
856
- FIREWALL_POLICIES = [Brightbox::Compute::Formats::Collected::FIREWALL_POLICY]
857
- IMAGES = [Brightbox::Compute::Formats::Collected::IMAGE]
858
- LOAD_BALANCERS = [Brightbox::Compute::Formats::Collected::LOAD_BALANCER]
859
- SERVERS = [Brightbox::Compute::Formats::Collected::SERVER]
860
- SERVER_GROUPS = [Brightbox::Compute::Formats::Collected::SERVER_GROUP]
861
- SERVER_TYPES = [Brightbox::Compute::Formats::Collected::SERVER_TYPE]
862
- USERS = [Brightbox::Compute::Formats::Collected::USER]
863
- VOLUMES = [Brightbox::Compute::Formats::Collected::VOLUME]
864
- ZONES = [Brightbox::Compute::Formats::Collected::ZONE]
848
+ ACCOUNTS = [Brightbox::Compute::Formats::Collected::ACCOUNT].freeze
849
+ API_CLIENTS = [Brightbox::Compute::Formats::Collected::API_CLIENT].freeze
850
+ APPLICATION = [Brightbox::Compute::Formats::Collected::APPLICATION].freeze
851
+ CLOUD_IPS = [Brightbox::Compute::Formats::Collected::CLOUD_IP].freeze
852
+ COLLABORATIONS = [Brightbox::Compute::Formats::Collected::COLLABORATION].freeze
853
+ DATABASE_SERVERS = [Brightbox::Compute::Formats::Collected::DATABASE_SERVER].freeze
854
+ DATABASE_SERVER_TYPES = [Brightbox::Compute::Formats::Collected::DATABASE_SERVER_TYPE].freeze
855
+ DATABASE_SNAPSHOTS = [Brightbox::Compute::Formats::Collected::DATABASE_SNAPSHOT].freeze
856
+ FIREWALL_POLICIES = [Brightbox::Compute::Formats::Collected::FIREWALL_POLICY].freeze
857
+ IMAGES = [Brightbox::Compute::Formats::Collected::IMAGE].freeze
858
+ LOAD_BALANCERS = [Brightbox::Compute::Formats::Collected::LOAD_BALANCER].freeze
859
+ SERVERS = [Brightbox::Compute::Formats::Collected::SERVER].freeze
860
+ SERVER_GROUPS = [Brightbox::Compute::Formats::Collected::SERVER_GROUP].freeze
861
+ SERVER_TYPES = [Brightbox::Compute::Formats::Collected::SERVER_TYPE].freeze
862
+ USERS = [Brightbox::Compute::Formats::Collected::USER].freeze
863
+ VOLUMES = [Brightbox::Compute::Formats::Collected::VOLUME].freeze
864
+ ZONES = [Brightbox::Compute::Formats::Collected::ZONE].freeze
865
865
  end
866
866
  end
867
867
  end
@@ -9,19 +9,19 @@ end
9
9
  Shindo.tests("Fog::Compute.new", ["brightbox"]) do
10
10
  tests("service options") do
11
11
  {
12
- :brightbox_api_url => "https://example.test",
13
- :brightbox_auth_url => "https://example.test",
14
- :brightbox_client_id => "app-12345",
15
- :brightbox_secret => "12345abdef6789",
16
- :brightbox_username => "user-12345",
17
- :brightbox_password => "password1234",
18
- :brightbox_account => "acc-12345",
19
- :brightbox_access_token => "12345abdef6789",
20
- :brightbox_refresh_token => "12345abdef6789",
21
- :brightbox_token_management => false
12
+ brightbox_api_url: "https://example.test",
13
+ brightbox_auth_url: "https://example.test",
14
+ brightbox_client_id: "app-12345",
15
+ brightbox_secret: "12345abdef6789",
16
+ brightbox_username: "user-12345",
17
+ brightbox_password: "password1234",
18
+ brightbox_account: "acc-12345",
19
+ brightbox_access_token: "12345abdef6789",
20
+ brightbox_refresh_token: "12345abdef6789",
21
+ brightbox_token_management: false
22
22
  }.each_pair do |option, sample|
23
23
  tests("recognises :#{option}").returns(true) do
24
- options = { :provider => "Brightbox" }
24
+ options = { provider: "Brightbox" }
25
25
  options[option] = sample
26
26
  begin
27
27
  Fog::Compute.new(options)
@@ -34,7 +34,7 @@ Shindo.tests("Fog::Compute.new", ["brightbox"]) do
34
34
  end
35
35
 
36
36
  tests("automatic token management") do
37
- service_options = { :provider => "Brightbox" }
37
+ service_options = { provider: "Brightbox" }
38
38
 
39
39
  tests("when enabled (default)") do
40
40
  service_options[:brightbox_token_management] = true
@@ -67,7 +67,7 @@ Shindo.tests("Fog::Compute.new", ["brightbox"]) do
67
67
  end
68
68
 
69
69
  tests("account scoping") do
70
- service = Fog::Compute.new(:provider => "Brightbox")
70
+ service = Fog::Compute.new(provider: "Brightbox")
71
71
  configured_account = Fog.credentials[:brightbox_account]
72
72
  tests("when Fog.credentials are #{configured_account}") do
73
73
  test("#scoped_account == #{configured_account}") { service.scoped_account == configured_account }
@@ -86,7 +86,7 @@ Shindo.tests("Fog::Compute.new", ["brightbox"]) do
86
86
 
87
87
  optioned_account = "acc-56789"
88
88
  tests("when Compute instance created with :brightbox_account => #{optioned_account}") do
89
- service = Fog::Compute.new(:provider => "Brightbox", :brightbox_account => optioned_account)
89
+ service = Fog::Compute.new(provider: "Brightbox", brightbox_account: optioned_account)
90
90
  test("#scoped_account == #{optioned_account}") { service.scoped_account == optioned_account }
91
91
  end
92
92
 
@@ -2,14 +2,4 @@ Shindo.tests("Fog::Compute[:brightbox] | Account model", ["brightbox"]) do
2
2
  pending if Fog.mocking?
3
3
 
4
4
  @account = Fog::Compute[:brightbox].account
5
-
6
- tests("success") do
7
- tests("#reset_ftp_password") do
8
- pending if Fog.mocking?
9
- test("original ftp password is blanked") { @account.library_ftp_password.nil? }
10
- @new_password = @account.reset_ftp_password
11
- test("new ftp password was not nil") { !@new_password.nil? }
12
- test("new ftp password is set") { @account.library_ftp_password == @new_password }
13
- end
14
- end
15
5
  end
@@ -3,7 +3,6 @@ Shindo.tests("Fog::Compute[:brightbox] | Server model", ["brightbox"]) do
3
3
 
4
4
  tests("success") do
5
5
  @server = Brightbox::Compute::TestSupport.get_test_server
6
- server_id = @server.id
7
6
 
8
7
  tests("#dns_name") do
9
8
  returns("public.#{@server.fqdn}") { @server.dns_name }
@@ -2,15 +2,15 @@ Shindo.tests("Fog::Compute[:brightbox] | account requests", ["brightbox"]) do
2
2
  tests("success") do
3
3
  tests("#list_accounts") do
4
4
  pending if Fog.mocking?
5
- result = Fog::Compute[:brightbox].list_accounts(:nested => true)
6
- data_matches_schema(Brightbox::Compute::Formats::Collection::ACCOUNTS, :allow_extra_keys => true) { result }
5
+ result = Fog::Compute[:brightbox].list_accounts(nested: true)
6
+ data_matches_schema(Brightbox::Compute::Formats::Collection::ACCOUNTS, allow_extra_keys: true) { result }
7
7
  end
8
8
 
9
9
  tests("#get_scoped_account") do
10
10
  pending if Fog.mocking?
11
11
  result = Fog::Compute[:brightbox].get_scoped_account
12
12
  @scoped_account_identifier = result["id"]
13
- data_matches_schema(Brightbox::Compute::Formats::Full::ACCOUNT, :allow_extra_keys => true) { result }
13
+ data_matches_schema(Brightbox::Compute::Formats::Full::ACCOUNT, allow_extra_keys: true) { result }
14
14
  test("ftp password is blanked") { result["library_ftp_password"].nil? }
15
15
  end
16
16
 
@@ -18,35 +18,21 @@ Shindo.tests("Fog::Compute[:brightbox] | account requests", ["brightbox"]) do
18
18
  pending if Fog.mocking?
19
19
  result = Fog::Compute[:brightbox].get_account(@scoped_account_identifier)
20
20
  @current_name = result["name"]
21
- data_matches_schema(Brightbox::Compute::Formats::Full::ACCOUNT, :allow_extra_keys => true) { result }
21
+ data_matches_schema(Brightbox::Compute::Formats::Full::ACCOUNT, allow_extra_keys: true) { result }
22
22
  test("ftp password is blanked") { result["library_ftp_password"].nil? }
23
23
  end
24
24
 
25
- update_options = { :name => @current_name }
25
+ update_options = { name: @current_name }
26
26
  tests("#update_scoped_account(#{update_options.inspect})") do
27
27
  pending if Fog.mocking?
28
28
  result = Fog::Compute[:brightbox].update_scoped_account(update_options)
29
- data_matches_schema(Brightbox::Compute::Formats::Full::ACCOUNT, :allow_extra_keys => true) { result }
29
+ data_matches_schema(Brightbox::Compute::Formats::Full::ACCOUNT, allow_extra_keys: true) { result }
30
30
  end
31
31
 
32
32
  tests("#update_account(#{@scoped_account_identifier}, #{update_options.inspect})") do
33
33
  pending if Fog.mocking?
34
34
  result = Fog::Compute[:brightbox].update_account(@scoped_account_identifier, update_options)
35
- data_matches_schema(Brightbox::Compute::Formats::Full::ACCOUNT, :allow_extra_keys => true) { result }
36
- end
37
-
38
- tests("#reset_ftp_password_scoped_account") do
39
- pending if Fog.mocking?
40
- result = Fog::Compute[:brightbox].reset_ftp_password_scoped_account
41
- data_matches_schema(Brightbox::Compute::Formats::Full::ACCOUNT, :allow_extra_keys => true) { result }
42
- test("new ftp password is visible") { !result["library_ftp_password"].nil? }
43
- end
44
-
45
- tests("#reset_ftp_password_account(#{@scoped_account_identifier})") do
46
- pending if Fog.mocking?
47
- result = Fog::Compute[:brightbox].reset_ftp_password_account(@scoped_account_identifier)
48
- data_matches_schema(Brightbox::Compute::Formats::Full::ACCOUNT, :allow_extra_keys => true) { result }
49
- test("new ftp password is visible") { !result["library_ftp_password"].nil? }
35
+ data_matches_schema(Brightbox::Compute::Formats::Full::ACCOUNT, allow_extra_keys: true) { result }
50
36
  end
51
37
  end
52
38