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,108 @@
|
|
1
|
+
require 'fog/core/model'
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Brightbox
|
5
|
+
class Compute
|
6
|
+
|
7
|
+
class Server < Fog::Model
|
8
|
+
|
9
|
+
identity :id
|
10
|
+
|
11
|
+
attribute :url
|
12
|
+
attribute :name
|
13
|
+
attribute :status
|
14
|
+
attribute :hostname
|
15
|
+
attribute :created_at, :type => :time
|
16
|
+
attribute :deleted_at, :type => :time
|
17
|
+
attribute :started_at, :type => :time
|
18
|
+
attribute :user_data
|
19
|
+
|
20
|
+
attribute :resource_type
|
21
|
+
|
22
|
+
attribute :account_id, :aliases => "account", :squash => "id"
|
23
|
+
attribute :image_id, :aliases => "image", :squash => "id"
|
24
|
+
attribute :flavor_id, :aliases => "server_type", :squash => "id"
|
25
|
+
attribute :zone_id, :aliases => "zone", :squash => "id"
|
26
|
+
|
27
|
+
attribute :snapshots
|
28
|
+
attribute :cloud_ips
|
29
|
+
attribute :interfaces
|
30
|
+
|
31
|
+
def snapshot
|
32
|
+
requires :identity
|
33
|
+
connection.snapshot_server(identity)
|
34
|
+
end
|
35
|
+
|
36
|
+
def reboot
|
37
|
+
false
|
38
|
+
end
|
39
|
+
|
40
|
+
def start
|
41
|
+
requires :identity
|
42
|
+
connection.start_server(identity)
|
43
|
+
true
|
44
|
+
end
|
45
|
+
|
46
|
+
def stop
|
47
|
+
requires :identity
|
48
|
+
connection.stop_server(identity)
|
49
|
+
true
|
50
|
+
end
|
51
|
+
|
52
|
+
def shutdown
|
53
|
+
requires :identity
|
54
|
+
connection.shutdown_server(identity)
|
55
|
+
true
|
56
|
+
end
|
57
|
+
|
58
|
+
def destroy
|
59
|
+
requires :identity
|
60
|
+
connection.destroy_server(identity)
|
61
|
+
true
|
62
|
+
end
|
63
|
+
|
64
|
+
def flavor
|
65
|
+
requires :flavor_id
|
66
|
+
connection.flavors.get(flavor_id)
|
67
|
+
end
|
68
|
+
|
69
|
+
def image
|
70
|
+
requires :image_id
|
71
|
+
connection.images.get(image_id)
|
72
|
+
end
|
73
|
+
|
74
|
+
def private_ip_address
|
75
|
+
nil
|
76
|
+
end
|
77
|
+
|
78
|
+
def public_ip_address
|
79
|
+
cloud_ips.first
|
80
|
+
end
|
81
|
+
|
82
|
+
def ready?
|
83
|
+
status == 'active'
|
84
|
+
end
|
85
|
+
|
86
|
+
def activate_console
|
87
|
+
requires :identity
|
88
|
+
response = connection.activate_console_server(identity)
|
89
|
+
[response["console_url"], response["console_token"], response["console_token_expires"]]
|
90
|
+
end
|
91
|
+
|
92
|
+
def save
|
93
|
+
requires :image_id
|
94
|
+
options = {
|
95
|
+
:image => image_id,
|
96
|
+
:server_type => flavor_id,
|
97
|
+
:name => name,
|
98
|
+
:zone => zone_id,
|
99
|
+
:user_data => user_data
|
100
|
+
}.delete_if {|k,v| v.nil? || v == "" }
|
101
|
+
data = connection.create_server(options)
|
102
|
+
merge_attributes(data)
|
103
|
+
true
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/compute/models/brightbox/server'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Brightbox
|
6
|
+
class Compute
|
7
|
+
|
8
|
+
class Servers < Fog::Collection
|
9
|
+
|
10
|
+
model Fog::Brightbox::Compute::Server
|
11
|
+
|
12
|
+
def all
|
13
|
+
data = connection.list_servers
|
14
|
+
load(data)
|
15
|
+
end
|
16
|
+
|
17
|
+
def get(identifier)
|
18
|
+
return nil if identifier.nil? || identifier == ""
|
19
|
+
data = connection.get_server(identifier)
|
20
|
+
new(data)
|
21
|
+
rescue Excon::Errors::NotFound
|
22
|
+
nil
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'fog/core/model'
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Brightbox
|
5
|
+
class Compute
|
6
|
+
|
7
|
+
class User < Fog::Model
|
8
|
+
|
9
|
+
identity :id
|
10
|
+
|
11
|
+
attribute :url
|
12
|
+
attribute :resource_type
|
13
|
+
attribute :name
|
14
|
+
attribute :email_address
|
15
|
+
attribute :email_verified
|
16
|
+
attribute :ssh_key
|
17
|
+
|
18
|
+
attribute :account_id, :aliases => "default_account", :squash => "id"
|
19
|
+
attribute :accounts
|
20
|
+
|
21
|
+
def save
|
22
|
+
requires :identity
|
23
|
+
|
24
|
+
options = {
|
25
|
+
:email_address => email_address,
|
26
|
+
:ssh_key => ssh_key,
|
27
|
+
:name => name
|
28
|
+
}
|
29
|
+
|
30
|
+
data = connection.update_user(identity, options)
|
31
|
+
merge_attributes(data)
|
32
|
+
true
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/compute/models/brightbox/user'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Brightbox
|
6
|
+
class Compute
|
7
|
+
|
8
|
+
class Users < Fog::Collection
|
9
|
+
|
10
|
+
model Fog::Brightbox::Compute::User
|
11
|
+
|
12
|
+
def all
|
13
|
+
data = connection.list_users
|
14
|
+
load(data)
|
15
|
+
end
|
16
|
+
|
17
|
+
def get(identifier)
|
18
|
+
return nil if identifier.nil? || identifier == ""
|
19
|
+
data = connection.get_user(identifier)
|
20
|
+
new(data)
|
21
|
+
rescue Excon::Errors::NotFound
|
22
|
+
nil
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'fog/core/model'
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Brightbox
|
5
|
+
class Compute
|
6
|
+
|
7
|
+
class Zone < Fog::Model
|
8
|
+
|
9
|
+
identity :id
|
10
|
+
|
11
|
+
attribute :url
|
12
|
+
attribute :handle
|
13
|
+
attribute :status
|
14
|
+
attribute :resource_type
|
15
|
+
attribute :description
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/compute/models/brightbox/zone'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Brightbox
|
6
|
+
class Compute
|
7
|
+
|
8
|
+
class Zones < Fog::Collection
|
9
|
+
|
10
|
+
model Fog::Brightbox::Compute::Zone
|
11
|
+
|
12
|
+
def all
|
13
|
+
data = connection.list_zones
|
14
|
+
load(data)
|
15
|
+
end
|
16
|
+
|
17
|
+
def get(identifier)
|
18
|
+
return nil if identifier.nil? || identifier == ""
|
19
|
+
data = connection.get_zone(identifier)
|
20
|
+
new(data)
|
21
|
+
rescue Excon::Errors::NotFound
|
22
|
+
nil
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def activate_console_server(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
request(
|
9
|
+
:expects => [202],
|
10
|
+
:method => 'POST',
|
11
|
+
:path => "/1.0/servers/#{identifier}/activate_console",
|
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 add_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}/add_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 add_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}/add_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 create_api_client(options = {})
|
7
|
+
request(
|
8
|
+
:expects => [201],
|
9
|
+
:method => 'POST',
|
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 create_cloud_ip(options = {})
|
7
|
+
request(
|
8
|
+
:expects => [201],
|
9
|
+
:method => 'POST',
|
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 create_image(options = {})
|
7
|
+
request(
|
8
|
+
:expects => [201],
|
9
|
+
:method => 'POST',
|
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 create_load_balancer(options = {})
|
7
|
+
request(
|
8
|
+
:expects => [202],
|
9
|
+
:method => 'POST',
|
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 create_server(options = {})
|
7
|
+
request(
|
8
|
+
:expects => [202],
|
9
|
+
:method => 'POST',
|
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,20 @@
|
|
1
|
+
module Fog
|
2
|
+
module Brightbox
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
def destroy_api_client(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
request(
|
9
|
+
:expects => [200],
|
10
|
+
:method => 'DELETE',
|
11
|
+
:path => "/1.0/api_clients/#{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 destroy_cloud_ip(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
request(
|
9
|
+
:expects => [200],
|
10
|
+
:method => 'DELETE',
|
11
|
+
:path => "/1.0/cloud_ips/#{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 destroy_image(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
request(
|
9
|
+
:expects => [202],
|
10
|
+
:method => 'DELETE',
|
11
|
+
:path => "/1.0/images/#{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 destroy_load_balancer(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
request(
|
9
|
+
:expects => [202],
|
10
|
+
:method => 'DELETE',
|
11
|
+
:path => "/1.0/load_balancers/#{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 destroy_server(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
request(
|
9
|
+
:expects => [202],
|
10
|
+
:method => 'DELETE',
|
11
|
+
:path => "/1.0/servers/#{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 get_account(options = {})
|
7
|
+
request(
|
8
|
+
:expects => [200],
|
9
|
+
:method => 'GET',
|
10
|
+
:path => "/1.0/account",
|
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 get_api_client(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
request(
|
9
|
+
:expects => [200],
|
10
|
+
:method => 'GET',
|
11
|
+
:path => "/1.0/api_clients/#{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_cloud_ip(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
request(
|
9
|
+
:expects => [200],
|
10
|
+
:method => 'GET',
|
11
|
+
:path => "/1.0/cloud_ips/#{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_image(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
request(
|
9
|
+
:expects => [200],
|
10
|
+
:method => 'GET',
|
11
|
+
:path => "/1.0/images/#{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_interface(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
request(
|
9
|
+
:expects => [200],
|
10
|
+
:method => 'GET',
|
11
|
+
:path => "/1.0/interfaces/#{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_load_balancer(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
request(
|
9
|
+
:expects => [200],
|
10
|
+
:method => 'GET',
|
11
|
+
:path => "/1.0/load_balancers/#{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_server(identifier, options = {})
|
7
|
+
return nil if identifier.nil? || identifier == ""
|
8
|
+
request(
|
9
|
+
:expects => [200],
|
10
|
+
:method => 'GET',
|
11
|
+
:path => "/1.0/servers/#{identifier}",
|
12
|
+
:headers => {"Content-Type" => "application/json"},
|
13
|
+
:body => options.to_json
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|