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.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/.rubocop.yml +20 -0
- data/.rubocop_todo.yml +81 -0
- data/CHANGELOG.md +17 -0
- data/README.md +6 -0
- data/fog-brightbox.gemspec +10 -9
- data/gemfiles/Gemfile.1.8.7 +1 -0
- data/lib/fog/brightbox.rb +2 -2
- data/lib/fog/brightbox/compute.rb +47 -48
- data/lib/fog/brightbox/compute/resource_locking.rb +26 -20
- data/lib/fog/brightbox/compute/shared.rb +2 -7
- data/lib/fog/brightbox/config.rb +12 -15
- data/lib/fog/brightbox/core.rb +5 -5
- data/lib/fog/brightbox/link_helper.rb +33 -0
- data/lib/fog/brightbox/models/compute/account.rb +0 -1
- data/lib/fog/brightbox/models/compute/accounts.rb +2 -6
- data/lib/fog/brightbox/models/compute/api_client.rb +2 -2
- data/lib/fog/brightbox/models/compute/application.rb +2 -2
- data/lib/fog/brightbox/models/compute/applications.rb +2 -6
- data/lib/fog/brightbox/models/compute/cloud_ip.rb +0 -4
- data/lib/fog/brightbox/models/compute/cloud_ips.rb +2 -6
- data/lib/fog/brightbox/models/compute/collaboration.rb +4 -4
- data/lib/fog/brightbox/models/compute/database_server.rb +11 -4
- data/lib/fog/brightbox/models/compute/database_servers.rb +2 -6
- data/lib/fog/brightbox/models/compute/database_snapshot.rb +1 -1
- data/lib/fog/brightbox/models/compute/database_snapshots.rb +2 -2
- data/lib/fog/brightbox/models/compute/database_types.rb +2 -4
- data/lib/fog/brightbox/models/compute/event.rb +0 -2
- data/lib/fog/brightbox/models/compute/events.rb +2 -4
- data/lib/fog/brightbox/models/compute/firewall_policies.rb +2 -6
- data/lib/fog/brightbox/models/compute/firewall_policy.rb +2 -3
- data/lib/fog/brightbox/models/compute/firewall_rule.rb +2 -3
- data/lib/fog/brightbox/models/compute/firewall_rules.rb +2 -6
- data/lib/fog/brightbox/models/compute/flavor.rb +0 -1
- data/lib/fog/brightbox/models/compute/flavors.rb +2 -6
- data/lib/fog/brightbox/models/compute/image.rb +3 -3
- data/lib/fog/brightbox/models/compute/images.rb +2 -6
- data/lib/fog/brightbox/models/compute/load_balancer.rb +5 -5
- data/lib/fog/brightbox/models/compute/load_balancers.rb +2 -6
- data/lib/fog/brightbox/models/compute/server.rb +15 -9
- data/lib/fog/brightbox/models/compute/server_group.rb +1 -1
- data/lib/fog/brightbox/models/compute/server_groups.rb +2 -6
- data/lib/fog/brightbox/models/compute/servers.rb +2 -6
- data/lib/fog/brightbox/models/compute/user.rb +0 -1
- data/lib/fog/brightbox/models/compute/user_collaboration.rb +2 -3
- data/lib/fog/brightbox/models/compute/users.rb +2 -5
- data/lib/fog/brightbox/models/compute/zones.rb +2 -6
- data/lib/fog/brightbox/models/storage/directories.rb +6 -13
- data/lib/fog/brightbox/models/storage/directory.rb +5 -7
- data/lib/fog/brightbox/models/storage/file.rb +37 -45
- data/lib/fog/brightbox/models/storage/files.rb +21 -25
- data/lib/fog/brightbox/oauth2.rb +136 -137
- data/lib/fog/brightbox/requests/compute/accept_user_collaboration.rb +0 -1
- data/lib/fog/brightbox/requests/compute/activate_console_server.rb +0 -1
- data/lib/fog/brightbox/requests/compute/add_listeners_load_balancer.rb +0 -1
- data/lib/fog/brightbox/requests/compute/add_nodes_load_balancer.rb +0 -1
- data/lib/fog/brightbox/requests/compute/add_servers_server_group.rb +0 -1
- data/lib/fog/brightbox/requests/compute/apply_to_firewall_policy.rb +0 -1
- data/lib/fog/brightbox/requests/compute/create_api_client.rb +0 -1
- data/lib/fog/brightbox/requests/compute/create_application.rb +0 -1
- data/lib/fog/brightbox/requests/compute/create_cloud_ip.rb +0 -1
- data/lib/fog/brightbox/requests/compute/create_collaboration.rb +0 -1
- data/lib/fog/brightbox/requests/compute/create_database_server.rb +0 -1
- data/lib/fog/brightbox/requests/compute/create_firewall_policy.rb +0 -1
- data/lib/fog/brightbox/requests/compute/create_firewall_rule.rb +0 -1
- data/lib/fog/brightbox/requests/compute/create_image.rb +0 -1
- data/lib/fog/brightbox/requests/compute/create_load_balancer.rb +0 -1
- data/lib/fog/brightbox/requests/compute/create_server.rb +0 -1
- data/lib/fog/brightbox/requests/compute/create_server_group.rb +0 -1
- data/lib/fog/brightbox/requests/compute/get_account.rb +0 -1
- data/lib/fog/brightbox/requests/compute/get_api_client.rb +0 -1
- data/lib/fog/brightbox/requests/compute/get_application.rb +0 -1
- data/lib/fog/brightbox/requests/compute/get_authenticated_user.rb +0 -2
- data/lib/fog/brightbox/requests/compute/get_cloud_ip.rb +0 -1
- data/lib/fog/brightbox/requests/compute/get_collaboration.rb +0 -1
- data/lib/fog/brightbox/requests/compute/get_database_server.rb +0 -1
- data/lib/fog/brightbox/requests/compute/get_database_snapshot.rb +0 -1
- data/lib/fog/brightbox/requests/compute/get_database_type.rb +0 -1
- data/lib/fog/brightbox/requests/compute/get_firewall_policy.rb +0 -1
- data/lib/fog/brightbox/requests/compute/get_firewall_rule.rb +0 -1
- data/lib/fog/brightbox/requests/compute/get_image.rb +0 -1
- data/lib/fog/brightbox/requests/compute/get_interface.rb +0 -1
- data/lib/fog/brightbox/requests/compute/get_load_balancer.rb +0 -1
- data/lib/fog/brightbox/requests/compute/get_scoped_account.rb +0 -1
- data/lib/fog/brightbox/requests/compute/get_server.rb +0 -1
- data/lib/fog/brightbox/requests/compute/get_server_group.rb +0 -1
- data/lib/fog/brightbox/requests/compute/get_server_type.rb +0 -1
- data/lib/fog/brightbox/requests/compute/get_user.rb +0 -1
- data/lib/fog/brightbox/requests/compute/get_user_collaboration.rb +0 -1
- data/lib/fog/brightbox/requests/compute/get_zone.rb +0 -1
- data/lib/fog/brightbox/requests/compute/list_accounts.rb +0 -1
- data/lib/fog/brightbox/requests/compute/list_api_clients.rb +0 -1
- data/lib/fog/brightbox/requests/compute/list_applications.rb +0 -1
- data/lib/fog/brightbox/requests/compute/list_cloud_ips.rb +0 -1
- data/lib/fog/brightbox/requests/compute/list_collaborations.rb +0 -1
- data/lib/fog/brightbox/requests/compute/list_database_servers.rb +0 -1
- data/lib/fog/brightbox/requests/compute/list_database_snapshots.rb +0 -1
- data/lib/fog/brightbox/requests/compute/list_database_types.rb +0 -1
- data/lib/fog/brightbox/requests/compute/list_events.rb +0 -1
- data/lib/fog/brightbox/requests/compute/list_firewall_policies.rb +0 -1
- data/lib/fog/brightbox/requests/compute/list_images.rb +0 -1
- data/lib/fog/brightbox/requests/compute/list_load_balancers.rb +0 -1
- data/lib/fog/brightbox/requests/compute/list_server_groups.rb +0 -1
- data/lib/fog/brightbox/requests/compute/list_server_types.rb +0 -1
- data/lib/fog/brightbox/requests/compute/list_servers.rb +0 -1
- data/lib/fog/brightbox/requests/compute/list_user_collaborations.rb +0 -1
- data/lib/fog/brightbox/requests/compute/list_users.rb +0 -1
- data/lib/fog/brightbox/requests/compute/list_zones.rb +0 -1
- data/lib/fog/brightbox/requests/compute/lock_resource_database_server.rb +0 -1
- data/lib/fog/brightbox/requests/compute/lock_resource_database_snapshot.rb +0 -1
- data/lib/fog/brightbox/requests/compute/lock_resource_image.rb +0 -1
- data/lib/fog/brightbox/requests/compute/lock_resource_load_balancer.rb +0 -1
- data/lib/fog/brightbox/requests/compute/lock_resource_server.rb +0 -1
- data/lib/fog/brightbox/requests/compute/map_cloud_ip.rb +0 -1
- data/lib/fog/brightbox/requests/compute/move_servers_server_group.rb +0 -1
- data/lib/fog/brightbox/requests/compute/reboot_server.rb +0 -1
- data/lib/fog/brightbox/requests/compute/reject_user_collaboration.rb +0 -1
- data/lib/fog/brightbox/requests/compute/remove_firewall_policy.rb +0 -1
- data/lib/fog/brightbox/requests/compute/remove_listeners_load_balancer.rb +0 -1
- data/lib/fog/brightbox/requests/compute/remove_nodes_load_balancer.rb +0 -1
- data/lib/fog/brightbox/requests/compute/remove_servers_server_group.rb +0 -1
- data/lib/fog/brightbox/requests/compute/resend_collaboration.rb +0 -1
- data/lib/fog/brightbox/requests/compute/reset_ftp_password_account.rb +0 -2
- data/lib/fog/brightbox/requests/compute/reset_ftp_password_scoped_account.rb +0 -1
- data/lib/fog/brightbox/requests/compute/reset_password_database_server.rb +0 -1
- data/lib/fog/brightbox/requests/compute/reset_secret_api_client.rb +0 -1
- data/lib/fog/brightbox/requests/compute/reset_secret_application.rb +0 -1
- data/lib/fog/brightbox/requests/compute/reset_server.rb +0 -1
- data/lib/fog/brightbox/requests/compute/shutdown_server.rb +0 -1
- data/lib/fog/brightbox/requests/compute/snapshot_database_server.rb +19 -3
- data/lib/fog/brightbox/requests/compute/snapshot_server.rb +19 -3
- data/lib/fog/brightbox/requests/compute/start_server.rb +0 -1
- data/lib/fog/brightbox/requests/compute/stop_server.rb +0 -1
- data/lib/fog/brightbox/requests/compute/unlock_resource_database_server.rb +0 -1
- data/lib/fog/brightbox/requests/compute/unlock_resource_database_snapshot.rb +0 -1
- data/lib/fog/brightbox/requests/compute/unlock_resource_image.rb +0 -1
- data/lib/fog/brightbox/requests/compute/unlock_resource_load_balancer.rb +0 -1
- data/lib/fog/brightbox/requests/compute/unlock_resource_server.rb +0 -1
- data/lib/fog/brightbox/requests/compute/unmap_cloud_ip.rb +0 -1
- data/lib/fog/brightbox/requests/compute/update_account.rb +0 -1
- data/lib/fog/brightbox/requests/compute/update_api_client.rb +0 -1
- data/lib/fog/brightbox/requests/compute/update_application.rb +0 -1
- data/lib/fog/brightbox/requests/compute/update_cloud_ip.rb +0 -1
- data/lib/fog/brightbox/requests/compute/update_database_server.rb +0 -1
- data/lib/fog/brightbox/requests/compute/update_database_snapshot.rb +0 -1
- data/lib/fog/brightbox/requests/compute/update_firewall_policy.rb +0 -1
- data/lib/fog/brightbox/requests/compute/update_firewall_rule.rb +0 -1
- data/lib/fog/brightbox/requests/compute/update_image.rb +0 -1
- data/lib/fog/brightbox/requests/compute/update_load_balancer.rb +0 -1
- data/lib/fog/brightbox/requests/compute/update_scoped_account.rb +0 -1
- data/lib/fog/brightbox/requests/compute/update_server.rb +0 -1
- data/lib/fog/brightbox/requests/compute/update_server_group.rb +0 -1
- data/lib/fog/brightbox/requests/compute/update_user.rb +0 -1
- data/lib/fog/brightbox/requests/storage/copy_object.rb +8 -10
- data/lib/fog/brightbox/requests/storage/delete_container.rb +1 -3
- data/lib/fog/brightbox/requests/storage/delete_multiple_objects.rb +7 -9
- data/lib/fog/brightbox/requests/storage/delete_object.rb +1 -3
- data/lib/fog/brightbox/requests/storage/delete_static_large_object.rb +7 -9
- data/lib/fog/brightbox/requests/storage/get_container.rb +3 -5
- data/lib/fog/brightbox/requests/storage/get_containers.rb +4 -6
- data/lib/fog/brightbox/requests/storage/get_object.rb +1 -3
- data/lib/fog/brightbox/requests/storage/get_object_https_url.rb +5 -10
- data/lib/fog/brightbox/requests/storage/head_container.rb +2 -4
- data/lib/fog/brightbox/requests/storage/head_containers.rb +3 -5
- data/lib/fog/brightbox/requests/storage/head_object.rb +4 -6
- data/lib/fog/brightbox/requests/storage/post_set_meta_temp_url_key.rb +2 -6
- data/lib/fog/brightbox/requests/storage/put_container.rb +3 -5
- data/lib/fog/brightbox/requests/storage/put_dynamic_obj_manifest.rb +2 -4
- data/lib/fog/brightbox/requests/storage/put_object.rb +1 -2
- data/lib/fog/brightbox/requests/storage/put_object_manifest.rb +0 -2
- data/lib/fog/brightbox/requests/storage/put_static_obj_manifest.rb +2 -4
- data/lib/fog/brightbox/storage.rb +26 -29
- data/lib/fog/brightbox/storage/connection.rb +10 -10
- data/lib/fog/brightbox/version.rb +1 -1
- data/spec/fog/brightbox/link_helper_spec.rb +18 -0
- data/spec/fog/brightbox/storage/authentication_request_spec.rb +16 -16
- data/spec/fog/brightbox/storage/connection_spec.rb +12 -12
- data/spec/fog/compute/brightbox/database_server_spec.rb +31 -0
- data/spec/fog/compute/brightbox/server_spec.rb +31 -0
- data/spec/fog/storage/brightbox_spec.rb +3 -3
- data/spec/spec_helper.rb +1 -1
- metadata +28 -10
- data/spec/model_helper.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 496e29fce89925667624be224c1f667295ee92fc
|
4
|
+
data.tar.gz: 86fca89817bccee070cdb86701a811cdb604cfa7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0725ecbd7084c492e79ef187183b1adebde76de09ac082d61b748784bb30fe73a91c47d7272c2cd96a28f27d78ff6462c0df951e1e898a88bf85e5bba56dae5
|
7
|
+
data.tar.gz: fbe5f43f457c4d2306bd8bbdcff03edb5dd002a07cb7bb7ffdbf65c20e092459dd93de159395543a15e4727cc4adaa8da3f8aa3f152cb6d0336eb000a851dc7b
|
data/.gitignore
CHANGED
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.
|
data/fog-brightbox.gemspec
CHANGED
@@ -1,31 +1,32 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
lib = File.expand_path(
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
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
|
12
|
-
spec.summary = %q
|
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
|
data/gemfiles/Gemfile.1.8.7
CHANGED
data/lib/fog/brightbox.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "fog/brightbox/compute"
|
2
|
+
require "fog/brightbox/storage"
|
@@ -1,12 +1,12 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
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
|
29
|
-
collection
|
30
|
-
model
|
31
|
-
collection
|
32
|
-
model
|
33
|
-
collection
|
34
|
-
model
|
35
|
-
collection
|
36
|
-
model
|
37
|
-
collection
|
38
|
-
model
|
39
|
-
collection
|
40
|
-
model
|
41
|
-
collection
|
42
|
-
model
|
43
|
-
collection
|
44
|
-
model
|
45
|
-
collection
|
46
|
-
model
|
47
|
-
collection
|
48
|
-
model
|
49
|
-
collection
|
50
|
-
model
|
51
|
-
collection
|
52
|
-
model
|
53
|
-
collection
|
54
|
-
model
|
55
|
-
collection
|
56
|
-
model
|
57
|
-
collection
|
58
|
-
model
|
59
|
-
collection
|
60
|
-
model
|
61
|
-
collection
|
62
|
-
model
|
63
|
-
collection
|
64
|
-
model
|
65
|
-
collection
|
66
|
-
model
|
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
|
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(
|
195
|
+
def request(_method, _path, _expected_responses, _parameters = {})
|
196
196
|
_request
|
197
197
|
end
|
198
198
|
|
199
|
-
def request_access_token(
|
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
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
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
|
-
|
11
|
-
|
12
|
-
|
13
|
+
def lock!
|
14
|
+
locking_request(:lock)
|
15
|
+
end
|
13
16
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
+
def unlock!
|
18
|
+
locking_request(:unlock)
|
19
|
+
end
|
17
20
|
|
18
|
-
|
21
|
+
private
|
19
22
|
|
20
|
-
|
21
|
-
|
23
|
+
def locking_request(lock_setting)
|
24
|
+
requires :identity
|
22
25
|
|
23
|
-
|
24
|
-
|
25
|
-
|
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
|
#
|
data/lib/fog/brightbox/config.rb
CHANGED
@@ -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
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
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
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
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.
|