fog-brightbox 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e26f79fc46a2f77a167b2bfdbec200eb894fe31564c2de8c032ef7b0988121ee
4
- data.tar.gz: 907d351d14930aca9ac3163419b1b24cde2b38e51ed5018891330ddd220bc44f
3
+ metadata.gz: 0171cd502b5ab6e6241edc43d35bd7cc5576ec5f8c4fc14076740927ac645ae2
4
+ data.tar.gz: 3017c31ae0face3f2fa8ae5993143ea5643c98ea58d2ea9adf0c5131d158cdc6
5
5
  SHA512:
6
- metadata.gz: 0fef06b499b0df676a162b957ec938dcde62ee20144c6adb17258d8b5589c635874bf4a67ec58a21392e5dfe88b048efce6aa8ef677ecb2a14672c149e9501ad
7
- data.tar.gz: 7bd7aa1451f637f20f1746b5efbe51afadbe294a4117061be4751bdba55798c5256390b5d557827c4a95db19a3542fe541ab643644dea761abfba9b8d16da10f
6
+ metadata.gz: bd84165e64c458d7c4d266243f057548bc559de6b5cf92979c13a1e70d52101021acea48f9a200b408f38a87ed15961a959acf35a646ea4ec5f700d993014ee7
7
+ data.tar.gz: 398a1e5d0efee2a0de986ce5e42f938eb86bbbce46bbbd16ce0d807fc9b6b04acc60fd830ee772c249b6a94357e2e6c72616bba44be035d16ad1158bf2bb7cef
@@ -1,3 +1,10 @@
1
+ ### 1.3.0 / 2020-11-24
2
+
3
+ Changes:
4
+
5
+ * Add `Server#disk_encrypted` attribute to support creation of servers with
6
+ LUKS based encryption at rest.
7
+
1
8
  ### 1.2.0 / 2020-11-16
2
9
 
3
10
  Changes:
@@ -21,6 +21,8 @@ module Fog
21
21
  attribute :fqdn
22
22
  attribute :console_token
23
23
 
24
+ attribute :disk_encrypted
25
+
24
26
  # Times
25
27
  attribute :created_at, :type => :time
26
28
  attribute :started_at, :type => :time
@@ -188,6 +190,7 @@ module Fog
188
190
 
189
191
  options.merge!(:server_type => flavor_id) unless flavor_id.nil? || flavor_id == ""
190
192
  options.merge!(:cloud_ip => cloud_ip) unless cloud_ip.nil? || cloud_ip == ""
193
+ options.merge!(:disk_encrypted => disk_encrypted) if disk_encrypted
191
194
 
192
195
  data = service.create_server(options)
193
196
  merge_attributes(data)
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Brightbox
3
- VERSION = "1.2.0"
3
+ VERSION = "1.3.0"
4
4
  end
5
5
  end
@@ -19,7 +19,49 @@ describe Fog::Brightbox::Compute::Server do
19
19
  end
20
20
  end
21
21
 
22
- describe "when snapshotting withi no options" do
22
+ describe "when creating" do
23
+ describe "with required image_id" do
24
+ it "sends correct JSON" do
25
+ options = {
26
+ image_id: "img-12345"
27
+ }
28
+
29
+ stub_request(:post, "http://localhost/1.0/servers").
30
+ with(:query => hash_including(:account_id),
31
+ :headers => { "Authorization" => "Bearer FAKECACHEDTOKEN",
32
+ "Content-Type" => "application/json" },
33
+ :body => hash_including(:image => "img-12345")).
34
+ to_return(:status => 202, :body => %q({"id":"srv-12345"}), :headers => {})
35
+
36
+ @server = Fog::Brightbox::Compute::Server.new({ :service => service }.merge(options))
37
+ assert @server.save
38
+ end
39
+ end
40
+
41
+ describe "with additional disk_encrypted" do
42
+ it "sends correct JSON" do
43
+ options = {
44
+ image_id: "img-12345",
45
+ disk_encrypted: true
46
+ }
47
+
48
+ stub_request(:post, "http://localhost/1.0/servers").
49
+ with(:query => hash_including(:account_id),
50
+ :headers => { "Authorization" => "Bearer FAKECACHEDTOKEN",
51
+ "Content-Type" => "application/json" },
52
+ :body => hash_including(:disk_encrypted => true)).
53
+ to_return(:status => 202,
54
+ :body => %q({"id":"srv-12345","disk_encrypted":true}),
55
+ :headers => {})
56
+
57
+ @server = Fog::Brightbox::Compute::Server.new({ :service => service }.merge(options))
58
+ assert @server.save
59
+ assert @server.disk_encrypted
60
+ end
61
+ end
62
+ end
63
+
64
+ describe "when snapshotting with no options" do
23
65
  it "returns the server" do
24
66
  stub_request(:post, "http://localhost/1.0/servers/srv-12345/snapshot").
25
67
  with(:query => hash_including(:account_id),
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.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Thornthwaite