fog-brightbox 1.0.0.rc1 → 1.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -1
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- data/lib/fog/brightbox/models/compute/cloud_ips.rb +3 -3
- data/lib/fog/brightbox/models/compute/collaboration.rb +2 -2
- data/lib/fog/brightbox/models/compute/collaborations.rb +4 -4
- data/lib/fog/brightbox/models/compute/database_server.rb +2 -2
- data/lib/fog/brightbox/models/compute/database_servers.rb +3 -3
- data/lib/fog/brightbox/models/compute/database_snapshot.rb +2 -2
- 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 +2 -2
- data/lib/fog/brightbox/models/compute/firewall_rule.rb +2 -2
- 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 +2 -2
- data/lib/fog/brightbox/models/compute/images.rb +3 -3
- data/lib/fog/brightbox/models/compute/load_balancer.rb +2 -2
- data/lib/fog/brightbox/models/compute/load_balancers.rb +3 -3
- data/lib/fog/brightbox/models/compute/server.rb +2 -2
- data/lib/fog/brightbox/models/compute/server_group.rb +2 -2
- 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 +2 -2
- data/lib/fog/brightbox/models/compute/user_collaborations.rb +3 -3
- 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/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 +4 -4
- 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 +1 -1
- data/spec/fog/compute/brightbox/server_group_spec.rb +1 -1
- data/spec/fog/compute/brightbox/server_spec.rb +4 -4
- 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 +4 -4
- data/spec/model_setup.rb +1 -1
- data/tests/brightbox/compute/schema.rb +1 -1
- data/tests/brightbox/requests/compute/helper.rb +1 -1
- metadata +16 -9
@@ -1,10 +1,10 @@
|
|
1
1
|
require "fog/brightbox/models/compute/firewall_policy"
|
2
2
|
|
3
3
|
module Fog
|
4
|
-
module
|
5
|
-
class
|
4
|
+
module Brightbox
|
5
|
+
class Compute
|
6
6
|
class FirewallPolicies < Fog::Collection
|
7
|
-
model Fog::Compute::
|
7
|
+
model Fog::Brightbox::Compute::FirewallPolicy
|
8
8
|
|
9
9
|
def all
|
10
10
|
data = service.list_firewall_policies
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "fog/brightbox/models/compute/firewall_rule"
|
2
2
|
|
3
3
|
module Fog
|
4
|
-
module
|
5
|
-
class
|
4
|
+
module Brightbox
|
5
|
+
class Compute
|
6
6
|
class FirewallRules < Fog::Collection
|
7
|
-
model Fog::Compute::
|
7
|
+
model Fog::Brightbox::Compute::FirewallRule
|
8
8
|
|
9
9
|
def get(identifier)
|
10
10
|
return nil if identifier.nil? || identifier == ""
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "fog/brightbox/models/compute/flavor"
|
2
2
|
|
3
3
|
module Fog
|
4
|
-
module
|
5
|
-
class
|
4
|
+
module Brightbox
|
5
|
+
class Compute
|
6
6
|
class Flavors < Fog::Collection
|
7
|
-
model Fog::Compute::
|
7
|
+
model Fog::Brightbox::Compute::Flavor
|
8
8
|
|
9
9
|
def all
|
10
10
|
data = service.list_server_types
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "fog/brightbox/models/compute/image"
|
2
2
|
|
3
3
|
module Fog
|
4
|
-
module
|
5
|
-
class
|
4
|
+
module Brightbox
|
5
|
+
class Compute
|
6
6
|
class Images < Fog::Collection
|
7
|
-
model Fog::Compute::
|
7
|
+
model Fog::Brightbox::Compute::Image
|
8
8
|
|
9
9
|
def all
|
10
10
|
data = service.list_images
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "fog/brightbox/models/compute/load_balancer"
|
2
2
|
|
3
3
|
module Fog
|
4
|
-
module
|
5
|
-
class
|
4
|
+
module Brightbox
|
5
|
+
class Compute
|
6
6
|
class LoadBalancers < Fog::Collection
|
7
|
-
model Fog::Compute::
|
7
|
+
model Fog::Brightbox::Compute::LoadBalancer
|
8
8
|
|
9
9
|
def all
|
10
10
|
data = service.list_load_balancers
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "fog/brightbox/models/compute/server_group"
|
2
2
|
|
3
3
|
module Fog
|
4
|
-
module
|
5
|
-
class
|
4
|
+
module Brightbox
|
5
|
+
class Compute
|
6
6
|
class ServerGroups < Fog::Collection
|
7
|
-
model Fog::Compute::
|
7
|
+
model Fog::Brightbox::Compute::ServerGroup
|
8
8
|
|
9
9
|
def all
|
10
10
|
data = service.list_server_groups
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "fog/brightbox/models/compute/server"
|
2
2
|
|
3
3
|
module Fog
|
4
|
-
module
|
5
|
-
class
|
4
|
+
module Brightbox
|
5
|
+
class Compute
|
6
6
|
class Servers < Fog::Collection
|
7
|
-
model Fog::Compute::
|
7
|
+
model Fog::Brightbox::Compute::Server
|
8
8
|
|
9
9
|
def all
|
10
10
|
data = service.list_servers
|
@@ -26,7 +26,7 @@ module Fog
|
|
26
26
|
# @option options [String] zone_id Identifer for preferred zone to locate server in
|
27
27
|
# @option options [Array<String>] server_groups List of group identifiers for the server to join
|
28
28
|
#
|
29
|
-
# @return Fog::Compute::
|
29
|
+
# @return Fog::Brightbox::Compute::Server
|
30
30
|
#
|
31
31
|
def bootstrap(options = {})
|
32
32
|
server = create(options)
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "fog/brightbox/models/compute/user_collaboration"
|
2
2
|
|
3
3
|
module Fog
|
4
|
-
module
|
5
|
-
class
|
4
|
+
module Brightbox
|
5
|
+
class Compute
|
6
6
|
class UserCollaborations < Fog::Collection
|
7
|
-
model Fog::Compute::
|
7
|
+
model Fog::Brightbox::Compute::UserCollaboration
|
8
8
|
|
9
9
|
def all
|
10
10
|
data = service.list_user_collaborations
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "fog/brightbox/models/compute/user"
|
2
2
|
|
3
3
|
module Fog
|
4
|
-
module
|
5
|
-
class
|
4
|
+
module Brightbox
|
5
|
+
class Compute
|
6
6
|
class Users < Fog::Collection
|
7
|
-
model Fog::Compute::
|
7
|
+
model Fog::Brightbox::Compute::User
|
8
8
|
|
9
9
|
def all
|
10
10
|
data = service.list_users
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "fog/brightbox/models/compute/zone"
|
2
2
|
|
3
3
|
module Fog
|
4
|
-
module
|
5
|
-
class
|
4
|
+
module Brightbox
|
5
|
+
class Compute
|
6
6
|
class Zones < Fog::Collection
|
7
|
-
model Fog::Compute::
|
7
|
+
model Fog::Brightbox::Compute::Zone
|
8
8
|
|
9
9
|
def all
|
10
10
|
data = service.list_zones
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "fog/brightbox/models/storage/directory"
|
2
2
|
|
3
3
|
module Fog
|
4
|
-
module
|
5
|
-
class
|
4
|
+
module Brightbox
|
5
|
+
class Storage
|
6
6
|
class Directories < Fog::Collection
|
7
|
-
model Fog::Storage::
|
7
|
+
model Fog::Brightbox::Storage::Directory
|
8
8
|
|
9
9
|
HEADER_ATTRIBUTES = %w(X-Container-Bytes-Used X-Container-Object-Count X-Container-Read X-Container-Write)
|
10
10
|
|
@@ -28,7 +28,7 @@ module Fog
|
|
28
28
|
directory.files << directory.files.new(file)
|
29
29
|
end
|
30
30
|
directory
|
31
|
-
rescue Fog::Storage::
|
31
|
+
rescue Fog::Brightbox::Storage::NotFound
|
32
32
|
nil
|
33
33
|
end
|
34
34
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require "fog/brightbox/models/storage/files"
|
2
2
|
|
3
3
|
module Fog
|
4
|
-
module
|
5
|
-
class
|
4
|
+
module Brightbox
|
5
|
+
class Storage
|
6
6
|
class Directory < Fog::Model
|
7
7
|
identity :key, :aliases => "name"
|
8
8
|
|
@@ -21,7 +21,7 @@ module Fog
|
|
21
21
|
|
22
22
|
def files
|
23
23
|
@files ||= begin
|
24
|
-
Fog::Storage::
|
24
|
+
Fog::Brightbox::Storage::Files.new(
|
25
25
|
:directory => self,
|
26
26
|
:service => service
|
27
27
|
)
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require "fog/brightbox/models/storage/file"
|
2
2
|
|
3
3
|
module Fog
|
4
|
-
module
|
5
|
-
class
|
4
|
+
module Brightbox
|
5
|
+
class Storage
|
6
6
|
class Files < Fog::Collection
|
7
7
|
attribute :directory
|
8
8
|
attribute :limit
|
@@ -10,7 +10,7 @@ module Fog
|
|
10
10
|
attribute :path
|
11
11
|
attribute :prefix
|
12
12
|
|
13
|
-
model Fog::Storage::
|
13
|
+
model Fog::Brightbox::Storage::File
|
14
14
|
|
15
15
|
def all(options = {})
|
16
16
|
requires :directory
|
@@ -57,14 +57,14 @@ module Fog
|
|
57
57
|
:key => key
|
58
58
|
)
|
59
59
|
new(file_data)
|
60
|
-
rescue Fog::Storage::
|
60
|
+
rescue Fog::Brightbox::Storage::NotFound
|
61
61
|
nil
|
62
62
|
end
|
63
63
|
|
64
64
|
def get_url(key)
|
65
65
|
requires :directory
|
66
66
|
if directory.public_url
|
67
|
-
"#{directory.public_url}/#{Fog::Storage
|
67
|
+
"#{directory.public_url}/#{Fog::Brightbox::Storage.escape(key, "/")}"
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
@@ -85,7 +85,7 @@ module Fog
|
|
85
85
|
:key => key
|
86
86
|
)
|
87
87
|
new(file_data)
|
88
|
-
rescue Fog::Storage::
|
88
|
+
rescue Fog::Brightbox::Storage::NotFound
|
89
89
|
nil
|
90
90
|
end
|
91
91
|
|