fog-brightbox 1.5.0.rc1 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +31 -0
- data/lib/fog/brightbox/compute/shared.rb +26 -10
- data/lib/fog/brightbox/compute.rb +11 -0
- data/lib/fog/brightbox/config.rb +12 -0
- data/lib/fog/brightbox/models/compute/account.rb +30 -18
- data/lib/fog/brightbox/models/compute/api_client.rb +10 -2
- data/lib/fog/brightbox/models/compute/application.rb +8 -0
- data/lib/fog/brightbox/models/compute/cloud_ip.rb +11 -11
- data/lib/fog/brightbox/models/compute/collaboration.rb +11 -0
- data/lib/fog/brightbox/models/compute/config_map.rb +14 -0
- data/lib/fog/brightbox/models/compute/config_maps.rb +22 -0
- data/lib/fog/brightbox/models/compute/database_server.rb +19 -15
- data/lib/fog/brightbox/models/compute/database_snapshot.rb +13 -6
- data/lib/fog/brightbox/models/compute/database_type.rb +6 -3
- data/lib/fog/brightbox/models/compute/event.rb +5 -4
- data/lib/fog/brightbox/models/compute/firewall_policy.rb +10 -4
- data/lib/fog/brightbox/models/compute/firewall_rule.rb +9 -6
- data/lib/fog/brightbox/models/compute/flavor.rb +3 -3
- data/lib/fog/brightbox/models/compute/image.rb +16 -14
- data/lib/fog/brightbox/models/compute/load_balancer.rb +12 -8
- data/lib/fog/brightbox/models/compute/server.rb +19 -17
- data/lib/fog/brightbox/models/compute/server_group.rb +13 -5
- data/lib/fog/brightbox/models/compute/user.rb +9 -4
- data/lib/fog/brightbox/models/compute/user_collaboration.rb +11 -0
- data/lib/fog/brightbox/models/compute/volume.rb +15 -14
- data/lib/fog/brightbox/models/compute/zone.rb +3 -4
- data/lib/fog/brightbox/oauth2.rb +47 -7
- data/lib/fog/brightbox/requests/compute/create_config_map.rb +22 -0
- data/lib/fog/brightbox/requests/compute/delete_config_map.rb +20 -0
- data/lib/fog/brightbox/requests/compute/get_config_map.rb +18 -0
- data/lib/fog/brightbox/requests/compute/list_config_maps.rb +18 -0
- data/lib/fog/brightbox/requests/compute/update_config_map.rb +22 -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
- metadata +16 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 930c37c33d46857b7fa6f4e9880bd11068f9b4cc3a90aad25d1db39904ae6601
|
4
|
+
data.tar.gz: e9bfaa815ea41d8a0fc5afc094b4e7626d8dfa3fb7b35ddb58f9fa0c60aaf945
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7d00dbc24b5d7b9c2e292bf7caa4797d93ed6d94d28622ea5beb9f29af6c29d6098d17ab495d3707f9e7a847694f9a331e5de5268000bddb1e4f884d80566c6
|
7
|
+
data.tar.gz: 4164e7796800011e460411dccc08efb780362b61afd2790b5af8e724151c86e50e315fba45f785ad8cf5fb44f9016e1aac36d7093436f07670332afff66c1aec
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,34 @@
|
|
1
|
+
### 1.7.0 / 2022-07-28
|
2
|
+
|
3
|
+
Changes:
|
4
|
+
|
5
|
+
* Adds support for `ConfigMaps` which are simple key/value stores for configuring
|
6
|
+
other resources.
|
7
|
+
* Updated the API models to include the latest set of attributes defined in the
|
8
|
+
Brightbox API enabling them to be referenced.
|
9
|
+
|
10
|
+
### 1.6.0 / 2022-07-25
|
11
|
+
|
12
|
+
Changes:
|
13
|
+
|
14
|
+
* Added support to opt-in to support Brightbox 2FA within clients.
|
15
|
+
|
16
|
+
Two Factor Authentication (2FA) support:
|
17
|
+
|
18
|
+
Passing `brightbox_support_two_factor` into a configuration will raise a new
|
19
|
+
error when user authentication has failed BUT the presence of the
|
20
|
+
`X-Brightbox-OTP: required` HTTP header is found.
|
21
|
+
|
22
|
+
This new error `Fog::Brightbox::OAuth2::TwoFactorMissingError` can be handled
|
23
|
+
differently by the client and the second factor can be prompted for or
|
24
|
+
recovered from a secure keychain.
|
25
|
+
|
26
|
+
Without opting in, the previous error `Excon::Errors::Unauthorized` is raised.
|
27
|
+
|
28
|
+
To send the OTP, the `brightbox_one_time_password` can be passed into a
|
29
|
+
configuration object or one_time_password can be passed to a credentials
|
30
|
+
object.
|
31
|
+
|
1
32
|
### 1.5.0 / 2022-06-09
|
2
33
|
|
3
34
|
Changes:
|
@@ -39,21 +39,15 @@ module Fog
|
|
39
39
|
@persistent = @config.connection_persistent?
|
40
40
|
@connection = Fog::Core::Connection.new(@api_url, @persistent, @connection_options)
|
41
41
|
|
42
|
-
# Authentication options
|
43
|
-
client_id = @config.client_id
|
44
|
-
client_secret = @config.client_secret
|
45
|
-
|
46
|
-
username = @config.username
|
47
|
-
password = @config.password
|
48
42
|
@configured_account = @config.account
|
49
43
|
# Request account can be changed at anytime and changes behaviour of future requests
|
50
44
|
@scoped_account = @configured_account
|
51
45
|
|
52
|
-
|
53
|
-
@
|
46
|
+
@two_factor = @config.two_factor?
|
47
|
+
@one_time_password = @config.one_time_password
|
54
48
|
|
55
49
|
# If existing tokens have been cached, allow continued use of them in the service
|
56
|
-
|
50
|
+
credentials.update_tokens(@config.cached_access_token, @config.cached_refresh_token)
|
57
51
|
|
58
52
|
@token_management = @config.managed_tokens?
|
59
53
|
end
|
@@ -73,6 +67,12 @@ module Fog
|
|
73
67
|
@scoped_account = @configured_account
|
74
68
|
end
|
75
69
|
|
70
|
+
def credentials
|
71
|
+
client_id = @config.client_id
|
72
|
+
client_secret = @config.client_secret
|
73
|
+
@credentials ||= CredentialSet.new(client_id, client_secret, credential_options)
|
74
|
+
end
|
75
|
+
|
76
76
|
# Returns the scoped account being used for requests
|
77
77
|
#
|
78
78
|
# * For API clients this is the owning account
|
@@ -122,7 +122,7 @@ module Fog
|
|
122
122
|
def get_access_token
|
123
123
|
begin
|
124
124
|
get_access_token!
|
125
|
-
rescue Excon::Errors::Unauthorized, Excon::Errors::BadRequest
|
125
|
+
rescue Fog::Brightbox::OAuth2::TwoFactorMissingError, Excon::Errors::Unauthorized, Excon::Errors::BadRequest
|
126
126
|
@credentials.update_tokens(nil, nil)
|
127
127
|
end
|
128
128
|
@credentials.access_token
|
@@ -154,8 +154,24 @@ module Fog
|
|
154
154
|
@default_image_id ||= (@config.default_image_id || select_default_image)
|
155
155
|
end
|
156
156
|
|
157
|
+
def two_factor?
|
158
|
+
@two_factor || false
|
159
|
+
end
|
160
|
+
|
157
161
|
private
|
158
162
|
|
163
|
+
# This returns a formatted set of options for the credentials for this service
|
164
|
+
#
|
165
|
+
# @return [Hash]
|
166
|
+
def credential_options
|
167
|
+
{
|
168
|
+
username: @config.username,
|
169
|
+
password: @config.password
|
170
|
+
}.tap do |opts|
|
171
|
+
opts[:one_time_password] = @one_time_password if two_factor?
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
159
175
|
# This makes a request of the API based on the configured setting for
|
160
176
|
# token management.
|
161
177
|
#
|
@@ -21,6 +21,10 @@ module Fog
|
|
21
21
|
# Automatic token management
|
22
22
|
recognizes :brightbox_token_management
|
23
23
|
|
24
|
+
# Two Factor Authentication support (2FA)
|
25
|
+
recognizes :brightbox_support_two_factor
|
26
|
+
recognizes :brightbox_one_time_password
|
27
|
+
|
24
28
|
# Excon connection settings
|
25
29
|
recognizes :persistent
|
26
30
|
|
@@ -33,6 +37,8 @@ module Fog
|
|
33
37
|
model :api_client
|
34
38
|
collection :collaborations
|
35
39
|
model :collaboration
|
40
|
+
collection :config_maps
|
41
|
+
model :config_map
|
36
42
|
collection :servers
|
37
43
|
model :server
|
38
44
|
collection :server_groups
|
@@ -81,6 +87,7 @@ module Fog
|
|
81
87
|
request :create_application
|
82
88
|
request :create_cloud_ip
|
83
89
|
request :create_collaboration
|
90
|
+
request :create_config_map
|
84
91
|
request :create_firewall_policy
|
85
92
|
request :create_firewall_rule
|
86
93
|
request :create_image
|
@@ -93,6 +100,7 @@ module Fog
|
|
93
100
|
request :delete_application
|
94
101
|
request :delete_cloud_ip
|
95
102
|
request :delete_collaboration
|
103
|
+
request :delete_config_map
|
96
104
|
request :delete_firewall_policy
|
97
105
|
request :delete_firewall_rule
|
98
106
|
request :delete_image
|
@@ -110,6 +118,7 @@ module Fog
|
|
110
118
|
request :get_authenticated_user
|
111
119
|
request :get_cloud_ip
|
112
120
|
request :get_collaboration
|
121
|
+
request :get_config_map
|
113
122
|
request :get_firewall_policy
|
114
123
|
request :get_firewall_rule
|
115
124
|
request :get_image
|
@@ -131,6 +140,7 @@ module Fog
|
|
131
140
|
request :list_applications
|
132
141
|
request :list_cloud_ips
|
133
142
|
request :list_collaborations
|
143
|
+
request :list_config_maps
|
134
144
|
request :list_events
|
135
145
|
request :list_firewall_policies
|
136
146
|
request :list_images
|
@@ -184,6 +194,7 @@ module Fog
|
|
184
194
|
request :update_api_client
|
185
195
|
request :update_application
|
186
196
|
request :update_cloud_ip
|
197
|
+
request :update_config_map
|
187
198
|
request :update_firewall_policy
|
188
199
|
request :update_firewall_rule
|
189
200
|
request :update_image
|
data/lib/fog/brightbox/config.rb
CHANGED
@@ -33,6 +33,10 @@ module Fog
|
|
33
33
|
# Set to specify the client secret to use for requests.
|
34
34
|
# @option options [String] :brightbox_token_management (true)
|
35
35
|
# Set to specify if the service should handle expired tokens or raise an error instead.
|
36
|
+
# @option options [Boolean] :brightbox_support_two_factor
|
37
|
+
# Set to enable two factor authentication (2FA) for this configuration/user
|
38
|
+
# @option options [String] :brightbox_one_time_password
|
39
|
+
# Set to pass through the current one time password when using 2FA
|
36
40
|
# @option options [String] :brightbox_username
|
37
41
|
# Set to specify your user account. Either user identifier (+usr-12345+) or email address
|
38
42
|
# may be used.
|
@@ -226,6 +230,14 @@ module Fog
|
|
226
230
|
def storage_temp_key
|
227
231
|
@options[:brightbox_temp_url_key]
|
228
232
|
end
|
233
|
+
|
234
|
+
def two_factor?
|
235
|
+
@options[:brightbox_support_two_factor] || false
|
236
|
+
end
|
237
|
+
|
238
|
+
def one_time_password
|
239
|
+
@options[:brightbox_one_time_password]
|
240
|
+
end
|
229
241
|
end
|
230
242
|
end
|
231
243
|
end
|
@@ -3,8 +3,8 @@ module Fog
|
|
3
3
|
class Compute
|
4
4
|
class Account < Fog::Brightbox::Model
|
5
5
|
identity :id
|
6
|
-
attribute :url
|
7
6
|
attribute :resource_type
|
7
|
+
attribute :url
|
8
8
|
|
9
9
|
attribute :name
|
10
10
|
attribute :status
|
@@ -20,35 +20,47 @@ module Fog
|
|
20
20
|
attribute :telephone_number
|
21
21
|
attribute :verified_telephone
|
22
22
|
attribute :verified_ip
|
23
|
-
|
24
|
-
|
25
|
-
attribute :
|
26
|
-
attribute :
|
27
|
-
attribute :
|
28
|
-
attribute :
|
29
|
-
attribute :
|
30
|
-
attribute :
|
31
|
-
attribute :
|
32
|
-
attribute :
|
23
|
+
|
24
|
+
# Account limits (read-only)
|
25
|
+
attribute :block_storage_limit, type: :integer
|
26
|
+
attribute :block_storage_used, type: :integer
|
27
|
+
attribute :cloud_ips_limit, type: :integer
|
28
|
+
attribute :cloud_ips_used, type: :integer
|
29
|
+
attribute :dbs_instances_used, type: :integer
|
30
|
+
attribute :dbs_ram_limit, type: :integer
|
31
|
+
attribute :dbs_ram_used, type: :integer
|
32
|
+
attribute :load_balancers_limit, type: :integer
|
33
|
+
attribute :load_balancers_used, type: :integer
|
34
|
+
attribute :ram_limit, type: :integer
|
35
|
+
attribute :ram_used, type: :integer
|
36
|
+
attribute :servers_used, type: :integer
|
37
|
+
|
33
38
|
attribute :library_ftp_host
|
34
39
|
attribute :library_ftp_user
|
35
40
|
# This is always returned as nil unless after a call to reset_ftp_password
|
36
41
|
attribute :library_ftp_password
|
37
42
|
|
38
43
|
# Boolean flags
|
39
|
-
attribute :valid_credit_card
|
40
|
-
attribute :telephone_verified
|
44
|
+
attribute :valid_credit_card, type: :boolean
|
45
|
+
attribute :telephone_verified, type: :boolean
|
41
46
|
|
42
|
-
#
|
43
|
-
attribute :created_at, :
|
44
|
-
attribute :verified_at, :
|
47
|
+
# Timestamps
|
48
|
+
attribute :created_at, type: :time
|
49
|
+
attribute :verified_at, type: :time
|
45
50
|
|
46
|
-
# Links
|
47
|
-
attribute :owner_id, :
|
51
|
+
# Links
|
52
|
+
attribute :owner_id, aliases: "owner", squash: "id"
|
48
53
|
attribute :clients
|
54
|
+
attribute :cloud_ips
|
55
|
+
attribute :database_servers
|
56
|
+
attribute :database_snapshots
|
57
|
+
attribute :firewall_policies
|
49
58
|
attribute :images
|
59
|
+
attribute :load_balancers
|
60
|
+
attribute :server_groups
|
50
61
|
attribute :servers
|
51
62
|
attribute :users
|
63
|
+
attribute :volumes
|
52
64
|
attribute :zones
|
53
65
|
|
54
66
|
# Resets the account's image library FTP password returning the new value
|
@@ -3,12 +3,20 @@ module Fog
|
|
3
3
|
class Compute
|
4
4
|
class ApiClient < Fog::Brightbox::Model
|
5
5
|
identity :id
|
6
|
+
attribute :resource_type
|
7
|
+
attribute :url
|
8
|
+
|
6
9
|
attribute :name
|
7
10
|
attribute :description
|
11
|
+
|
8
12
|
attribute :secret
|
9
|
-
attribute :revoked_at, :type => :time
|
10
13
|
attribute :permissions_group
|
11
|
-
|
14
|
+
|
15
|
+
# Timestamps
|
16
|
+
attribute :revoked_at, type: :time
|
17
|
+
|
18
|
+
# Links
|
19
|
+
attribute :account_id, aliases: "account", squash: "id"
|
12
20
|
|
13
21
|
def save
|
14
22
|
raise Fog::Errors::Error.new("Resaving an existing object may create a duplicate") if persisted?
|
@@ -3,10 +3,18 @@ module Fog
|
|
3
3
|
class Compute
|
4
4
|
class Application < Fog::Brightbox::Model
|
5
5
|
identity :id
|
6
|
+
attribute :resource_type
|
6
7
|
attribute :url
|
8
|
+
|
7
9
|
attribute :name
|
10
|
+
attribute :description
|
8
11
|
attribute :secret
|
9
12
|
|
13
|
+
# Timestamps
|
14
|
+
attribute :created_at, type: :time
|
15
|
+
attribute :updated_at, type: :time
|
16
|
+
attribute :revoked_at, type: :time
|
17
|
+
|
10
18
|
def save
|
11
19
|
raise Fog::Errors::Error.new("Resaving an existing object may create a duplicate") if persisted?
|
12
20
|
options = {
|
@@ -3,28 +3,28 @@ module Fog
|
|
3
3
|
class Compute
|
4
4
|
class CloudIp < Fog::Brightbox::Model
|
5
5
|
identity :id
|
6
|
-
attribute :url
|
7
6
|
attribute :resource_type
|
7
|
+
attribute :url
|
8
8
|
|
9
9
|
attribute :name
|
10
10
|
attribute :status
|
11
11
|
attribute :description
|
12
12
|
|
13
|
-
attribute :
|
13
|
+
attribute :fqdn
|
14
|
+
attribute :mode
|
14
15
|
attribute :public_ip
|
15
16
|
attribute :public_ipv4
|
16
17
|
attribute :public_ipv6
|
17
|
-
attribute :
|
18
|
+
attribute :reverse_dns
|
18
19
|
|
19
|
-
# Links
|
20
|
-
attribute :account_id, :
|
21
|
-
attribute :interface_id, :
|
22
|
-
attribute :server_id, :
|
23
|
-
attribute :load_balancer, :alias => "load_balancer", :
|
24
|
-
attribute :server_group, :alias => "server_group", :
|
25
|
-
attribute :database_server, :alias => "database_server", :
|
20
|
+
# Links
|
21
|
+
attribute :account_id, aliases: "account", squash: "id"
|
22
|
+
attribute :interface_id, aliases: "interface", squash: "id"
|
23
|
+
attribute :server_id, aliases: "server", squash: "id"
|
24
|
+
attribute :load_balancer, :alias => "load_balancer", squash: "id"
|
25
|
+
attribute :server_group, :alias => "server_group", squash: "id"
|
26
|
+
attribute :database_server, :alias => "database_server", squash: "id"
|
26
27
|
attribute :port_translators
|
27
|
-
attribute :name
|
28
28
|
|
29
29
|
# Attempt to map or point the Cloud IP to the destination resource.
|
30
30
|
#
|
@@ -3,10 +3,21 @@ module Fog
|
|
3
3
|
class Compute
|
4
4
|
class Collaboration < Fog::Brightbox::Model
|
5
5
|
identity :id
|
6
|
+
attribute :resource_type
|
7
|
+
attribute :url
|
8
|
+
|
6
9
|
attribute :status
|
10
|
+
|
7
11
|
attribute :email
|
8
12
|
attribute :role
|
9
13
|
attribute :role_label
|
14
|
+
|
15
|
+
# Timestamps
|
16
|
+
attribute :created_at, type: :time
|
17
|
+
attribute :started_at, type: :time
|
18
|
+
attribute :finished_at, type: :time
|
19
|
+
|
20
|
+
# Links
|
10
21
|
attribute :account
|
11
22
|
attribute :user
|
12
23
|
attribute :inviter
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class ConfigMaps < Fog::Collection
|
5
|
+
model Fog::Brightbox::Compute::ConfigMap
|
6
|
+
|
7
|
+
def all
|
8
|
+
data = service.list_config_maps
|
9
|
+
load(data)
|
10
|
+
end
|
11
|
+
|
12
|
+
def get(identifier)
|
13
|
+
return nil if identifier.nil? || identifier == ""
|
14
|
+
data = service.get_config_map(identifier)
|
15
|
+
new(data)
|
16
|
+
rescue Excon::Errors::NotFound
|
17
|
+
nil
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -5,39 +5,43 @@ module Fog
|
|
5
5
|
include Fog::Brightbox::Compute::ResourceLocking
|
6
6
|
|
7
7
|
identity :id
|
8
|
-
attribute :url
|
9
8
|
attribute :resource_type
|
9
|
+
attribute :url
|
10
10
|
|
11
11
|
attribute :name
|
12
12
|
attribute :description
|
13
|
-
attribute :state, :
|
13
|
+
attribute :state, aliases: "status"
|
14
14
|
|
15
15
|
attribute :admin_username
|
16
16
|
attribute :admin_password
|
17
|
-
|
17
|
+
attribute :allow_access
|
18
18
|
attribute :database_engine
|
19
19
|
attribute :database_version
|
20
|
+
attribute :maintenance_hour #, type: :integer
|
21
|
+
attribute :maintenance_weekday #, type: :integer
|
22
|
+
attribute :source
|
20
23
|
|
21
|
-
attribute :
|
22
|
-
attribute :maintenance_hour
|
24
|
+
attribute :snapshots_retention, type: :string
|
23
25
|
|
24
26
|
# This is a crontab formatted string e.g. "* 5 * * 0"
|
25
|
-
attribute :snapshots_schedule, :
|
26
|
-
attribute :snapshots_schedule_next_at, :
|
27
|
+
attribute :snapshots_schedule, type: :string
|
28
|
+
attribute :snapshots_schedule_next_at, type: :time
|
27
29
|
|
28
|
-
|
29
|
-
attribute :
|
30
|
-
attribute :
|
30
|
+
# Timestamps
|
31
|
+
attribute :created_at, type: :time
|
32
|
+
attribute :updated_at, type: :time
|
33
|
+
attribute :deleted_at, type: :time
|
31
34
|
|
32
|
-
|
35
|
+
# Links
|
36
|
+
attribute :flavor_id, alias: "database_server_type", squash: "id"
|
37
|
+
attribute :zone_id, alias: "zone", squash: "id"
|
33
38
|
|
34
|
-
attribute :
|
35
|
-
attribute :
|
39
|
+
attribute :account
|
40
|
+
attribute :cloud_ips
|
36
41
|
|
42
|
+
# Generated from snapshot action and not a real attribute
|
37
43
|
attribute :snapshot_id
|
38
44
|
|
39
|
-
attribute :cloud_ips
|
40
|
-
|
41
45
|
def save
|
42
46
|
options = {
|
43
47
|
:name => name,
|
@@ -7,21 +7,28 @@ module Fog
|
|
7
7
|
include Fog::Brightbox::Compute::ResourceLocking
|
8
8
|
|
9
9
|
identity :id
|
10
|
-
attribute :url
|
11
10
|
attribute :resource_type
|
11
|
+
attribute :url
|
12
12
|
|
13
13
|
attribute :name
|
14
14
|
attribute :description
|
15
|
-
attribute :state, :
|
15
|
+
attribute :state, aliases: "status"
|
16
16
|
|
17
17
|
attribute :database_engine
|
18
18
|
attribute :database_version
|
19
19
|
|
20
|
-
attribute :size
|
20
|
+
attribute :size, type: :integer
|
21
|
+
attribute :source
|
22
|
+
attribute :source_trigger
|
23
|
+
|
24
|
+
# Timestamps
|
25
|
+
attribute :created_at, type: :time
|
26
|
+
attribute :updated_at, type: :time
|
27
|
+
attribute :deleted_at, type: :time
|
21
28
|
|
22
|
-
|
23
|
-
attribute :
|
24
|
-
attribute :
|
29
|
+
# Links
|
30
|
+
attribute :account
|
31
|
+
attribute :account_id, aliases: "account", squash: "id"
|
25
32
|
|
26
33
|
def save
|
27
34
|
options = {
|
@@ -3,14 +3,17 @@ module Fog
|
|
3
3
|
class Compute
|
4
4
|
class DatabaseType < Fog::Brightbox::Model
|
5
5
|
identity :id
|
6
|
-
attribute :url
|
7
6
|
attribute :resource_type
|
7
|
+
attribute :url
|
8
8
|
|
9
9
|
attribute :name
|
10
10
|
attribute :description
|
11
11
|
|
12
|
-
attribute :disk, :
|
13
|
-
attribute :ram
|
12
|
+
attribute :disk, aliases: "disk_size", type: :integer
|
13
|
+
attribute :ram, type: :integer
|
14
|
+
|
15
|
+
# Boolean flags
|
16
|
+
attribute :default, type: :boolean
|
14
17
|
end
|
15
18
|
end
|
16
19
|
end
|
@@ -4,17 +4,18 @@ module Fog
|
|
4
4
|
# @api private
|
5
5
|
class Event < Fog::Brightbox::Model
|
6
6
|
identity :id
|
7
|
-
attribute :url
|
8
7
|
attribute :resource_type
|
8
|
+
attribute :url
|
9
9
|
|
10
10
|
attribute :action
|
11
11
|
attribute :message
|
12
12
|
attribute :short_message
|
13
13
|
|
14
|
-
#
|
15
|
-
attribute :created_at, :
|
14
|
+
# Timestamps
|
15
|
+
attribute :created_at, type: :time
|
16
16
|
|
17
|
-
# Links
|
17
|
+
# Links
|
18
|
+
attribute :affects
|
18
19
|
attribute :resource
|
19
20
|
attribute :client
|
20
21
|
attribute :user
|
@@ -3,16 +3,22 @@ module Fog
|
|
3
3
|
class Compute
|
4
4
|
class FirewallPolicy < Fog::Brightbox::Model
|
5
5
|
identity :id
|
6
|
-
attribute :url
|
7
6
|
attribute :resource_type
|
7
|
+
attribute :url
|
8
8
|
|
9
9
|
attribute :name
|
10
10
|
attribute :description
|
11
11
|
|
12
|
-
|
12
|
+
# Boolean flags
|
13
|
+
attribute :default, type: :boolean
|
14
|
+
|
15
|
+
# Timestamps
|
16
|
+
attribute :created_at, type: :time
|
17
|
+
|
18
|
+
# Links
|
19
|
+
attribute :account_id, aliases: "account", squash: "id"
|
20
|
+
attribute :server_group_id, aliases: "server_group", squash: "id"
|
13
21
|
|
14
|
-
attribute :server_group_id, :aliases => "server_group", :squash => "id"
|
15
|
-
attribute :created_at, :type => :time
|
16
22
|
attribute :rules
|
17
23
|
|
18
24
|
# Sticking with existing Fog behaviour, save does not update but creates a new resource
|
@@ -3,20 +3,23 @@ module Fog
|
|
3
3
|
class Compute
|
4
4
|
class FirewallRule < Fog::Brightbox::Model
|
5
5
|
identity :id
|
6
|
-
attribute :url
|
7
6
|
attribute :resource_type
|
7
|
+
attribute :url
|
8
8
|
|
9
9
|
attribute :description
|
10
10
|
|
11
|
-
attribute :source
|
12
|
-
attribute :source_port
|
13
11
|
attribute :destination
|
14
12
|
attribute :destination_port
|
15
|
-
attribute :protocol
|
16
13
|
attribute :icmp_type_name
|
17
|
-
attribute :
|
14
|
+
attribute :protocol
|
15
|
+
attribute :source
|
16
|
+
attribute :source_port
|
17
|
+
|
18
|
+
# Timestamps
|
19
|
+
attribute :created_at, type: :time
|
18
20
|
|
19
|
-
|
21
|
+
# Links
|
22
|
+
attribute :firewall_policy_id, aliases: "firewall_policy", squash: "id"
|
20
23
|
|
21
24
|
# Sticking with existing Fog behaviour, save does not update but creates a new resource
|
22
25
|
def save
|
@@ -3,19 +3,19 @@ module Fog
|
|
3
3
|
class Compute
|
4
4
|
class Flavor < Fog::Brightbox::Model
|
5
5
|
identity :id
|
6
|
-
attribute :url
|
7
6
|
attribute :resource_type
|
7
|
+
attribute :url
|
8
8
|
|
9
9
|
attribute :name
|
10
10
|
attribute :status
|
11
|
-
attribute :description
|
12
11
|
|
13
12
|
attribute :handle
|
14
13
|
|
15
14
|
attribute :bits
|
16
15
|
attribute :cores
|
17
|
-
attribute :disk, :
|
16
|
+
attribute :disk, aliases: "disk_size"
|
18
17
|
attribute :ram
|
18
|
+
attribute :storage_type
|
19
19
|
|
20
20
|
def bits
|
21
21
|
64 # This is actually based on the Image type used. 32bit or 64bit Images are supported
|