fog-brightbox 1.0.0.rc1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/CHANGELOG.md +58 -2
- data/README.md +3 -4
- data/fog-brightbox.gemspec +2 -2
- data/lib/fog/brightbox.rb +4 -24
- data/lib/fog/brightbox/compute.rb +18 -33
- data/lib/fog/brightbox/compute/config.rb +1 -1
- data/lib/fog/brightbox/compute/image_selector.rb +5 -3
- data/lib/fog/brightbox/compute/resource_locking.rb +1 -1
- data/lib/fog/brightbox/compute/shared.rb +3 -3
- data/lib/fog/brightbox/models/compute/account.rb +2 -2
- data/lib/fog/brightbox/models/compute/accounts.rb +3 -3
- data/lib/fog/brightbox/models/compute/api_client.rb +3 -3
- data/lib/fog/brightbox/models/compute/api_clients.rb +3 -3
- data/lib/fog/brightbox/models/compute/application.rb +2 -2
- data/lib/fog/brightbox/models/compute/applications.rb +3 -3
- data/lib/fog/brightbox/models/compute/cloud_ip.rb +3 -3
- data/lib/fog/brightbox/models/compute/cloud_ips.rb +3 -3
- data/lib/fog/brightbox/models/compute/collaboration.rb +3 -3
- data/lib/fog/brightbox/models/compute/collaborations.rb +5 -5
- data/lib/fog/brightbox/models/compute/database_server.rb +6 -3
- data/lib/fog/brightbox/models/compute/database_servers.rb +3 -3
- data/lib/fog/brightbox/models/compute/database_snapshot.rb +3 -3
- data/lib/fog/brightbox/models/compute/database_snapshots.rb +3 -3
- data/lib/fog/brightbox/models/compute/database_type.rb +2 -2
- data/lib/fog/brightbox/models/compute/database_types.rb +3 -3
- data/lib/fog/brightbox/models/compute/event.rb +2 -2
- data/lib/fog/brightbox/models/compute/events.rb +3 -3
- data/lib/fog/brightbox/models/compute/firewall_policies.rb +3 -3
- data/lib/fog/brightbox/models/compute/firewall_policy.rb +3 -3
- data/lib/fog/brightbox/models/compute/firewall_rule.rb +3 -3
- data/lib/fog/brightbox/models/compute/firewall_rules.rb +3 -3
- data/lib/fog/brightbox/models/compute/flavor.rb +2 -2
- data/lib/fog/brightbox/models/compute/flavors.rb +3 -3
- data/lib/fog/brightbox/models/compute/image.rb +3 -3
- data/lib/fog/brightbox/models/compute/images.rb +3 -3
- data/lib/fog/brightbox/models/compute/load_balancer.rb +6 -3
- data/lib/fog/brightbox/models/compute/load_balancers.rb +3 -3
- data/lib/fog/brightbox/models/compute/server.rb +6 -3
- data/lib/fog/brightbox/models/compute/server_group.rb +3 -3
- data/lib/fog/brightbox/models/compute/server_groups.rb +3 -3
- data/lib/fog/brightbox/models/compute/servers.rb +4 -4
- data/lib/fog/brightbox/models/compute/user.rb +2 -2
- data/lib/fog/brightbox/models/compute/user_collaboration.rb +3 -3
- data/lib/fog/brightbox/models/compute/user_collaborations.rb +4 -4
- data/lib/fog/brightbox/models/compute/users.rb +3 -3
- data/lib/fog/brightbox/models/compute/zone.rb +2 -2
- data/lib/fog/brightbox/models/compute/zones.rb +3 -3
- data/lib/fog/brightbox/models/storage/directories.rb +4 -4
- data/lib/fog/brightbox/models/storage/directory.rb +3 -3
- data/lib/fog/brightbox/models/storage/file.rb +2 -2
- data/lib/fog/brightbox/models/storage/files.rb +6 -6
- data/lib/fog/brightbox/requests/compute/accept_user_collaboration.rb +2 -2
- data/lib/fog/brightbox/requests/compute/activate_console_server.rb +2 -2
- data/lib/fog/brightbox/requests/compute/add_listeners_load_balancer.rb +2 -2
- data/lib/fog/brightbox/requests/compute/add_nodes_load_balancer.rb +2 -2
- data/lib/fog/brightbox/requests/compute/add_servers_server_group.rb +2 -2
- data/lib/fog/brightbox/requests/compute/apply_to_firewall_policy.rb +2 -2
- data/lib/fog/brightbox/requests/compute/create_api_client.rb +2 -2
- data/lib/fog/brightbox/requests/compute/create_application.rb +2 -2
- data/lib/fog/brightbox/requests/compute/create_cloud_ip.rb +2 -2
- data/lib/fog/brightbox/requests/compute/create_collaboration.rb +2 -2
- data/lib/fog/brightbox/requests/compute/create_database_server.rb +2 -2
- data/lib/fog/brightbox/requests/compute/create_firewall_policy.rb +2 -2
- data/lib/fog/brightbox/requests/compute/create_firewall_rule.rb +2 -2
- data/lib/fog/brightbox/requests/compute/create_image.rb +2 -2
- data/lib/fog/brightbox/requests/compute/create_load_balancer.rb +2 -2
- data/lib/fog/brightbox/requests/compute/create_server.rb +2 -2
- data/lib/fog/brightbox/requests/compute/create_server_group.rb +2 -2
- data/lib/fog/brightbox/requests/compute/delete_api_client.rb +2 -10
- data/lib/fog/brightbox/requests/compute/delete_application.rb +2 -10
- data/lib/fog/brightbox/requests/compute/delete_cloud_ip.rb +2 -10
- data/lib/fog/brightbox/requests/compute/delete_collaboration.rb +2 -10
- data/lib/fog/brightbox/requests/compute/delete_database_server.rb +2 -10
- data/lib/fog/brightbox/requests/compute/delete_database_snapshot.rb +2 -10
- data/lib/fog/brightbox/requests/compute/delete_firewall_policy.rb +2 -10
- data/lib/fog/brightbox/requests/compute/delete_firewall_rule.rb +2 -10
- data/lib/fog/brightbox/requests/compute/delete_image.rb +2 -10
- data/lib/fog/brightbox/requests/compute/delete_load_balancer.rb +2 -10
- data/lib/fog/brightbox/requests/compute/delete_server.rb +2 -10
- data/lib/fog/brightbox/requests/compute/delete_server_group.rb +2 -10
- data/lib/fog/brightbox/requests/compute/delete_user_collaboration.rb +2 -10
- data/lib/fog/brightbox/requests/compute/get_account.rb +6 -15
- data/lib/fog/brightbox/requests/compute/get_api_client.rb +2 -2
- data/lib/fog/brightbox/requests/compute/get_application.rb +2 -2
- data/lib/fog/brightbox/requests/compute/get_authenticated_user.rb +2 -2
- data/lib/fog/brightbox/requests/compute/get_cloud_ip.rb +2 -2
- data/lib/fog/brightbox/requests/compute/get_collaboration.rb +2 -2
- data/lib/fog/brightbox/requests/compute/get_database_server.rb +2 -2
- data/lib/fog/brightbox/requests/compute/get_database_snapshot.rb +2 -2
- data/lib/fog/brightbox/requests/compute/get_database_type.rb +2 -2
- data/lib/fog/brightbox/requests/compute/get_firewall_policy.rb +2 -2
- data/lib/fog/brightbox/requests/compute/get_firewall_rule.rb +2 -2
- data/lib/fog/brightbox/requests/compute/get_image.rb +2 -2
- data/lib/fog/brightbox/requests/compute/get_interface.rb +2 -2
- data/lib/fog/brightbox/requests/compute/get_load_balancer.rb +2 -2
- data/lib/fog/brightbox/requests/compute/get_scoped_account.rb +2 -2
- data/lib/fog/brightbox/requests/compute/get_server.rb +2 -2
- data/lib/fog/brightbox/requests/compute/get_server_group.rb +2 -2
- data/lib/fog/brightbox/requests/compute/get_server_type.rb +2 -2
- data/lib/fog/brightbox/requests/compute/get_user.rb +6 -15
- data/lib/fog/brightbox/requests/compute/get_user_collaboration.rb +2 -2
- data/lib/fog/brightbox/requests/compute/get_zone.rb +2 -2
- data/lib/fog/brightbox/requests/compute/list_accounts.rb +2 -2
- data/lib/fog/brightbox/requests/compute/list_api_clients.rb +2 -2
- data/lib/fog/brightbox/requests/compute/list_applications.rb +2 -2
- data/lib/fog/brightbox/requests/compute/list_cloud_ips.rb +2 -2
- data/lib/fog/brightbox/requests/compute/list_collaborations.rb +2 -2
- data/lib/fog/brightbox/requests/compute/list_database_servers.rb +2 -2
- data/lib/fog/brightbox/requests/compute/list_database_snapshots.rb +2 -2
- data/lib/fog/brightbox/requests/compute/list_database_types.rb +2 -2
- data/lib/fog/brightbox/requests/compute/list_events.rb +2 -2
- data/lib/fog/brightbox/requests/compute/list_firewall_policies.rb +2 -2
- data/lib/fog/brightbox/requests/compute/list_images.rb +2 -2
- data/lib/fog/brightbox/requests/compute/list_load_balancers.rb +2 -2
- data/lib/fog/brightbox/requests/compute/list_server_groups.rb +2 -2
- data/lib/fog/brightbox/requests/compute/list_server_types.rb +2 -2
- data/lib/fog/brightbox/requests/compute/list_servers.rb +2 -2
- data/lib/fog/brightbox/requests/compute/list_user_collaborations.rb +2 -2
- data/lib/fog/brightbox/requests/compute/list_users.rb +2 -2
- data/lib/fog/brightbox/requests/compute/list_zones.rb +2 -2
- data/lib/fog/brightbox/requests/compute/lock_resource_database_server.rb +2 -2
- data/lib/fog/brightbox/requests/compute/lock_resource_database_snapshot.rb +2 -2
- data/lib/fog/brightbox/requests/compute/lock_resource_image.rb +2 -2
- data/lib/fog/brightbox/requests/compute/lock_resource_load_balancer.rb +2 -2
- data/lib/fog/brightbox/requests/compute/lock_resource_server.rb +2 -2
- data/lib/fog/brightbox/requests/compute/map_cloud_ip.rb +2 -2
- data/lib/fog/brightbox/requests/compute/move_servers_server_group.rb +2 -2
- data/lib/fog/brightbox/requests/compute/reboot_server.rb +2 -2
- data/lib/fog/brightbox/requests/compute/reject_user_collaboration.rb +2 -2
- data/lib/fog/brightbox/requests/compute/remove_firewall_policy.rb +2 -2
- data/lib/fog/brightbox/requests/compute/remove_listeners_load_balancer.rb +2 -2
- data/lib/fog/brightbox/requests/compute/remove_nodes_load_balancer.rb +2 -2
- data/lib/fog/brightbox/requests/compute/remove_servers_server_group.rb +2 -2
- data/lib/fog/brightbox/requests/compute/resend_collaboration.rb +2 -2
- data/lib/fog/brightbox/requests/compute/reset_ftp_password_account.rb +6 -15
- data/lib/fog/brightbox/requests/compute/reset_ftp_password_scoped_account.rb +2 -2
- data/lib/fog/brightbox/requests/compute/reset_password_database_server.rb +2 -2
- data/lib/fog/brightbox/requests/compute/reset_secret_api_client.rb +2 -2
- data/lib/fog/brightbox/requests/compute/reset_secret_application.rb +2 -2
- data/lib/fog/brightbox/requests/compute/reset_server.rb +2 -2
- data/lib/fog/brightbox/requests/compute/shutdown_server.rb +2 -2
- data/lib/fog/brightbox/requests/compute/snapshot_database_server.rb +2 -2
- data/lib/fog/brightbox/requests/compute/snapshot_server.rb +2 -2
- data/lib/fog/brightbox/requests/compute/start_server.rb +2 -2
- data/lib/fog/brightbox/requests/compute/stop_server.rb +2 -2
- data/lib/fog/brightbox/requests/compute/unlock_resource_database_server.rb +2 -2
- data/lib/fog/brightbox/requests/compute/unlock_resource_database_snapshot.rb +2 -2
- data/lib/fog/brightbox/requests/compute/unlock_resource_image.rb +2 -2
- data/lib/fog/brightbox/requests/compute/unlock_resource_load_balancer.rb +2 -2
- data/lib/fog/brightbox/requests/compute/unlock_resource_server.rb +2 -2
- data/lib/fog/brightbox/requests/compute/unmap_cloud_ip.rb +2 -2
- data/lib/fog/brightbox/requests/compute/update_account.rb +15 -36
- data/lib/fog/brightbox/requests/compute/update_api_client.rb +2 -2
- data/lib/fog/brightbox/requests/compute/update_application.rb +2 -2
- data/lib/fog/brightbox/requests/compute/update_cloud_ip.rb +2 -2
- data/lib/fog/brightbox/requests/compute/update_database_server.rb +2 -2
- data/lib/fog/brightbox/requests/compute/update_database_snapshot.rb +2 -2
- data/lib/fog/brightbox/requests/compute/update_firewall_policy.rb +2 -2
- data/lib/fog/brightbox/requests/compute/update_firewall_rule.rb +2 -2
- data/lib/fog/brightbox/requests/compute/update_image.rb +2 -2
- data/lib/fog/brightbox/requests/compute/update_load_balancer.rb +2 -2
- data/lib/fog/brightbox/requests/compute/update_scoped_account.rb +2 -2
- data/lib/fog/brightbox/requests/compute/update_server.rb +2 -2
- data/lib/fog/brightbox/requests/compute/update_server_group.rb +2 -2
- data/lib/fog/brightbox/requests/compute/update_user.rb +2 -2
- data/lib/fog/brightbox/requests/storage/copy_object.rb +3 -3
- data/lib/fog/brightbox/requests/storage/delete_container.rb +3 -3
- data/lib/fog/brightbox/requests/storage/delete_multiple_objects.rb +2 -2
- data/lib/fog/brightbox/requests/storage/delete_object.rb +3 -3
- data/lib/fog/brightbox/requests/storage/delete_static_large_object.rb +3 -3
- data/lib/fog/brightbox/requests/storage/get_container.rb +3 -3
- data/lib/fog/brightbox/requests/storage/get_containers.rb +2 -2
- data/lib/fog/brightbox/requests/storage/get_object.rb +3 -3
- data/lib/fog/brightbox/requests/storage/get_object_http_url.rb +2 -2
- data/lib/fog/brightbox/requests/storage/get_object_https_url.rb +2 -2
- data/lib/fog/brightbox/requests/storage/head_container.rb +3 -3
- data/lib/fog/brightbox/requests/storage/head_containers.rb +2 -2
- data/lib/fog/brightbox/requests/storage/head_object.rb +3 -3
- data/lib/fog/brightbox/requests/storage/post_set_meta_temp_url_key.rb +2 -2
- data/lib/fog/brightbox/requests/storage/put_container.rb +3 -3
- data/lib/fog/brightbox/requests/storage/put_dynamic_obj_manifest.rb +5 -5
- data/lib/fog/brightbox/requests/storage/put_object.rb +3 -3
- data/lib/fog/brightbox/requests/storage/put_object_manifest.rb +2 -2
- data/lib/fog/brightbox/requests/storage/put_static_obj_manifest.rb +4 -4
- data/lib/fog/brightbox/storage.rb +12 -5
- data/lib/fog/brightbox/storage/authentication_request.rb +1 -1
- data/lib/fog/brightbox/storage/authentication_required.rb +1 -1
- data/lib/fog/brightbox/storage/config.rb +1 -1
- data/lib/fog/brightbox/storage/connection.rb +2 -2
- data/lib/fog/brightbox/storage/management_url_unknown.rb +1 -1
- data/lib/fog/brightbox/storage/not_found.rb +8 -0
- data/lib/fog/brightbox/version.rb +1 -1
- data/spec/fog/brightbox/compute/wrapped_request_spec.rb +4 -4
- data/spec/fog/brightbox/config_spec.rb +3 -3
- data/spec/fog/brightbox/link_helper_spec.rb +1 -1
- data/spec/fog/brightbox/storage/authentication_request_spec.rb +4 -4
- data/spec/fog/brightbox/storage/connection_errors_spec.rb +1 -1
- data/spec/fog/brightbox/storage/connection_spec.rb +2 -2
- data/spec/fog/compute/brightbox/account_spec.rb +1 -1
- data/spec/fog/compute/brightbox/api_client_spec.rb +1 -1
- data/spec/fog/compute/brightbox/application_spec.rb +1 -1
- data/spec/fog/compute/brightbox/cloud_ip_spec.rb +1 -1
- data/spec/fog/compute/brightbox/collaboration_spec.rb +1 -1
- data/spec/fog/compute/brightbox/database_server_spec.rb +20 -5
- data/spec/fog/compute/brightbox/database_snapshot_spec.rb +1 -1
- data/spec/fog/compute/brightbox/database_type_spec.rb +1 -1
- data/spec/fog/compute/brightbox/event_spec.rb +1 -1
- data/spec/fog/compute/brightbox/firewall_policy_spec.rb +1 -1
- data/spec/fog/compute/brightbox/flavor_spec.rb +1 -1
- data/spec/fog/compute/brightbox/image_spec.rb +1 -1
- data/spec/fog/compute/brightbox/load_balancer_spec.rb +25 -1
- data/spec/fog/compute/brightbox/server_group_spec.rb +1 -1
- data/spec/fog/compute/brightbox/server_spec.rb +47 -5
- data/spec/fog/compute/brightbox/user_collaboration_spec.rb +1 -1
- data/spec/fog/compute/brightbox/user_spec.rb +1 -1
- data/spec/fog/compute/brightbox/zone_spec.rb +1 -1
- data/spec/fog/compute/brightbox_spec.rb +5 -5
- data/spec/fog/storage/brightbox_spec.rb +8 -8
- data/spec/model_setup.rb +1 -1
- data/tests/brightbox/compute/schema.rb +1 -1
- data/tests/brightbox/compute_tests.rb +2 -2
- data/tests/brightbox/requests/compute/api_client_tests.rb +2 -2
- data/tests/brightbox/requests/compute/application_test.rb +2 -2
- data/tests/brightbox/requests/compute/cloud_ip_tests.rb +2 -2
- data/tests/brightbox/requests/compute/collaboration_tests.rb +6 -3
- data/tests/brightbox/requests/compute/database_server_tests.rb +2 -2
- data/tests/brightbox/requests/compute/database_snapsnot_tests.rb +2 -2
- data/tests/brightbox/requests/compute/firewall_policy_tests.rb +2 -2
- data/tests/brightbox/requests/compute/firewall_rule_tests.rb +2 -2
- data/tests/brightbox/requests/compute/helper.rb +1 -1
- data/tests/brightbox/requests/compute/image_tests.rb +2 -2
- data/tests/brightbox/requests/compute/load_balancer_tests.rb +2 -2
- data/tests/brightbox/requests/compute/server_group_tests.rb +2 -2
- data/tests/brightbox/requests/compute/server_tests.rb +2 -2
- metadata +20 -14
@@ -1,7 +1,7 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
require "fog/brightbox/models/compute/load_balancer"
|
3
3
|
|
4
|
-
describe Fog::Compute::
|
4
|
+
describe Fog::Brightbox::Compute::LoadBalancer do
|
5
5
|
include ModelSetup
|
6
6
|
include SupportsResourceLocking
|
7
7
|
|
@@ -18,4 +18,28 @@ describe Fog::Compute::Brightbox::LoadBalancer do
|
|
18
18
|
assert_equal "load_balancer", subject.resource_name
|
19
19
|
end
|
20
20
|
end
|
21
|
+
|
22
|
+
describe "when creating" do
|
23
|
+
it "send correct JSON" do
|
24
|
+
options = {
|
25
|
+
healthcheck: {},
|
26
|
+
listeners: [
|
27
|
+
{
|
28
|
+
protocol: "http",
|
29
|
+
in: 80,
|
30
|
+
out: 80
|
31
|
+
}
|
32
|
+
],
|
33
|
+
nodes: []
|
34
|
+
}
|
35
|
+
|
36
|
+
stub_request(:post, "http://localhost/1.0/load_balancers").
|
37
|
+
with(:query => hash_including(:account_id),
|
38
|
+
:headers => { "Authorization" => "Bearer FAKECACHEDTOKEN" }).
|
39
|
+
to_return(:status => 202, :body => %q({"id": "lba-12345"}), :headers => {})
|
40
|
+
|
41
|
+
@load_balancer = Fog::Brightbox::Compute::LoadBalancer.new({ :service => service }.merge(options))
|
42
|
+
assert @load_balancer.save
|
43
|
+
end
|
44
|
+
end
|
21
45
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
require "fog/brightbox/models/compute/server"
|
3
3
|
|
4
|
-
describe Fog::Compute::
|
4
|
+
describe Fog::Brightbox::Compute::Server do
|
5
5
|
include ModelSetup
|
6
6
|
include SupportsResourceLocking
|
7
7
|
|
@@ -19,14 +19,56 @@ describe Fog::Compute::Brightbox::Server do
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
describe "when
|
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),
|
26
68
|
:headers => { "Authorization" => "Bearer FAKECACHEDTOKEN" }).
|
27
69
|
to_return(:status => 202, :body => %q({"id": "srv-12345"}), :headers => {})
|
28
70
|
|
29
|
-
@server = Fog::Compute::
|
71
|
+
@server = Fog::Brightbox::Compute::Server.new(:service => service, :id => "srv-12345")
|
30
72
|
assert_kind_of Hash, @server.snapshot
|
31
73
|
end
|
32
74
|
end
|
@@ -43,8 +85,8 @@ describe Fog::Compute::Brightbox::Server do
|
|
43
85
|
with(:query => hash_including(:account_id),
|
44
86
|
:headers => { "Authorization" => "Bearer FAKECACHEDTOKEN" }).
|
45
87
|
to_return(:status => 200, :body => %q({"id": "img-12345"}))
|
46
|
-
@server = Fog::Compute::
|
47
|
-
assert_kind_of Fog::Compute::
|
88
|
+
@server = Fog::Brightbox::Compute::Server.new(:service => service, :id => "srv-12345")
|
89
|
+
assert_kind_of Fog::Brightbox::Compute::Image, @server.snapshot(true)
|
48
90
|
end
|
49
91
|
end
|
50
92
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
require "fog/brightbox/models/compute/user_collaboration"
|
3
3
|
|
4
|
-
describe Fog::Compute::
|
4
|
+
describe Fog::Brightbox::Compute::UserCollaboration do
|
5
5
|
include ModelSetup
|
6
6
|
|
7
7
|
subject { service.user_collaborations.new }
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
describe Fog::Compute
|
3
|
+
describe Fog::Brightbox::Compute do
|
4
4
|
describe "when global config is available" do
|
5
5
|
before do
|
6
6
|
@arguments = {
|
@@ -19,7 +19,7 @@ describe Fog::Compute::Brightbox do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
Fog.stub :credentials, @credential_guard do
|
22
|
-
@service = Fog::Compute
|
22
|
+
@service = Fog::Brightbox::Compute.new(@arguments)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -40,7 +40,7 @@ describe Fog::Compute::Brightbox do
|
|
40
40
|
it "raises an error" do
|
41
41
|
Fog.stub :credentials, {} do
|
42
42
|
assert_raises ArgumentError do
|
43
|
-
Fog::Compute
|
43
|
+
Fog::Brightbox::Compute.new({})
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
@@ -53,7 +53,7 @@ describe Fog::Compute::Brightbox do
|
|
53
53
|
:brightbox_secret => "1234567890"
|
54
54
|
}
|
55
55
|
@config = Fog::Brightbox::Config.new(@options)
|
56
|
-
@service = Fog::Compute
|
56
|
+
@service = Fog::Brightbox::Compute.new(@config)
|
57
57
|
pass
|
58
58
|
end
|
59
59
|
end
|
@@ -62,7 +62,7 @@ describe Fog::Compute::Brightbox do
|
|
62
62
|
it "raises ArgumentError"do
|
63
63
|
@config = Fog::Brightbox::Config.new({})
|
64
64
|
assert_raises ArgumentError do
|
65
|
-
@service = Fog::Compute
|
65
|
+
@service = Fog::Brightbox::Compute.new(@config)
|
66
66
|
end
|
67
67
|
end
|
68
68
|
end
|
@@ -1,16 +1,16 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
describe Fog::Storage
|
3
|
+
describe Fog::Brightbox::Storage do
|
4
4
|
include StockStorageResponses
|
5
5
|
|
6
6
|
let(:config) { Fog::Brightbox::Config.new(settings) }
|
7
|
-
let(:service) { Fog::Storage
|
7
|
+
let(:service) { Fog::Brightbox::Storage.new(config) }
|
8
8
|
|
9
9
|
describe "when created without required arguments" do
|
10
10
|
it "raises an error" do
|
11
11
|
Fog.stub :credentials, {} do
|
12
12
|
assert_raises ArgumentError do
|
13
|
-
Fog::Storage
|
13
|
+
Fog::Brightbox::Storage.new({})
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
@@ -35,7 +35,7 @@ describe Fog::Storage::Brightbox do
|
|
35
35
|
|
36
36
|
it "raises ArgumentError" do
|
37
37
|
assert_raises ArgumentError do
|
38
|
-
Fog::Storage
|
38
|
+
Fog::Brightbox::Storage.new(config)
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
@@ -89,7 +89,7 @@ describe Fog::Storage::Brightbox do
|
|
89
89
|
{
|
90
90
|
:brightbox_client_id => "app-12345",
|
91
91
|
:brightbox_secret => "12345",
|
92
|
-
:brightbox_username => "user@example.
|
92
|
+
:brightbox_username => "user@example.test",
|
93
93
|
:brightbox_password => "abcde",
|
94
94
|
:brightbox_account => "acc-abcde"
|
95
95
|
}
|
@@ -111,7 +111,7 @@ describe Fog::Storage::Brightbox do
|
|
111
111
|
{
|
112
112
|
:brightbox_client_id => "app-12345",
|
113
113
|
:brightbox_secret => "12345",
|
114
|
-
:brightbox_username => "user@example.
|
114
|
+
:brightbox_username => "user@example.test",
|
115
115
|
:brightbox_password => "abcde"
|
116
116
|
}
|
117
117
|
end
|
@@ -204,7 +204,7 @@ describe Fog::Storage::Brightbox do
|
|
204
204
|
{
|
205
205
|
:brightbox_client_id => "app-12345",
|
206
206
|
:brightbox_secret => "12345",
|
207
|
-
:brightbox_username => "user@example.
|
207
|
+
:brightbox_username => "user@example.test",
|
208
208
|
:brightbox_password => "12345",
|
209
209
|
:brightbox_access_token => "1234567890abcdefghijklmnopqrstuvwxyz",
|
210
210
|
:brightbox_refresh_token => "1234567890abcdefghijklmnopqrstuvwxyz",
|
@@ -221,7 +221,7 @@ describe Fog::Storage::Brightbox do
|
|
221
221
|
|
222
222
|
# The reauthentication
|
223
223
|
stub_request(:get, "https://files.gb2.brightbox.com/v1").
|
224
|
-
with(:headers => { "X-Auth-User" => "user@example.
|
224
|
+
with(:headers => { "X-Auth-User" => "user@example.test", "X-Auth-Key" => "12345" }).
|
225
225
|
to_return(authorized_response)
|
226
226
|
|
227
227
|
# Repeated request
|
data/spec/model_setup.rb
CHANGED
@@ -9,8 +9,8 @@ end
|
|
9
9
|
Shindo.tests("Fog::Compute.new", ["brightbox"]) do
|
10
10
|
tests("service options") do
|
11
11
|
{
|
12
|
-
:brightbox_api_url => "https://example.
|
13
|
-
:brightbox_auth_url => "https://example.
|
12
|
+
:brightbox_api_url => "https://example.test",
|
13
|
+
:brightbox_auth_url => "https://example.test",
|
14
14
|
:brightbox_client_id => "app-12345",
|
15
15
|
:brightbox_secret => "12345abdef6789",
|
16
16
|
:brightbox_username => "user-12345",
|
@@ -38,9 +38,9 @@ Shindo.tests("Fog::Compute[:brightbox] | api client requests", ["brightbox"]) do
|
|
38
38
|
test("new secret is visible") { !result["secret"].nil? }
|
39
39
|
end
|
40
40
|
|
41
|
-
tests("#
|
41
|
+
tests("#delete_api_client('#{@api_client_id}')") do
|
42
42
|
pending if Fog.mocking?
|
43
|
-
result = Fog::Compute[:brightbox].
|
43
|
+
result = Fog::Compute[:brightbox].delete_api_client(@api_client_id)
|
44
44
|
data_matches_schema(Brightbox::Compute::Formats::Full::API_CLIENT, :allow_extra_keys => true) { result }
|
45
45
|
end
|
46
46
|
end
|
@@ -37,9 +37,9 @@ Shindo.tests("Fog::Compute[:brightbox] | api client requests", ["brightbox"]) do
|
|
37
37
|
test("new secret is visible") { !result["secret"].nil? }
|
38
38
|
end
|
39
39
|
|
40
|
-
tests("#
|
40
|
+
tests("#delete_application('#{@application_id}')") do
|
41
41
|
pending if Fog.mocking?
|
42
|
-
result = Fog::Compute[:brightbox].
|
42
|
+
result = Fog::Compute[:brightbox].delete_application(@application_id)
|
43
43
|
data_matches_schema(Brightbox::Compute::Formats::Full::APPLICATION, :allow_extra_keys => true) { result }
|
44
44
|
end
|
45
45
|
end
|
@@ -54,9 +54,9 @@ Shindo.tests("Fog::Compute[:brightbox] | cloud ip requests", ["brightbox"]) do
|
|
54
54
|
result = Fog::Compute[:brightbox].update_cloud_ip(@cloud_ip_id, :reverse_dns => "")
|
55
55
|
end
|
56
56
|
|
57
|
-
tests("#
|
57
|
+
tests("#delete_cloud_ip('#{@cloud_ip_id}')") do
|
58
58
|
pending if Fog.mocking?
|
59
|
-
result = Fog::Compute[:brightbox].
|
59
|
+
result = Fog::Compute[:brightbox].delete_cloud_ip(@cloud_ip_id)
|
60
60
|
data_matches_schema(Brightbox::Compute::Formats::Full::CLOUD_IP, :allow_extra_keys => true) { result }
|
61
61
|
end
|
62
62
|
|
@@ -1,8 +1,11 @@
|
|
1
1
|
Shindo.tests("Fog::Compute[:brightbox] | collaboration requests", ["brightbox"]) do
|
2
2
|
tests("success") do
|
3
|
+
@test_collaborator_email = ENV["FOG_TEST_COLLABORATOR_EMAIL"]
|
4
|
+
pending unless @test_collaborator_email
|
5
|
+
|
3
6
|
tests("#create_collaboration") do
|
4
7
|
pending if Fog.mocking?
|
5
|
-
collaboration = Fog::Compute[:brightbox].create_collaboration(:email =>
|
8
|
+
collaboration = Fog::Compute[:brightbox].create_collaboration(:email => @test_collaborator_email, :role => "admin")
|
6
9
|
@collaboration_id = collaboration["id"]
|
7
10
|
formats(Brightbox::Compute::Formats::Full::COLLABORATION, false) { collaboration }
|
8
11
|
end
|
@@ -20,9 +23,9 @@ Shindo.tests("Fog::Compute[:brightbox] | collaboration requests", ["brightbox"])
|
|
20
23
|
formats(Brightbox::Compute::Formats::Full::COLLABORATION, false) { result }
|
21
24
|
end
|
22
25
|
|
23
|
-
tests("#
|
26
|
+
tests("#delete_collaboration") do
|
24
27
|
pending if Fog.mocking?
|
25
|
-
result = Fog::Compute[:brightbox].
|
28
|
+
result = Fog::Compute[:brightbox].delete_collaboration(@collaboration_id)
|
26
29
|
formats(Brightbox::Compute::Formats::Full::COLLABORATION, false) { result }
|
27
30
|
end
|
28
31
|
end
|
@@ -35,8 +35,8 @@ Shindo.tests("Fog::Compute[:brightbox] | database server requests", ["brightbox"
|
|
35
35
|
test("new password is visible") { !result["admin_password"].nil? }
|
36
36
|
end
|
37
37
|
|
38
|
-
tests("#
|
39
|
-
result = Fog::Compute[:brightbox].
|
38
|
+
tests("#delete_database_server('#{@database_server_id}')") do
|
39
|
+
result = Fog::Compute[:brightbox].delete_database_server(@database_server_id)
|
40
40
|
data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SERVER, :allow_extra_keys => true) { result }
|
41
41
|
end
|
42
42
|
end
|
@@ -32,8 +32,8 @@ Shindo.tests("Fog::Compute[:brightbox] | database snapshot requests", ["brightbo
|
|
32
32
|
data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SNAPSHOT, :allow_extra_keys => true) { result }
|
33
33
|
end
|
34
34
|
|
35
|
-
tests("#
|
36
|
-
result = service.
|
35
|
+
tests("#delete_database_snapshot('#{@database_snapshot_id}')") do
|
36
|
+
result = service.delete_database_snapshot(@database_snapshot_id)
|
37
37
|
data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SNAPSHOT, :allow_extra_keys => true) { result }
|
38
38
|
end
|
39
39
|
end
|
@@ -31,8 +31,8 @@ Shindo.tests("Fog::Compute[:brightbox] | firewall policy requests", ["brightbox"
|
|
31
31
|
returns("Fog test policy B") { result["name"] }
|
32
32
|
end
|
33
33
|
|
34
|
-
tests("#
|
35
|
-
result = Fog::Compute[:brightbox].
|
34
|
+
tests("#delete_firewall_policy('#{@firewall_policy_id}')") do
|
35
|
+
result = Fog::Compute[:brightbox].delete_firewall_policy(@firewall_policy_id)
|
36
36
|
data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_POLICY, :allow_extra_keys => true) { result }
|
37
37
|
end
|
38
38
|
end
|
@@ -30,8 +30,8 @@ Shindo.tests("Fog::Compute[:brightbox] | firewall rule requests", ["brightbox"])
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
tests("#
|
34
|
-
result = Fog::Compute[:brightbox].
|
33
|
+
tests("#delete_firewall_rule('#{@firewall_rule_id}')") do
|
34
|
+
result = Fog::Compute[:brightbox].delete_firewall_rule(@firewall_rule_id)
|
35
35
|
data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_RULE, :allow_extra_keys => true) { result }
|
36
36
|
end
|
37
37
|
|