bbcloud 0.10.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bbcloud.gemspec +2 -2
- data/lib/bbcloud/api.rb +1 -1
- data/lib/bbcloud/cli.rb +8 -2
- data/lib/bbcloud/commands/servers-activate-cloud.rb +23 -0
- data/lib/bbcloud/commands/types-list.rb +1 -1
- data/lib/bbcloud/config.rb +1 -0
- data/lib/bbcloud/servers.rb +4 -0
- data/lib/bbcloud/types.rb +8 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/brightbox.rb +162 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/account.rb +51 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/cloud_ip.rb +47 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/cloud_ips.rb +34 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/flavor.rb +33 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/flavors.rb +28 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/image.rb +56 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/images.rb +28 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/load_balancer.rb +50 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/load_balancers.rb +28 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/server.rb +108 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/servers.rb +29 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/user.rb +39 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/users.rb +29 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/zone.rb +21 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/models/brightbox/zones.rb +29 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/activate_console_server.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/add_listeners_load_balancer.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/add_nodes_load_balancer.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/create_api_client.rb +19 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/create_cloud_ip.rb +19 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/create_image.rb +19 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/create_load_balancer.rb +19 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/create_server.rb +19 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/destroy_api_client.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/destroy_cloud_ip.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/destroy_image.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/destroy_load_balancer.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/destroy_server.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/get_account.rb +19 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/get_api_client.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/get_cloud_ip.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/get_image.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/get_interface.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/get_load_balancer.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/get_server.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/get_server_type.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/get_user.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/get_zone.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/list_api_clients.rb +19 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/list_cloud_ips.rb +19 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/list_images.rb +19 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/list_load_balancers.rb +19 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/list_server_types.rb +19 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/list_servers.rb +19 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/list_users.rb +19 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/list_zones.rb +19 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/map_cloud_ip.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/remove_listeners_load_balancer.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/remove_nodes_load_balancer.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/reset_ftp_password_account.rb +19 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/resize_server.rb +19 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/shutdown_server.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/snapshot_server.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/start_server.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/stop_server.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/unmap_cloud_ip.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/update_account.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/update_api_client.rb +21 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/update_image.rb +21 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/update_load_balancer.rb +21 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/update_server.rb +21 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/update_user.rb +21 -0
- data/lib/bbcloud/vendor/fog/lib/fog/compute.rb +43 -0
- data/lib/bbcloud/vendor/fog/lib/fog/core/attributes.rb +178 -0
- data/lib/bbcloud/vendor/fog/lib/fog/core/collection.rb +127 -0
- data/lib/bbcloud/vendor/fog/lib/fog/core/connection.rb +35 -0
- data/lib/bbcloud/vendor/fog/lib/fog/core/credentials.rb +92 -0
- data/lib/bbcloud/vendor/fog/lib/fog/core/deprecation.rb +23 -0
- data/lib/bbcloud/vendor/fog/lib/fog/core/errors.rb +20 -0
- data/lib/bbcloud/vendor/fog/lib/fog/core/hmac.rb +48 -0
- data/lib/bbcloud/vendor/fog/lib/fog/core/mock.rb +68 -0
- data/lib/bbcloud/vendor/fog/lib/fog/core/model.rb +57 -0
- data/lib/bbcloud/vendor/fog/lib/fog/core/parser.rb +99 -0
- data/lib/bbcloud/vendor/fog/lib/fog/core/provider.rb +18 -0
- data/lib/bbcloud/vendor/fog/lib/fog/core/scp.rb +67 -0
- data/lib/bbcloud/vendor/fog/lib/fog/core/service.rb +175 -0
- data/lib/bbcloud/vendor/fog/lib/fog/core/ssh.rb +120 -0
- data/lib/bbcloud/vendor/fog/lib/fog/core/time.rb +27 -0
- data/lib/bbcloud/vendor/fog/lib/fog/core/wait_for.rb +17 -0
- data/lib/bbcloud/vendor/fog/lib/fog/core.rb +32 -0
- data/lib/bbcloud/vendor/fog/lib/fog/providers/brightbox.rb +9 -0
- data/lib/bbcloud/vendor/fog/lib/fog/providers.rb +9 -0
- data/lib/bbcloud/vendor/fog/lib/fog.rb +14 -0
- data/lib/bbcloud/version.rb +1 -1
- metadata +105 -26
@@ -0,0 +1,20 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def get_server_type(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
request(
|
9
|
+
:expects => [200],
|
10
|
+
:method => 'GET',
|
11
|
+
:path => "/1.0/server_types/#{identifier}",
|
12
|
+
:headers => {"Content-Type" => "application/json"},
|
13
|
+
:body => options.to_json
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def get_user(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
request(
|
9
|
+
:expects => [200],
|
10
|
+
:method => 'GET',
|
11
|
+
:path => "/1.0/users/#{identifier}",
|
12
|
+
:headers => {"Content-Type" => "application/json"},
|
13
|
+
:body => options.to_json
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def get_zone(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
request(
|
9
|
+
:expects => [200],
|
10
|
+
:method => 'GET',
|
11
|
+
:path => "/1.0/zones/#{identifier}",
|
12
|
+
:headers => {"Content-Type" => "application/json"},
|
13
|
+
:body => options.to_json
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def list_api_clients(options = {})
|
7
|
+
request(
|
8
|
+
:expects => [200],
|
9
|
+
:method => 'GET',
|
10
|
+
:path => "/1.0/api_clients",
|
11
|
+
:headers => {"Content-Type" => "application/json"},
|
12
|
+
:body => options.to_json
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def list_cloud_ips(options = {})
|
7
|
+
request(
|
8
|
+
:expects => [200],
|
9
|
+
:method => 'GET',
|
10
|
+
:path => "/1.0/cloud_ips",
|
11
|
+
:headers => {"Content-Type" => "application/json"},
|
12
|
+
:body => options.to_json
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def list_images(options = {})
|
7
|
+
request(
|
8
|
+
:expects => [200],
|
9
|
+
:method => 'GET',
|
10
|
+
:path => "/1.0/images",
|
11
|
+
:headers => {"Content-Type" => "application/json"},
|
12
|
+
:body => options.to_json
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def list_load_balancers(options = {})
|
7
|
+
request(
|
8
|
+
:expects => [200],
|
9
|
+
:method => 'GET',
|
10
|
+
:path => "/1.0/load_balancers",
|
11
|
+
:headers => {"Content-Type" => "application/json"},
|
12
|
+
:body => options.to_json
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def list_server_types(options = {})
|
7
|
+
request(
|
8
|
+
:expects => [200],
|
9
|
+
:method => 'GET',
|
10
|
+
:path => "/1.0/server_types",
|
11
|
+
:headers => {"Content-Type" => "application/json"},
|
12
|
+
:body => options.to_json
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def list_servers(options = {})
|
7
|
+
request(
|
8
|
+
:expects => [200],
|
9
|
+
:method => 'GET',
|
10
|
+
:path => "/1.0/servers",
|
11
|
+
:headers => {"Content-Type" => "application/json"},
|
12
|
+
:body => options.to_json
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def list_users(options = {})
|
7
|
+
request(
|
8
|
+
:expects => [200],
|
9
|
+
:method => 'GET',
|
10
|
+
:path => "/1.0/users",
|
11
|
+
:headers => {"Content-Type" => "application/json"},
|
12
|
+
:body => options.to_json
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def list_zones(options = {})
|
7
|
+
request(
|
8
|
+
:expects => [200],
|
9
|
+
:method => 'GET',
|
10
|
+
:path => "/1.0/zones",
|
11
|
+
:headers => {"Content-Type" => "application/json"},
|
12
|
+
:body => options.to_json
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def map_cloud_ip(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
request(
|
9
|
+
:expects => [202],
|
10
|
+
:method => 'POST',
|
11
|
+
:path => "/1.0/cloud_ips/#{identifier}/map",
|
12
|
+
:headers => {"Content-Type" => "application/json"},
|
13
|
+
:body => options.to_json
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/bbcloud/vendor/fog/lib/fog/compute/requests/brightbox/remove_listeners_load_balancer.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def remove_listeners_load_balancer(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
request(
|
9
|
+
:expects => [202],
|
10
|
+
:method => 'POST',
|
11
|
+
:path => "/1.0/load_balancers/#{identifier}/remove_listeners",
|
12
|
+
:headers => {"Content-Type" => "application/json"},
|
13
|
+
:body => options.to_json
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def remove_nodes_load_balancer(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
request(
|
9
|
+
:expects => [202],
|
10
|
+
:method => 'POST',
|
11
|
+
:path => "/1.0/load_balancers/#{identifier}/remove_nodes",
|
12
|
+
:headers => {"Content-Type" => "application/json"},
|
13
|
+
:body => options.to_json
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def reset_ftp_password_account(options = {})
|
7
|
+
request(
|
8
|
+
:expects => [200],
|
9
|
+
:method => 'POST',
|
10
|
+
:path => "/1.0/account/reset_ftp_password",
|
11
|
+
:headers => {"Content-Type" => "application/json"},
|
12
|
+
:body => options.to_json
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def resize_server(identifier, options = {})
|
7
|
+
request(
|
8
|
+
:expects => [202],
|
9
|
+
:method => 'POST',
|
10
|
+
:path => "/1.0/servers/#{identifier}/resize",
|
11
|
+
:headers => {"Content-Type" => "application/json"},
|
12
|
+
:body => options.to_json
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def shutdown_server(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
request(
|
9
|
+
:expects => [202],
|
10
|
+
:method => 'POST',
|
11
|
+
:path => "/1.0/servers/#{identifier}/shutdown",
|
12
|
+
:headers => {"Content-Type" => "application/json"},
|
13
|
+
:body => options.to_json
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def snapshot_server(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
request(
|
9
|
+
:expects => [202],
|
10
|
+
:method => 'POST',
|
11
|
+
:path => "/1.0/servers/#{identifier}/snapshot",
|
12
|
+
:headers => {"Content-Type" => "application/json"},
|
13
|
+
:body => options.to_json
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def start_server(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
request(
|
9
|
+
:expects => [202],
|
10
|
+
:method => 'POST',
|
11
|
+
:path => "/1.0/servers/#{identifier}/start",
|
12
|
+
:headers => {"Content-Type" => "application/json"},
|
13
|
+
:body => options.to_json
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def stop_server(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
request(
|
9
|
+
:expects => [202],
|
10
|
+
:method => 'POST',
|
11
|
+
:path => "/1.0/servers/#{identifier}/stop",
|
12
|
+
:headers => {"Content-Type" => "application/json"},
|
13
|
+
:body => options.to_json
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def unmap_cloud_ip(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
request(
|
9
|
+
:expects => [202],
|
10
|
+
:method => 'POST',
|
11
|
+
:path => "/1.0/cloud_ips/#{identifier}/unmap",
|
12
|
+
:headers => {"Content-Type" => "application/json"},
|
13
|
+
:body => options.to_json
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def update_account(options = {})
|
7
|
+
return nil if options.empty? || options.nil?
|
8
|
+
request(
|
9
|
+
:expects => [200],
|
10
|
+
:method => 'PUT',
|
11
|
+
:path => "/1.0/account",
|
12
|
+
:headers => {"Content-Type" => "application/json"},
|
13
|
+
:body => options.to_json
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def update_api_client(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
return nil if options.empty? || options.nil?
|
9
|
+
request(
|
10
|
+
:expects => [200],
|
11
|
+
:method => 'PUT',
|
12
|
+
:path => "/1.0/api_clients/#{identifier}",
|
13
|
+
:headers => {"Content-Type" => "application/json"},
|
14
|
+
:body => options.to_json
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def update_image(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
return nil if options.empty? || options.nil?
|
9
|
+
request(
|
10
|
+
:expects => [200],
|
11
|
+
:method => 'PUT',
|
12
|
+
:path => "/1.0/images/#{identifier}",
|
13
|
+
:headers => {"Content-Type" => "application/json"},
|
14
|
+
:body => options.to_json
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def update_load_balancer(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
return nil if options.empty? || options.nil?
|
9
|
+
request(
|
10
|
+
:expects => [202],
|
11
|
+
:method => 'PUT',
|
12
|
+
:path => "/1.0/load_balancers/#{identifier}",
|
13
|
+
:headers => {"Content-Type" => "application/json"},
|
14
|
+
:body => options.to_json
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def update_server(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
return nil if options.empty? || options.nil?
|
9
|
+
request(
|
10
|
+
:expects => [200],
|
11
|
+
:method => 'PUT',
|
12
|
+
:path => "/1.0/servers/#{identifier}",
|
13
|
+
:headers => {"Content-Type" => "application/json"},
|
14
|
+
:body => options.to_json
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def update_user(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
return nil if options.empty? || options.nil?
|
9
|
+
request(
|
10
|
+
:expects => [200],
|
11
|
+
:method => 'PUT',
|
12
|
+
:path => "/1.0/users/#{identifier}",
|
13
|
+
:headers => {"Content-Type" => "application/json"},
|
14
|
+
:body => options.to_json
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module Fog
|
2
|
+
class Compute
|
3
|
+
|
4
|
+
def self.new(attributes)
|
5
|
+
attributes = attributes.dup # prevent delete from having side effects
|
6
|
+
case provider = attributes[:provider] # attributes.delete(:provider)
|
7
|
+
when 'AWS'
|
8
|
+
require 'fog/compute/aws'
|
9
|
+
Fog::AWS::Compute.new(attributes)
|
10
|
+
when 'Bluebox'
|
11
|
+
require 'fog/compute/bluebox'
|
12
|
+
Fog::Bluebox::Compute.new(attributes)
|
13
|
+
when 'Brightbox'
|
14
|
+
require 'fog/compute/brightbox'
|
15
|
+
Fog::Brightbox::Compute.new(attributes)
|
16
|
+
when 'Ecloud'
|
17
|
+
require 'fog/compute/ecloud'
|
18
|
+
Fog::Ecloud::Compute.new(attributes)
|
19
|
+
when 'GoGrid'
|
20
|
+
require 'fog/compute/go_grid'
|
21
|
+
Fog::GoGrid::Compute.new(attributes)
|
22
|
+
when 'Linode'
|
23
|
+
require 'fog/compute/linode'
|
24
|
+
Fog::Linode::Compute.new(attributes)
|
25
|
+
when 'NewServers'
|
26
|
+
require 'fog/compute/new_servers'
|
27
|
+
Fog::NewServers::Compute.new(attributes)
|
28
|
+
when 'Rackspace'
|
29
|
+
require 'fog/compute/rackspace'
|
30
|
+
Fog::Rackspace::Compute.new(attributes)
|
31
|
+
when 'Voxel'
|
32
|
+
require 'fog/compute/voxel'
|
33
|
+
Fog::Voxel::Compute.new(attributes)
|
34
|
+
when 'Slicehost'
|
35
|
+
require 'fog/compute/slicehost'
|
36
|
+
Fog::Slicehost::Compute.new(attributes)
|
37
|
+
else
|
38
|
+
raise ArgumentError.new("#{provider} is not a recognized compute provider")
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
end
|