fog-brightbox 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/lib/fog/brightbox/compute.rb +7 -0
  4. data/lib/fog/brightbox/models/compute/account.rb +30 -18
  5. data/lib/fog/brightbox/models/compute/api_client.rb +10 -2
  6. data/lib/fog/brightbox/models/compute/application.rb +8 -0
  7. data/lib/fog/brightbox/models/compute/cloud_ip.rb +11 -11
  8. data/lib/fog/brightbox/models/compute/collaboration.rb +11 -0
  9. data/lib/fog/brightbox/models/compute/config_map.rb +14 -0
  10. data/lib/fog/brightbox/models/compute/config_maps.rb +22 -0
  11. data/lib/fog/brightbox/models/compute/database_server.rb +19 -15
  12. data/lib/fog/brightbox/models/compute/database_snapshot.rb +13 -6
  13. data/lib/fog/brightbox/models/compute/database_type.rb +6 -3
  14. data/lib/fog/brightbox/models/compute/event.rb +5 -4
  15. data/lib/fog/brightbox/models/compute/firewall_policy.rb +10 -4
  16. data/lib/fog/brightbox/models/compute/firewall_rule.rb +9 -6
  17. data/lib/fog/brightbox/models/compute/flavor.rb +3 -3
  18. data/lib/fog/brightbox/models/compute/image.rb +16 -14
  19. data/lib/fog/brightbox/models/compute/load_balancer.rb +12 -8
  20. data/lib/fog/brightbox/models/compute/server.rb +19 -17
  21. data/lib/fog/brightbox/models/compute/server_group.rb +13 -5
  22. data/lib/fog/brightbox/models/compute/user.rb +9 -4
  23. data/lib/fog/brightbox/models/compute/user_collaboration.rb +11 -0
  24. data/lib/fog/brightbox/models/compute/volume.rb +15 -14
  25. data/lib/fog/brightbox/models/compute/zone.rb +3 -4
  26. data/lib/fog/brightbox/requests/compute/create_config_map.rb +22 -0
  27. data/lib/fog/brightbox/requests/compute/delete_config_map.rb +20 -0
  28. data/lib/fog/brightbox/requests/compute/get_config_map.rb +18 -0
  29. data/lib/fog/brightbox/requests/compute/list_config_maps.rb +18 -0
  30. data/lib/fog/brightbox/requests/compute/update_config_map.rb +22 -0
  31. data/lib/fog/brightbox/version.rb +1 -1
  32. metadata +8 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ed1e1f608af748e905cfeafeb9f1a72674074f11720c854988e324de9e1fa84
4
- data.tar.gz: c078791baaf84d13fb09c1f0d8ff17b9c1116f247cfb8c73647b529b97ce3bea
3
+ metadata.gz: 930c37c33d46857b7fa6f4e9880bd11068f9b4cc3a90aad25d1db39904ae6601
4
+ data.tar.gz: e9bfaa815ea41d8a0fc5afc094b4e7626d8dfa3fb7b35ddb58f9fa0c60aaf945
5
5
  SHA512:
6
- metadata.gz: fbfd902483fc3bb101255c4915d8fec6e54c5edf2995f6aa1b0eebe510e210a0b6173b109aa19811fee8fabc1c5f05c294d36b49fbcc9b15056bedf22e1ebac2
7
- data.tar.gz: e3b208fa57e74eca736fa8d53683cbfa78645a6aa75a15b680f59365bbd26538cbb373828f92ba4d6de7a79a867e2377500179c9ef18171c35748dd3fa759e17
6
+ metadata.gz: e7d00dbc24b5d7b9c2e292bf7caa4797d93ed6d94d28622ea5beb9f29af6c29d6098d17ab495d3707f9e7a847694f9a331e5de5268000bddb1e4f884d80566c6
7
+ data.tar.gz: 4164e7796800011e460411dccc08efb780362b61afd2790b5af8e724151c86e50e315fba45f785ad8cf5fb44f9016e1aac36d7093436f07670332afff66c1aec
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
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
+
1
10
  ### 1.6.0 / 2022-07-25
2
11
 
3
12
  Changes:
@@ -37,6 +37,8 @@ module Fog
37
37
  model :api_client
38
38
  collection :collaborations
39
39
  model :collaboration
40
+ collection :config_maps
41
+ model :config_map
40
42
  collection :servers
41
43
  model :server
42
44
  collection :server_groups
@@ -85,6 +87,7 @@ module Fog
85
87
  request :create_application
86
88
  request :create_cloud_ip
87
89
  request :create_collaboration
90
+ request :create_config_map
88
91
  request :create_firewall_policy
89
92
  request :create_firewall_rule
90
93
  request :create_image
@@ -97,6 +100,7 @@ module Fog
97
100
  request :delete_application
98
101
  request :delete_cloud_ip
99
102
  request :delete_collaboration
103
+ request :delete_config_map
100
104
  request :delete_firewall_policy
101
105
  request :delete_firewall_rule
102
106
  request :delete_image
@@ -114,6 +118,7 @@ module Fog
114
118
  request :get_authenticated_user
115
119
  request :get_cloud_ip
116
120
  request :get_collaboration
121
+ request :get_config_map
117
122
  request :get_firewall_policy
118
123
  request :get_firewall_rule
119
124
  request :get_image
@@ -135,6 +140,7 @@ module Fog
135
140
  request :list_applications
136
141
  request :list_cloud_ips
137
142
  request :list_collaborations
143
+ request :list_config_maps
138
144
  request :list_events
139
145
  request :list_firewall_policies
140
146
  request :list_images
@@ -188,6 +194,7 @@ module Fog
188
194
  request :update_api_client
189
195
  request :update_application
190
196
  request :update_cloud_ip
197
+ request :update_config_map
191
198
  request :update_firewall_policy
192
199
  request :update_firewall_rule
193
200
  request :update_image
@@ -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
- attribute :servers_used
24
- attribute :ram_limit
25
- attribute :ram_used
26
- attribute :cloud_ips_limit
27
- attribute :cloud_ips_used
28
- attribute :load_balancers_limit
29
- attribute :load_balancers_used
30
- attribute :dbs_servers_used
31
- attribute :dbs_ram_limit
32
- attribute :dbs_ram_used
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
- # Times
43
- attribute :created_at, :type => :time
44
- attribute :verified_at, :type => :time
47
+ # Timestamps
48
+ attribute :created_at, type: :time
49
+ attribute :verified_at, type: :time
45
50
 
46
- # Links - to be replaced
47
- attribute :owner_id, :aliases => "owner", :squash => "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
- attribute :account_id
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 :reverse_dns
13
+ attribute :fqdn
14
+ attribute :mode
14
15
  attribute :public_ip
15
16
  attribute :public_ipv4
16
17
  attribute :public_ipv6
17
- attribute :fqdn
18
+ attribute :reverse_dns
18
19
 
19
- # Links - to be replaced
20
- attribute :account_id, :aliases => "account", :squash => "id"
21
- attribute :interface_id, :aliases => "interface", :squash => "id"
22
- attribute :server_id, :aliases => "server", :squash => "id"
23
- attribute :load_balancer, :alias => "load_balancer", :squash => "id"
24
- attribute :server_group, :alias => "server_group", :squash => "id"
25
- attribute :database_server, :alias => "database_server", :squash => "id"
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,14 @@
1
+ module Fog
2
+ module Brightbox
3
+ class Compute
4
+ class ConfigMap < Fog::Brightbox::Model
5
+ identity :id
6
+ attribute :resource_type
7
+ attribute :url
8
+
9
+ attribute :name
10
+ attribute :data
11
+ end
12
+ end
13
+ end
14
+ end
@@ -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, :aliases => "status"
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 :maintenance_weekday
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, :type => :string
26
- attribute :snapshots_schedule_next_at, :type => :time
27
+ attribute :snapshots_schedule, type: :string
28
+ attribute :snapshots_schedule_next_at, type: :time
27
29
 
28
- attribute :created_at, :type => :time
29
- attribute :updated_at, :type => :time
30
- attribute :deleted_at, :type => :time
30
+ # Timestamps
31
+ attribute :created_at, type: :time
32
+ attribute :updated_at, type: :time
33
+ attribute :deleted_at, type: :time
31
34
 
32
- attribute :allow_access
35
+ # Links
36
+ attribute :flavor_id, alias: "database_server_type", squash: "id"
37
+ attribute :zone_id, alias: "zone", squash: "id"
33
38
 
34
- attribute :flavor_id, "alias" => "database_server_type", :squash => "id"
35
- attribute :zone_id, "alias" => "zone", :squash => "id"
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, :aliases => "status"
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
- attribute :created_at, :type => :time
23
- attribute :updated_at, :type => :time
24
- attribute :deleted_at, :type => :time
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, :aliases => "disk_size"
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
- # Times
15
- attribute :created_at, :type => :time
14
+ # Timestamps
15
+ attribute :created_at, type: :time
16
16
 
17
- # Links - to be replaced
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
- attribute :default
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 :created_at, :type => :time
14
+ attribute :protocol
15
+ attribute :source
16
+ attribute :source_port
17
+
18
+ # Timestamps
19
+ attribute :created_at, type: :time
18
20
 
19
- attribute :firewall_policy_id, :aliases => "firewall_policy", :squash => "id"
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, :aliases => "disk_size"
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
@@ -5,32 +5,34 @@ 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
- attribute :username
13
12
  attribute :status
14
13
  attribute :description
15
14
 
16
- attribute :source
17
- attribute :source_type
18
15
  attribute :arch
19
- attribute :virtual_size
20
- attribute :disk_size
16
+ attribute :disk_size, type: :integer
21
17
  attribute :licence_name
18
+ attribute :min_ram, type: :integer
19
+ attribute :source
20
+ attribute :source_trigger
21
+ attribute :source_type
22
+ attribute :username
23
+ attribute :virtual_size, type: :integer
22
24
 
23
25
  # Boolean flags
24
- attribute :public
25
- attribute :official
26
- attribute :compatibility_mode
26
+ attribute :compatibility_mode, type: :boolean
27
+ attribute :official, type: :boolean
28
+ attribute :public, type: :boolean
27
29
 
28
- # Times
29
- attribute :created_at, :type => :time
30
+ # Timestamps
31
+ attribute :created_at, type: :time
30
32
 
31
- # Links - to be replaced
32
- attribute :ancestor_id, :aliases => "ancestor", :squash => "id"
33
- attribute :owner_id, :aliases => "owner", :squash => "id"
33
+ # Links
34
+ attribute :ancestor_id, aliases: "ancestor", squash: "id"
35
+ attribute :owner_id, aliases: "owner", squash: "id"
34
36
 
35
37
  def ready?
36
38
  status == "available"
@@ -5,13 +5,13 @@ 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 :status
13
13
 
14
- attribute :buffer_size
14
+ attribute :buffer_size, type: :integer
15
15
 
16
16
  attribute :policy
17
17
  attribute :nodes
@@ -34,14 +34,18 @@ module Fog
34
34
  # List of domains for ACME
35
35
  attribute :domains
36
36
 
37
- # Times
38
- attribute :created_at, :type => :time
39
- attribute :deleted_at, :type => :time
37
+ # Booleans
38
+ attribute :https_redirect, type: :boolean
39
+
40
+ # Timestamps
41
+ attribute :created_at, type: :time
42
+ attribute :deleted_at, type: :time
40
43
 
41
- # Links - to be replaced
44
+ # Links
42
45
  attribute :account
43
- attribute :server
44
- attribute :cloud_ip
46
+
47
+ attribute :nodes
48
+ attribute :cloud_ips
45
49
 
46
50
  def ready?
47
51
  status == "active"
@@ -14,35 +14,37 @@ module Fog
14
14
  attribute :url
15
15
 
16
16
  attribute :name
17
- attribute :state, :aliases => "status"
17
+ attribute :state, aliases: "status"
18
18
 
19
- attribute :hostname
20
- attribute :fqdn
21
- attribute :user_data
19
+ attribute :console_token
22
20
  attribute :console_url
23
21
  attribute :fqdn
24
- attribute :console_token
22
+ attribute :hostname
23
+ attribute :user_data
25
24
 
26
- attribute :disk_encrypted
25
+ # Boolean flags
26
+ attribute :compatibility_mode, type: :boolean
27
+ attribute :disk_encrypted, type: :boolean
27
28
 
28
- # Times
29
- attribute :created_at, :type => :time
30
- attribute :started_at, :type => :time
31
- attribute :console_token_expires, :type => :time
32
- attribute :deleted_at, :type => :time
29
+ # Timestamps
30
+ attribute :created_at, type: :time
31
+ attribute :started_at, type: :time
32
+ attribute :console_token_expires, type: :time
33
+ attribute :deleted_at, type: :time
33
34
 
34
- # Links - to be replaced
35
- attribute :account_id, :aliases => "account", :squash => "id"
36
- attribute :image_id, :aliases => "image", :squash => "id"
35
+ # Links
36
+ attribute :account_id, aliases: "account", squash: "id"
37
+ attribute :image_id, aliases: "image", squash: "id"
37
38
 
38
- attribute :snapshots
39
+ attribute :server_type
40
+ attribute :zone
39
41
  attribute :cloud_ip # Creation option only
42
+
40
43
  attribute :cloud_ips
41
44
  attribute :interfaces
42
45
  attribute :server_groups
46
+ attribute :snapshots
43
47
  attribute :volumes
44
- attribute :zone
45
- attribute :server_type
46
48
 
47
49
  def initialize(attributes = {})
48
50
  # Call super first to initialize the service object for our default image
@@ -6,15 +6,23 @@ module Fog
6
6
  # Certain actions can accept a server group and affect all members
7
7
  class ServerGroup < Fog::Brightbox::Model
8
8
  identity :id
9
-
10
- attribute :url
11
9
  attribute :resource_type
10
+ attribute :url
11
+
12
12
  attribute :name
13
13
  attribute :description
14
- attribute :default
15
- attribute :created_at, :type => :time
14
+ attribute :fqdn
15
+
16
+ # Booleans
17
+ attribute :default, type: :boolean
18
+
19
+ # Timestamps
20
+ attribute :created_at, type: :time
16
21
 
17
- attribute :server_ids, :aliases => "servers"
22
+ # Links
23
+ attribute :account_id, aliases: "account", squash: "id"
24
+ attribute :firewall_policy_id, aliases: "firewall_policy", squash: "id"
25
+ attribute :server_ids, aliases: "servers"
18
26
 
19
27
  def save
20
28
  options = {
@@ -11,13 +11,18 @@ module Fog
11
11
  attribute :ssh_key
12
12
 
13
13
  # Boolean flags
14
- attribute :email_verified
15
- attribute :messaging_pref
14
+ attribute :email_verified, type: :boolean
16
15
 
17
- # Links - to be replaced
18
- attribute :account_id, :aliases => "default_account", :squash => "id"
16
+ # Timestamps
17
+ attribute :created_at, type: :time
18
+
19
+ # Links
20
+ attribute :account_id, aliases: "default_account", squash: "id"
19
21
  attribute :accounts
20
22
 
23
+ # Deprecated
24
+ attribute :messaging_pref, type: :boolean
25
+
21
26
  def save
22
27
  requires :identity
23
28
 
@@ -3,10 +3,21 @@ module Fog
3
3
  class Compute
4
4
  class UserCollaboration < Fog::Brightbox::Model
5
5
  identity :id
6
+ # resource_type is buggy for this resource
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
@@ -5,34 +5,35 @@ 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
- attribute :state, :aliases => "status"
13
-
12
+ attribute :state, aliases: "status"
14
13
  attribute :description
14
+
15
15
  attribute :filesystem_label
16
16
  attribute :filesystem_type
17
17
  attribute :serial
18
- attribute :size
18
+ attribute :size, type: :integer
19
19
  attribute :source
20
20
  attribute :source_type
21
21
  attribute :storage_type
22
22
 
23
- attribute :boot
24
- attribute :delete_with_server
25
- attribute :encrypted
23
+ # Boolean flags
24
+ attribute :boot, type: :boolean
25
+ attribute :delete_with_server, type: :boolean
26
+ attribute :encrypted, type: :boolean
26
27
 
27
- # Times
28
- attribute :created_at, :type => :time
29
- attribute :updated_at, :type => :time
30
- attribute :deleted_at, :type => :time
28
+ # Timestamps
29
+ attribute :created_at, type: :time
30
+ attribute :updated_at, type: :time
31
+ attribute :deleted_at, type: :time
31
32
 
32
33
  # Links
33
- attribute :account_id, :aliases => "account", :squash => "id"
34
- attribute :image_id, :aliases => "image", :squash => "id"
35
- attribute :server_id, :aliases => "server", :squash => "id"
34
+ attribute :account_id, aliases: "account", squash: "id"
35
+ attribute :image_id, aliases: "image", squash: "id"
36
+ attribute :server_id, aliases: "server", squash: "id"
36
37
 
37
38
  def attach(server)
38
39
  requires :identity
@@ -3,13 +3,12 @@ module Fog
3
3
  class Compute
4
4
  class Zone < Fog::Brightbox::Model
5
5
  identity :id
6
- attribute :url
7
6
  attribute :resource_type
8
-
9
- attribute :status
10
- attribute :handle
7
+ attribute :url
11
8
 
12
9
  attribute :description
10
+ attribute :handle
11
+ attribute :status
13
12
  end
14
13
  end
15
14
  end
@@ -0,0 +1,22 @@
1
+ module Fog
2
+ module Brightbox
3
+ class Compute
4
+ class Real
5
+ # Create a new config map
6
+ #
7
+ # @param [Hash] options
8
+ # @option options [String] :name to identify this config map
9
+ # @option options [Hash] :data key/values to expose in config map
10
+ # @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
11
+ #
12
+ # @return [Hash] if successful Hash version of JSON object
13
+ # @return [NilClass] if no options were passed
14
+ #
15
+ def create_config_map(options)
16
+ return nil if options.empty? || options.nil?
17
+ wrapped_request("post", "/1.0/config_maps", [200], options)
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,20 @@
1
+ module Fog
2
+ module Brightbox
3
+ class Compute
4
+ class Real
5
+ # Destroy the config map
6
+ #
7
+ # @param [String] identifier Unique reference to identify the resource
8
+ # @param [Hash] options
9
+ # @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
10
+ #
11
+ # @return [Hash] if successful Hash version of JSON object
12
+ #
13
+ def delete_config_map(identifier, options = {})
14
+ return nil if identifier.nil? || identifier == ""
15
+ wrapped_request("delete", "/1.0/config_maps/#{identifier}", [200], options)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,18 @@
1
+ module Fog
2
+ module Brightbox
3
+ class Compute
4
+ class Real
5
+ # @param [String] identifier Unique reference to identify the resource
6
+ # @param [Hash] options
7
+ # @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
8
+ #
9
+ # @return [Hash] if successful Hash version of JSON object
10
+ #
11
+ def get_config_map(identifier, options = {})
12
+ return nil if identifier.nil? || identifier == ""
13
+ wrapped_request("get", "/1.0/config_maps/#{identifier}", [200], options)
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ module Fog
2
+ module Brightbox
3
+ class Compute
4
+ class Real
5
+ # Lists summary details of config maps owned by the account.
6
+ #
7
+ # @param [Hash] options
8
+ # @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
9
+ #
10
+ # @return [Hash] if successful Hash version of JSON object
11
+ #
12
+ def list_config_maps(options = {})
13
+ wrapped_request("get", "/1.0/config_maps", [200], options)
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,22 @@
1
+ module Fog
2
+ module Brightbox
3
+ class Compute
4
+ class Real
5
+ # @param [String] identifier Unique reference to identify the resource
6
+ # @param [Hash] options
7
+ # @option options [String] :name to identifier this config map
8
+ # @option options [Hash] :data key/values to expose in config map
9
+ # @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
10
+ #
11
+ # @return [Hash] if successful Hash version of JSON object
12
+ # @return [NilClass] if no options were passed
13
+ #
14
+ def update_config_map(identifier, options)
15
+ return nil if identifier.nil? || identifier == ""
16
+ return nil if options.empty? || options.nil?
17
+ wrapped_request("put", "/1.0/config_maps/#{identifier}", [200], options)
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Brightbox
3
- VERSION = "1.6.0"
3
+ VERSION = "1.7.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-brightbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Thornthwaite
@@ -193,6 +193,8 @@ files:
193
193
  - lib/fog/brightbox/models/compute/cloud_ips.rb
194
194
  - lib/fog/brightbox/models/compute/collaboration.rb
195
195
  - lib/fog/brightbox/models/compute/collaborations.rb
196
+ - lib/fog/brightbox/models/compute/config_map.rb
197
+ - lib/fog/brightbox/models/compute/config_maps.rb
196
198
  - lib/fog/brightbox/models/compute/database_server.rb
197
199
  - lib/fog/brightbox/models/compute/database_servers.rb
198
200
  - lib/fog/brightbox/models/compute/database_snapshot.rb
@@ -240,6 +242,7 @@ files:
240
242
  - lib/fog/brightbox/requests/compute/create_application.rb
241
243
  - lib/fog/brightbox/requests/compute/create_cloud_ip.rb
242
244
  - lib/fog/brightbox/requests/compute/create_collaboration.rb
245
+ - lib/fog/brightbox/requests/compute/create_config_map.rb
243
246
  - lib/fog/brightbox/requests/compute/create_database_server.rb
244
247
  - lib/fog/brightbox/requests/compute/create_firewall_policy.rb
245
248
  - lib/fog/brightbox/requests/compute/create_firewall_rule.rb
@@ -252,6 +255,7 @@ files:
252
255
  - lib/fog/brightbox/requests/compute/delete_application.rb
253
256
  - lib/fog/brightbox/requests/compute/delete_cloud_ip.rb
254
257
  - lib/fog/brightbox/requests/compute/delete_collaboration.rb
258
+ - lib/fog/brightbox/requests/compute/delete_config_map.rb
255
259
  - lib/fog/brightbox/requests/compute/delete_database_server.rb
256
260
  - lib/fog/brightbox/requests/compute/delete_database_snapshot.rb
257
261
  - lib/fog/brightbox/requests/compute/delete_firewall_policy.rb
@@ -269,6 +273,7 @@ files:
269
273
  - lib/fog/brightbox/requests/compute/get_authenticated_user.rb
270
274
  - lib/fog/brightbox/requests/compute/get_cloud_ip.rb
271
275
  - lib/fog/brightbox/requests/compute/get_collaboration.rb
276
+ - lib/fog/brightbox/requests/compute/get_config_map.rb
272
277
  - lib/fog/brightbox/requests/compute/get_database_server.rb
273
278
  - lib/fog/brightbox/requests/compute/get_database_snapshot.rb
274
279
  - lib/fog/brightbox/requests/compute/get_database_type.rb
@@ -290,6 +295,7 @@ files:
290
295
  - lib/fog/brightbox/requests/compute/list_applications.rb
291
296
  - lib/fog/brightbox/requests/compute/list_cloud_ips.rb
292
297
  - lib/fog/brightbox/requests/compute/list_collaborations.rb
298
+ - lib/fog/brightbox/requests/compute/list_config_maps.rb
293
299
  - lib/fog/brightbox/requests/compute/list_database_servers.rb
294
300
  - lib/fog/brightbox/requests/compute/list_database_snapshots.rb
295
301
  - lib/fog/brightbox/requests/compute/list_database_types.rb
@@ -342,6 +348,7 @@ files:
342
348
  - lib/fog/brightbox/requests/compute/update_api_client.rb
343
349
  - lib/fog/brightbox/requests/compute/update_application.rb
344
350
  - lib/fog/brightbox/requests/compute/update_cloud_ip.rb
351
+ - lib/fog/brightbox/requests/compute/update_config_map.rb
345
352
  - lib/fog/brightbox/requests/compute/update_database_server.rb
346
353
  - lib/fog/brightbox/requests/compute/update_database_snapshot.rb
347
354
  - lib/fog/brightbox/requests/compute/update_firewall_policy.rb