fog-brightbox 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/.rubocop.yml +20 -0
  4. data/.rubocop_todo.yml +81 -0
  5. data/CHANGELOG.md +17 -0
  6. data/README.md +6 -0
  7. data/fog-brightbox.gemspec +10 -9
  8. data/gemfiles/Gemfile.1.8.7 +1 -0
  9. data/lib/fog/brightbox.rb +2 -2
  10. data/lib/fog/brightbox/compute.rb +47 -48
  11. data/lib/fog/brightbox/compute/resource_locking.rb +26 -20
  12. data/lib/fog/brightbox/compute/shared.rb +2 -7
  13. data/lib/fog/brightbox/config.rb +12 -15
  14. data/lib/fog/brightbox/core.rb +5 -5
  15. data/lib/fog/brightbox/link_helper.rb +33 -0
  16. data/lib/fog/brightbox/models/compute/account.rb +0 -1
  17. data/lib/fog/brightbox/models/compute/accounts.rb +2 -6
  18. data/lib/fog/brightbox/models/compute/api_client.rb +2 -2
  19. data/lib/fog/brightbox/models/compute/application.rb +2 -2
  20. data/lib/fog/brightbox/models/compute/applications.rb +2 -6
  21. data/lib/fog/brightbox/models/compute/cloud_ip.rb +0 -4
  22. data/lib/fog/brightbox/models/compute/cloud_ips.rb +2 -6
  23. data/lib/fog/brightbox/models/compute/collaboration.rb +4 -4
  24. data/lib/fog/brightbox/models/compute/database_server.rb +11 -4
  25. data/lib/fog/brightbox/models/compute/database_servers.rb +2 -6
  26. data/lib/fog/brightbox/models/compute/database_snapshot.rb +1 -1
  27. data/lib/fog/brightbox/models/compute/database_snapshots.rb +2 -2
  28. data/lib/fog/brightbox/models/compute/database_types.rb +2 -4
  29. data/lib/fog/brightbox/models/compute/event.rb +0 -2
  30. data/lib/fog/brightbox/models/compute/events.rb +2 -4
  31. data/lib/fog/brightbox/models/compute/firewall_policies.rb +2 -6
  32. data/lib/fog/brightbox/models/compute/firewall_policy.rb +2 -3
  33. data/lib/fog/brightbox/models/compute/firewall_rule.rb +2 -3
  34. data/lib/fog/brightbox/models/compute/firewall_rules.rb +2 -6
  35. data/lib/fog/brightbox/models/compute/flavor.rb +0 -1
  36. data/lib/fog/brightbox/models/compute/flavors.rb +2 -6
  37. data/lib/fog/brightbox/models/compute/image.rb +3 -3
  38. data/lib/fog/brightbox/models/compute/images.rb +2 -6
  39. data/lib/fog/brightbox/models/compute/load_balancer.rb +5 -5
  40. data/lib/fog/brightbox/models/compute/load_balancers.rb +2 -6
  41. data/lib/fog/brightbox/models/compute/server.rb +15 -9
  42. data/lib/fog/brightbox/models/compute/server_group.rb +1 -1
  43. data/lib/fog/brightbox/models/compute/server_groups.rb +2 -6
  44. data/lib/fog/brightbox/models/compute/servers.rb +2 -6
  45. data/lib/fog/brightbox/models/compute/user.rb +0 -1
  46. data/lib/fog/brightbox/models/compute/user_collaboration.rb +2 -3
  47. data/lib/fog/brightbox/models/compute/users.rb +2 -5
  48. data/lib/fog/brightbox/models/compute/zones.rb +2 -6
  49. data/lib/fog/brightbox/models/storage/directories.rb +6 -13
  50. data/lib/fog/brightbox/models/storage/directory.rb +5 -7
  51. data/lib/fog/brightbox/models/storage/file.rb +37 -45
  52. data/lib/fog/brightbox/models/storage/files.rb +21 -25
  53. data/lib/fog/brightbox/oauth2.rb +136 -137
  54. data/lib/fog/brightbox/requests/compute/accept_user_collaboration.rb +0 -1
  55. data/lib/fog/brightbox/requests/compute/activate_console_server.rb +0 -1
  56. data/lib/fog/brightbox/requests/compute/add_listeners_load_balancer.rb +0 -1
  57. data/lib/fog/brightbox/requests/compute/add_nodes_load_balancer.rb +0 -1
  58. data/lib/fog/brightbox/requests/compute/add_servers_server_group.rb +0 -1
  59. data/lib/fog/brightbox/requests/compute/apply_to_firewall_policy.rb +0 -1
  60. data/lib/fog/brightbox/requests/compute/create_api_client.rb +0 -1
  61. data/lib/fog/brightbox/requests/compute/create_application.rb +0 -1
  62. data/lib/fog/brightbox/requests/compute/create_cloud_ip.rb +0 -1
  63. data/lib/fog/brightbox/requests/compute/create_collaboration.rb +0 -1
  64. data/lib/fog/brightbox/requests/compute/create_database_server.rb +0 -1
  65. data/lib/fog/brightbox/requests/compute/create_firewall_policy.rb +0 -1
  66. data/lib/fog/brightbox/requests/compute/create_firewall_rule.rb +0 -1
  67. data/lib/fog/brightbox/requests/compute/create_image.rb +0 -1
  68. data/lib/fog/brightbox/requests/compute/create_load_balancer.rb +0 -1
  69. data/lib/fog/brightbox/requests/compute/create_server.rb +0 -1
  70. data/lib/fog/brightbox/requests/compute/create_server_group.rb +0 -1
  71. data/lib/fog/brightbox/requests/compute/get_account.rb +0 -1
  72. data/lib/fog/brightbox/requests/compute/get_api_client.rb +0 -1
  73. data/lib/fog/brightbox/requests/compute/get_application.rb +0 -1
  74. data/lib/fog/brightbox/requests/compute/get_authenticated_user.rb +0 -2
  75. data/lib/fog/brightbox/requests/compute/get_cloud_ip.rb +0 -1
  76. data/lib/fog/brightbox/requests/compute/get_collaboration.rb +0 -1
  77. data/lib/fog/brightbox/requests/compute/get_database_server.rb +0 -1
  78. data/lib/fog/brightbox/requests/compute/get_database_snapshot.rb +0 -1
  79. data/lib/fog/brightbox/requests/compute/get_database_type.rb +0 -1
  80. data/lib/fog/brightbox/requests/compute/get_firewall_policy.rb +0 -1
  81. data/lib/fog/brightbox/requests/compute/get_firewall_rule.rb +0 -1
  82. data/lib/fog/brightbox/requests/compute/get_image.rb +0 -1
  83. data/lib/fog/brightbox/requests/compute/get_interface.rb +0 -1
  84. data/lib/fog/brightbox/requests/compute/get_load_balancer.rb +0 -1
  85. data/lib/fog/brightbox/requests/compute/get_scoped_account.rb +0 -1
  86. data/lib/fog/brightbox/requests/compute/get_server.rb +0 -1
  87. data/lib/fog/brightbox/requests/compute/get_server_group.rb +0 -1
  88. data/lib/fog/brightbox/requests/compute/get_server_type.rb +0 -1
  89. data/lib/fog/brightbox/requests/compute/get_user.rb +0 -1
  90. data/lib/fog/brightbox/requests/compute/get_user_collaboration.rb +0 -1
  91. data/lib/fog/brightbox/requests/compute/get_zone.rb +0 -1
  92. data/lib/fog/brightbox/requests/compute/list_accounts.rb +0 -1
  93. data/lib/fog/brightbox/requests/compute/list_api_clients.rb +0 -1
  94. data/lib/fog/brightbox/requests/compute/list_applications.rb +0 -1
  95. data/lib/fog/brightbox/requests/compute/list_cloud_ips.rb +0 -1
  96. data/lib/fog/brightbox/requests/compute/list_collaborations.rb +0 -1
  97. data/lib/fog/brightbox/requests/compute/list_database_servers.rb +0 -1
  98. data/lib/fog/brightbox/requests/compute/list_database_snapshots.rb +0 -1
  99. data/lib/fog/brightbox/requests/compute/list_database_types.rb +0 -1
  100. data/lib/fog/brightbox/requests/compute/list_events.rb +0 -1
  101. data/lib/fog/brightbox/requests/compute/list_firewall_policies.rb +0 -1
  102. data/lib/fog/brightbox/requests/compute/list_images.rb +0 -1
  103. data/lib/fog/brightbox/requests/compute/list_load_balancers.rb +0 -1
  104. data/lib/fog/brightbox/requests/compute/list_server_groups.rb +0 -1
  105. data/lib/fog/brightbox/requests/compute/list_server_types.rb +0 -1
  106. data/lib/fog/brightbox/requests/compute/list_servers.rb +0 -1
  107. data/lib/fog/brightbox/requests/compute/list_user_collaborations.rb +0 -1
  108. data/lib/fog/brightbox/requests/compute/list_users.rb +0 -1
  109. data/lib/fog/brightbox/requests/compute/list_zones.rb +0 -1
  110. data/lib/fog/brightbox/requests/compute/lock_resource_database_server.rb +0 -1
  111. data/lib/fog/brightbox/requests/compute/lock_resource_database_snapshot.rb +0 -1
  112. data/lib/fog/brightbox/requests/compute/lock_resource_image.rb +0 -1
  113. data/lib/fog/brightbox/requests/compute/lock_resource_load_balancer.rb +0 -1
  114. data/lib/fog/brightbox/requests/compute/lock_resource_server.rb +0 -1
  115. data/lib/fog/brightbox/requests/compute/map_cloud_ip.rb +0 -1
  116. data/lib/fog/brightbox/requests/compute/move_servers_server_group.rb +0 -1
  117. data/lib/fog/brightbox/requests/compute/reboot_server.rb +0 -1
  118. data/lib/fog/brightbox/requests/compute/reject_user_collaboration.rb +0 -1
  119. data/lib/fog/brightbox/requests/compute/remove_firewall_policy.rb +0 -1
  120. data/lib/fog/brightbox/requests/compute/remove_listeners_load_balancer.rb +0 -1
  121. data/lib/fog/brightbox/requests/compute/remove_nodes_load_balancer.rb +0 -1
  122. data/lib/fog/brightbox/requests/compute/remove_servers_server_group.rb +0 -1
  123. data/lib/fog/brightbox/requests/compute/resend_collaboration.rb +0 -1
  124. data/lib/fog/brightbox/requests/compute/reset_ftp_password_account.rb +0 -2
  125. data/lib/fog/brightbox/requests/compute/reset_ftp_password_scoped_account.rb +0 -1
  126. data/lib/fog/brightbox/requests/compute/reset_password_database_server.rb +0 -1
  127. data/lib/fog/brightbox/requests/compute/reset_secret_api_client.rb +0 -1
  128. data/lib/fog/brightbox/requests/compute/reset_secret_application.rb +0 -1
  129. data/lib/fog/brightbox/requests/compute/reset_server.rb +0 -1
  130. data/lib/fog/brightbox/requests/compute/shutdown_server.rb +0 -1
  131. data/lib/fog/brightbox/requests/compute/snapshot_database_server.rb +19 -3
  132. data/lib/fog/brightbox/requests/compute/snapshot_server.rb +19 -3
  133. data/lib/fog/brightbox/requests/compute/start_server.rb +0 -1
  134. data/lib/fog/brightbox/requests/compute/stop_server.rb +0 -1
  135. data/lib/fog/brightbox/requests/compute/unlock_resource_database_server.rb +0 -1
  136. data/lib/fog/brightbox/requests/compute/unlock_resource_database_snapshot.rb +0 -1
  137. data/lib/fog/brightbox/requests/compute/unlock_resource_image.rb +0 -1
  138. data/lib/fog/brightbox/requests/compute/unlock_resource_load_balancer.rb +0 -1
  139. data/lib/fog/brightbox/requests/compute/unlock_resource_server.rb +0 -1
  140. data/lib/fog/brightbox/requests/compute/unmap_cloud_ip.rb +0 -1
  141. data/lib/fog/brightbox/requests/compute/update_account.rb +0 -1
  142. data/lib/fog/brightbox/requests/compute/update_api_client.rb +0 -1
  143. data/lib/fog/brightbox/requests/compute/update_application.rb +0 -1
  144. data/lib/fog/brightbox/requests/compute/update_cloud_ip.rb +0 -1
  145. data/lib/fog/brightbox/requests/compute/update_database_server.rb +0 -1
  146. data/lib/fog/brightbox/requests/compute/update_database_snapshot.rb +0 -1
  147. data/lib/fog/brightbox/requests/compute/update_firewall_policy.rb +0 -1
  148. data/lib/fog/brightbox/requests/compute/update_firewall_rule.rb +0 -1
  149. data/lib/fog/brightbox/requests/compute/update_image.rb +0 -1
  150. data/lib/fog/brightbox/requests/compute/update_load_balancer.rb +0 -1
  151. data/lib/fog/brightbox/requests/compute/update_scoped_account.rb +0 -1
  152. data/lib/fog/brightbox/requests/compute/update_server.rb +0 -1
  153. data/lib/fog/brightbox/requests/compute/update_server_group.rb +0 -1
  154. data/lib/fog/brightbox/requests/compute/update_user.rb +0 -1
  155. data/lib/fog/brightbox/requests/storage/copy_object.rb +8 -10
  156. data/lib/fog/brightbox/requests/storage/delete_container.rb +1 -3
  157. data/lib/fog/brightbox/requests/storage/delete_multiple_objects.rb +7 -9
  158. data/lib/fog/brightbox/requests/storage/delete_object.rb +1 -3
  159. data/lib/fog/brightbox/requests/storage/delete_static_large_object.rb +7 -9
  160. data/lib/fog/brightbox/requests/storage/get_container.rb +3 -5
  161. data/lib/fog/brightbox/requests/storage/get_containers.rb +4 -6
  162. data/lib/fog/brightbox/requests/storage/get_object.rb +1 -3
  163. data/lib/fog/brightbox/requests/storage/get_object_https_url.rb +5 -10
  164. data/lib/fog/brightbox/requests/storage/head_container.rb +2 -4
  165. data/lib/fog/brightbox/requests/storage/head_containers.rb +3 -5
  166. data/lib/fog/brightbox/requests/storage/head_object.rb +4 -6
  167. data/lib/fog/brightbox/requests/storage/post_set_meta_temp_url_key.rb +2 -6
  168. data/lib/fog/brightbox/requests/storage/put_container.rb +3 -5
  169. data/lib/fog/brightbox/requests/storage/put_dynamic_obj_manifest.rb +2 -4
  170. data/lib/fog/brightbox/requests/storage/put_object.rb +1 -2
  171. data/lib/fog/brightbox/requests/storage/put_object_manifest.rb +0 -2
  172. data/lib/fog/brightbox/requests/storage/put_static_obj_manifest.rb +2 -4
  173. data/lib/fog/brightbox/storage.rb +26 -29
  174. data/lib/fog/brightbox/storage/connection.rb +10 -10
  175. data/lib/fog/brightbox/version.rb +1 -1
  176. data/spec/fog/brightbox/link_helper_spec.rb +18 -0
  177. data/spec/fog/brightbox/storage/authentication_request_spec.rb +16 -16
  178. data/spec/fog/brightbox/storage/connection_spec.rb +12 -12
  179. data/spec/fog/compute/brightbox/database_server_spec.rb +31 -0
  180. data/spec/fog/compute/brightbox/server_spec.rb +31 -0
  181. data/spec/fog/storage/brightbox_spec.rb +3 -3
  182. data/spec/spec_helper.rb +1 -1
  183. metadata +28 -10
  184. data/spec/model_helper.rb +0 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 52897a886916a22c81a1739e501b85f1c5cc31b9
4
- data.tar.gz: de27f7575f275ef77bb7469996cd3dd57e93e826
3
+ metadata.gz: 496e29fce89925667624be224c1f667295ee92fc
4
+ data.tar.gz: 86fca89817bccee070cdb86701a811cdb604cfa7
5
5
  SHA512:
6
- metadata.gz: af4897d9093f4aa615f4250f0a5d33f07b5ecf0639cacb25c4972862c58f8017c4aaae2d05e46651e370471cd19810e48873017df191016fead34ebfdb7c0762
7
- data.tar.gz: 862944dce4be95bdd31f6c9572ae024c16d61924b99db947eaeca644d8bbfae567b8d99826857411e9035f97be87ed925079d6b0ff0718abebd3671cd0870563
6
+ metadata.gz: e0725ecbd7084c492e79ef187183b1adebde76de09ac082d61b748784bb30fe73a91c47d7272c2cd96a28f27d78ff6462c0df951e1e898a88bf85e5bba56dae5
7
+ data.tar.gz: fbe5f43f457c4d2306bd8bbdcff03edb5dd002a07cb7bb7ffdbf65c20e092459dd93de159395543a15e4727cc4adaa8da3f8aa3f152cb6d0336eb000a851dc7b
data/.gitignore CHANGED
@@ -1,2 +1,5 @@
1
1
  Gemfile.lock
2
2
  gemfiles/*.lock
3
+ pkg
4
+ doc/*
5
+ .yardoc
data/.rubocop.yml ADDED
@@ -0,0 +1,20 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ HashSyntax:
4
+ EnforcedStyle: hash_rockets
5
+
6
+ LineLength:
7
+ Max: 100
8
+ Enabled: false
9
+
10
+ StringLiterals:
11
+ EnforcedStyle: double_quotes
12
+
13
+ Encoding:
14
+ Description: 'Use UTF-8 as the source file encoding.'
15
+ Enabled: false
16
+
17
+ SignalException:
18
+ Description: 'Do not enforce use of fail when raising exceptions.'
19
+ # Valid values are: semantic, only_raise and only_fail
20
+ EnforcedStyle: only_raise
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,81 @@
1
+ # This configuration was generated by `rubocop --auto-gen-config`
2
+ # on 2014-10-23 16:16:50 +0100 using RuboCop version 0.23.0.
3
+ # The point is for the user to remove these configuration records
4
+ # one by one as the offenses are removed from the code base.
5
+ # Note that changes in the inspected code, or installation of new
6
+ # versions of RuboCop, may require this file to be generated again.
7
+
8
+ # Offense count: 2
9
+ # Configuration parameters: AllowSafeAssignment.
10
+ Lint/AssignmentInCondition:
11
+ Enabled: false
12
+
13
+ # Offense count: 4
14
+ Style/AccessorMethodName:
15
+ Enabled: false
16
+
17
+ # Offense count: 2
18
+ # Cop supports --auto-correct.
19
+ Style/Blocks:
20
+ Enabled: false
21
+
22
+ # Offense count: 4
23
+ # Configuration parameters: CountComments.
24
+ Style/ClassLength:
25
+ Max: 165
26
+
27
+ # Offense count: 4
28
+ Style/CyclomaticComplexity:
29
+ Max: 8
30
+
31
+ # Offense count: 190
32
+ Style/Documentation:
33
+ Enabled: false
34
+
35
+ # Offense count: 26
36
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
37
+ Style/DotPosition:
38
+ Enabled: false
39
+
40
+ # Offense count: 5
41
+ Style/DoubleNegation:
42
+ Enabled: false
43
+
44
+ # Offense count: 2
45
+ # Configuration parameters: MinBodyLength.
46
+ Style/GuardClause:
47
+ Enabled: false
48
+
49
+ # Offense count: 1
50
+ # Configuration parameters: MaxLineLength.
51
+ Style/IfUnlessModifier:
52
+ Enabled: false
53
+
54
+ # Offense count: 23
55
+ # Configuration parameters: CountComments.
56
+ Style/MethodLength:
57
+ Max: 24
58
+
59
+ # Offense count: 2
60
+ Style/MultilineBlockChain:
61
+ Enabled: false
62
+
63
+ # Offense count: 1
64
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
65
+ Style/Next:
66
+ Enabled: false
67
+
68
+ # Offense count: 9
69
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
70
+ Style/RaiseArgs:
71
+ Enabled: false
72
+
73
+ # Offense count: 3
74
+ Style/RegexpLiteral:
75
+ MaxSlashes: 0
76
+
77
+ # Offense count: 1
78
+ # Cop supports --auto-correct.
79
+ # Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, Whitelist.
80
+ Style/TrivialAccessors:
81
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ ### 0.7.0 / 2014-11-27
2
+
3
+ Enhancements:
4
+
5
+ * Can read `Link` headers returned from snapshot actions
6
+ * Optionally allow return or `Snapshot` objects from snapshot actions.
7
+
8
+ Bug fixes:
9
+
10
+ * Ignore select directories from version control.
11
+ * Removed duplicate spec_helper
12
+ * Addition of style rules using `rubocop`
13
+ * Automated clean up of style rules
14
+ * Be pessimistic about `inflecto` gem.
15
+ Next release of Inflecto gem will introduce 1.9 constraint so we need to be
16
+ pessimistic about the version to depend on for now.
17
+
1
18
  ### 0.6.1 / 2014-10-22
2
19
 
3
20
  Bug fixes:
data/README.md CHANGED
@@ -39,6 +39,12 @@ and its modules:
39
39
  * http://fog.io/
40
40
  * http://rubydoc.info/gems/fog/
41
41
 
42
+ ### Ruby 1.8.7
43
+
44
+ If you are still using Ruby 1.8.7 in production, see `gemfiles/Gemfile.1.8.7`
45
+ for a gemfile of 1.8.7 compatible version of dependencies you may need to
46
+ specify in your application's `Gemfile`
47
+
42
48
  ## Contributing
43
49
 
44
50
  `fog` modules are kept within the main repo.
@@ -1,31 +1,32 @@
1
1
  # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
2
+ lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'fog/brightbox/version'
4
+ require "fog/brightbox/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "fog-brightbox"
8
8
  spec.version = Fog::Brightbox::VERSION
9
9
  spec.authors = ["Paul Thornthwaite"]
10
10
  spec.email = ["tokengeek@gmail.com"]
11
- spec.description = %q{Module for the 'fog' gem to support Brightbox Cloud}
12
- spec.summary = %q{This library can be used as a module for `fog` or as standalone provider
13
- to use the Brightbox Cloud in applications}
11
+ spec.description = %q(Module for the 'fog' gem to support Brightbox Cloud)
12
+ spec.summary = %q(This library can be used as a module for `fog` or as standalone provider
13
+ to use the Brightbox Cloud in applications)
14
14
  spec.homepage = ""
15
15
  spec.license = "MIT"
16
16
 
17
- spec.files = `git ls-files`.split($/)
17
+ spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
18
18
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
20
  spec.require_paths = ["lib"]
21
21
 
22
22
  spec.add_dependency "fog-core", "~> 1.22"
23
23
  spec.add_dependency "fog-json"
24
- spec.add_dependency "inflecto"
24
+ spec.add_dependency "inflecto", "~> 0.0.2"
25
25
 
26
26
  spec.add_development_dependency "bundler", "~> 1.3"
27
- spec.add_development_dependency "rake"
28
- spec.add_development_dependency "pry"
29
27
  spec.add_development_dependency "minitest"
28
+ spec.add_development_dependency "pry"
29
+ spec.add_development_dependency "rake"
30
30
  spec.add_development_dependency "webmock"
31
+ spec.add_development_dependency "yard"
31
32
  end
@@ -2,5 +2,6 @@ source "https://rubygems.org"
2
2
 
3
3
  gem "fog-core", :github => "fog/fog-core"
4
4
  gem "mime-types", "~> 1.22"
5
+ gem "inflecto", "~> 0.0.2"
5
6
 
6
7
  gemspec :path => ".."
data/lib/fog/brightbox.rb CHANGED
@@ -1,2 +1,2 @@
1
- require 'fog/brightbox/compute'
2
- require 'fog/brightbox/storage'
1
+ require "fog/brightbox/compute"
2
+ require "fog/brightbox/storage"
@@ -1,12 +1,12 @@
1
- require 'fog/brightbox/core'
2
- require 'fog/brightbox/compute/config'
3
- require 'fog/brightbox/compute/shared'
4
- require 'fog/brightbox/compute/image_selector'
1
+ require "fog/brightbox/core"
2
+ require "fog/brightbox/compute/config"
3
+ require "fog/brightbox/compute/shared"
4
+ require "fog/brightbox/compute/image_selector"
5
+ require "fog/brightbox/link_helper"
5
6
 
6
7
  module Fog
7
8
  module Compute
8
9
  class Brightbox < Fog::Service
9
-
10
10
  # Client credentials
11
11
  requires :brightbox_client_id, :brightbox_secret
12
12
 
@@ -25,47 +25,47 @@ module Fog
25
25
  # Excon connection settings
26
26
  recognizes :persistent
27
27
 
28
- model_path 'fog/brightbox/models/compute'
29
- collection :accounts
30
- model :account
31
- collection :applications
32
- model :application
33
- collection :api_clients
34
- model :api_client
35
- collection :collaborations
36
- model :collaboration
37
- collection :servers
38
- model :server
39
- collection :server_groups
40
- model :server_group
41
- collection :events
42
- model :event
43
- collection :firewall_policies
44
- model :firewall_policy
45
- collection :firewall_rules
46
- model :firewall_rule
47
- collection :flavors
48
- model :flavor
49
- collection :images
50
- model :image
51
- collection :load_balancers
52
- model :load_balancer
53
- collection :database_servers
54
- model :database_server
55
- collection :database_snapshots
56
- model :database_snapshot
57
- collection :database_types
58
- model :database_type
59
- collection :zones
60
- model :zone
61
- collection :cloud_ips
62
- model :cloud_ip
63
- collection :users
64
- model :user
65
- collection :user_collaborations
66
- model :user_collaboration
28
+ model_path "fog/brightbox/models/compute"
29
+ collection :accounts
30
+ model :account
31
+ collection :applications
32
+ model :application
33
+ collection :api_clients
34
+ model :api_client
35
+ collection :collaborations
36
+ model :collaboration
37
+ collection :servers
38
+ model :server
39
+ collection :server_groups
40
+ model :server_group
41
+ collection :events
42
+ model :event
43
+ collection :firewall_policies
44
+ model :firewall_policy
45
+ collection :firewall_rules
46
+ model :firewall_rule
47
+ collection :flavors
48
+ model :flavor
49
+ collection :images
50
+ model :image
51
+ collection :load_balancers
52
+ model :load_balancer
53
+ collection :database_servers
54
+ model :database_server
55
+ collection :database_snapshots
56
+ model :database_snapshot
57
+ collection :database_types
58
+ model :database_type
59
+ collection :zones
60
+ model :zone
61
+ collection :cloud_ips
62
+ model :cloud_ip
63
+ collection :users
64
+ model :user
65
+ collection :user_collaborations
66
+ model :user_collaboration
67
67
 
68
- request_path 'fog/brightbox/requests/compute'
68
+ request_path "fog/brightbox/requests/compute"
69
69
  request :accept_user_collaboration
70
70
  request :activate_console_server
71
71
  request :add_listeners_load_balancer
@@ -192,11 +192,11 @@ module Fog
192
192
  class Mock
193
193
  include Fog::Brightbox::Compute::Shared
194
194
 
195
- def request(method, path, expected_responses, parameters = {})
195
+ def request(_method, _path, _expected_responses, _parameters = {})
196
196
  _request
197
197
  end
198
198
 
199
- def request_access_token(connection, credentials)
199
+ def request_access_token(_connection, _credentials)
200
200
  _request
201
201
  end
202
202
 
@@ -315,7 +315,6 @@ module Fog
315
315
  Fog::Brightbox::Compute::ImageSelector.new(list_images).latest_ubuntu
316
316
  end
317
317
  end
318
-
319
318
  end
320
319
  end
321
320
  end
@@ -1,27 +1,33 @@
1
- module ResourceLocking
2
- def locked?
3
- if attributes.key?("locked") || attributes.key?(:locked)
4
- attributes["locked"] || attributes[:locked] || false
5
- else
6
- false
7
- end
8
- end
1
+ module Fog
2
+ module Brightbox
3
+ module Compute
4
+ module ResourceLocking
5
+ def locked?
6
+ if attributes.key?("locked") || attributes.key?(:locked)
7
+ attributes["locked"] || attributes[:locked] || false
8
+ else
9
+ false
10
+ end
11
+ end
9
12
 
10
- def lock!
11
- locking_request(:lock)
12
- end
13
+ def lock!
14
+ locking_request(:lock)
15
+ end
13
16
 
14
- def unlock!
15
- locking_request(:unlock)
16
- end
17
+ def unlock!
18
+ locking_request(:unlock)
19
+ end
17
20
 
18
- private
21
+ private
19
22
 
20
- def locking_request(lock_setting)
21
- requires :identity
23
+ def locking_request(lock_setting)
24
+ requires :identity
22
25
 
23
- data = service.send(:"#{lock_setting}_resource_#{resource_name}", identity)
24
- merge_attributes(data)
25
- true
26
+ data = service.send(:"#{lock_setting}_resource_#{resource_name}", identity)
27
+ merge_attributes(data)
28
+ true
29
+ end
30
+ end
31
+ end
26
32
  end
27
33
  end
@@ -3,13 +3,14 @@ require "fog/brightbox/oauth2"
3
3
  module Fog
4
4
  module Brightbox
5
5
  module Compute
6
-
7
6
  # The Shared module consists of code that was duplicated between the Real
8
7
  # and Mock implementations.
9
8
  #
10
9
  module Shared
11
10
  include Fog::Brightbox::OAuth2
12
11
 
12
+ attr_writer :scoped_account
13
+
13
14
  API_URL = "https://api.gb1.brightbox.com/"
14
15
 
15
16
  # Creates a new instance of the Brightbox Compute service
@@ -59,12 +60,6 @@ module Fog
59
60
  @token_management = @config.managed_tokens?
60
61
  end
61
62
 
62
- # Sets the scoped account for future requests
63
- # @param [String] scoped_account Identifier of the account to scope request to
64
- def scoped_account=(scoped_account)
65
- @scoped_account = scoped_account
66
- end
67
-
68
63
  # This returns the account identifier that the request should be scoped by
69
64
  # based on the options passed to the request and current configuration
70
65
  #
@@ -9,6 +9,8 @@ module Fog
9
9
  # is told a token has expired then another will not retry it.
10
10
  #
11
11
  class Config
12
+ attr_writer :storage_management_url
13
+
12
14
  # Creates a new set of configuration settings based on the options provided.
13
15
  #
14
16
  # @param [Hash] options The configuration settings
@@ -53,12 +55,12 @@ module Fog
53
55
 
54
56
  # @return [OAuth2::CredentialSet]
55
57
  def credentials
56
- @credentials ||= OAuth2::CredentialSet.new(client_id, client_secret, {
57
- :username => username,
58
- :password => password,
59
- :access_token => cached_access_token,
60
- :refresh_token => cached_refresh_token
61
- })
58
+ @credentials ||= OAuth2::CredentialSet.new(client_id, client_secret,
59
+ :username => username,
60
+ :password => password,
61
+ :access_token => cached_access_token,
62
+ :refresh_token => cached_refresh_token
63
+ )
62
64
  end
63
65
 
64
66
  # @return [Boolean]
@@ -94,15 +96,10 @@ module Fog
94
96
 
95
97
  def storage_management_url
96
98
  @storage_management_url ||= if @options.key?(:brightbox_storage_management_url)
97
- URI.parse(@options[:brightbox_storage_management_url])
98
- else
99
- nil
100
- end
101
- end
102
-
103
- # @param [URI] management_url The URI to use for management requests.
104
- def storage_management_url=(management_url)
105
- @storage_management_url = management_url
99
+ URI.parse(@options[:brightbox_storage_management_url])
100
+ else
101
+ nil
102
+ end
106
103
  end
107
104
 
108
105
  # @return [String] The configured identifier of the API client or user application.