fog-brightbox 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +1 -0
  4. data/CHANGELOG.md +18 -0
  5. data/fog-brightbox.gemspec +1 -0
  6. data/lib/fog/brightbox/compute/shared.rb +1 -1
  7. data/lib/fog/brightbox/oauth2.rb +16 -13
  8. data/lib/fog/brightbox/version.rb +1 -1
  9. data/spec/fog/brightbox/oauth2/client_credentials_strategy_spec.rb +30 -0
  10. data/spec/fog/brightbox/oauth2/credential_set_spec.rb +86 -0
  11. data/spec/fog/brightbox/oauth2/grant_type_strategy_spec.rb +24 -0
  12. data/spec/fog/brightbox/oauth2/refresh_token_strategy_spec.rb +33 -0
  13. data/spec/fog/brightbox/oauth2/user_credentials_strategy_spec.rb +40 -0
  14. data/spec/fog/compute/brightbox/database_server_spec.rb +3 -3
  15. data/spec/fog/compute/brightbox/server_spec.rb +3 -3
  16. data/tests/brightbox/compute/helper.rb +1 -0
  17. data/tests/brightbox/compute/schema.rb +794 -0
  18. data/tests/brightbox/compute_tests.rb +98 -0
  19. data/tests/brightbox/helper.rb +1 -0
  20. data/tests/brightbox/models/compute/account_tests.rb +15 -0
  21. data/tests/brightbox/models/compute/cloud_ip_tests.rb +32 -0
  22. data/tests/brightbox/models/compute/database_server_tests.rb +78 -0
  23. data/tests/brightbox/models/compute/database_snapshot_tests.rb +26 -0
  24. data/tests/brightbox/models/compute/database_type_tests.rb +27 -0
  25. data/tests/brightbox/models/compute/server_tests.rb +19 -0
  26. data/tests/brightbox/requests/compute/account_tests.rb +59 -0
  27. data/tests/brightbox/requests/compute/api_client_tests.rb +59 -0
  28. data/tests/brightbox/requests/compute/application_test.rb +58 -0
  29. data/tests/brightbox/requests/compute/cloud_ip_tests.rb +79 -0
  30. data/tests/brightbox/requests/compute/collaboration_tests.rb +36 -0
  31. data/tests/brightbox/requests/compute/database_server_tests.rb +53 -0
  32. data/tests/brightbox/requests/compute/database_snapsnot_tests.rb +46 -0
  33. data/tests/brightbox/requests/compute/database_type_tests.rb +16 -0
  34. data/tests/brightbox/requests/compute/firewall_policy_tests.rb +39 -0
  35. data/tests/brightbox/requests/compute/firewall_rule_tests.rb +42 -0
  36. data/tests/brightbox/requests/compute/helper.rb +42 -0
  37. data/tests/brightbox/requests/compute/image_tests.rb +54 -0
  38. data/tests/brightbox/requests/compute/interface_tests.rb +30 -0
  39. data/tests/brightbox/requests/compute/load_balancer_tests.rb +116 -0
  40. data/tests/brightbox/requests/compute/server_group_tests.rb +91 -0
  41. data/tests/brightbox/requests/compute/server_tests.rb +93 -0
  42. data/tests/brightbox/requests/compute/server_type_tests.rb +28 -0
  43. data/tests/brightbox/requests/compute/user_collaboration_tests.rb +65 -0
  44. data/tests/brightbox/requests/compute/user_tests.rb +32 -0
  45. data/tests/brightbox/requests/compute/zone_tests.rb +28 -0
  46. data/tests/helper.rb +8 -0
  47. data/tests/helpers/collection_helper.rb +91 -0
  48. data/tests/helpers/compute/flavors_helper.rb +28 -0
  49. data/tests/helpers/compute/server_helper.rb +23 -0
  50. data/tests/helpers/compute/servers_helper.rb +8 -0
  51. data/tests/helpers/formats_helper.rb +98 -0
  52. data/tests/helpers/formats_helper_tests.rb +106 -0
  53. data/tests/helpers/mock_helper.rb +98 -0
  54. data/tests/helpers/model_helper.rb +29 -0
  55. data/tests/helpers/responds_to_helper.rb +11 -0
  56. data/tests/helpers/schema_validator_tests.rb +101 -0
  57. data/tests/helpers/succeeds_helper.rb +9 -0
  58. metadata +68 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc26a1e84e598ef68b0b5fbcabd7b03057c2cd50
4
- data.tar.gz: 48e03f4c51600c6d7c367f6291bce1846a9fb5ac
3
+ metadata.gz: 6c9a95faeba8a3a048c0c78b7a827a5c38352376
4
+ data.tar.gz: 1ad831ca22581854bb6dd7de9d7bac093d55693c
5
5
  SHA512:
6
- metadata.gz: 34a67830a5a9b119e26755269691e10a55f0374c92c29a995faee18ef5662d2169a77142ef87c0b37dec5de2dbebd23146c93401449f63ff107f45666739431b
7
- data.tar.gz: 6d89c9acdcb2c431b661179bf5aa383116cfbc6e60ba9644afc1cba55b8e98c3592a2f8b7e27ee9b0ad1fa39a6010f66009e028ce1859b2ec1462b2ad4104934
6
+ metadata.gz: 8964770e126300956aa66cc50211bc04fe4cf102f979526cef423034cc613991ba5478844ce612a7ae355d82d1fc5a630d7143f81bcddae400a689c981d3077f
7
+ data.tar.gz: cb04b1cc0e8ded94525bcf3f65b9b4911da51ee48853d0b7ca942034fb412fb9d7cfb056d67effc27878f75ea0a08648e3c1f2bbb2efafb4f7a4cd251bd84e99
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ coverage
1
2
  Gemfile.lock
2
3
  gemfiles/*.lock
3
4
  pkg
data/.travis.yml CHANGED
@@ -1,3 +1,4 @@
1
+ sudo: false
1
2
  language: ruby
2
3
  rvm:
3
4
  - 2.2.0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ### 0.9.0 / 2015-08-18
2
+
3
+ Changes:
4
+
5
+ * Updated the OAuth model to better reflect the final OAuth 2.0 spec. This is
6
+ not a breaking change since the server side component remain backwards
7
+ compatible so usage of the `fog` API should not have changed.
8
+ * Updated `travis.yml` to use faster container architecture.
9
+ * Moved `shindo` tests into repo from main `fog` gem. These act as acceptance
10
+ tests against real environments.
11
+ * Moved OAuth module specs from Shindo to Minispec.
12
+
13
+ Bug fixes:
14
+
15
+ * Use `Authorization: Bearer` scheme rather than draft value of "Token"
16
+ * Use `client_credentials` grant type rather than draft value of "none"
17
+ * Remove duplicate scheme keys causing warnings in Shindo tests
18
+
1
19
  ### 0.8.0 / 2015-07-16
2
20
 
3
21
  Changes:
@@ -27,6 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency "minitest"
28
28
  spec.add_development_dependency "pry"
29
29
  spec.add_development_dependency "rake"
30
+ spec.add_development_dependency "shindo"
30
31
  spec.add_development_dependency "webmock"
31
32
  spec.add_development_dependency "yard"
32
33
  end
@@ -197,7 +197,7 @@ module Fog
197
197
  # @return [Excon::Response]
198
198
  def authenticated_request(options)
199
199
  headers = options[:headers] || {}
200
- headers.merge!("Authorization" => "OAuth #{@credentials.access_token}", "Content-Type" => "application/json")
200
+ headers.merge!("Authorization" => "Bearer #{@credentials.access_token}", "Content-Type" => "application/json")
201
201
  options[:headers] = headers
202
202
  # TODO: This is just a wrapper around a call to Excon::Connection#request
203
203
  # so can be extracted from Compute by passing in the connection,
@@ -16,16 +16,10 @@ module Fog
16
16
  def request_access_token(connection, credentials)
17
17
  token_strategy = credentials.best_grant_strategy
18
18
 
19
- header_content = "#{credentials.client_id}:#{credentials.client_secret}"
20
- encoded_credentials = Base64.encode64(header_content).chomp
21
-
22
19
  connection.request(
23
20
  :path => "/token",
24
21
  :expects => 200,
25
- :headers => {
26
- "Authorization" => "Basic #{encoded_credentials}",
27
- "Content-Type" => "application/json"
28
- },
22
+ :headers => token_strategy.headers,
29
23
  :method => "POST",
30
24
  :body => Fog::JSON.encode(token_strategy.authorization_body_data)
31
25
  )
@@ -110,17 +104,28 @@ module Fog
110
104
  def authorization_body_data
111
105
  raise "Not implemented"
112
106
  end
107
+
108
+ def authorization_header
109
+ header_content = "#{@credentials.client_id}:#{@credentials.client_secret}"
110
+ "Basic #{Base64.encode64(header_content).chomp}"
111
+ end
112
+
113
+ def headers
114
+ {
115
+ "Authorization" => authorization_header,
116
+ "Content-Type" => "application/json"
117
+ }
118
+ end
113
119
  end
114
120
 
115
121
  # This implements client based authentication/authorization
116
- # based on the existing trust relationship using the `none`
117
- # grant type.
122
+ # based on the existing trust relationship using the
123
+ # `client_credentials` grant type.
118
124
  #
119
125
  class ClientCredentialsStrategy < GrantTypeStrategy
120
126
  def authorization_body_data
121
127
  {
122
- "grant_type" => "none",
123
- "client_id" => @credentials.client_id
128
+ "grant_type" => "client_credentials",
124
129
  }
125
130
  end
126
131
  end
@@ -133,7 +138,6 @@ module Fog
133
138
  def authorization_body_data
134
139
  {
135
140
  "grant_type" => "password",
136
- "client_id" => @credentials.client_id,
137
141
  "username" => @credentials.username,
138
142
  "password" => @credentials.password
139
143
  }
@@ -147,7 +151,6 @@ module Fog
147
151
  def authorization_body_data
148
152
  {
149
153
  "grant_type" => "refresh_token",
150
- "client_id" => @credentials.client_id,
151
154
  "refresh_token" => @credentials.refresh_token
152
155
  }
153
156
  end
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Brightbox
3
- VERSION = "0.8.0"
3
+ VERSION = "0.9.0"
4
4
  end
5
5
  end
@@ -0,0 +1,30 @@
1
+ require "spec_helper"
2
+
3
+ describe Fog::Brightbox::OAuth2::ClientCredentialsStrategy do
4
+ before do
5
+ @client_id = "app-12345"
6
+ @client_secret = "__mashed_keys_123__"
7
+ @credentials = Fog::Brightbox::OAuth2::CredentialSet.new(@client_id, @client_secret)
8
+ @strategy = Fog::Brightbox::OAuth2::ClientCredentialsStrategy.new(@credentials)
9
+ end
10
+
11
+ it "tests #respond_to?(:authorization_body_data) returns true" do
12
+ assert @strategy.respond_to?(:authorization_body_data)
13
+ end
14
+
15
+ it "tests #respond_to?(:headers) returns true" do
16
+ assert @strategy.respond_to?(:headers)
17
+ end
18
+
19
+ it "tests #authorization_body_data" do
20
+ authorization_body_data = @strategy.authorization_body_data
21
+ assert_equal "client_credentials", authorization_body_data["grant_type"]
22
+ refute_includes authorization_body_data, "client_id"
23
+ end
24
+
25
+ it "tests #headers" do
26
+ headers = @strategy.headers
27
+ assert_equal "Basic YXBwLTEyMzQ1Ol9fbWFzaGVkX2tleXNfMTIzX18=", headers["Authorization"]
28
+ assert_equal "application/json", headers["Content-Type"]
29
+ end
30
+ end
@@ -0,0 +1,86 @@
1
+ require "spec_helper"
2
+
3
+ describe Fog::Brightbox::OAuth2::CredentialSet do
4
+ before do
5
+ @client_id = "app-12345"
6
+ @client_secret = "__mashed_keys_123__"
7
+ @username = "usr-12345"
8
+ @password = "__mushed_keys_321__"
9
+ @access_token = "12efde32fdfe4989"
10
+ @refresh_token = "7894389f9074f071"
11
+ @expires_in = 7200
12
+ end
13
+
14
+ describe "when using client credentials" do
15
+ before do
16
+ @credentials = Fog::Brightbox::OAuth2::CredentialSet.new(@client_id, @client_secret)
17
+ end
18
+
19
+ it "tests #user_details? returns false" do
20
+ refute @credentials.user_details?
21
+ end
22
+
23
+ it "tests #access_token? returns false" do
24
+ refute @credentials.access_token?
25
+ end
26
+
27
+ it "tests #refresh_token? returns false" do
28
+ refute @credentials.refresh_token?
29
+ end
30
+
31
+ it "tests #best_grant_strategy returns ClientCredentialStategy" do
32
+ assert @credentials.best_grant_strategy.is_a?(Fog::Brightbox::OAuth2::ClientCredentialsStrategy)
33
+ end
34
+ end
35
+
36
+ describe "when using user credentials" do
37
+ before do
38
+ options = { :username => @username, :password => @password }
39
+ @credentials = Fog::Brightbox::OAuth2::CredentialSet.new(@client_id, @client_secret, options)
40
+ end
41
+
42
+ it "tests #user_details? returns true" do
43
+ assert @credentials.user_details?
44
+ end
45
+
46
+ it "tests #access_token? returns false" do
47
+ refute @credentials.access_token?
48
+ end
49
+
50
+ it "tests #refresh_token? returns false" do
51
+ refute @credentials.refresh_token?
52
+ end
53
+
54
+ it "tests #best_grant_strategy returns ClientCredentialStategy" do
55
+ assert @credentials.best_grant_strategy.is_a?(Fog::Brightbox::OAuth2::UserCredentialsStrategy)
56
+ end
57
+ end
58
+
59
+ describe "when using refresh token" do
60
+ before do
61
+ options = {
62
+ :username => @username,
63
+ :access_token => @access_token,
64
+ :refresh_token => @refresh_token,
65
+ :expires_in => @expires_in
66
+ }
67
+ @credentials = Fog::Brightbox::OAuth2::CredentialSet.new(@client_id, @client_secret, options)
68
+ end
69
+
70
+ it "tests #user_details? returns false" do
71
+ refute @credentials.user_details?
72
+ end
73
+
74
+ it "tests #access_token? returns true" do
75
+ assert @credentials.access_token?
76
+ end
77
+
78
+ it "tests #refresh_token? returns true" do
79
+ assert @credentials.refresh_token?
80
+ end
81
+
82
+ it "tests #best_grant_strategy returns ClientCredentialStategy" do
83
+ assert @credentials.best_grant_strategy.is_a?(Fog::Brightbox::OAuth2::RefreshTokenStrategy)
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,24 @@
1
+ require "spec_helper"
2
+
3
+ describe Fog::Brightbox::OAuth2::RefreshTokenStrategy do
4
+ before do
5
+ @client_id = "app-12345"
6
+ @client_secret = "__mashed_keys_123__"
7
+ @credentials = Fog::Brightbox::OAuth2::CredentialSet.new(@client_id, @client_secret)
8
+ @strategy = Fog::Brightbox::OAuth2::GrantTypeStrategy.new(@credentials)
9
+ end
10
+
11
+ it "tests #respond_to?(:authorization_body_data) returns true" do
12
+ assert @strategy.respond_to?(:authorization_body_data)
13
+ end
14
+
15
+ it "tests #respond_to?(:headers) returns true" do
16
+ assert @strategy.respond_to?(:headers)
17
+ end
18
+
19
+ it "tests #headers" do
20
+ headers = @strategy.headers
21
+ assert_equal "Basic YXBwLTEyMzQ1Ol9fbWFzaGVkX2tleXNfMTIzX18=", headers["Authorization"]
22
+ assert_equal "application/json", headers["Content-Type"]
23
+ end
24
+ end
@@ -0,0 +1,33 @@
1
+ require "spec_helper"
2
+
3
+ describe Fog::Brightbox::OAuth2::RefreshTokenStrategy do
4
+ before do
5
+ @client_id = "app-12345"
6
+ @client_secret = "__mashed_keys_123__"
7
+ @refresh_token = "ab4b39dddf909"
8
+ options = { :refresh_token => @refresh_token }
9
+ @credentials = Fog::Brightbox::OAuth2::CredentialSet.new(@client_id, @client_secret, options)
10
+ @strategy = Fog::Brightbox::OAuth2::RefreshTokenStrategy.new(@credentials)
11
+ end
12
+
13
+ it "tests #respond_to?(:authorization_body_data) returns true" do
14
+ assert @strategy.respond_to?(:authorization_body_data)
15
+ end
16
+
17
+ it "tests #respond_to?(:headers) returns true" do
18
+ assert @strategy.respond_to?(:headers)
19
+ end
20
+
21
+ it "tests #authorization_body_data" do
22
+ authorization_body_data = @strategy.authorization_body_data
23
+ assert_equal "refresh_token", authorization_body_data["grant_type"]
24
+ assert_equal @refresh_token, authorization_body_data["refresh_token"]
25
+ refute_includes authorization_body_data, "client_id"
26
+ end
27
+
28
+ it "tests #headers" do
29
+ headers = @strategy.headers
30
+ assert_equal "Basic YXBwLTEyMzQ1Ol9fbWFzaGVkX2tleXNfMTIzX18=", headers["Authorization"]
31
+ assert_equal "application/json", headers["Content-Type"]
32
+ end
33
+ end
@@ -0,0 +1,40 @@
1
+ require "spec_helper"
2
+
3
+ describe Fog::Brightbox::OAuth2::UserCredentialsStrategy do
4
+ before do
5
+ @client_id = "app-12345"
6
+ @client_secret = "__mashed_keys_123__"
7
+ @username = "usr-12345"
8
+ @password = "__mushed_keys_321__"
9
+
10
+ options = {
11
+ :username => @username,
12
+ :password => @password
13
+ }
14
+
15
+ @credentials = Fog::Brightbox::OAuth2::CredentialSet.new(@client_id, @client_secret, options)
16
+ @strategy = Fog::Brightbox::OAuth2::UserCredentialsStrategy.new(@credentials)
17
+ end
18
+
19
+ it "tests #respond_to?(:authorization_body_data) returns true" do
20
+ assert @strategy.respond_to?(:authorization_body_data)
21
+ end
22
+
23
+ it "tests #respond_to?(:headers) returns true" do
24
+ assert @strategy.respond_to?(:headers)
25
+ end
26
+
27
+ it "tests #authorization_body_data" do
28
+ authorization_body_data = @strategy.authorization_body_data
29
+ assert_equal "password", authorization_body_data["grant_type"]
30
+ assert_equal @username, authorization_body_data["username"]
31
+ assert_equal @password, authorization_body_data["password"]
32
+ refute_includes authorization_body_data, "client_id"
33
+ end
34
+
35
+ it "tests #headers" do
36
+ headers = @strategy.headers
37
+ assert_equal "Basic YXBwLTEyMzQ1Ol9fbWFzaGVkX2tleXNfMTIzX18=", headers["Authorization"]
38
+ assert_equal "application/json", headers["Content-Type"]
39
+ end
40
+ end
@@ -24,7 +24,7 @@ describe Fog::Compute::Brightbox::DatabaseServer do
24
24
  skip if RUBY_VERSION < "1.9"
25
25
 
26
26
  stub_request(:post, "http://localhost/1.0/database_servers/dbs-12345/snapshot?account_id=").
27
- with(:headers => { "Authorization" => "OAuth FAKECACHEDTOKEN" }).
27
+ with(:headers => { "Authorization" => "Bearer FAKECACHEDTOKEN" }).
28
28
  to_return(:status => 202, :body => %q({"id": "dbs-12345"}), :headers => {})
29
29
 
30
30
  @database_server = Fog::Compute::Brightbox::DatabaseServer.new(:service => service, :id => "dbs-12345")
@@ -39,11 +39,11 @@ describe Fog::Compute::Brightbox::DatabaseServer do
39
39
  link = "<https://api.gb1.brightbox.com/1.0/database_snapshots/dbi-12345>; rel=snapshot"
40
40
 
41
41
  stub_request(:post, "http://localhost/1.0/database_servers/dbs-12345/snapshot").
42
- with(:headers => { "Authorization" => "OAuth FAKECACHEDTOKEN" }).
42
+ with(:headers => { "Authorization" => "Bearer FAKECACHEDTOKEN" }).
43
43
  to_return(:status => 202, :body => "{}", :headers => { "Link" => link })
44
44
 
45
45
  stub_request(:get, "http://localhost/1.0/database_snapshots/dbi-12345?account_id=").
46
- with(:headers => { "Authorization" => "OAuth FAKECACHEDTOKEN" }).
46
+ with(:headers => { "Authorization" => "Bearer FAKECACHEDTOKEN" }).
47
47
  to_return(:status => 200, :body => %q({"id": "dbs-12345"}))
48
48
  @database_server = Fog::Compute::Brightbox::DatabaseServer.new(:service => service, :id => "dbs-12345")
49
49
  assert_kind_of Fog::Compute::Brightbox::DatabaseSnapshot, @database_server.snapshot(true)
@@ -24,7 +24,7 @@ describe Fog::Compute::Brightbox::Server do
24
24
  skip if RUBY_VERSION < "1.9"
25
25
 
26
26
  stub_request(:post, "http://localhost/1.0/servers/srv-12345/snapshot?account_id=").
27
- with(:headers => { "Authorization" => "OAuth FAKECACHEDTOKEN" }).
27
+ with(:headers => { "Authorization" => "Bearer FAKECACHEDTOKEN" }).
28
28
  to_return(:status => 202, :body => %q({"id": "srv-12345"}), :headers => {})
29
29
 
30
30
  @server = Fog::Compute::Brightbox::Server.new(:service => service, :id => "srv-12345")
@@ -39,11 +39,11 @@ describe Fog::Compute::Brightbox::Server do
39
39
  link = "<https://api.gb1.brightbox.com/1.0/images/img-12345>; rel=snapshot"
40
40
 
41
41
  stub_request(:post, "http://localhost/1.0/servers/srv-12345/snapshot").
42
- with(:headers => { "Authorization" => "OAuth FAKECACHEDTOKEN" }).
42
+ with(:headers => { "Authorization" => "Bearer FAKECACHEDTOKEN" }).
43
43
  to_return(:status => 202, :body => "{}", :headers => { "Link" => link })
44
44
 
45
45
  stub_request(:get, "http://localhost/1.0/images/img-12345?account_id=").
46
- with(:headers => { "Authorization" => "OAuth FAKECACHEDTOKEN" }).
46
+ with(:headers => { "Authorization" => "Bearer FAKECACHEDTOKEN" }).
47
47
  to_return(:status => 200, :body => %q({"id": "img-12345"}))
48
48
  @server = Fog::Compute::Brightbox::Server.new(:service => service, :id => "srv-12345")
49
49
  assert_kind_of Fog::Compute::Brightbox::Image, @server.snapshot(true)
@@ -0,0 +1 @@
1
+ require File.expand_path("schema", File.dirname(__FILE__))
@@ -0,0 +1,794 @@
1
+ module Fog
2
+ module Brightbox
3
+ module Nullable
4
+ module Account; end
5
+ module ApiClient; end
6
+ module FirewallPolicy; end
7
+ module Image; end
8
+ module Interface; end
9
+ module LoadBalancer; end
10
+ module Server; end
11
+ module ServerGroup; end
12
+ module User; end
13
+ module Zone; end
14
+ end
15
+ end
16
+ end
17
+
18
+ Hash.send :include, Fog::Brightbox::Nullable::Account
19
+ NilClass.send :include, Fog::Brightbox::Nullable::Account
20
+
21
+ Hash.send :include, Fog::Brightbox::Nullable::ApiClient
22
+ NilClass.send :include, Fog::Brightbox::Nullable::ApiClient
23
+
24
+ Hash.send :include, Fog::Brightbox::Nullable::FirewallPolicy
25
+ NilClass.send :include, Fog::Brightbox::Nullable::FirewallPolicy
26
+
27
+ Hash.send :include, Fog::Brightbox::Nullable::Image
28
+ NilClass.send :include, Fog::Brightbox::Nullable::Image
29
+
30
+ Hash.send :include, Fog::Brightbox::Nullable::Interface
31
+ NilClass.send :include, Fog::Brightbox::Nullable::Interface
32
+
33
+ Hash.send :include, Fog::Brightbox::Nullable::LoadBalancer
34
+ NilClass.send :include, Fog::Brightbox::Nullable::LoadBalancer
35
+
36
+ Hash.send :include, Fog::Brightbox::Nullable::Server
37
+ NilClass.send :include, Fog::Brightbox::Nullable::Server
38
+
39
+ Hash.send :include, Fog::Brightbox::Nullable::ServerGroup
40
+ NilClass.send :include, Fog::Brightbox::Nullable::ServerGroup
41
+
42
+ Hash.send :include, Fog::Brightbox::Nullable::User
43
+ NilClass.send :include, Fog::Brightbox::Nullable::User
44
+
45
+ Hash.send :include, Fog::Brightbox::Nullable::Zone
46
+ NilClass.send :include, Fog::Brightbox::Nullable::Zone
47
+
48
+ class Brightbox
49
+ module Compute
50
+ module Formats
51
+ module Struct
52
+ CIP_PORT_TRANSLATOR = {
53
+ "protocol" => String,
54
+ "incoming" => Integer,
55
+ "outgoing" => Integer
56
+ }
57
+ LB_LISTENER = {
58
+ "in" => Integer,
59
+ "out" => Integer,
60
+ "protocol" => String,
61
+ "timeout" => Integer
62
+ }
63
+ LB_HEALTHCHECK = {
64
+ "type" => String,
65
+ "request" => String,
66
+ "port" => Integer,
67
+ "interval" => Integer,
68
+ "timeout" => Integer,
69
+ "threshold_up" => Integer,
70
+ "threshold_down" => Integer
71
+ }
72
+ end
73
+
74
+ module Nested
75
+ ACCOUNT = {
76
+ "name" => String,
77
+ "resource_type" => String,
78
+ "url" => String,
79
+ "id" => String,
80
+ "status" => String
81
+ }
82
+
83
+ API_CLIENT = {
84
+ "id" => String,
85
+ "resource_type" => String,
86
+ "url" => String,
87
+ "name" => String,
88
+ "description" => String,
89
+ "revoked_at" => Fog::Nullable::String
90
+ }
91
+
92
+ CLOUD_IP = {
93
+ "id" => String,
94
+ "resource_type" => String,
95
+ "url" => String,
96
+ "name" => Fog::Nullable::String,
97
+ "public_ip" => String,
98
+ "status" => String,
99
+ "reverse_dns" => String
100
+ }
101
+
102
+ DATABASE_SERVER = {
103
+ "id" => String,
104
+ "resource_type" => String,
105
+ "url" => String,
106
+ "name" => String,
107
+ "description" => String,
108
+ "allow_access" => Array,
109
+ "database_version" => String,
110
+ "status" => String,
111
+ "created_at" => String,
112
+ "deleted_at" => Fog::Nullable::String
113
+ }
114
+
115
+ DATABASE_SNAPSHOT = {
116
+ "id" => String,
117
+ "resource_type" => String,
118
+ "url" => String,
119
+ "name" => String,
120
+ "description" => String,
121
+ "database_version" => String,
122
+ "size" => Integer,
123
+ "status" => String,
124
+ "created_at" => String,
125
+ "deleted_at" => Fog::Nullable::String,
126
+ "account" => Brightbox::Compute::Formats::Nested::ACCOUNT
127
+ }
128
+
129
+ DATABASE_SERVER_TYPE = {
130
+ "id" => String,
131
+ "resource_type" => String,
132
+ "url" => String,
133
+ "name" => String,
134
+ "description" => String,
135
+ "ram" => Integer,
136
+ "disk_size" => Integer
137
+ }
138
+
139
+ FIREWALL_POLICY = {
140
+ "id" => String,
141
+ "resource_type" => String,
142
+ "url" => String,
143
+ "name" => Fog::Nullable::String,
144
+ "default" => Fog::Boolean,
145
+ "created_at" => String,
146
+ "description" => Fog::Nullable::String
147
+ }
148
+
149
+ FIREWALL_RULE = {
150
+ "id" => String,
151
+ "resource_type" => String,
152
+ "url" => String,
153
+ "created_at" => String,
154
+ "source" => Fog::Nullable::String,
155
+ "source_port" => Fog::Nullable::String,
156
+ "destination" => Fog::Nullable::String,
157
+ "destination_port" => Fog::Nullable::String,
158
+ "protocol" => Fog::Nullable::String,
159
+ "icmp_type_name" => Fog::Nullable::String,
160
+ "description" => Fog::Nullable::String
161
+ }
162
+
163
+ IMAGE = {
164
+ "name" => String,
165
+ "created_at" => String,
166
+ "resource_type" => String,
167
+ "arch" => String,
168
+ "url" => String,
169
+ "id" => String,
170
+ "description" => String,
171
+ "source" => String,
172
+ "status" => String,
173
+ "public" => Fog::Boolean,
174
+ "official" => Fog::Boolean,
175
+ "owner" => String,
176
+ "username" => Fog::Nullable::String
177
+ }
178
+
179
+ INTERFACE = {
180
+ "resource_type" => String,
181
+ "url" => String,
182
+ "id" => String,
183
+ "ipv4_address" => String,
184
+ "ipv6_address" => Fog::Nullable::String,
185
+ "mac_address" => String
186
+ }
187
+
188
+ LOAD_BALANCER = {
189
+ "id" => String,
190
+ "resource_type" => String,
191
+ "url" => String,
192
+ "name" => String,
193
+ "status" => String,
194
+ "created_at" => String,
195
+ "deleted_at" => Fog::Nullable::String
196
+ }
197
+
198
+ SERVER = {
199
+ "id" => String,
200
+ "resource_type" => String,
201
+ "url" => String,
202
+ "name" => String,
203
+ "status" => String,
204
+ "hostname" => String,
205
+ "fqdn" => String,
206
+ "created_at" => String,
207
+ "started_at" => Fog::Nullable::String,
208
+ "deleted_at" => Fog::Nullable::String,
209
+ "username" => Fog::Nullable::String
210
+ }
211
+
212
+ SERVER_GROUP = {
213
+ "id" => String,
214
+ "resource_type" => String,
215
+ "url" => String,
216
+ "name" => Fog::Nullable::String,
217
+ "created_at" => String,
218
+ "default" => Fog::Boolean,
219
+ "description" => Fog::Nullable::String
220
+ }
221
+
222
+ SERVER_TYPE = {
223
+ "name" => String,
224
+ "handle" => Fog::Nullable::String,
225
+ "cores" => Integer,
226
+ "resource_type" => String,
227
+ "disk_size" => Integer,
228
+ "url" => String,
229
+ "id" => String,
230
+ "ram" => Integer,
231
+ "status" => String
232
+ }
233
+
234
+ USER = {
235
+ "id" => String,
236
+ "resource_type" => String,
237
+ "url" => String,
238
+ "name" => String,
239
+ "email_address" => String
240
+ }
241
+
242
+ COLLABORATION = {
243
+ "id" => String,
244
+ "resource_type" => String,
245
+ "url" => String,
246
+ "status" => String,
247
+ "email" => Fog::Nullable::String,
248
+ "role" => String,
249
+ "role_label" => String,
250
+ "user" => Fog::Brightbox::Nullable::User,
251
+ "account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
252
+ "inviter" => Brightbox::Compute::Formats::Nested::USER
253
+ }
254
+
255
+ ZONE = {
256
+ "id" => String,
257
+ "resource_type" => String,
258
+ "url" => String,
259
+ "handle" => Fog::Nullable::String
260
+ }
261
+ end
262
+
263
+ module Collected
264
+ ACCOUNT = {
265
+ "id" => String,
266
+ "resource_type" => String,
267
+ "url" => String,
268
+ "name" => String,
269
+ "status" => String,
270
+ "vat_registration_number" => Fog::Nullable::String,
271
+ "telephone_number" => Fog::Nullable::String,
272
+ "telephone_verified" => Fog::Nullable::Boolean,
273
+ "ram_limit" => Integer,
274
+ "ram_used" => Integer,
275
+ "cloud_ips_limit" => Integer,
276
+ "cloud_ips_used" => Integer,
277
+ "load_balancers_limit" => Integer,
278
+ "load_balancers_used" => Integer,
279
+ "library_ftp_password" => Fog::Nullable::String,
280
+ "verified_telephone" => Fog::Nullable::String,
281
+ "verified_at" => Fog::Nullable::String,
282
+ "verified_ip" => Fog::Nullable::String,
283
+ "owner" => Brightbox::Compute::Formats::Nested::USER,
284
+ "users" => [Brightbox::Compute::Formats::Nested::USER],
285
+ "clients" => [Brightbox::Compute::Formats::Nested::API_CLIENT],
286
+ "servers" => [Brightbox::Compute::Formats::Nested::SERVER],
287
+ "load_balancers" => [Brightbox::Compute::Formats::Nested::LOAD_BALANCER],
288
+ "cloud_ips" => [Brightbox::Compute::Formats::Nested::CLOUD_IP],
289
+ "server_groups" => [Brightbox::Compute::Formats::Nested::SERVER_GROUP],
290
+ "firewall_policies" => [Brightbox::Compute::Formats::Nested::FIREWALL_POLICY],
291
+ "images" => [Brightbox::Compute::Formats::Nested::IMAGE],
292
+ "zones" => [Brightbox::Compute::Formats::Nested::ZONE]
293
+ }
294
+
295
+ API_CLIENT = {
296
+ "id" => String,
297
+ "resource_type" => String,
298
+ "url" => String,
299
+ "name" => String,
300
+ "description" => String,
301
+ "revoked_at" => Fog::Nullable::String,
302
+ "account" => Brightbox::Compute::Formats::Nested::ACCOUNT
303
+ }
304
+
305
+ APPLICATION = {
306
+ "id" => String,
307
+ "resource_type" => String,
308
+ "url" => String,
309
+ "name" => Fog::Nullable::String
310
+ }
311
+
312
+ CLOUD_IP = {
313
+ "id" => String,
314
+ "resource_type" => String,
315
+ "url" => String,
316
+ "name" => Fog::Nullable::String,
317
+ "public_ip" => String,
318
+ "status" => String,
319
+ "reverse_dns" => String,
320
+ "port_translators" => [Brightbox::Compute::Formats::Struct::CIP_PORT_TRANSLATOR],
321
+ "account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
322
+ "interface" => Fog::Brightbox::Nullable::Interface,
323
+ "load_balancer" => Fog::Brightbox::Nullable::LoadBalancer,
324
+ "server" => Fog::Brightbox::Nullable::Server,
325
+ "server_group" => Fog::Brightbox::Nullable::ServerGroup
326
+ }
327
+
328
+ DATABASE_SERVER = {
329
+ "id" => String,
330
+ "resource_type" => String,
331
+ "url" => String,
332
+ "name" => String,
333
+ "description" => String,
334
+ "allow_access" => Array,
335
+ "database_version" => String,
336
+ "status" => String,
337
+ "created_at" => String,
338
+ "deleted_at" => Fog::Nullable::String
339
+ }
340
+
341
+ DATABASE_SNAPSHOT = {
342
+ "id" => String,
343
+ "resource_type" => String,
344
+ "url" => String,
345
+ "name" => String,
346
+ "description" => String,
347
+ "database_version" => String,
348
+ "size" => Integer,
349
+ "status" => String,
350
+ "created_at" => String,
351
+ "deleted_at" => Fog::Nullable::String,
352
+ "account" => Brightbox::Compute::Formats::Nested::ACCOUNT
353
+ }
354
+
355
+ DATABASE_SERVER_TYPE = {
356
+ "id" => String,
357
+ "resource_type" => String,
358
+ "url" => String,
359
+ "name" => String,
360
+ "description" => String,
361
+ "ram" => Integer,
362
+ "disk_size" => Integer
363
+ }
364
+
365
+ FIREWALL_POLICY = {
366
+ "id" => String,
367
+ "resource_type" => String,
368
+ "url" => String,
369
+ "name" => Fog::Nullable::String,
370
+ "description" => Fog::Nullable::String,
371
+ "default" => Fog::Boolean,
372
+ "created_at" => String,
373
+ "server_group" => Fog::Brightbox::Nullable::ServerGroup,
374
+ "rules" => [Brightbox::Compute::Formats::Nested::FIREWALL_RULE]
375
+ }
376
+
377
+ IMAGE = {
378
+ "name" => String,
379
+ "created_at" => String,
380
+ "resource_type" => String,
381
+ "arch" => String,
382
+ "url" => String,
383
+ "id" => String,
384
+ "description" => String,
385
+ "source" => String,
386
+ "source_type" => String,
387
+ "status" => String,
388
+ "owner" => String,
389
+ "username" => Fog::Nullable::String,
390
+ "public" => Fog::Boolean,
391
+ "official" => Fog::Boolean,
392
+ "compatibility_mode" => Fog::Boolean,
393
+ "virtual_size" => Integer,
394
+ "disk_size" => Integer,
395
+ "min_ram" => Fog::Nullable::Integer,
396
+ "ancestor" => Fog::Brightbox::Nullable::Image
397
+ }
398
+
399
+ LOAD_BALANCER = {
400
+ "id" => String,
401
+ "resource_type" => String,
402
+ "url" => String,
403
+ "name" => String,
404
+ "status" => String,
405
+ "created_at" => String,
406
+ "deleted_at" => Fog::Nullable::String,
407
+ "cloud_ips" => [Brightbox::Compute::Formats::Nested::CLOUD_IP],
408
+ "account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
409
+ "listeners" => [Brightbox::Compute::Formats::Struct::LB_LISTENER],
410
+ "nodes" => [Brightbox::Compute::Formats::Nested::SERVER]
411
+ }
412
+
413
+ SERVER = {
414
+ "id" => String,
415
+ "resource_type" => String,
416
+ "url" => String,
417
+ "name" => String,
418
+ "status" => String,
419
+ "hostname" => String,
420
+ "fqdn" => String,
421
+ "created_at" => String,
422
+ "started_at" => Fog::Nullable::String,
423
+ "deleted_at" => Fog::Nullable::String,
424
+ "account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
425
+ "server_type" => Brightbox::Compute::Formats::Nested::SERVER_TYPE,
426
+ "cloud_ips" => [Brightbox::Compute::Formats::Nested::CLOUD_IP],
427
+ "image" => Brightbox::Compute::Formats::Nested::IMAGE,
428
+ "server_groups" => [Brightbox::Compute::Formats::Nested::SERVER_GROUP],
429
+ "snapshots" => [Brightbox::Compute::Formats::Nested::IMAGE],
430
+ "interfaces" => [Brightbox::Compute::Formats::Nested::INTERFACE],
431
+ "zone" => Fog::Brightbox::Nullable::Zone,
432
+ "username" => Fog::Nullable::String,
433
+ "compatibility_mode" => Fog::Boolean
434
+ }
435
+
436
+ SERVER_GROUP = {
437
+ "created_at" => String,
438
+ "id" => String,
439
+ "resource_type" => String,
440
+ "url" => String,
441
+ "name" => Fog::Nullable::String,
442
+ "description" => Fog::Nullable::String,
443
+ "default" => Fog::Boolean,
444
+ "account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
445
+ "servers" => [Brightbox::Compute::Formats::Nested::SERVER],
446
+ "firewall_policy" => Fog::Brightbox::Nullable::FirewallPolicy
447
+ }
448
+
449
+ SERVER_TYPE = {
450
+ "id" => String,
451
+ "resource_type" => String,
452
+ "url" => String,
453
+ "handle" => Fog::Nullable::String,
454
+ "name" => String,
455
+ "status" => String,
456
+ "cores" => Integer,
457
+ "ram" => Integer,
458
+ "disk_size" => Integer
459
+ }
460
+
461
+ USER = {
462
+ "id" => String,
463
+ "resource_type" => String,
464
+ "url" => String,
465
+ "name" => String,
466
+ "email_address" => String,
467
+ "email_verified" => Fog::Boolean,
468
+ "accounts" => [Brightbox::Compute::Formats::Nested::ACCOUNT],
469
+ "default_account" => NilClass
470
+ }
471
+
472
+ COLLABORATION = {
473
+ "id" => String,
474
+ "resource_type" => String,
475
+ "url" => String,
476
+ "status" => String,
477
+ "role" => String,
478
+ "role_label" => String,
479
+ "email" => Fog::Nullable::String,
480
+ "user" => Fog::Brightbox::Nullable::User,
481
+ "account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
482
+ "inviter" => Brightbox::Compute::Formats::Nested::USER
483
+ }
484
+
485
+ ZONE = {
486
+ "id" => String,
487
+ "resource_type" => String,
488
+ "url" => String,
489
+ "handle" => Fog::Nullable::String
490
+ }
491
+ end
492
+
493
+ module Full
494
+ ACCOUNT = {
495
+ "id" => String,
496
+ "resource_type" => String,
497
+ "url" => String,
498
+ "name" => String,
499
+ "status" => String,
500
+ "address_1" => String,
501
+ "address_2" => String,
502
+ "city" => String,
503
+ "county" => String,
504
+ "postcode" => String,
505
+ "country_code" => String,
506
+ "country_name" => String,
507
+ "vat_registration_number" => Fog::Nullable::String,
508
+ "telephone_number" => String,
509
+ "telephone_verified" => Fog::Boolean,
510
+ "created_at" => String,
511
+ "ram_limit" => Integer,
512
+ "ram_used" => Integer,
513
+ "cloud_ips_limit" => Integer,
514
+ "cloud_ips_used" => Integer,
515
+ "load_balancers_limit" => Integer,
516
+ "load_balancers_used" => Integer,
517
+ "library_ftp_host" => String,
518
+ "library_ftp_user" => String,
519
+ "library_ftp_password" => Fog::Nullable::String,
520
+ "verified_telephone" => Fog::Nullable::String,
521
+ "verified_at" => Fog::Nullable::String,
522
+ "verified_ip" => Fog::Nullable::String,
523
+ "valid_credit_card" => Fog::Boolean,
524
+ "owner" => Brightbox::Compute::Formats::Nested::USER,
525
+ "users" => [Brightbox::Compute::Formats::Nested::USER],
526
+ "clients" => [Brightbox::Compute::Formats::Nested::API_CLIENT],
527
+ "servers" => [Brightbox::Compute::Formats::Nested::SERVER],
528
+ "load_balancers" => [Brightbox::Compute::Formats::Nested::LOAD_BALANCER],
529
+ "cloud_ips" => [Brightbox::Compute::Formats::Nested::CLOUD_IP],
530
+ "server_groups" => [Brightbox::Compute::Formats::Nested::SERVER_GROUP],
531
+ "firewall_policies" => [Brightbox::Compute::Formats::Nested::FIREWALL_POLICY],
532
+ "images" => [Brightbox::Compute::Formats::Nested::IMAGE],
533
+ "zones" => [Brightbox::Compute::Formats::Nested::ZONE]
534
+ }
535
+
536
+ API_CLIENT = {
537
+ "id" => String,
538
+ "resource_type" => String,
539
+ "url" => String,
540
+ "name" => String,
541
+ "description" => String,
542
+ "revoked_at" => Fog::Nullable::String,
543
+ "secret" => Fog::Nullable::String,
544
+ "account" => Brightbox::Compute::Formats::Nested::ACCOUNT
545
+ }
546
+
547
+ APPLICATION = {
548
+ "id" => String,
549
+ "resource_type" => String,
550
+ "url" => String,
551
+ "name" => Fog::Nullable::String,
552
+ "secret" => Fog::Nullable::String
553
+ }
554
+
555
+ CLOUD_IP = {
556
+ "id" => String,
557
+ "resource_type" => String,
558
+ "url" => String,
559
+ "name" => Fog::Nullable::String,
560
+ "public_ip" => String,
561
+ "status" => String,
562
+ "reverse_dns" => String,
563
+ "port_translators" => [Brightbox::Compute::Formats::Struct::CIP_PORT_TRANSLATOR],
564
+ "account" => Fog::Brightbox::Nullable::Account,
565
+ "interface" => Fog::Brightbox::Nullable::Interface,
566
+ "load_balancer" => Fog::Brightbox::Nullable::LoadBalancer,
567
+ "server" => Fog::Brightbox::Nullable::Server,
568
+ "server_group" => Fog::Brightbox::Nullable::ServerGroup
569
+ }
570
+
571
+ DATABASE_SERVER = {
572
+ "id" => String,
573
+ "resource_type" => String,
574
+ "url" => String,
575
+ "name" => String,
576
+ "description" => String,
577
+ "admin_username" => Fog::Nullable::String,
578
+ "admin_password" => Fog::Nullable::String,
579
+ "allow_access" => Array,
580
+ "database_version" => String,
581
+ "status" => String,
582
+ "created_at" => String,
583
+ "deleted_at" => Fog::Nullable::String
584
+ }
585
+
586
+ DATABASE_SNAPSHOT = {
587
+ "id" => String,
588
+ "resource_type" => String,
589
+ "url" => String,
590
+ "name" => String,
591
+ "description" => String,
592
+ "database_version" => String,
593
+ "size" => Integer,
594
+ "status" => String,
595
+ "created_at" => String,
596
+ "deleted_at" => Fog::Nullable::String,
597
+ "account" => Brightbox::Compute::Formats::Nested::ACCOUNT
598
+ }
599
+
600
+ DATABASE_SERVER_TYPE = {
601
+ "id" => String,
602
+ "resource_type" => String,
603
+ "url" => String,
604
+ "name" => String,
605
+ "description" => String,
606
+ "ram" => Integer,
607
+ "disk_size" => Integer
608
+ }
609
+
610
+ FIREWALL_POLICY = {
611
+ "id" => String,
612
+ "resource_type" => String,
613
+ "url" => String,
614
+ "name" => Fog::Nullable::String,
615
+ "description" => Fog::Nullable::String,
616
+ "default" => Fog::Boolean,
617
+ "created_at" => String,
618
+ "server_group" => Fog::Brightbox::Nullable::ServerGroup,
619
+ "rules" => [Brightbox::Compute::Formats::Nested::FIREWALL_RULE]
620
+ }
621
+
622
+ FIREWALL_RULE = {
623
+ "id" => String,
624
+ "resource_type" => String,
625
+ "url" => String,
626
+ "created_at" => String,
627
+ "source" => Fog::Nullable::String,
628
+ "source_port" => Fog::Nullable::String,
629
+ "destination" => Fog::Nullable::String,
630
+ "destination_port" => Fog::Nullable::String,
631
+ "protocol" => Fog::Nullable::String,
632
+ "icmp_type_name" => Fog::Nullable::String,
633
+ "description" => Fog::Nullable::String,
634
+ "firewall_policy" => Brightbox::Compute::Formats::Nested::FIREWALL_POLICY
635
+ }
636
+
637
+ IMAGE = {
638
+ "name" => String,
639
+ "created_at" => String,
640
+ "resource_type" => String,
641
+ "arch" => String,
642
+ "url" => String,
643
+ "id" => String,
644
+ "description" => String,
645
+ "source" => String,
646
+ "source_type" => String,
647
+ "status" => String,
648
+ "owner" => String, # Account ID not object
649
+ "username" => Fog::Nullable::String,
650
+ "public" => Fog::Boolean,
651
+ "official" => Fog::Boolean,
652
+ "compatibility_mode" => Fog::Boolean,
653
+ "virtual_size" => Integer,
654
+ "disk_size" => Integer,
655
+ "min_ram" => Fog::Nullable::Integer,
656
+ "ancestor" => Fog::Brightbox::Nullable::Image,
657
+ "licence_name" => Fog::Nullable::String
658
+ }
659
+
660
+ INTERFACE = {
661
+ "resource_type" => String,
662
+ "url" => String,
663
+ "id" => String,
664
+ "ipv4_address" => String,
665
+ "ipv6_address" => Fog::Nullable::String,
666
+ "mac_address" => String,
667
+ "server" => Brightbox::Compute::Formats::Nested::SERVER
668
+ }
669
+
670
+ LOAD_BALANCER = {
671
+ "id" => String,
672
+ "resource_type" => String,
673
+ "url" => String,
674
+ "name" => String,
675
+ "status" => String,
676
+ "listeners" => [Brightbox::Compute::Formats::Struct::LB_LISTENER],
677
+ "policy" => String,
678
+ "healthcheck" => Brightbox::Compute::Formats::Struct::LB_HEALTHCHECK,
679
+ "certificate" => Fog::Nullable::Hash,
680
+ "created_at" => String,
681
+ "deleted_at" => Fog::Nullable::String,
682
+ "account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
683
+ "nodes" => [Brightbox::Compute::Formats::Nested::SERVER],
684
+ "cloud_ips" => [Brightbox::Compute::Formats::Nested::CLOUD_IP]
685
+ }
686
+
687
+ SERVER = {
688
+ "id" => String,
689
+ "resource_type" => String,
690
+ "url" => String,
691
+ "name" => String,
692
+ "status" => String,
693
+ "hostname" => String,
694
+ "fqdn" => String,
695
+ "created_at" => String,
696
+ "started_at" => Fog::Nullable::String,
697
+ "deleted_at" => Fog::Nullable::String,
698
+ "user_data" => Fog::Nullable::String,
699
+ "console_url" => Fog::Nullable::String,
700
+ "console_token" => Fog::Nullable::String,
701
+ "console_token_expires" => Fog::Nullable::String,
702
+ "account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
703
+ "server_type" => Brightbox::Compute::Formats::Nested::SERVER_TYPE,
704
+ "cloud_ips" => [Brightbox::Compute::Formats::Nested::CLOUD_IP],
705
+ "image" => Brightbox::Compute::Formats::Nested::IMAGE,
706
+ "snapshots" => [Brightbox::Compute::Formats::Nested::IMAGE],
707
+ "server_groups" => [Brightbox::Compute::Formats::Nested::SERVER_GROUP],
708
+ "interfaces" => [Brightbox::Compute::Formats::Nested::INTERFACE],
709
+ "zone" => Fog::Brightbox::Nullable::Zone,
710
+ "licence_name" => Fog::Nullable::String,
711
+ "username" => Fog::Nullable::String,
712
+ "compatibility_mode" => Fog::Boolean
713
+ }
714
+
715
+ SERVER_GROUP = {
716
+ "created_at" => String,
717
+ "id" => String,
718
+ "resource_type" => String,
719
+ "url" => String,
720
+ "name" => String,
721
+ "description" => Fog::Nullable::String,
722
+ "default" => Fog::Boolean,
723
+ "account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
724
+ "servers" => [Brightbox::Compute::Formats::Nested::SERVER],
725
+ "firewall_policy" => Fog::Brightbox::Nullable::FirewallPolicy
726
+ }
727
+
728
+ SERVER_TYPE = {
729
+ "id" => String,
730
+ "resource_type" => String,
731
+ "url" => String,
732
+ "handle" => Fog::Nullable::String,
733
+ "name" => String,
734
+ "status" => String,
735
+ "cores" => Integer,
736
+ "ram" => Integer,
737
+ "disk_size" => Integer
738
+ }
739
+
740
+ USER = {
741
+ "id" => String,
742
+ "resource_type" => String,
743
+ "url" => String,
744
+ "name" => String,
745
+ "email_address" => String,
746
+ "email_verified" => Fog::Boolean,
747
+ "accounts" => [Brightbox::Compute::Formats::Nested::ACCOUNT],
748
+ "default_account" => Fog::Brightbox::Nullable::Account,
749
+ "ssh_key" => Fog::Nullable::String,
750
+ "messaging_pref" => Fog::Boolean
751
+ }
752
+
753
+ COLLABORATION = {
754
+ "id" => String,
755
+ "resource_type" => String,
756
+ "url" => String,
757
+ "status" => String,
758
+ "role" => String,
759
+ "role_label" => String,
760
+ "email" => Fog::Nullable::String,
761
+ "user" => Fog::Brightbox::Nullable::User,
762
+ "account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
763
+ "inviter" => Brightbox::Compute::Formats::Nested::USER
764
+ }
765
+
766
+ ZONE = {
767
+ "id" => String,
768
+ "resource_type" => String,
769
+ "url" => String,
770
+ "handle" => String
771
+ }
772
+ end
773
+
774
+ module Collection
775
+ ACCOUNTS = [Brightbox::Compute::Formats::Collected::ACCOUNT]
776
+ API_CLIENTS = [Brightbox::Compute::Formats::Collected::API_CLIENT]
777
+ APPLICATION = [Brightbox::Compute::Formats::Collected::APPLICATION]
778
+ CLOUD_IPS = [Brightbox::Compute::Formats::Collected::CLOUD_IP]
779
+ COLLABORATIONS = [Brightbox::Compute::Formats::Collected::COLLABORATION]
780
+ DATABASE_SERVERS = [Brightbox::Compute::Formats::Collected::DATABASE_SERVER]
781
+ DATABASE_SERVER_TYPES = [Brightbox::Compute::Formats::Collected::DATABASE_SERVER_TYPE]
782
+ DATABASE_SNAPSHOTS = [Brightbox::Compute::Formats::Collected::DATABASE_SNAPSHOT]
783
+ FIREWALL_POLICIES = [Brightbox::Compute::Formats::Collected::FIREWALL_POLICY]
784
+ IMAGES = [Brightbox::Compute::Formats::Collected::IMAGE]
785
+ LOAD_BALANCERS = [Brightbox::Compute::Formats::Collected::LOAD_BALANCER]
786
+ SERVERS = [Brightbox::Compute::Formats::Collected::SERVER]
787
+ SERVER_GROUPS = [Brightbox::Compute::Formats::Collected::SERVER_GROUP]
788
+ SERVER_TYPES = [Brightbox::Compute::Formats::Collected::SERVER_TYPE]
789
+ USERS = [Brightbox::Compute::Formats::Collected::USER]
790
+ ZONES = [Brightbox::Compute::Formats::Collected::ZONE]
791
+ end
792
+ end
793
+ end
794
+ end